Skip to content

Commit

Permalink
Merge pull request #149 from SCIP-Interfaces/rs/scip7
Browse files Browse the repository at this point in the history
Support SCIP 7.0.0
  • Loading branch information
rschwarz authored Apr 8, 2020
2 parents 3bdcf43 + d50a577 commit a4867f4
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ notifications:

install:
- ps: iex ((new-object net.webclient).DownloadString("https://raw.githubusercontent.com/JuliaCI/Appveyor.jl/version-1/bin/install.ps1"))
- ps: wget http://scip.zib.de/download/release/SCIPOptSuite-6.0.2-win64-VS15.exe -outfile scipopt-installer.exe
- ps: wget https://scip.zib.de/download/release/SCIPOptSuite-7.0.0-win64-VS15.exe -outfile scipopt-installer.exe
- scipopt-installer.exe /S /D=%SCIPOPTDIR%

build_script:
Expand Down
16 changes: 9 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ language: julia
os:
- linux
- osx
dist: xenial
dist: bionic
sudo: true
julia:
- 1.0
Expand All @@ -18,18 +18,20 @@ addons:
- libblas3
- libc6
- libgcc1
- libgfortran3
- libgfortran4
- libgmp10
- libgsl2
- libgsl23
- liblapack3
- libquadmath0
- libstdc++6
- libtbb2
- zlib1g
before_install:
- export VERSION=6.0.2
- export DEBFILE=SCIPOptSuite-$VERSION-Linux-Ub1604.deb
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then wget http://scip.zib.de/download/release/$DEBFILE; fi
- export VERSION=7.0.0
- export DEBFILE=SCIPOptSuite-$VERSION-Linux.deb
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then wget https://scip.zib.de/download/release/$DEBFILE; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo dpkg -i $DEBFILE ; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then wget http://scip.zib.de/download/release/scipoptsuite-$VERSION.tgz; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then wget https://scip.zib.de/download/release/scipoptsuite-$VERSION.tgz; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then tar -xf scipoptsuite-$VERSION.tgz && cd scipoptsuite-$VERSION; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then mkdir build && cd build && cmake -D CMAKE_BUILD_TYPE=Release -D ZIMPL=OFF -D GCG=OFF -D BUILD_TESTING=OFF -D CMAKE_INSTALL_PREFIX=../install ..; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then make -j 4 && make install; fi
Expand Down
15 changes: 10 additions & 5 deletions deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ libname = if Sys.islinux()
elseif Sys.isapple()
"libscip.dylib"
elseif Sys.iswindows()
"scip.dll"
"libscip.dll"
else
error("SCIP is currently not supported on \"$(Sys.KERNEL)\"")
end
Expand All @@ -35,19 +35,24 @@ end
push!(paths_to_try, libname)

found = false
tried = String[]
for l in paths_to_try
d = Libdl.dlopen_e(l)
if d != C_NULL
try
d = Libdl.dlopen(l)
global found = true
write_depsfile(l)
break
catch e
push!(tried, "$(l): $(e.msg)")
end
end

if !found && !haskey(ENV, "SCIP_JL_SKIP_LIB_CHECK")
error("""
Unable to locate SCIP installation.
Tried:\n\t$(join(paths_to_try, "\n\t"))
Unable to locate SCIP installation. Tried:
$(join(tried, "\n\n"))
Note that this must be downloaded separately from scip.zib.de.
Please set the environment variable SCIPOPTDIR to SCIP's installation path.
""")
Expand Down
6 changes: 3 additions & 3 deletions src/init.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ function __init__()
patch = SCIPtechVersion()
current = VersionNumber("$major.$minor.$patch")
required = VersionNumber("6.0.0")
upperbound = VersionNumber(required.major + 1)
if current < required || current >= upperbound
upperbound = VersionNumber("7.0.0")
if current < required || current > upperbound
error("SCIP is installed at version $current, " *
"supported are $required up to $upperbound.")
"supported are $required up to (including) $upperbound.")
end
end
11 changes: 9 additions & 2 deletions test/MOI_conshdlr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,15 @@ end
end

@testset "NoGoodCounter (2 binary vars)" begin
optimizer = SCIP.Optimizer(display_verblevel=0,
misc_allowdualreds=SCIP.FALSE)
optimizer = SCIP.Optimizer(display_verblevel=0)

allow_dual_reductions = if SCIP.SCIPmajorVersion() < 7
MOI.RawParameter("misc/allowdualreds")
else
MOI.RawParameter("misc/allowstrongdualreds")
end
MOI.set(optimizer, allow_dual_reductions, SCIP.FALSE)

atol, rtol = 1e-6, 1e-6

# add binary variables
Expand Down
2 changes: 1 addition & 1 deletion test/MOI_wrapper_bridged.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ end
end

@testset "MOI Integer Linear" begin
excluded = String[]
excluded = String["semiconttest", "semiinttest"]
MOIT.intlineartest(BRIDGED, CONFIG, excluded)
MOIT.indicator3_test(BRIDGED, CONFIG)
end
Expand Down

0 comments on commit a4867f4

Please sign in to comment.