Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Install Gurobi 10.0.1 version for julia #512

Closed
gaganuee opened this issue May 5, 2023 · 8 comments
Closed

Unable to Install Gurobi 10.0.1 version for julia #512

gaganuee opened this issue May 5, 2023 · 8 comments

Comments

@gaganuee
Copy link

gaganuee commented May 5, 2023

Gurobi.txt

Please refer the attached file for error

@gaganuee
Copy link
Author

gaganuee commented May 5, 2023

Gurobi.txt

I also tried with 10.0.0 version .... It is still giving the following error. Please help

@mattall
Copy link

mattall commented May 5, 2023

I don't think version 10 is supported yet. It says as much when I try to add it.

    **Unable to locate Gurobi installation. Running some common diagnostics.**

    Gurobi.jl only supports the following versions:

     - gurobi91
     - gurobi90

Interestingly, it says it fails because

    We were looking for (but could not find) a file named like
    libgurobiXXX.so, libgurobiXXX.dylib, or gurobiXXX.dll.

but it also does show that there is a similarly named .so file in the directory it searches.

I wonder if there is anything fundamentally different in 10 vs 9 that keeps it from working, or if perhaps it's just a hardcoded constraint in the package installation pipeline.

That directory has the following files:

 - /opt/gurobi1001/linux64/lib/gurobi-javadoc.jar
 - /opt/gurobi1001/linux64/lib/gurobi.jar
 - /opt/gurobi1001/linux64/lib/gurobi.py
 - /opt/gurobi1001/linux64/lib/gurobi100.netstandard20.dll
 - /opt/gurobi1001/linux64/lib/gurobi100.netstandard20.xml
 - /opt/gurobi1001/linux64/lib/libGurobiJni100.so
 - /opt/gurobi1001/linux64/lib/libgurobi.so.10.0.1
 - /opt/gurobi1001/linux64/lib/libgurobi100.so
 - /opt/gurobi1001/linux64/lib/libgurobi100_light.so
 - /opt/gurobi1001/linux64/lib/libgurobi_c++.a
 - /opt/gurobi1001/linux64/lib/libgurobi_g++4.8.a
 - /opt/gurobi1001/linux64/lib/libgurobi_g++5.2.a
 - /opt/gurobi1001/linux64/lib/python3.10_utf32
 - /opt/gurobi1001/linux64/lib/python3.11_utf32
 - /opt/gurobi1001/linux64/lib/python3.7
 - /opt/gurobi1001/linux64/lib/python3.7_utf32
 - /opt/gurobi1001/linux64/lib/python3.8_utf32
 - /opt/gurobi1001/linux64/lib/python3.9_utf32
 - /opt/gurobi1001/linux64/lib/rootcert.pem
```

Full output below. 

```shell
julia> Pkg.build("Gurobi")
    Building Gurobi → `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/aac05324d46b53289ccb05510b05b4a56ffd3ed5/build.log`
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/jump-dev/Gurobi.jl and post the full
print-out of this diagnostic attempt.

Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:33
 [2] top-level scope
   @ ~/.julia/packages/Gurobi/BAtIN/deps/build.jl:165
 [3] include(fname::String)
   @ Base.MainInclude ./client.jl:444
 [4] top-level scope
   @ none:5
in expression starting at /home/matt/.julia/packages/Gurobi/BAtIN/deps/build.jl:159

**Unable to locate Gurobi installation. Running some common diagnostics.**

Gurobi.jl only supports the following versions:

 - gurobi91
 - gurobi90

Did you download and install one of these versions from gurobi.com?
Installing Gurobi.jl via the Julia package manager is _not_ sufficient!

Found GUROBI_HOME =  /opt/gurobi1001/linux64

Does this point to the correct install location?

We're going to look for the Gurobi library in this directory:
    /opt/gurobi1001/linux64/lib

