# JuMP IPOPT plugin can’t find or interface with LAPACK at runtime?

**URL:** <https://discourse.julialang.org/t/jump-ipopt-plugin-can-t-find-or-interface-with-lapack-at-runtime/127809>\
**Category:** Optimization (Mathematical)\
**Tags:** jump\
**Created:** [April 7, 2025, 4:26pm UTC](https://discourse.julialang.org/t/jump-ipopt-plugin-can-t-find-or-interface-with-lapack-at-runtime/127809 "2025-04-07T16:26:18Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![askvorts](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/askvorts/32/7120_2.png) [@askvorts](https://discourse.julialang.org/u/askvorts)\
**Post date:** [April 7, 2025, 4:26pm UTC](https://discourse.julialang.org/t/jump-ipopt-plugin-can-t-find-or-interface-with-lapack-at-runtime/127809/1 "2025-04-07T16:26:18Z")

</div>

I am trying to solve a MIQP portfolio optimisation problem using JuMP and SCIP (tried Juniper before but it crashed Julia). There are repeated errors:

```julia
Error: no BLAS/LAPACK library loaded for dsyev_()
[nlpi_ipopt.cpp:2680] ERROR: There was an error when calling DSYEV. INFO = 3
# Afterwards
WARNING: Failed to compute eigenvalues of quadratic coefficient matrix --> don't know curvature

```

which I believe may imply that SCIP’s IPOPT plugin can’t find or interface with LAPACK at runtime — even though Julia itself can. Indeed we can see `lbt` as the result of

```julia
LinearAlgebra.BLAS.vendor()

```

Julia is using the Apple Accelerate framework on macOS. So in principle it should support LAPACK routines like `dsyev_()`. I can check curvature myself with something like

```julia
Sigma = Symmetric(Sigma)
Sigma += 1e-6 * I # regularization to ensure positive definiteness
eigvals = eigen(Sigma).values
minimum(eigvals) 

```

Is there a way to tell JuMP/SCIP what the eigenvalues are since, as it is, it is unable to compute them? Or perhaps there is a better way to overcome this problem? 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:** [April 8, 2025, 4:01am UTC](https://discourse.julialang.org/t/jump-ipopt-plugin-can-t-find-or-interface-with-lapack-at-runtime/127809/2 "2025-04-08T04:01:57Z")

</div>

Hi @askvorts,

Do you have a reproducible example?

What is the output of `import Pkg; Pkg.versioninfo()` and `Pkg.status()`?

---

<div class="post-metadata">

**Author:** ![askvorts](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/askvorts/32/7120_2.png) [@askvorts](https://discourse.julialang.org/u/askvorts)\
**Post date:** [April 8, 2025, 2:45pm UTC](https://discourse.julialang.org/t/jump-ipopt-plugin-can-t-find-or-interface-with-lapack-at-runtime/127809/3 "2025-04-08T14:45:23Z")

</div>

> [@askvorts](#):
>
> SCIP

Thank you very much for having a look at this. This is the exact script, not very minimal, but reproduces the error. Notice that the script runs till the end. I uploaded the CSV file with the DJIA returns (added the .jl extension (djia.csv.jl) so that I could upload the file …).

```julia
############## Cardinality Constraints ######################
 using LinearAlgebra
 using JuMP
 using SCIP  
 using CSV

 # Get returns from Dow Jones 30 components from 2024-01-01, to 2025-03-31 
 returns = CSV.read("djia.csv", DataFrame) # Load the data

# Calculate sample mean vector (mu) and covariance matrix (Sigma)
mu = mean(Matrix(returns[:, 2:end]), dims=1)'
n = length(mu)
Sigma = cov(Matrix(returns[:, 2:end]))

# Market capitalization weights (assumed equal for simplicity)
w_mkt = fill(1/n, n)

# Risk aversion coefficient
lambda = 5

# Implied equilibrium returns
PI = lambda * Sigma * w_mkt

# Investor views
# Example: Expect AAPL to outperform MSFT by 2%
P = [1 -1 zeros(1, n-2)]
q = [0.02]

# Uncertainty of views
Omega = P * Sigma * P' * 0.25

# Black-Litterman formula
tau = 0.05
M = inv(inv(tau * Sigma) + P' * inv(Omega) * P)
mu_bl = M * (inv(tau * Sigma) * PI + P' * inv(Omega) * q)

# Create the SCIP/JuMP model
model = Model(SCIP.Optimizer)

 # Weights: long-only, max 10%
 @variable(model, 0 <= w[1:n] <= 0.1)  

 # Binary variables for activation 
 @variable(model, z[1:n], Bin)    

 # Fully invested portfolio
 @constraint(model, sum(w) == 1.0) 

 # Threshold if invested
 @constraint(model, [i=1:n], w[i] >= 0.01 * z[i])  

 # Upper bound when active
 @constraint(model, [i=1:n], w[i] <= 0.1 * z[i])   

 # Objective: use Black-Litterman (mu_bl) or other expected return vector
 objective = dot(mu_bl, w) - (lambda/2) * dot(w, Sigma * w)  
 @objective(model, Max, objective)

 optimize!(model)
 w_dc = value.(w)
 println("Optimal weights (Disjunctive Constraint) = ", round.(w_dc,digits = 6))

```

`Pkg.status()`is

```julia
[336ed68f] CSV v0.10.15
  [a93c6f00] DataFrames v1.7.0
⌃ [31c24e10] Distributions v0.25.117
  [b6b21f68] Ipopt v1.8.0
  [2ddba703] Juniper v0.9.2
  [b8f27783] MathOptInterface v1.38.1
  [0987c9cc] MonteCarloMeasurements v1.4.5
  [ab2f91bb] OSQP v0.8.1
⌃ [429524aa] Optim v1.11.0
⌃ [82193955] SCIP v0.11.6
  [1277b4bf] ShiftedArrays v2.0.0
  [ade2ca70] Dates v1.11.0
  [37e2e46d] LinearAlgebra v1.11.0
  [9a3f8284] Random v1.11.0

```

and the Julia version is: `1.11.4 (2025-03-10)`

---

<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:** [April 8, 2025, 8:35pm UTC](https://discourse.julialang.org/t/jump-ipopt-plugin-can-t-find-or-interface-with-lapack-at-runtime/127809/4 "2025-04-08T20:35:04Z")

</div>

> [@odow](#):
>
> What is the output of `import Pkg; Pkg.versioninfo()`

Could you provide the complete output of this?

> ⌃ [82193955] SCIP v0.11.6

Your version of SCIP is out of date. Try updating your packages. This may have been fixed already.

> I uploaded the CSV file with the DJIA returns

I don’t see it?

---

<div class="post-metadata">

**Author:** ![askvorts](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/askvorts/32/7120_2.png) [@askvorts](https://discourse.julialang.org/u/askvorts)\
**Post date:** [April 8, 2025, 8:41pm UTC](https://discourse.julialang.org/t/jump-ipopt-plugin-can-t-find-or-interface-with-lapack-at-runtime/127809/5 "2025-04-08T20:41:58Z")

</div>

Here it is

```julia
Julia Version 1.11.4
Commit 8561cc3d68d (2025-03-10 11:36 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (arm64-apple-darwin24.0.0)
  CPU: 8 × Apple M1
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, apple-m1)
Threads: 1 default, 0 interactive, 1 GC (on 4 virtual cores)

```

[djia.csv.jl](https://discourse.julialang.org/uploads/short-url/v4tjYbYyQhJCi3nOgB0cgm8o9RU.jl) (198.3 KB)

---

<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:** [April 8, 2025, 8:53pm UTC](https://discourse.julialang.org/t/jump-ipopt-plugin-can-t-find-or-interface-with-lapack-at-runtime/127809/6 "2025-04-08T20:53:24Z")

</div>

I can’t reproduce this, so try updating your packages. There have been a bunch of improvements between SCIP 0.11.6 (released in October 2022) and the latest version. It’s probably something to do with your M1 Mac.

You can also write your model like:

```julia
model = Model(SCIP.Optimizer)
@variable(model, w[1:n] in Semicontinuous(0.01, 0.1)) 
@constraint(model, sum(w) == 1.0) 
@objective(model, Max, mu_bl' * w - 0.5 * lambda * w' * Sigma * w)
optimize!(model)
assert_is_solved_and_feasible(model)
w_dc = value.(w)

```

---

<div class="post-metadata">

**Author:** ![askvorts](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/askvorts/32/7120_2.png) [@askvorts](https://discourse.julialang.org/u/askvorts)\
**Post date:** [April 8, 2025, 9:50pm UTC](https://discourse.julialang.org/t/jump-ipopt-plugin-can-t-find-or-interface-with-lapack-at-runtime/127809/7 "2025-04-08T21:50:04Z")

</div>

Indeed, updating solved the problem. I was not aware I had such an old version installed. Also tried with Juniper + OSQP and it worked fine too. 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:** [April 8, 2025, 9:53pm UTC](https://discourse.julialang.org/t/jump-ipopt-plugin-can-t-find-or-interface-with-lapack-at-runtime/127809/8 "2025-04-08T21:53:04Z")

</div>

If you look at the full output of `Pkg.status()`, you’ll see:

```julia
⌃ [82193955] SCIP v0.11.6

Info Packages marked with ⌃ have new versions available and may be upgradable.

```

---

<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:** [April 12, 2025, 10:41pm UTC](https://discourse.julialang.org/t/jump-ipopt-plugin-can-t-find-or-interface-with-lapack-at-runtime/127809/9 "2025-04-12T22:41:43Z")

</div>

It seems that an LP64 BLAS / LAPACK is not loaded. Does SCIP\_jll.jl directly relies on Ipopt\_jll.jl?

Can you try again by just doing a `using Ipopt` before anything else?  
It will load a LP64 backend (OpenBLAS32) for the user.

---

<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:** [April 13, 2025, 8:55pm UTC](https://discourse.julialang.org/t/jump-ipopt-plugin-can-t-find-or-interface-with-lapack-at-runtime/127809/10 "2025-04-13T20:55:12Z")

</div>

Recent versions of SCIP load things here:

> <https://github.com/scipopt/SCIP.jl/blob/c1f02f1888bdfb64146da14f4e220f140c5752a2/src/init.jl#L27-L33>

I assume the broken version did not.
