Open EetuReijonen opened 8 months ago
I have no idea, why this happens. I don't think, that there are name conflicts (GR
vs GRB
).
Could please find the missing library (find ~/.julia/artifacts -name libgurobi100.dylib
) and try the following command:
otool -L <path from above find command>libgurobi100.dylib
You could also try to run the otool
command within your Julia session.
For some reason I cannot find the Gurobi library in my artifacts folder (or any .dylib
file with gurobi
in the name).
eetureijonen@Eetus-MacBook-Air artifacts % find ~/.julia/artifacts -type f \( -name "*gurobi*" -a -name "*.dylib" \)
I found it in my /Library
folder and this is the output from the otool
-command.
eetureijonen@Eetus-MacBook-Air lib % otool -L /Library/gurobi1001/macos_universal2/lib/libgurobi100.dylib
/Library/gurobi1001/macos_universal2/lib/libgurobi100.dylib (architecture x86_64):
/Library/gurobi1001/macos_universal2/lib/libgurobi100.dylib (compatibility version 10.0.0, current version 10.0.1)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.60.1)
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1770.255.0)
/System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate (compatibility version 1.0.0, current version 4.0.0)
/System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration (compatibility version 1.0.0, current version 1109.60.2)
/System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 59754.60.13)
/Library/gurobi1001/macos_universal2/lib/libgurobi100.dylib (architecture arm64):
/Library/gurobi1001/macos_universal2/lib/libgurobi100.dylib (compatibility version 10.0.0, current version 10.0.1)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.60.1)
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1770.255.0)
/System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate (compatibility version 1.0.0, current version 4.0.0)
/System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration (compatibility version 1.0.0, current version 1109.60.2)
/System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 59754.60.13)
/Library/gurobi1001/macos_universal2/lib
is not in the dlopen
search path, so you could try to explicitly set it before starting Julia:
export DYLD_LIBRARY_PATH="/Library/gurobi1001/macos_universal2/lib:${DYLD_LIBRARY_PATH}"
julia ...
Thank you, this seems to solve the acute problem for me.
eetureijonen@Eetus-MacBook-Air examples % export DYLD_LIBRARY_PATH="/Library/gurobi1001/macos_universal2/lib:${DYLD_LIBRARY_PATH}"
eetureijonen@Eetus-MacBook-Air examples % julia --project
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.9.1 (2023-06-07)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia> using Plots
julia> gr()
Plots.GRBackend()
julia> plot()
julia> using Distributed
julia> addprocs(4)
4-element Vector{Int64}:
2
3
4
5
julia> @everywhere begin
using Gurobi
Gurobi.Env()
end
Set parameter Username
Academic license - for non-commercial use only - expires 2024-05-21
From worker 2: Set parameter Username
From worker 3: Set parameter Username
From worker 3: Academic license - for non-commercial use only - expires 2024-05-21
From worker 2: Academic license - for non-commercial use only - expires 2024-05-21
From worker 5: Set parameter Username
From worker 4: Set parameter Username
From worker 5: Academic license - for non-commercial use only - expires 2024-05-21
From worker 4: Academic license - for non-commercial use only - expires 2024-05-21
However, I think there is still something going on as other backends do not cause the same issue.
Hi, I have run into a weird issue when trying to use Plots.jl with GRBackend and Gurobi.jl (the optimization solver) with multiple workers.
The minimal working example is here:
This code will produce an error, which, according to my understanding, indicates that the Gurobi library/program cannot be found.
However, by using a different backend (e.g. PyPlot), the code works just fine:
Output:
I'm using Julia version 1.9.1, Plot.jl v1.39.0, Gurobi.jl v1.2.1 on a Macbook M2 Air with macOS 14.2
Could this issue be caused by some kind of alteration to the system environment before it's passed to the workers? Or possibly a namespace conflict (Gurobi is also abbreviated GR in some contexts)?