That directory has the following files:

 - /opt/gurobi1001/linux64/lib/gurobi-javadoc.jar
 - /opt/gurobi1001/linux64/lib/gurobi.jar
 - /opt/gurobi1001/linux64/lib/gurobi.py
 - /opt/gurobi1001/linux64/lib/gurobi100.netstandard20.dll
 - /opt/gurobi1001/linux64/lib/gurobi100.netstandard20.xml
 - /opt/gurobi1001/linux64/lib/libGurobiJni100.so
 - /opt/gurobi1001/linux64/lib/libgurobi.so.10.0.1
 - /opt/gurobi1001/linux64/lib/libgurobi100.so
 - /opt/gurobi1001/linux64/lib/libgurobi100_light.so
 - /opt/gurobi1001/linux64/lib/libgurobi_c++.a
 - /opt/gurobi1001/linux64/lib/libgurobi_g++4.8.a
 - /opt/gurobi1001/linux64/lib/libgurobi_g++5.2.a
 - /opt/gurobi1001/linux64/lib/python3.10_utf32
 - /opt/gurobi1001/linux64/lib/python3.11_utf32
 - /opt/gurobi1001/linux64/lib/python3.7
 - /opt/gurobi1001/linux64/lib/python3.7_utf32
 - /opt/gurobi1001/linux64/lib/python3.8_utf32
 - /opt/gurobi1001/linux64/lib/python3.9_utf32
 - /opt/gurobi1001/linux64/lib/rootcert.pem

We were looking for (but could not find) a file named like
`libgurobiXXX.so`, `libgurobiXXX.dylib`, or `gurobiXXX.dll`.


You should set the `GUROBI_HOME` environment variable to point to the
install location then try again. For example (updating the path to the
correct location if needed):
```
# On Windows, this might be
ENV["GUROBI_HOME"] = "C:\\Program Files\\gurobi910\\win64\\"
import Pkg
Pkg.add("Gurobi")
Pkg.build("Gurobi")

# On OSX, this might be
ENV["GUROBI_HOME"] = "/Library/gurobi910/mac64/"
import Pkg
Pkg.add("Gurobi")
Pkg.build("Gurobi")

# On Unix, this might be
ENV["GUROBI_HOME"] = "/opt/gurobi910/linux64/"
import Pkg
Pkg.add("Gurobi")
Pkg.build("Gurobi")
```
**Note: your path may differ. Check which folder you installed the Gurobi
binary in, and update the path accordingly.**

