[Solved] Problem installing the Gurobi package on a cluster

Hello.

I’m doing a postgraduate degree and I have access to a cluster that has julia/1.7.3, gurobi/10.0.0 and gurobi/11.0.1.

Until now it was running gurobi/10.0.0 perfectly. However, in order to use the most recent version available (11.0.1), I removed the gurobi package (pkg> rm Gurobi) and I am trying to reinstall it to update to version 11. However, when running pkg> add Gurobi
I receive:

pkg> add Gurobi
    Updating registry at `~/.julia/registries/General`
    Updating git-repo `https://github.com/JuliaRegistries/General.git`
   Resolving package versions...
   Installed Gurobi_jll ─ v11.0.2+2
   Installed Gurobi ───── v1.3.0
  Downloaded artifact: Gurobi
  Downloaded artifact: Gurobi
ERROR: Unable to automatically install 'Gurobi' from '/home/alex/.julia/packages/Gurobi_jll/QGjvN/Artifacts.toml'
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:33
  [2] ensure_artifact_installed(name::String, meta::Dict{String, Any}, artifacts_toml::String; platform::Base.BinaryPlatforms.Platform, verbose::Bool, quiet_download::Bool, io::Base.TTY)
    @ Pkg.Artifacts /mnt/nfs/modules/apps/julia/1.7.3/share/julia/stdlib/v1.7/Pkg/src/Artifacts.jl:441
  [3] download_artifacts(env::Pkg.Types.EnvCache; platform::Base.BinaryPlatforms.Platform, julia_version::VersionNumber, verbose::Bool, io::Base.TTY)
    @ Pkg.Operations /mnt/nfs/modules/apps/julia/1.7.3/share/julia/stdlib/v1.7/Pkg/src/Operations.jl:617
  [4] add(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}, new_git::Set{Base.UUID}; preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform)
    @ Pkg.Operations /mnt/nfs/modules/apps/julia/1.7.3/share/julia/stdlib/v1.7/Pkg/src/Operations.jl:1182
  [5] add(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform, kwargs::Base.Pairs{Symbol, Base.TTY, Tuple{Symbol}, NamedTuple{(:io,), Tuple{Base.TTY}}})
    @ Pkg.API /mnt/nfs/modules/apps/julia/1.7.3/share/julia/stdlib/v1.7/Pkg/src/API.jl:268
  [6] add(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Pkg.API /mnt/nfs/modules/apps/julia/1.7.3/share/julia/stdlib/v1.7/Pkg/src/API.jl:149
  [7] add(pkgs::Vector{Pkg.Types.PackageSpec})
    @ Pkg.API /mnt/nfs/modules/apps/julia/1.7.3/share/julia/stdlib/v1.7/Pkg/src/API.jl:144
  [8] do_cmd!(command::Pkg.REPLMode.Command, repl::REPL.LineEditREPL)
    @ Pkg.REPLMode /mnt/nfs/modules/apps/julia/1.7.3/share/julia/stdlib/v1.7/Pkg/src/REPLMode/REPLMode.jl:407
  [9] do_cmd(repl::REPL.LineEditREPL, input::String; do_rethrow::Bool)
    @ Pkg.REPLMode /mnt/nfs/modules/apps/julia/1.7.3/share/julia/stdlib/v1.7/Pkg/src/REPLMode/REPLMode.jl:385
 [10] do_cmd
    @ /mnt/nfs/modules/apps/julia/1.7.3/share/julia/stdlib/v1.7/Pkg/src/REPLMode/REPLMode.jl:376 [inlined]
 [11] (::Pkg.REPLMode.var"#24#27"{REPL.LineEditREPL, REPL.LineEdit.Prompt})(s::REPL.LineEdit.MIState, buf::IOBuffer, ok::Bool)
    @ Pkg.REPLMode /mnt/nfs/modules/apps/julia/1.7.3/share/julia/stdlib/v1.7/Pkg/src/REPLMode/REPLMode.jl:549
 [12] #invokelatest#2
    @ ./essentials.jl:716 [inlined]
 [13] invokelatest
    @ ./essentials.jl:714 [inlined]
 [14] run_interface(terminal::REPL.Terminals.TextTerminal, m::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
    @ REPL.LineEdit /mnt/nfs/modules/apps/julia/1.7.3/share/julia/stdlib/v1.7/REPL/src/LineEdit.jl:2493
 [15] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
    @ REPL /mnt/nfs/modules/apps/julia/1.7.3/share/julia/stdlib/v1.7/REPL/src/REPL.jl:1232
 [16] (::REPL.var"#49#54"{REPL.LineEditREPL, REPL.REPLBackendRef})()
    @ REPL ./task.jl:429

The file “/home/alex/.julia/packages/Gurobi_jll/QGjvN/Artifacts.toml” contains:

cat /home/alex/.julia/packages/Gurobi_jll/QGjvN/Artifacts.toml
[[Gurobi]]
git-tree-sha1 = "1cf3993225db760f620b7a50047dda0abc07e2a1"
arch = "x86_64"
os = "linux"

    [[Gurobi.download]]
    sha256 = "ad5509a74e6eb75a34c43d5cd1017722430881113dcaf335fa0e057359bdbe50"
    url = "https://anaconda.org/Gurobi/gurobi/11.0.2/download/linux-64/gurobi-11.0.2-py311_0.tar.bz2"
[[Gurobi]]
git-tree-sha1 = "85c79ce364ac145db080d4db6e5108a0c4bd8f72"
arch = "aarch64"
os = "linux"

    [[Gurobi.download]]
    sha256 = "ba305286f2d641f7e3e8d1938e5f6e7ac339c8729861959abc5c9de6cf7a0694"
    url = "https://anaconda.org/Gurobi/gurobi/11.0.2/download/linux-aarch64/gurobi-11.0.2-py311_0.tar.bz2"
[[Gurobi]]
git-tree-sha1 = "c6002a5d5f15ef98c2821ea90c04c1ce087df37f"
arch = "x86_64"
os = "macos"

    [[Gurobi.download]]
    sha256 = "c740302ee24d035b314188ba6b24a4c47c2bc5d594f0f1d2d34ed5ec36b1ea76"
    url = "https://anaconda.org/Gurobi/gurobi/11.0.2/download/osx-64/gurobi-11.0.2-py311_0.tar.bz2"
[[Gurobi]]
git-tree-sha1 = "4f276549146c3ac663c68db6fc5496497cdbd50a"
arch = "aarch64"
os = "macos"

    [[Gurobi.download]]
    sha256 = "2fb9b0a79f9e9ab623c950d1cbbec91a0d403fa4d37741a640ab0e2dc0c1ae58"
    url = "https://anaconda.org/Gurobi/gurobi/11.0.2/download/osx-arm64/gurobi-11.0.2-py311_0.tar.bz2"
[[Gurobi]]
git-tree-sha1 = "3ac0916a338e11669ea3a0ec6074115e5dae5eb0"
arch = "x86_64"
os = "windows"

    [[Gurobi.download]]
    sha256 = "f17e1ba56d1ce26cbf6ee40835a21203c133fdb3045ffc0dd94939542542597d"
    url = "https://anaconda.org/Gurobi/gurobi/11.0.2/download/win-64/gurobi-11.0.2-py311_0.tar.bz2"

Therefore, my suspicion may be that the version available on the cluster is 11.0.1, but I’m not sure if that’s it.

So, could anyone give a suggestion on how to resolve this?

I think I found a way around it. Browsing through old posts here on the forum I found this: . Here https://discourse.julialang.org/t/gurobi-v10-and-julia/90220/2 it suggests updating to a specific version of the Gurobi package with the command using Pkg; pkg"add Gurobi@0.11.4" therefore, considering my previous suspicion of possible incompatibility of version 11.0.2 in the file while in the cluster I have version 11.0.1 available, I There was an attempt to install a previous version of Gurobi. This way, accessing Releases · jump-dev/Gurobi.jl · GitHub I verified that the version prior to latest is version v1.2.3.

Therefore, when executing add Gurobi@1.2.3 the Gurobi package was installed. And when running,

using JuMP, Gurobi
v = MOI.get(Gurobi.Optimizer(), MOI.SolverVersion())

Finally I get:

Set parameter TokenServer to value "XXX.XXX.XXX.XXX"
"11.0.1".

In other words, I can finally use the desired version 11.0.1.

*If you can provide more details as to why I was unable to install the latest Julia Gurobi package, I would be grateful.

The issue is likely that your cluster is blocking us automatically installing the Gurobi binary.

Follow the Manual installation section of GitHub - jump-dev/Gurobi.jl: A Julia interface to the Gurobi Optimizer with Gurobi@1.3.

Thanks for the feedback! I will test your suggestion as soon as possible.

1 Like