I’m trying to upgrade Julia to 1.4 from 1.3, but Gurobi package is giving me the following error.
Could anybody confirm whether it’s related to my own setting or not? Any comments would be appreciated.
I only have three packages installed:
(@v1.4) pkg> status
Status `~/.julia/environments/v1.4/Project.toml`
[c52e3926] Atom v0.12.15
[4076af6c] JuMP v0.21.3
[e5e0dc1b] Juno v0.8.2
When I try to add Gurobi, it gives me the following error:
(@v1.4) pkg> add Gurobi
Updating registry at `~/.julia/registries/General`
Updating git-repo `https://github.com/JuliaRegistries/General.git`
Resolving package versions...
Installed MathProgBase ─ v0.7.8
Installed Gurobi ─────── v0.8.1
Updating `~/.julia/environments/v1.4/Project.toml`
[2e9cd046] + Gurobi v0.8.1
Updating `~/.julia/environments/v1.4/Manifest.toml`
[2e9cd046] + Gurobi v0.8.1
[fdba3010] + MathProgBase v0.7.8
Building Gurobi → `~/.julia/packages/Gurobi/7YNJV/deps/build.log`
┌ Error: Error building `Gurobi`:
│ Gurobi Optimizer version 9.0.2 build v9.0.2rc0 (mac64)
│ Copyright (c) 2020, Gurobi Optimization, LLC
│ ERROR: LoadError: Unable to locate Gurobi installation. If the advice above did not help,
│ open an issue at https://github.com/JuliaOpt/Gurobi.jl and post the full
│ print-out of this diagnostic attempt.
│
│ Stacktrace:
│ [1] error(::String) at ./error.jl:33
│ [2] top-level scope at /Users/singingkim/.julia/packages/Gurobi/7YNJV/deps/build.jl:154
│ [3] include(::String) at ./client.jl:439
│ [4] top-level scope at none:5
│ in expression starting at /Users/singingkim/.julia/packages/Gurobi/7YNJV/deps/build.jl:152
│ Unable to locate Gurobi installation. Running some common diagnostics.
│
│ Gurobi.jl only supports the following versions:
│
│ - gurobi90
│ - gurobi81
│ - gurobi80
│ - gurobi75
│ - gurobi70
│
│ Did you download and install one of these versions from gurobi.com?
│
│
│ Looking for a version of Gurobi in your path:
│
│
│ We couldn't find the `GUROBI_HOME` environment variable, but we
│ found this version of Gurobi on your path. Is this version one of
│ the supported versions listed above? If not, you should edit your
│ `PATH` to point to the correct version.
└ @ Pkg.Operations /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/Pkg/src/Operations.jl:899
That is super weird. It looks like it found Gurobi but then it didn’t?
Where is your Gurobi installed? Try setting the GUROBI_HOME environment variable to /Library/gurobi902/mac64 (or equivalent, depending on where you installed it).
┌ Error: Error building `Gurobi`:
│ ERROR: LoadError: Unable to locate Gurobi installation. If the advice above did not help,
│ open an issue at https://github.com/JuliaOpt/Gurobi.jl and post the full
│ print-out of this diagnostic attempt.
│
│ Stacktrace:
│ [1] error(::String) at /Applications/Julia-1.4.app/Contents/Resources/julia/lib/julia/sys.dylib:?
│ [2] top-level scope at /Users/tamasgal/.julia/packages/Gurobi/7YNJV/deps/build.jl:154
│ [3] include(::String) at /Applications/Julia-1.4.app/Contents/Resources/julia/lib/julia/sys.dylib:?
│ [4] top-level scope at none:5
│ in expression starting at /Users/tamasgal/.julia/packages/Gurobi/7YNJV/deps/build.jl:152
│ Unable to locate Gurobi installation. Running some common diagnostics.
│ Gurobi.jl only supports the following versions:
│
│ - gurobi90
│ - gurobi81
│ - gurobi80
│ - gurobi75
│ - gurobi70
│
│ Did you download and install one of these versions from gurobi.com?
It’s very odd as it works just fine on Julia 1.3.
Can you let me know how to set an environment variable?
Gurobi installation location: /Library/gurobi902/
julia> using Libdl
julia> Libdl.dlopen("libgurobi90.dylib")
ERROR: could not load library "libgurobi90.dylib"
dlopen(libgurobi90.dylib, 1): image not found
Stacktrace:
[1] dlopen(::String, ::UInt32; throw_error::Bool) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/Libdl/src/Libdl.jl:109
[2] dlopen at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/Libdl/src/Libdl.jl:109 [inlined] (repeats 2 times)
[3] top-level scope at REPL[10]:1
using JuMP, Ipopt
m = Model(Ipopt.Optimizer)
set_optimizer_attribute(m, "linear_solver", "ma86")
@variable(m, x <= 5)
JuMP.optimize!(m)
Exception of type: OPTION_INVALID in file "IpAlgBuilder.cpp" at line 349:
Exception message: Selected linear solver HSL_MA86 not available.
Tried to obtain HSL_MA86 from shared library "libhsl.dylib", but the following error occured:
dlopen(libhsl.dylib, 2): image not found
However, it also works fine with Julia 1.3.
(Your renaming solution (libcoinhsl.dylib->libhsl.dylib) fixed my previous issue with Julia 1.3.).
Do you have any idea how to fix this for Julia 1.4?