Stacktrace:
  [1] pkgerror(msg::String)
    @ Pkg.Types /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Types.jl:55
  [2] (::Pkg.Operations.var"#82#87"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec})()
    @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Operations.jl:1044
  [3] withenv(::Pkg.Operations.var"#82#87"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec}, ::Pair{String, String}, ::Vararg{Pair{String, B} where B, N} where N)
    @ Base ./env.jl:161
  [4] (::Pkg.Operations.var"#109#113"{String, Pkg.Operations.var"#82#87"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec}, Pkg.Types.PackageSpec})()
    @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Operations.jl:1542
  [5] with_temp_env(fn::Pkg.Operations.var"#109#113"{String, Pkg.Operations.var"#82#87"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec}, Pkg.Types.PackageSpec}, temp_env::String)
    @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Operations.jl:1444
  [6] (::Pkg.Operations.var"#108#112"{Pkg.Operations.var"#82#87"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec}, Pkg.Types.Context, Pkg.Types.PackageSpec, String, Pkg.Types.Project, String})(tmp::String)
    @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Operations.jl:1517
  [7] mktempdir(fn::Pkg.Operations.var"#108#112"{Pkg.Operations.var"#82#87"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec}, Pkg.Types.Context, Pkg.Types.PackageSpec, String, Pkg.Types.Project, String}, parent::String; prefix::String)
    @ Base.Filesystem ./file.jl:729
  [8] mktempdir(fn::Function, parent::String) (repeats 2 times)
    @ Base.Filesystem ./file.jl:727
  [9] sandbox(fn::Function, ctx::Pkg.Types.Context, target::Pkg.Types.PackageSpec, target_path::String, sandbox_path::String, sandbox_project_override::Pkg.Types.Project)
    @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Operations.jl:1483
 [10] build_versions(ctx::Pkg.Types.Context, uuids::Vector{Base.UUID}; verbose::Bool)
    @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Operations.jl:1025
 [11] build(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}, verbose::Bool)
    @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Operations.jl:906
 [12] build(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; verbose::Bool, kwargs::Base.Iterators.Pairs{Symbol, Base.TTY, Tuple{Symbol}, NamedTuple{(:io,), Tuple{Base.TTY}}})
    @ Pkg.API /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:899
 [13] build(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Pkg.API /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:79
 [14] build(pkgs::Vector{Pkg.Types.PackageSpec})
    @ Pkg.API /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:77
 [15] #build#71
    @ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:75 [inlined]
 [16] build
    @ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:75 [inlined]
 [17] #build#70
    @ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:74 [inlined]
 [18] build(pkg::String)
    @ Pkg.API /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:74
 [19] top-level scope
    @ REPL[2]:1

@odow
Copy link
Member

odow commented May 6, 2023

Gurobi 10 is supported by Gurobi.jl, but you need a recent version of Gurobi.jl.

Do:

import Pkg
Pkg.pkg"add Gurobi@1"

Then restart Julia.

If you get an error, then there is likely another package that is preventing you from installing the latest version of Gurobi.jl. You'll need to delete it before you can install Gurobi.

@odow
Copy link
Member

odow commented May 6, 2023

@mattall

or if perhaps it's just a hardcoded constraint in the package installation pipeline.

It's this:

Gurobi.jl/deps/build.jl

Lines 25 to 30 in 7145c28

const ALIASES = [
"gurobi100",
"gurobi95",
"gurobi91",
"gurobi90"
]

We need to maintain a hard-coded list of supported versions because we generate the C API for each particular version: #488

@gaganuee
Copy link
Author

gaganuee commented May 8, 2023

Gurobi 10 is supported by Gurobi.jl, but you need a recent version of Gurobi.jl.

Do:

import Pkg
Pkg.pkg"add Gurobi@1"

Then restart Julia.

If you get an error, then there is likely another package that is preventing you from installing the latest version of Gurobi.jl. You'll need to delete it before you can install Gurobi.

using Gurobi@1 I am getting this error
(@v1.8) pkg> add Gurobi@1
Resolving package versions...
ERROR: Unsatisfiable requirements detected for package MathOptInterface [b8f27783]:
MathOptInterface [b8f27783] log:
├─possible versions are: 0.5.0-1.15.1 or uninstalled
├─restricted by compatibility requirements with HiGHS [87dc4568] to versions: [0.9.17-0.9.22, 0.10.4-1.15.1]
│ └─HiGHS [87dc4568] log:
│ ├─possible versions are: 0.1.0-1.5.1 or uninstalled
│ └─restricted to versions * by an explicit requirement, leaving only versions 0.1.0-1.5.1
├─restricted by compatibility requirements with Hypatia [b99e6be6] to versions: [0.9.14-0.9.22, 0.10.6-1.15.1], leaving only versions: [0.9.17-0.9.22, 0.10.6-1.15.1]
│ └─Hypatia [b99e6be6] log:
│ ├─possible versions are: 0.1.0-0.7.2 or uninstalled
│ └─restricted to versions * by an explicit requirement, leaving only versions 0.1.0-0.7.2
├─restricted by compatibility requirements with MadNLP [2621e9c9] to versions: [0.9.0-0.9.22, 0.10.5-0.10.8, 1.0.0-1.15.1], leaving only versions: [0.9.17-0.9.22, 0.10.6-0.10.8, 1.0.0-1.15.1]
│ └─MadNLP [2621e9c9] log:
│ ├─possible versions are: 0.1.0-0.6.0 or uninstalled
│ └─restricted to versions * by an explicit requirement, leaving only versions 0.1.0-0.6.0
├─restricted by compatibility requirements with CDCS [4fe2ecd4] to versions: [0.8.2-0.9.22, 1.0.0-1.15.1], leaving only versions: [0.9.17-0.9.22, 1.0.0-1.15.1]
│ └─CDCS [4fe2ecd4] log:
│ ├─possible versions are: 0.0.1-0.2.0 or uninstalled
│ └─restricted to versions * by an explicit requirement, leaving only versions 0.0.1-0.2.0
├─restricted by compatibility requirements with Gurobi [2e9cd046] to versions: 1.12.0-1.15.1
│ └─Gurobi [2e9cd046] log:
│ ├─possible versions are: 0.5.0-1.0.1 or uninstalled
│ └─restricted to versions 1 by an explicit requirement, leaving only versions 1.0.0-1.0.1
└─restricted by compatibility requirements with StochasticPrograms [8b8459f2] to versions: [0.9.1-0.9.22, 1.3.0] — no versions left
└─StochasticPrograms [8b8459f2] log:
├─possible versions are: 0.1.0-0.6.4 or uninstalled
├─restricted to versions * by an explicit requirement, leaving only versions 0.1.0-0.6.4
└─restricted by compatibility requirements with JuMP [4076af6c] to versions: 0.4.0-0.6.4 or uninstalled, leaving only versions: 0.4.0-0.6.4
└─JuMP [4076af6c] log:
├─possible versions are: 0.18.3-1.11.0 or uninstalled
├─restricted to versions * by an explicit requirement, leaving only versions 0.18.3-1.11.0
├─restricted by compatibility requirements with FlexPlan [4dc3fedf] to versions: [0.19.1-0.19.2, 0.21.0-1.11.0]
│ └─FlexPlan [4dc3fedf] log:
│ ├─possible versions are: 0.1.0-0.3.0 or uninstalled
│ └─restricted to versions * by an explicit requirement, leaving only versions 0.1.0-0.3.0
├─restricted by compatibility requirements with InfiniteOpt [20393b10] to versions: 0.21.0-1.11.0
│ └─InfiniteOpt [20393b10] log:
│ ├─possible versions are: 0.1.0-0.5.7 or uninstalled
│ └─restricted to versions * by an explicit requirement, leaving only versions 0.1.0-0.5.7
├─restricted by compatibility requirements with PowerSimulations [e690365d] to versions: [0.19.1-0.21.10, 0.23.0-1.11.0], leaving only versions: [0.21.0-0.21.10, 0.23.0-1.11.0]
│ └─PowerSimulations [e690365d] log:
│ ├─possible versions are: 0.1.0-0.20.1 or uninstalled
│ └─restricted to versions * by an explicit requirement, leaving only versions 0.1.0-0.20.1
└─restricted by compatibility requirements with StochasticPrograms [8b8459f2] to versions: [0.21.0-0.21.10, 1.2.1]
└─StochasticPrograms [8b8459f2] log: see above

@odow
Copy link
Member

odow commented May 8, 2023

StochasticPrograms requires MOI v1.3.0: https://github.com/martinbiel/StochasticPrograms.jl/blob/ba8f82c6bd382339160d2e8d21150aaa53d1c17d/Project.toml#L30
but recent versions of Gurobi.jl require at least MOI v1.12

MathOptInterface = "1.12"

Therefore, you cannot use Gurobi v10 with StochasticPrograms.jl.

This has already been reported: martinbiel/StochasticPrograms.jl#46, but I don't know if you should expect a fix in the near term.

I suggest you uninstall StochasticPrograms.jl, or use a different solver.

@gaganuee
Copy link
Author

gaganuee commented May 8, 2023

StochasticPrograms requires MOI v1.3.0: https://github.com/martinbiel/StochasticPrograms.jl/blob/ba8f82c6bd382339160d2e8d21150aaa53d1c17d/Project.toml#L30 but recent versions of Gurobi.jl require at least MOI v1.12

MathOptInterface = "1.12"

Therefore, you cannot use Gurobi v10 with StochasticPrograms.jl.

This has already been reported: martinbiel/StochasticPrograms.jl#46, but I don't know if you should expect a fix in the near term.

I suggest you uninstall StochasticPrograms.jl, or use a different solver.

Thanks a Lot. It is working fine now after removing StochasticPrograms.jl

@odow
Copy link
Member

odow commented May 8, 2023

Glad to hear.

Closing because this is not a bug in Gurobi.jl.

@odow odow closed this as completed May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants