# Incorrect objective type when using MA57 with Ipopt in JuMP

**URL:** <https://discourse.julialang.org/t/incorrect-objective-type-when-using-ma57-with-ipopt-in-jump/90578>\
**Category:** Optimization (Mathematical)\
**Tags:** jump\
**Created:** [November 21, 2022, 8:09am UTC](https://discourse.julialang.org/t/incorrect-objective-type-when-using-ma57-with-ipopt-in-jump/90578 "2022-11-21T08:09:28Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![this\_josh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/this_josh/32/42679_2.png) [@this\_josh](https://discourse.julialang.org/u/this_josh)\
**Post date:** [November 21, 2022, 8:09am UTC](https://discourse.julialang.org/t/incorrect-objective-type-when-using-ma57-with-ipopt-in-jump/90578/1 "2022-11-21T08:09:29Z")

</div>

I’d like minimise the sum of a variable using JuMP, here is a MWE:

```julia
UB= rand(1:9, (67,24)) # not really necessary 
model = Model()
@variable(model, 0 ≤ x[i= 1:67, j=1:24] ≤ UB[i,j])
@objective(model, Min, sum(x[ii, jj] for ii in 1:67 for jj in 1:24))

```

Now if I run this using either `MUMPS`, `ma27`, `ma77`, or `ma87` I get the expected result where all values in x are approximately zero. However, using `ma57` gives:

> **\`Input Error: Incorrect objective type.\`**
>
> ```julia
> 
> julia> opt = optimizer_with_attributes(Ipopt.Optimizer, "linear_solver"=>"ma57")
> julia> set_optimizer(model, opt)
> julia> optimize!(model)
> This is Ipopt version 3.14.4, running with linear solver ma57.
> 
> Number of nonzeros in equality constraint Jacobian...: 0
> Number of nonzeros in inequality constraint Jacobian.: 0
> Number of nonzeros in Lagrangian Hessian.............: 0
> 
> Total number of variables............................: 1608
> variables with only lower bounds: 0
> variables with lower and upper bounds: 1608
> variables with only upper bounds: 0
> Total number of equality constraints.................: 0
> Total number of inequality constraints...............: 0
> inequality constraints with only lower bounds: 0
> inequality constraints with lower and upper bounds: 0
> inequality constraints with only upper bounds: 0
> 
> iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls
> 0 1.6079984e+01 0.00e+00 1.00e+00 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0
> Runtime parameters:
> Objective type: METIS_OBJTYPE_CUT
> Coarsening type: METIS_CTYPE_RM
> Initial partitioning type: METIS_IPTYPE_GROW
> Refinement type: Unknown!
> Perform a 2-hop matching: No
> Number of balancing constraints: 1
> Number of refinement iterations: 0
> Random number seed: 1860230298
> Number of separators: 0
> Compress graph prior to ordering: Yes
> Detect & order connected components separately: Yes
> Prunning factor for high degree vertices: 0.000000
> Allowed maximum load imbalance: 1.000 
> 
> Input Error: Incorrect objective type.
> nbrpool statistics
> nbrpoolsize: 0 nbrpoolcpos: 0
> nbrpoolreallocs: 0
> 
> Runtime parameters:
> Objective type: METIS_OBJTYPE_CUT
> Coarsening type: METIS_CTYPE_RM
> Initial partitioning type: METIS_IPTYPE_GROW
> Refinement type: Unknown!
> Perform a 2-hop matching: Yes
> Number of balancing constraints: 1
> Number of refinement iterations: 0
> Random number seed: 6
> Number of separators: 0
> Compress graph prior to ordering: Yes
> Detect & order connected components separately: No
> Prunning factor for high degree vertices: 0.000000
> Allowed maximum load imbalance: 1.000 
> 
> Input Error: Incorrect objective type.
> nbrpool statistics
> nbrpoolsize: 0 nbrpoolcpos: 0
> nbrpoolreallocs: 0
> 
> ```

With the line `Input Error: Incorrect objective type.` priniting even if the model is set silent (I’m not sure if this is a hint as to what is going on)

I’m getting this with `Ipopt.jl` version 1.1.0 and `JuMP.jl` version 1.4.0. For the problems I’m working with `ma57` is typically the most performant, is there a way I can get it working with this type of objective function?

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [November 21, 2022, 8:28am UTC](https://discourse.julialang.org/t/incorrect-objective-type-when-using-ma57-with-ipopt-in-jump/90578/2 "2022-11-21T08:28:56Z")

</div>

I’ve never seen this error. It looks like it comes from:

> <https://github.com/scibuilder/metis/blob/982842a5ace9b3da2b2800817eb9e5fd3b42966b/libmetis/options.c#L444-L448>

It seems unrelated to Ipopt.jl, because we just give it the linear function, and it also works with other `maXX` solvers.

There are a bunch of ma57-specific options you could try: [Ipopt: Ipopt Options](https://coin-or.github.io/Ipopt/OPTIONS.html#OPT_MA57_Linear_Solver). Do any help? What happens if you increase the `ma57_print_level`?

---

<div class="post-metadata">

**Author:** ![this\_josh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/this_josh/32/42679_2.png) [@this\_josh](https://discourse.julialang.org/u/this_josh)\
**Post date:** [November 21, 2022, 9:03am UTC](https://discourse.julialang.org/t/incorrect-objective-type-when-using-ma57-with-ipopt-in-jump/90578/3 "2022-11-21T09:03:41Z")

</div>

I’ve tried every option listed [here](https://coin-or.github.io/Ipopt/OPTIONS.html#OPT_MA57_Linear_Solver) individually, although mostly just an option furthest from the default, here is what I found:

Unfortunately I was unable to set the print level, I’m not sure what I’m doing wrong here:

> **ma57\_print\_level=3; \`Num\` options need to be explictly passed as \`Float64(3)\`.**
>
> ```julia
> julia> set_optimizer_attribute(model, "ma57_print_level", 3)
> 
> julia> optimize!(model)
> Tried to set Option: ma57_print_level. It is not a valid option. Please check the list of available options.
> ERROR: IPOPT: Couldn't set option 'ma57_print_level' to value '3'::Int32. Note that `Num` options need to be explictly passed as `Float64(3)` instead of their integer equivalents.
> Stacktrace:
> [1] error(s::String)
> @ Base ./error.jl:35
> [2] AddIpoptIntOption(prob::IpoptProblem, keyword::String, value::Int64)
> @ Ipopt ~/.julia/packages/Ipopt/rQctM/src/C_wrapper.jl:355
> [3] optimize!(model::Ipopt.Optimizer)
> @ Ipopt ~/.julia/packages/Ipopt/rQctM/src/MOI_wrapper.jl:694
> [4] optimize!
> @ ~/.julia/packages/MathOptInterface/a4tKm/src/Bridges/bridge_optimizer.jl:376 [inlined]
> [5] optimize!(m::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.Bridges.LazyBridgeOptimizer{Ipopt.Optimizer}, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}})
> @ MathOptInterface.Utilities ~/.julia/packages/MathOptInterface/a4tKm/src/Utilities/cachingoptimizer.jl:325
> [6] optimize!(model::Model; ignore_optimize_hook::Bool, _differentiation_backend::MathOptInterface.Nonlinear.SparseReverseMode, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
> @ JuMP ~/.julia/packages/JuMP/gVq7V/src/optimizer_interface.jl:185
> [7] optimize!(model::Model)
> @ JuMP ~/.julia/packages/JuMP/gVq7V/src/optimizer_interface.jl:155
> [8] top-level scope
> @ REPL[4]:1
> 
> ```

> **ma57\_print\_level=Float64(3); Couldn't set option 'ma57\_print\_level' to value '3.0'.**
>
> ```julia
> julia> set_optimizer_attribute(model, "ma57_print_level", Float64(3))
> 
> julia> optimize!(model)
> Tried to set Option: ma57_print_level. It is not a valid option. Please check the list of available options.
> ERROR: IPOPT: Couldn't set option 'ma57_print_level' to value '3.0'.
> Stacktrace:
> [1] error(s::String)
> @ Base ./error.jl:35
> [2] AddIpoptNumOption(prob::IpoptProblem, keyword::String, value::Float64)
> @ Ipopt ~/.julia/packages/Ipopt/rQctM/src/C_wrapper.jl:337
> [3] optimize!(model::Ipopt.Optimizer)
> @ Ipopt ~/.julia/packages/Ipopt/rQctM/src/MOI_wrapper.jl:697
> [4] optimize!
> @ ~/.julia/packages/MathOptInterface/a4tKm/src/Bridges/bridge_optimizer.jl:376 [inlined]
> [5] optimize!(m::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.Bridges.LazyBridgeOptimizer{Ipopt.Optimizer}, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}})
> @ MathOptInterface.Utilities ~/.julia/packages/MathOptInterface/a4tKm/src/Utilities/cachingoptimizer.jl:325
> [6] optimize!(model::Model; ignore_optimize_hook::Bool, _differentiation_backend::MathOptInterface.Nonlinear.SparseReverseMode, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
> @ JuMP ~/.julia/packages/JuMP/gVq7V/src/optimizer_interface.jl:185
> [7] optimize!(model::Model)
> @ JuMP ~/.julia/packages/JuMP/gVq7V/src/optimizer_interface.jl:155
> [8] top-level scope
> @ REPL[8]:1
> 
> ```

> **ma57\_print\_level=3.0; Couldn't set option 'ma57\_print\_level' to value '3.0'.**
>
> ```julia
> julia> set_optimizer_attribute(model, "ma57_print_level", 3.0)
> 
> julia> optimize!(model)
> Tried to set Option: ma57_print_level. It is not a valid option. Please check the list of available options.
> ERROR: IPOPT: Couldn't set option 'ma57_print_level' to value '3.0'.
> Stacktrace:
> [1] error(s::String)
> @ Base ./error.jl:35
> [2] AddIpoptNumOption(prob::IpoptProblem, keyword::String, value::Float64)
> @ Ipopt ~/.julia/packages/Ipopt/rQctM/src/C_wrapper.jl:337
> [3] optimize!(model::Ipopt.Optimizer)
> @ Ipopt ~/.julia/packages/Ipopt/rQctM/src/MOI_wrapper.jl:697
> [4] optimize!
> @ ~/.julia/packages/MathOptInterface/a4tKm/src/Bridges/bridge_optimizer.jl:376 [inlined]
> [5] optimize!(m::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.Bridges.LazyBridgeOptimizer{Ipopt.Optimizer}, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}})
> @ MathOptInterface.Utilities ~/.julia/packages/MathOptInterface/a4tKm/src/Utilities/cachingoptimizer.jl:325
> [6] optimize!(model::Model; ignore_optimize_hook::Bool, _differentiation_backend::MathOptInterface.Nonlinear.SparseReverseMode, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
> @ JuMP ~/.julia/packages/JuMP/gVq7V/src/optimizer_interface.jl:185
> [7] optimize!(model::Model)
> @ JuMP ~/.julia/packages/JuMP/gVq7V/src/optimizer_interface.jl:155
> [8] top-level scope
> @ REPL[6]:1
> 
> ```

These options all gave the **same error** :  
pivtol=0.9  
ma57\_pivtolmax=0.9  
ma57\_pre\_alloc=10.0  
ma57\_node\_amalgamation=64  
ma57\_block\_size=64  
ma57\_pivot\_order=4  
ma57\_pivot\_order=5

This gave an `error in step computation`:  
ma57\_pivot\_order=1

These options ran and gave the expected result  
ma57\_pivot\_order=2  
ma57\_pivot\_order=3

Changing the pivot order also works on my actual problem, so for now I can use that.

After reading through the [`MA57` docs](https://www.hsl.rl.ac.uk/specs/ma57.pdf) (`pivtol` is on page 8 as `ICNTL(6)`) it seems pivot order is by default automatic, so increasing the print level would be helpful so I can see which method it is choosing, although given where the error message is coming from it seems likely it is choosing METIS.

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [November 21, 2022, 6:14pm UTC](https://discourse.julialang.org/t/incorrect-objective-type-when-using-ma57-with-ipopt-in-jump/90578/4 "2022-11-21T18:14:32Z")

</div>

Ah. The `print_level` options were added recently: [add {ma27,ma57,mumps}\_print\_level options · coin-or/Ipopt@5a3b5bd · GitHub](https://github.com/coin-or/Ipopt/commit/5a3b5bd135b21a12cffca736dc3960ad122ddea9)

I need to make a new release of Ipopt\_jll.

I’m not much help on the rest, sorry. I don’t have MA57 installed so I can’t test. But this seems like the sort of thing that @amontoison might have some insight into.

---

<div class="post-metadata">

**Author:** ![amontoison](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/amontoison/32/218741_2.png) [@amontoison](https://discourse.julialang.org/u/amontoison)\
**Post date:** [November 21, 2022, 10:24pm UTC](https://discourse.julialang.org/t/incorrect-objective-type-when-using-ma57-with-ipopt-in-jump/90578/5 "2022-11-21T22:24:09Z")

</div>

@this_josh What is your version of `HSL_MA57`? is it 5.2.0 / 5.3.2 or do you use the `coinhsl` archive version 2021-05-05?

---

<div class="post-metadata">

**Author:** ![this\_josh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/this_josh/32/42679_2.png) [@this\_josh](https://discourse.julialang.org/u/this_josh)\
**Post date:** [November 22, 2022, 7:59am UTC](https://discourse.julialang.org/t/incorrect-objective-type-when-using-ma57-with-ipopt-in-jump/90578/6 "2022-11-22T07:59:53Z")

</div>

I’m currently using the 2021-05-05 version, which I installed following the [Ipopt.jl instructions](https://github.com/jump-dev/Ipopt.jl#mac-1).

---

<div class="post-metadata">

**Author:** ![this\_josh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/this_josh/32/42679_2.png) [@this\_josh](https://discourse.julialang.org/u/this_josh)\
**Post date:** [November 22, 2022, 8:01am UTC](https://discourse.julialang.org/t/incorrect-objective-type-when-using-ma57-with-ipopt-in-jump/90578/7 "2022-11-22T08:01:46Z")

</div>

That makes sense, I’ll keep an eye out for an update then. Cheers.

---

<div class="post-metadata">

**Author:** ![amontoison](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/amontoison/32/218741_2.png) [@amontoison](https://discourse.julialang.org/u/amontoison)\
**Post date:** [November 23, 2022, 3:35am UTC](https://discourse.julialang.org/t/incorrect-objective-type-when-using-ma57-with-ipopt-in-jump/90578/8 "2022-11-23T03:35:01Z")

</div>

@this_josh  
`HSL_MA57` v"5.2.0" and v"5.3.2" work fine on my computer.

```julia
******************************************************************************
This program contains Ipopt, a library for large-scale nonlinear optimization.
 Ipopt is released as open source code under the Eclipse Public License (EPL).
         For more information visit https://github.com/coin-or/Ipopt
******************************************************************************

This is Ipopt version 3.14.4, running with linear solver ma57.

Number of nonzeros in equality constraint Jacobian...: 0
Number of nonzeros in inequality constraint Jacobian.: 0
Number of nonzeros in Lagrangian Hessian.............: 0

Total number of variables............................: 1608
                     variables with only lower bounds: 0
                variables with lower and upper bounds: 1608
                     variables with only upper bounds: 0
Total number of equality constraints.................: 0
Total number of inequality constraints...............: 0
        inequality constraints with only lower bounds: 0
   inequality constraints with lower and upper bounds: 0
        inequality constraints with only upper bounds: 0

iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls
   0 1.6079984e+01 0.00e+00 1.00e+00 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0
   1 1.5984682e+02 0.00e+00 1.11e-16 -1.0 8.98e-02 - 1.00e+00 1.00e+00f 1
   2 1.3153805e+01 0.00e+00 1.11e-16 -2.5 9.50e-02 - 9.31e-01 1.00e+00f 1
   3 2.6857598e-01 0.00e+00 7.16e-17 -3.8 1.90e-02 - 1.00e+00 1.00e+00f 1
   4 2.9613712e-03 0.00e+00 9.62e-17 -5.7 1.91e-04 - 1.00e+00 1.00e+00f 1
   5 -1.2048804e-05 0.00e+00 1.11e-16 -8.6 1.86e-06 - 1.00e+00 1.00e+00f 1

Number of Iterations....: 5

                                   (scaled) (unscaled)
Objective...............: -1.2048804298021919e-05 -1.2048804298021919e-05
Dual infeasibility......: 1.1065617247106498e-16 1.1065617247106498e-16
Constraint violation....: 0.0000000000000000e+00 0.0000000000000000e+00
Variable bound violation: 7.4937192784312844e-09 7.4937192784312844e-09
Complementarity.........: 2.5092975443155260e-09 2.5092975443155260e-09
Overall NLP error.......: 2.5092975443155260e-09 2.5092975443155260e-09

Number of objective function evaluations = 6
Number of objective gradient evaluations = 6
Number of equality constraint evaluations = 0
Number of inequality constraint evaluations = 0
Number of equality constraint Jacobian evaluations = 0
Number of inequality constraint Jacobian evaluations = 0
Number of Lagrangian Hessian evaluations = 1
Total seconds in IPOPT = 0.250

EXIT: Optimal Solution Found.

```

I tried `coinhsl` and Ipopt was not happy at runtime:

```julia
Exception of type: DYNAMIC_LIBRARY_FAILURE in file "Common/IpLibraryLoader.cpp" at line 67
Exception message: /home/alexis/Bureau/git/HSL.jl/deps/usr/lib/libcoinhsl.so: undefined symbol: dtrmm_

EXIT: Library loading failure.

```

I tested with the following code:

```julia
using HSL, Ipopt, JuMP

UB= rand(1:9, (67,24)) # not really necessary 
model = Model()
@variable(model, 0 ≤ x[i= 1:67, j=1:24] ≤ UB[i,j])
@objective(model, Min, sum(x[ii, jj] for ii in 1:67 for jj in 1:24))

opt = optimizer_with_attributes(Ipopt.Optimizer, "linear_solver" => "ma57", "hsllib" => HSL.libhsl_ma57)
# opt = optimizer_with_attributes(Ipopt.Optimizer, "linear_solver" => "ma57", "hsllib" => HSL.libcoinhsl)
set_optimizer(model, opt)
optimize!(model)

```

I checked what is inside the `coinhsl` archive and it’s an old version of MA57 (`v3.11.0`).

---

<div class="post-metadata">

**Author:** ![amontoison](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/amontoison/32/218741_2.png) [@amontoison](https://discourse.julialang.org/u/amontoison)\
**Post date:** [November 23, 2022, 4:12am UTC](https://discourse.julialang.org/t/incorrect-objective-type-when-using-ma57-with-ipopt-in-jump/90578/9 "2022-11-23T04:12:22Z")

</div>

The generic Julia BLAS/LAPACK backend (LBT) was not linked correctly with the `configure` of `coinhsl`, I fixed it and It works fine now.  
Can you try it with our build script from HSL.jl?

You just need to define `ENV["HSL_ARCHIVES_PATH"] = "path_to_folder_with_coinhsl_archive"` and do `pkg> build HSL`.  
You will be able to use it directly in Ipopt after with:

```julia
using HSL
opt = optimizer_with_attributes(Ipopt.Optimizer, "linear_solver" => "maXY", "hsllib" => HSL.libcoinhsl)

```

It’s also compiled with LBT (like the last release of Ipopt\_jll), which means that it uses OpenBLAS32 but you can easily switch to MKL or Apple Accelerate if you want.

---

<div class="post-metadata">

**Author:** ![this\_josh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/this_josh/32/42679_2.png) [@this\_josh](https://discourse.julialang.org/u/this_josh)\
**Post date:** [November 23, 2022, 11:05am UTC](https://discourse.julialang.org/t/incorrect-objective-type-when-using-ma57-with-ipopt-in-jump/90578/10 "2022-11-23T11:05:32Z")

</div>

Thank you for looking into this. I’m surprised how old the bundled version is.

Ah yes, I’ve had similar errors when trying to get it running on HPCs.

I’m having a little trouble with HSL. I’ve done

```julia
git clone https://github.com/JuliaSmoothOptimizers/HSL.jl.git   
cd HSL
brew unlink metis 
julia --project=.
ENV["HSL_ARCHIVES_PATH"] ="/path/to/coinhsl/" # coinhsl-2021.05.05.tar.gz is in this dir
] build
 Info: coinhsl: v"2021.5.5" # suggests it's installed
] test # all passed

