-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- inspired by Gurobi.jl - seems to work when `/usr/lib/libscip.so` exists.
- Loading branch information
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
julia 1.0 | ||
Compat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,38 @@ | ||
using Compat | ||
using Libdl | ||
|
||
depsfile = joinpath(dirname(@__FILE__), "deps.jl") | ||
if isfile(depsfile) | ||
rm(depsfile) | ||
end | ||
|
||
function write_depsfile(path) | ||
f = open(depsfile, "w") | ||
println(f, "const libscip = \"$path\"") | ||
close(f) | ||
end | ||
|
||
libname = "libscip.so" | ||
paths_to_try = [libname] | ||
|
||
if haskey(ENV, "SCIPOPTDIR") | ||
if Compat.Sys.isunix() | ||
push!(paths_to_try, joinpath(ENV["SCIPOPTDIR"], "lib", libname)) | ||
end | ||
end | ||
|
||
found = false | ||
for l in paths_to_try | ||
d = Libdl.dlopen_e(l) | ||
if d != C_NULL | ||
global found = true | ||
write_depsfile(l) | ||
break | ||
end | ||
end | ||
|
||
if !found && !haskey(ENV, "SCIP_JL_SKIP_LIB_CHECK") | ||
error("Unable to locate SCIP installation. " * | ||
"Note that this must be downloaded separately from scip.zib.de. " * | ||
"Please set the environment variable SCIPOPTDIR to SCIP's installation path.") | ||
end |