# Errors using JuMP with Ipopt or HiGHS: UndefVarError: libipopt not defined and UndefVarError: libhighs not defined

**URL:** <https://discourse.julialang.org/t/errors-using-jump-with-ipopt-or-highs-undefvarerror-libipopt-not-defined-and-undefvarerror-libhighs-not-defined/78539>\
**Category:** Optimization (Mathematical)\
**Tags:** jump\
**Created:** [March 27, 2022, 1:34am UTC](https://discourse.julialang.org/t/errors-using-jump-with-ipopt-or-highs-undefvarerror-libipopt-not-defined-and-undefvarerror-libhighs-not-defined/78539 "2022-03-27T01:34:28Z")\
**Posts on this page:** 5\
**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:** [March 27, 2022, 1:34am UTC](https://discourse.julialang.org/t/errors-using-jump-with-ipopt-or-highs-undefvarerror-libipopt-not-defined-and-undefvarerror-libhighs-not-defined/78539/1 "2022-03-27T01:34:28Z")

</div>

I have `Ipopt`, `OSQP`and `HiGHS` installed. In Jupiter, when running the following script,

`n = size(Sigma,1) # Sigma is a 30x30 covariance matrix`  
`m = Model(Ipopt.Optimizer)`  
`@variable(m, w[1:n])`  
`@objective(m, Min, w' * Sigma * w) `  
`@constraint(m, sum(w) == 1) `  
`@constraint(m, w .>= 0) `  
`optimize!(m) `  
`value.(w)`

I get the following error:

`UndefVarError: libipopt not defined`

`Stacktrace: [1] createProblem(n::Int64, x_L::Vector{Float64}, x_U::Vector{Float64}, m::Int64, g_L::Vector{Float64}, g_U::Vector{Float64}, nele_jac::Int64, nele_hess::Int64, eval_f::Ipopt.var"#eval_f_cb#44"{Ipopt.Optimizer}, eval_g::Ipopt.var"#eval_g_cb#46"{Ipopt.Optimizer}, eval_grad_f::Ipopt.var"#eval_grad_f_cb#45"{Ipopt.Optimizer}, eval_jac_g::Ipopt.var"#eval_jac_g_cb#47"{Ipopt.Optimizer, Vector{Tuple{Int64, Int64}}}, eval_h::Ipopt.var"#eval_h_cb#48"{Ipopt.Optimizer, Vector{Tuple{Int64, Int64}}}) @ Ipopt ~/.julia/packages/Ipopt/vtrOr/src/Ipopt.jl:320 [2] optimize!(model::Ipopt.Optimizer) @ Ipopt ~/.julia/packages/Ipopt/vtrOr/src/MOI_wrapper.jl:1616 [3] optimize!(b::MathOptInterface.Bridges.LazyBridgeOptimizer{Ipopt.Optimizer}) @ MathOptInterface.Bridges ~/.julia/packages/MathOptInterface/YDdD3/src/Bridges/bridge_optimizer.jl:319 [4] optimize!(m::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.AbstractOptimizer, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.GenericModel{Float64, MathOptInterface.Utilities.ModelFunctionConstraints{Float64}}}}) @ MathOptInterface.Utilities ~/.julia/packages/MathOptInterface/YDdD3/src/Utilities/cachingoptimizer.jl:252 [5] optimize!(model::Model, optimizer_factory::Nothing; bridge_constraints::Bool, ignore_optimize_hook::Bool, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}) @ JuMP ~/.julia/packages/JuMP/e0Uc2/src/optimizer_interface.jl:130 [6] optimize! (repeats 2 times) @ ~/.julia/packages/JuMP/e0Uc2/src/optimizer_interface.jl:106 [inlined] [7] top-level scope @ In[50]:7 [8] eval @ ./boot.jl:373 [inlined] [9] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String) @ Base ./loading.jl:1196`

Replacing `m = Model(Ipopt.Optimizer)` with `m = Model(HiGHS.Optimizer)` one gets the similar error: `UndefVarError: libhighs not defined`. However `m = Model(OSQP.Optimizer)` runs and computes the optimal weights `w`.

My list of packages is the following:  
` [9961bab8] Cbc v0.8.1`  
` [a93c6f00] DataFrames v1.3.2`  
`[31c24e10] Distributions v0.23.8`  
`[87dc4568] HiGHS v0.2.3`  
`[b6b21f68] Ipopt v0.7.0`  
`[4076af6c] JuMP v0.21.4`  
`[76087f3c] NLopt v0.6.3`  
`[ab2f91bb] OSQP v0.6.1`  
`[429524aa] Optim v1.6.2`  
`[f3b207a7] StatsPlots v0.14.30`

I am wondering if I am doing something wrong… Thanks in advance!

---

<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:** [March 27, 2022, 2:23am UTC](https://discourse.julialang.org/t/errors-using-jump-with-ipopt-or-highs-undefvarerror-libipopt-not-defined-and-undefvarerror-libhighs-not-defined/78539/2 "2022-03-27T02:23:12Z")

</div>

Is this on an M1 Mac? Please update to the latest versions of each package.

x-ref: [https://github.com/jump-dev/HiGHS.jl/issues/96](https://github.com/jump-dev/HiGHS.jl/issues/96)

---

<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:** [March 27, 2022, 4:17am UTC](https://discourse.julialang.org/t/errors-using-jump-with-ipopt-or-highs-undefvarerror-libipopt-not-defined-and-undefvarerror-libhighs-not-defined/78539/3 "2022-03-27T04:17:17Z")

</div>

Yes, it is on an M1 Mac. Indeed, updating solved the problem. Thank you!

---

<div class="post-metadata">

**Author:** ![Aakriti\_Rohatgi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aakriti_rohatgi/32/34413_2.png) [@Aakriti\_Rohatgi](https://discourse.julialang.org/u/Aakriti_Rohatgi)\
**Post date:** [December 2, 2022, 1:24pm UTC](https://discourse.julialang.org/t/errors-using-jump-with-ipopt-or-highs-undefvarerror-libipopt-not-defined-and-undefvarerror-libhighs-not-defined/78539/4 "2022-12-02T13:24:32Z")

</div>

HI,  
I am facing the same issue with Ipopt and Highs, updating the packages is also not resolving the issue.  
I am wondering if I am doing something wrong… Thanks in advance!  
Thanks  
Aakriti

---

<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:** [December 4, 2022, 7:48pm UTC](https://discourse.julialang.org/t/errors-using-jump-with-ipopt-or-highs-undefvarerror-libipopt-not-defined-and-undefvarerror-libhighs-not-defined/78539/5 "2022-12-04T19:48:00Z")

</div>

Hi @Aakriti_Rohatgi, please start a new post, and provide the output of `versioninfo()` and `import Pkg; Pkg.status()`.

If I have to guess, you probably have a large number of packages in the global environment. Try following the example here to create a new environment:

> [@Installing Pardiso on Julia (Mac)](https://discourse.julialang.org/t/installing-pardiso-on-julia-mac/91014/9):
>
> You have somehow installed a very old version of Ipopt that is not actually using Ipopt\_jll. Do you have lots of other packages in your environment? You should use a new environment for each project. Don’t install a bunch of packages into the default environment; bad things can happen like this that lead to version conflicts. You can work with projects like this: (base) oscar@Oscars-MBP /tmp % julia \_ \_ \_ \_(\_)\_ | Documentation: https://docs.juliala…