```

Now when I go to use HSL I’m getting a segfault

```julia
using HSL, Ipopt, JuMP
opt = optimizer_with_attributes(Ipopt.Optimizer, "linear_solver" => "ma57", "hsllib" => HSL.libcoinhsl)
UB= rand(1:9, (67,24)) # not really necessary 
model = Model(opt)
@variable(model, 0 ≤ x[i= 1:67, j=1:24] ≤ UB[i,j])
@objective(model, Min, sum(x[ii, jj] for ii in 1:67 for jj in 1:24))

```

> **Segfault**
>
> ```julia
> julia> optimize!(model)
> 
> ******************************************************************************
> This program contains Ipopt, a library for large-scale nonlinear optimization.
> Ipopt is released as open source code under the Eclipse Public License (EPL).
> For more information visit https://github.com/coin-or/Ipopt
> ******************************************************************************
> 
> This is Ipopt version 3.14.4, running with linear solver ma57.
> 
> Number of nonzeros in equality constraint Jacobian...: 0
> Number of nonzeros in inequality constraint Jacobian.: 0
> Number of nonzeros in Lagrangian Hessian.............: 0
> 
> Total number of variables............................: 1608
> variables with only lower bounds: 0
> variables with lower and upper bounds: 1608
> variables with only upper bounds: 0
> Total number of equality constraints.................: 0
> Total number of inequality constraints...............: 0
> inequality constraints with only lower bounds: 0
> inequality constraints with lower and upper bounds: 0
> inequality constraints with only upper bounds: 0
> 
> iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls
> 0 1.6079984e+01 0.00e+00 1.00e+00 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0
> 
> signal (11): Segmentation fault: 11
> in expression starting at REPL[10]:1
> __GKfree at /Users/jak121/.julia/artifacts/b37e9531329a61dca55e9e90b0e9de92bb00b883/lib/libmetis4.dylib (unknown line)
> __CompressGraph at /Users/jak121/.julia/artifacts/b37e9531329a61dca55e9e90b0e9de92bb00b883/lib/libmetis4.dylib (unknown line)
> METIS_NodeND at /Users/jak121/.julia/artifacts/b37e9531329a61dca55e9e90b0e9de92bb00b883/lib/libmetis4.dylib (unknown line)
> ma57ad_ at /Users/jak121/Git_repos/HSL.jl/deps/usr/lib/libcoinhsl.dylib (unknown line)
> _ZN5Ipopt20Ma57TSolverInterface21SymbolicFactorizationEPKiS2_ at /Users/jak121/.julia/artifacts/5f87ee5a0999062b66c1db490761d65343e0613f/lib/libipopt.3.dylib (unknown line)
> _ZN5Ipopt20Ma57TSolverInterface19InitializeStructureEiiPKiS2_ at /Users/jak121/.julia/artifacts/5f87ee5a0999062b66c1db490761d65343e0613f/lib/libipopt.3.dylib (unknown line)
> _ZN5Ipopt16TSymLinearSolver19InitializeStructureERKNS_9SymMatrixE at /Users/jak121/.julia/artifacts/5f87ee5a0999062b66c1db490761d65343e0613f/lib/libipopt.3.dylib (unknown line)
> _ZN5Ipopt16TSymLinearSolver10MultiSolveERKNS_9SymMatrixERNSt3__16vectorINS_8SmartPtrIKNS_6VectorEEENS4_9allocatorIS9_EEEERNS5_INS6_IS7_EENSA_ISE_EEEEbi at /Users/jak121/.julia/artifacts/5f87ee5a0999062b66c1db490761d65343e0613f/lib/libipopt.3.dylib (unknown line)
> _ZN5Ipopt18StdAugSystemSolver10MultiSolveEPKNS_9SymMatrixEdPKNS_6VectorEdS6_dPKNS_6MatrixES6_dS9_S6_dRNSt3__16vectorINS_8SmartPtrIS5_EENSA_9allocatorISD_EEEESH_SH_SH_RNSB_INSC_IS4_EENSE_ISI_EEEESL_SL_SL_bi at /Users/jak121/.julia/artifacts/5f87ee5a0999062b66c1db490761d65343e0613f/lib/libipopt.3.dylib (unknown line)
> _ZN5Ipopt15AugSystemSolver5SolveEPKNS_9SymMatrixEdPKNS_6VectorEdS6_dPKNS_6MatrixES6_dS9_S6_dRS5_SA_SA_SA_RS4_SB_SB_SB_bi at /Users/jak121/.julia/artifacts/5f87ee5a0999062b66c1db490761d65343e0613f/lib/libipopt.3.dylib (unknown line)
> _ZN5Ipopt17PDFullSpaceSolver9SolveOnceEbbRKNS_9SymMatrixERKNS_6MatrixES6_S6_S6_S6_S6_RKNS_6VectorES9_S9_S9_S9_S9_S9_S9_S9_S9_ddRKNS_14IteratesVectorERSA_ at /Users/jak121/.julia/artifacts/5f87ee5a0999062b66c1db490761d65343e0613f/lib/libipopt.3.dylib (unknown line)
> _ZN5Ipopt17PDFullSpaceSolver5SolveEddRKNS_14IteratesVectorERS1_bb at /Users/jak121/.julia/artifacts/5f87ee5a0999062b66c1db490761d65343e0613f/lib/libipopt.3.dylib (unknown line)
> _ZN5Ipopt21PDSearchDirCalculator22ComputeSearchDirectionEv at /Users/jak121/.julia/artifacts/5f87ee5a0999062b66c1db490761d65343e0613f/lib/libipopt.3.dylib (unknown line)
> _ZN5Ipopt14IpoptAlgorithm22ComputeSearchDirectionEv at /Users/jak121/.julia/artifacts/5f87ee5a0999062b66c1db490761d65343e0613f/lib/libipopt.3.dylib (unknown line)
> _ZN5Ipopt14IpoptAlgorithm8OptimizeEb at /Users/jak121/.julia/artifacts/5f87ee5a0999062b66c1db490761d65343e0613f/lib/libipopt.3.dylib (unknown line)
> _ZN5Ipopt16IpoptApplication13call_optimizeEv at /Users/jak121/.julia/artifacts/5f87ee5a0999062b66c1db490761d65343e0613f/lib/libipopt.3.dylib (unknown line)
> _ZN5Ipopt16IpoptApplication11OptimizeNLPERKNS_8SmartPtrINS_3NLPEEERNS1_INS_16AlgorithmBuilderEEE at /Users/jak121/.julia/artifacts/5f87ee5a0999062b66c1db490761d65343e0613f/lib/libipopt.3.dylib (unknown line)
> _ZN5Ipopt16IpoptApplication11OptimizeNLPERKNS_8SmartPtrINS_3NLPEEE at /Users/jak121/.julia/artifacts/5f87ee5a0999062b66c1db490761d65343e0613f/lib/libipopt.3.dylib (unknown line)
> _ZN5Ipopt16IpoptApplication12OptimizeTNLPERKNS_8SmartPtrINS_4TNLPEEE at /Users/jak121/.julia/artifacts/5f87ee5a0999062b66c1db490761d65343e0613f/lib/libipopt.3.dylib (unknown line)
> IpoptSolve at /Users/jak121/.julia/artifacts/5f87ee5a0999062b66c1db490761d65343e0613f/lib/libipopt.3.dylib (unknown line)
> IpoptSolve at /Users/jak121/.julia/packages/Ipopt/rQctM/src/C_wrapper.jl:442
> optimize! at /Users/jak121/.julia/packages/Ipopt/rQctM/src/MOI_wrapper.jl:727
> optimize! at /Users/jak121/.julia/packages/MathOptInterface/Ht8hE/src/Bridges/bridge_optimizer.jl:376 [inlined]
> optimize! at /Users/jak121/.julia/packages/MathOptInterface/Ht8hE/src/MathOptInterface.jl:87 [inlined]
> optimize! at /Users/jak121/.julia/packages/MathOptInterface/Ht8hE/src/Utilities/cachingoptimizer.jl:316
> unknown function (ip: 0x2b1a0045b)
> ijl_apply_generic at /Users/jak121/.julia/juliaup/julia-1.8.3+0.aarch64/lib/julia/libjulia-internal.1.8.dylib (unknown line)
> #optimize!#138 at /Users/jak121/.julia/packages/JuMP/Z1pVn/src/optimizer_interface.jl:185
> optimize! at /Users/jak121/.julia/packages/JuMP/Z1pVn/src/optimizer_interface.jl:155
> unknown function (ip: 0x2b161c037)
> ijl_apply_generic at /Users/jak121/.julia/juliaup/julia-1.8.3+0.aarch64/lib/julia/libjulia-internal.1.8.dylib (unknown line)
> do_call at /Users/jak121/.julia/juliaup/julia-1.8.3+0.aarch64/lib/julia/libjulia-internal.1.8.dylib (unknown line)
> eval_body at /Users/jak121/.julia/juliaup/julia-1.8.3+0.aarch64/lib/julia/libjulia-internal.1.8.dylib (unknown line)
> jl_interpret_toplevel_thunk at /Users/jak121/.julia/juliaup/julia-1.8.3+0.aarch64/lib/julia/libjulia-internal.1.8.dylib (unknown line)
> jl_toplevel_eval_flex at /Users/jak121/.julia/juliaup/julia-1.8.3+0.aarch64/lib/julia/libjulia-internal.1.8.dylib (unknown line)
> jl_toplevel_eval_flex at /Users/jak121/.julia/juliaup/julia-1.8.3+0.aarch64/lib/julia/libjulia-internal.1.8.dylib (unknown line)
> jl_toplevel_eval_flex at /Users/jak121/.julia/juliaup/julia-1.8.3+0.aarch64/lib/julia/libjulia-internal.1.8.dylib (unknown line)
> ijl_toplevel_eval_in at /Users/jak121/.julia/juliaup/julia-1.8.3+0.aarch64/lib/julia/libjulia-internal.1.8.dylib (unknown line)
> eval at ./boot.jl:368 [inlined]
> eval_user_input at /Users/administrator/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-macmini-aarch64-1.0/build/default-macmini-aarch64-1-0/julialang/julia-release-1-dot-8/usr/share/julia/stdlib/v1.8/REPL/src/REPL.jl:151
> repl_backend_loop at /Users/administrator/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-macmini-aarch64-1.0/build/default-macmini-aarch64-1-0/julialang/julia-release-1-dot-8/usr/share/julia/stdlib/v1.8/REPL/src/REPL.jl:247
> start_repl_backend at /Users/administrator/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-macmini-aarch64-1.0/build/default-macmini-aarch64-1-0/julialang/julia-release-1-dot-8/usr/share/julia/stdlib/v1.8/REPL/src/REPL.jl:232
> #run_repl#47 at /Users/administrator/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-macmini-aarch64-1.0/build/default-macmini-aarch64-1-0/julialang/julia-release-1-dot-8/usr/share/julia/stdlib/v1.8/REPL/src/REPL.jl:369
> run_repl at /Users/administrator/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-macmini-aarch64-1.0/build/default-macmini-aarch64-1-0/julialang/julia-release-1-dot-8/usr/share/julia/stdlib/v1.8/REPL/src/REPL.jl:355
> jfptr_run_repl_63972 at /Users/jak121/.julia/juliaup/julia-1.8.3+0.aarch64/lib/julia/sys.dylib (unknown line)
> ijl_apply_generic at /Users/jak121/.julia/juliaup/julia-1.8.3+0.aarch64/lib/julia/libjulia-internal.1.8.dylib (unknown line)
> #967 at ./client.jl:419
> jfptr_YY.967_25249 at /Users/jak121/.julia/juliaup/julia-1.8.3+0.aarch64/lib/julia/sys.dylib (unknown line)
> ijl_apply_generic at /Users/jak121/.julia/juliaup/julia-1.8.3+0.aarch64/lib/julia/libjulia-internal.1.8.dylib (unknown line)
> jl_f__call_latest at /Users/jak121/.julia/juliaup/julia-1.8.3+0.aarch64/lib/julia/libjulia-internal.1.8.dylib (unknown line)
> #invokelatest#2 at ./essentials.jl:729 [inlined]
> invokelatest at ./essentials.jl:726 [inlined]
> run_main_repl at ./client.jl:404
> exec_options at ./client.jl:318
> _start at ./client.jl:522
> jfptr__start_47905 at /Users/jak121/.julia/juliaup/julia-1.8.3+0.aarch64/lib/julia/sys.dylib (unknown line)
> ijl_apply_generic at /Users/jak121/.julia/juliaup/julia-1.8.3+0.aarch64/lib/julia/libjulia-internal.1.8.dylib (unknown line)
> true_main at /Users/jak121/.julia/juliaup/julia-1.8.3+0.aarch64/lib/julia/libjulia-internal.1.8.dylib (unknown line)
> jl_repl_entrypoint at /Users/jak121/.julia/juliaup/julia-1.8.3+0.aarch64/lib/julia/libjulia-internal.1.8.dylib (unknown line)
> Allocations: 106414853 (Pool: 106360329; Big: 54524); GC: 46
> 
> ```

This is on `1.8.3+0.aarch64` which seems like `HSL.jl` is [tested for](https://github.com/JuliaSmoothOptimizers/HSL.jl/blob/main/.github/workflows/CI_M1.yml).

I have tried relinking metis and running `LinearAlgebra.BLAS.lbt_forward(OpenBLAS32_jll.libopenblas_path)` on the chance they’d make a difference but I still get the segfault.

---

<div class="post-metadata">

**Author:** ![amontoison](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/amontoison/32/218741_2.png) [@amontoison](https://discourse.julialang.org/u/amontoison)\
**Post date:** [November 23, 2022, 6:54pm UTC](https://discourse.julialang.org/t/incorrect-objective-type-when-using-ma57-with-ipopt-in-jump/90578/11 "2022-11-23T18:54:07Z")

</div>

The issue is in METIS4. 🤔  
you can try two things:

- Add the flags `-arch x86_64` in `HSL_FC` and `HSL_CC`.  
It could help the compilation on the new Mac.
- Remove `-lmetis4` in `deps/build.jl` ([line 125](https://github.com/JuliaSmoothOptimizers/HSL.jl/blob/main/deps/build.jl#L125) and [line 129](https://github.com/JuliaSmoothOptimizers/HSL.jl/blob/main/deps/build.jl#L129)) because METIS is optional.

`HSL.jl` is tested on `1.8.3+0.aarch64` for all interfaced HSL packages but not `coinhsl`.  
`coinhsl` doesn’t have `c` and `z` versions of the solvers.

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [November 23, 2022, 7:52pm UTC](https://discourse.julialang.org/t/incorrect-objective-type-when-using-ma57-with-ipopt-in-jump/90578/12 "2022-11-23T19:52:05Z")

</div>

I can reproduce the segfault exactly.

---

<div class="post-metadata">

**Author:** ![dpo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpo/32/3335_2.png) [@dpo](https://discourse.julialang.org/u/dpo)\
**Post date:** [November 23, 2022, 9:55pm UTC](https://discourse.julialang.org/t/incorrect-objective-type-when-using-ma57-with-ipopt-in-jump/90578/13 "2022-11-23T21:55:29Z")

</div>

> [@this\_josh](#):
>
> This is on `1.8.3+0.aarch64` which seems like `HSL.jl` is [tested for](https://github.com/JuliaSmoothOptimizers/HSL.jl/blob/main/.github/workflows/CI_M1.yml).

No, it’s tested on the x86\_64 architecture: [https://github.com/JuliaSmoothOptimizers/HSL.jl/blob/main/.github/workflows/CI\_M1.yml#L20](https://github.com/JuliaSmoothOptimizers/HSL.jl/blob/main/.github/workflows/CI_M1.yml#L20)

Also, it’s tested with gcc/gfortran version 7. Newer compilers were causing issues. Locally on my M1, using gcc/gfortran version 12 for aarch64 produces the same error as the one you report when running `]test HSL`.

Your problem will probably go away if you install an x86\_64 version of julia (e.g., with `juliaup`) and gcc/gfortran version 7.

We’ll investigate, but after all, julia for aarch64 is not in tier 1, so it may be a wild goose chase.

Mysteriously, Julia 1.8.2 for x86\_64 ships with libgfortran4, but for aarch64, it ships with libgfortran5. So even if you managed to build gcc/gfortran 7 for aarch64 (Homebrew doesn’t provide it), it wouldn’t work as it uses libgfortran4.

---

<div class="post-metadata">

**Author:** ![this\_josh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/this_josh/32/42679_2.png) [@this\_josh](https://discourse.julialang.org/u/this_josh)\
**Post date:** [November 24, 2022, 8:27am UTC](https://discourse.julialang.org/t/incorrect-objective-type-when-using-ma57-with-ipopt-in-jump/90578/14 "2022-11-24T08:27:58Z")

</div>

> [@amontoison](#):
>
> 5.3.2

Given it works on 5.3.2, rather than fixing the coinhsl install I’ll change `ma57_pivot_order` for now and consider updating my MA57 using `HSL.jl` at some point.

---

<div class="post-metadata">

**Author:** ![this\_josh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/this_josh/32/42679_2.png) [@this\_josh](https://discourse.julialang.org/u/this_josh)\
**Post date:** [November 24, 2022, 8:38am UTC](https://discourse.julialang.org/t/incorrect-objective-type-when-using-ma57-with-ipopt-in-jump/90578/15 "2022-11-24T08:38:27Z")

</div>

> [@dpo](#):
>
> Your problem will probably go away if you install an x86\_64 version of julia (e.g., with `juliaup`) and gcc/gfortran version 7.

In the past I’ve had errors associated with the x86\_64 version so I’d prefer to stick with the non-tier one aarch64. I did try installing on Julia LTS (x86\_64) but got an error during the install so didn’t pursue it further.

Thanks for the explanation. Given the different libgfortran versions I can really appreciate why it may be a wild goose chase.,I’ll keep an eye on `HSL.jl` in case anything changes.

Cheers
