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

Failed to install Gurobi to Julia #410

Closed
LuciaSummer opened this issue May 18, 2021 · 5 comments
Closed

Failed to install Gurobi to Julia #410

LuciaSummer opened this issue May 18, 2021 · 5 comments

Comments

@LuciaSummer
Copy link

LuciaSummer commented May 18, 2021

I’m having trouble installing Gurobi 9.1. My license is up to date and the new Gurobi has been installed in the correct location. I’ve also added the correct path prior to building the package: ENV["GUROBI_HOME"] = "E:\gurobi911\win64".
However, when I put the command in Julia:

"ENV["GUROBI_HOME"] = "E:\\gurobi911\\win64"
import Pkg
Pkg.add("Gurobi")
Pkg.build("Gurobi")

Error building Gurobi would occur. Please find the error message below:

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\Dn7m0\deps\build.jl:161
 [3] include(fname::String)
   @ Base.MainInclude .\client.jl:444
 [4] top-level scope
   @ none:5
in expression starting at C:\Users\bonnie\.julia\packages\Gurobi\Dn7m0\deps\build.jl:155

**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 =  E:\gurobi911\win64

Does this point to the correct install location?

We're going to look for the Gurobi library in this directory:
    E:\gurobi911\win64\bin

That directory has the following files:

 - E:\gurobi911\win64\bin\Gurobi91.NET.XML
 - E:\gurobi911\win64\bin\Gurobi91.NET.dll
 - E:\gurobi911\win64\bin\GurobiJni91.dll
 - E:\gurobi911\win64\bin\grb_ts.exe
 - E:\gurobi911\win64\bin\grbcluster.exe
 - E:\gurobi911\win64\bin\grbgetkey.exe
 - E:\gurobi911\win64\bin\grbprobe.exe
 - E:\gurobi911\win64\bin\grbtune.exe
 - E:\gurobi911\win64\bin\gurobi.bat
 - E:\gurobi911\win64\bin\gurobi91.dll
 - E:\gurobi911\win64\bin\gurobi91_light.dll
 - E:\gurobi911\win64\bin\gurobi_cl.exe
 - E:\gurobi911\win64\bin\vslauncher.exe
 - E:\gurobi911\win64\bin\vswhere.exe

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 C:\buildbot\worker\package_win32\build\usr\share\julia\stdlib\v1.6\Pkg\src\Types.jl:55
  [2] (::Pkg.Operations.var"#81#86"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec})()
    @ Pkg.Operations C:\buildbot\worker\package_win32\build\usr\share\julia\stdlib\v1.6\Pkg\src\Operations.jl:1040
  [3] withenv(::Pkg.Operations.var"#81#86"{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"#108#112"{String, Pkg.Operations.var"#81#86"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec}, Pkg.Types.PackageSpec})()
    @ Pkg.Operations C:\buildbot\worker\package_win32\build\usr\share\julia\stdlib\v1.6\Pkg\src\Operations.jl:1540
  [5] with_temp_env(fn::Pkg.Operations.var"#108#112"{String, Pkg.Operations.var"#81#86"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec}, Pkg.Types.PackageSpec}, temp_env::String)
    @ Pkg.Operations C:\buildbot\worker\package_win32\build\usr\share\julia\stdlib\v1.6\Pkg\src\Operations.jl:1442
  [6] (::Pkg.Operations.var"#107#111"{Pkg.Operations.var"#81#86"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec}, Pkg.Types.Context, Pkg.Types.PackageSpec, String, Pkg.Types.Project, String})(tmp::String)
    @ Pkg.Operations C:\buildbot\worker\package_win32\build\usr\share\julia\stdlib\v1.6\Pkg\src\Operations.jl:1515
  [7] mktempdir(fn::Pkg.Operations.var"#107#111"{Pkg.Operations.var"#81#86"{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 C:\buildbot\worker\package_win32\build\usr\share\julia\stdlib\v1.6\Pkg\src\Operations.jl:1481
 [10] build_versions(ctx::Pkg.Types.Context, uuids::Vector{Base.UUID}; verbose::Bool)
    @ Pkg.Operations C:\buildbot\worker\package_win32\build\usr\share\julia\stdlib\v1.6\Pkg\src\Operations.jl:1021
 [11] build(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}, verbose::Bool)
    @ Pkg.Operations C:\buildbot\worker\package_win32\build\usr\share\julia\stdlib\v1.6\Pkg\src\Operations.jl:902
 [12] build(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; verbose::Bool, kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Pkg.API C:\buildbot\worker\package_win32\build\usr\share\julia\stdlib\v1.6\Pkg\src\API.jl:893
 [13] build
    @ C:\buildbot\worker\package_win32\build\usr\share\julia\stdlib\v1.6\Pkg\src\API.jl:877 [inlined]
 [14] build(pkgs::Vector{Pkg.Types.PackageSpec}; kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Pkg.API C:\buildbot\worker\package_win32\build\usr\share\julia\stdlib\v1.6\Pkg\src\API.jl:73
 [15] build
    @ C:\buildbot\worker\package_win32\build\usr\share\julia\stdlib\v1.6\Pkg\src\API.jl:72 [inlined]
 [16] #build#69
    @ C:\buildbot\worker\package_win32\build\usr\share\julia\stdlib\v1.6\Pkg\src\API.jl:70 [inlined]
 [17] build
    @ C:\buildbot\worker\package_win32\build\usr\share\julia\stdlib\v1.6\Pkg\src\API.jl:70 [inlined]
 [18] #build#68
    @ C:\buildbot\worker\package_win32\build\usr\share\julia\stdlib\v1.6\Pkg\src\API.jl:69 [inlined]
 [19] build(pkg::String)
    @ Pkg.API C:\buildbot\worker\package_win32\build\usr\share\julia\stdlib\v1.6\Pkg\src\API.jl:69
 [20] top-level scope
    @ none:1
@odow
Copy link
Member

odow commented May 18, 2021

Interesting! It certainly looks like it found it.

What is the output of

versioninfo()

import Libdl
Libdl.dlopen("E:\\gurobi911\\win64\\bin\\gurobi91.dll")

@LuciaSummer
Copy link
Author

Here is the output:

julia> versioninfo()
Julia Version 1.6.0
Commit f9720dc2eb (2021-03-24 12:55 UTC)
Platform Info:
OS: Windows (i686-w64-mingw32)
CPU: Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
WORD_SIZE: 32
LIBM: libopenlibm
LLVM: libLLVM-11.0.1 (ORCJIT, skylake)
Environment:
JULIA_EDITOR = "C:\Users\bonnie\AppData\Local\atom\app-1.57.0\atom.exe" -a
JULIA_NUM_THREADS = 4

julia> import Libdl

julia>

julia> Libdl.dlopen("E:\gurobi911\win64\bin\gurobi91.dll")
ERROR: could not load library "E:\gurobi911\win64\bin\gurobi91.dll"
%1 is not a valid Win32 application.
Stacktrace:
[1] dlopen(s::String, flags::UInt32; throw_error::Bool)
@ Base.Libc.Libdl .\libdl.jl:114
[2] dlopen (repeats 2 times)
@ .\libdl.jl:114 [inlined]
[3] top-level scope
@ none:1

@blegat
Copy link
Member

blegat commented May 19, 2021

Is it possible that you downloaded Gurobi 64 bit while your OS is 32 bit?

@odow
Copy link
Member

odow commented May 19, 2021

WORD_SIZE: 32

You need to make sure you use 64-bit Julia because Gurobi doesn't support 32-bit.

Install the "64-bit (installer)" link from here: https://julialang.org/downloads/.

@LuciaSummer
Copy link
Author

Problem solved!
Thank you so much for the help. :)

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