-
Notifications
You must be signed in to change notification settings - Fork 81
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
A recommendation for code revision #509
Comments
What do you mean by "compiled"? We need the code as-is, because many users have Gurobi on their PATH and haven't set the When building Gurobi, we'll only write out the library path as |
I indeed have GUROBI_HOME environment variable and also the directory of 'gurobi100' in the Path, so I am able to successfully call for gurobi100.dll in my package or any other Julia script .jl. However, after I use PackageCompiler.create_library() to create a standalone APP from my package, running the APP will throw an error containing the prompt of ErrorException("could not load library "gurobi 100". I am not familiar with the mechanism of PackageCompiler.create_library(), and have to modify the code of Gurobi.jl to be paths_to_try = [] after many attempts. Such a modification succeed in directing the APP to find the gurobi100.dll. |
Once you have the app, it should still work if Gurobi is on your PATH. Did you run the binary from a difference computer where Gurobi wasn't on the PATH? @joaquimg is the person with experience doing this and may have some suggestions. |
The strange question is that the compiled APP can even not succeed on my own computer, and the slight modification of "paths_to_try = []" can solve it perfectly. |
But presumably if you set |
No, the app can be executed successfully in another computer which even has different version of Gurobi installed, provided that paths_to_try = [] was used when compiling the app |
Is it a linux machine? If so, when Lines 16 to 23 in 7145c28
If you leave If you want to run on linux only, then I'd suggest removing Gurobi from the path before compiling. |
Any updates on this? |
I am runing windows |
PackageCompiler currently does not work well with packages which require hard-code paths for external binaries. The best work-around is probably to have |
The new version of Gurobi.jl uses binaries provided by Gurobi_jll, so it should work by default on any machine that has a valid Gurobi license. You do not need to manually install or specify the path in the build step. |
I suggest to revise the build.jl like this
"
const ALIASES = [
"gurobi100",
"gurobi95",
"gurobi91",
"gurobi90"
]
paths_to_try = []
"
The reason is that the original piece of code "paths_to_try = copy(ALIASES)" will result in the library handle variable like "libgurobi = gurobi100". Such a handle variable does not include the absolute path and makes a compiled package with "Gurobi.jl" throw error of "ErrorException("could not load library "gurobi 100"".
The text was updated successfully, but these errors were encountered: