# \[Ipopt+HSL\] Error: no BLAS/LAPACK library loaded!

**URL:** <https://discourse.julialang.org/t/ipopt-hsl-error-no-blas-lapack-library-loaded/74409>\
**Category:** Optimization (Mathematical)\
**Created:** [January 11, 2022, 4:58pm UTC](https://discourse.julialang.org/t/ipopt-hsl-error-no-blas-lapack-library-loaded/74409 "2022-01-11T16:58:39Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![SingingKim](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@SingingKim](https://discourse.julialang.org/u/SingingKim)\
**Post date:** [January 11, 2022, 4:58pm UTC](https://discourse.julialang.org/t/ipopt-hsl-error-no-blas-lapack-library-loaded/74409/1 "2022-01-11T16:58:39Z")

</div>

Happy New Year!

I’m having an error with Ipopt and HSL library.

With a toy example:

```julia
using JuMP, Ipopt
m = Model(Ipopt.Optimizer)
set_optimizer_attribute(m, "linear_solver", "ma86")
@variable(m, x <= 5)
@variable(m, y <= 45)
@objective(m, Max, x + y)
JuMP.optimize!(m)

```

Ipopt + HSL has started to give me the following error (It used to be working fine):

```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 ma86.

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............................: 2
                     variables with only lower bounds: 0
                variables with lower and upper bounds: 0
                     variables with only upper bounds: 2
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 0.0000000e+00 0.00e+00 0.00e+00 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
   1 4.9411805e+01 0.00e+00 1.00e-06 -1.0 4.49e+01 - 1.00e+00 9.92e-01f 1
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
   2 4.9960000e+01 0.00e+00 2.00e-07 -1.7 4.30e-01 - 1.00e+00 1.00e+00f 1
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
   3 4.9999700e+01 0.00e+00 1.50e-09 -3.8 1.98e-02 - 1.00e+00 1.00e+00f 1
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
   4 4.9999997e+01 0.00e+00 1.84e-11 -5.7 1.49e-04 - 1.00e+00 1.00e+00f 1
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
Error: no BLAS/LAPACK library loaded!
   5 5.0000000e+01 0.00e+00 2.51e-14 -8.6 1.84e-06 - 1.00e+00 1.00e+00f 1

Number of Iterations....: 5

                                   (scaled) (unscaled)
Objective...............: -5.0000000494988193e+01 5.0000000494988193e+01
Dual infeasibility......: 2.5091040356528538e-14 2.5091040356528538e-14
Constraint violation....: 0.0000000000000000e+00 0.0000000000000000e+00
Variable bound violation: 4.4749409511268823e-07 4.4749409511268823e-07
Complementarity.........: 2.5059065933419962e-09 2.5059065933419962e-09
Overall NLP error.......: 2.5059065933419962e-09 2.5059065933419962e-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.182

EXIT: Optimal Solution Found.

```

Can this be related to “OpenBLAS32\_jll v0.3.17+0”?

My current environment is the following:

```julia
julia> versioninfo()
Julia Version 1.7.1
Commit ac5cc99908 (2021-12-22 19:35 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin19.5.0)
  CPU: Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, skylake)

```

and

```julia
(@v1.7) pkg> status
      Status `~/.julia/environments/v1.7/Project.toml`
  [336ed68f] CSV v0.9.11
  [5ae59095] Colors v0.12.8
  [a93c6f00] DataFrames v1.3.1
  [31c24e10] Distributions v0.25.37
  [2e9cd046] Gurobi v0.10.1
  [b6b21f68] Ipopt v0.9.1
  [033835bb] JLD2 v0.4.17
  [4076af6c] JuMP v0.22.2
  [67920dd8] KNITRO v0.11.0
  [b964fa9f] LaTeXStrings v1.3.0
  [23992714] MAT v0.10.2
  [6405355b] Mosek v1.2.1
  [1ec41992] MosekTools v0.11.0
  [a8b11937] OpenDSSDirect v0.7.2
  [8314cec4] PGFPlotsX v1.4.1
  [91a5bcdd] Plots v1.25.5
  [c36e90e8] PowerModels v0.19.1
  [22bb73d7] SVR v1.2.3

```

Thank you!

---

<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:** [January 11, 2022, 6:23pm UTC](https://discourse.julialang.org/t/ipopt-hsl-error-no-blas-lapack-library-loaded/74409/2 "2022-01-11T18:23:04Z")

</div>

See [https://github.com/jump-dev/Ipopt.jl#julia-17](https://github.com/jump-dev/Ipopt.jl#julia-17)

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [January 11, 2022, 6:43pm UTC](https://discourse.julialang.org/t/ipopt-hsl-error-no-blas-lapack-library-loaded/74409/3 "2022-01-11T18:43:57Z")

</div>

@odow would registering [https://github.com/giordano/OpenBLAS32.jl](https://github.com/giordano/OpenBLAS32.jl) help?

---

<div class="post-metadata">

**Author:** ![SingingKim](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@SingingKim](https://discourse.julialang.org/u/SingingKim)\
**Post date:** [January 11, 2022, 7:38pm UTC](https://discourse.julialang.org/t/ipopt-hsl-error-no-blas-lapack-library-loaded/74409/4 "2022-01-11T19:38:46Z")

</div>

@odow This resolved my issue. Thank you so much!

---

<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:** [January 11, 2022, 10:37pm UTC](https://discourse.julialang.org/t/ipopt-hsl-error-no-blas-lapack-library-loaded/74409/5 "2022-01-11T22:37:49Z")

</div>

> would registering [GitHub - giordano/OpenBLAS32.jl](https://github.com/giordano/OpenBLAS32.jl) help?

We could just add that piece of code to Ipopt directly. I don’t think we need an extra dependency.

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [January 11, 2022, 10:44pm UTC](https://discourse.julialang.org/t/ipopt-hsl-error-no-blas-lapack-library-loaded/74409/6 "2022-01-11T22:44:00Z")

</div>

Yeah, well, that’s literally one line 😄

---

<div class="post-metadata">

**Author:** ![SingingKim](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@SingingKim](https://discourse.julialang.org/u/SingingKim)\
**Post date:** [January 12, 2022, 1:40am UTC](https://discourse.julialang.org/t/ipopt-hsl-error-no-blas-lapack-library-loaded/74409/7 "2022-01-12T01:40:19Z")

</div>

@odow Is there a way to automatically run (or initialize) the suggested code?

```julia
import LinearAlgebra, OpenBLAS32_jll
LinearAlgebra.BLAS.lbt_forward(OpenBLAS32_jll.libopenblas_path)

```

It is a little bit of a hassle to run it every time 😅

---

<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:** [January 12, 2022, 2:15am UTC](https://discourse.julialang.org/t/ipopt-hsl-error-no-blas-lapack-library-loaded/74409/8 "2022-01-12T02:15:02Z")

</div>

The suggestion above is to add it to Ipopt. (I’ll review a pull request with it if you want to make one.)

Otherwise it’s only one line, and you’re using non-standard Ipopt options, so it isn’t that much of an inconvenience.

---

<div class="post-metadata">

**Author:** ![SingingKim](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@SingingKim](https://discourse.julialang.org/u/SingingKim)\
**Post date:** [January 12, 2022, 3:19am UTC](https://discourse.julialang.org/t/ipopt-hsl-error-no-blas-lapack-library-loaded/74409/9 "2022-01-12T03:19:19Z")

</div>

@odow Fair enough. Thank you for your input.
