diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index a03b5bb7..00000000 --- a/.appveyor.yml +++ /dev/null @@ -1,30 +0,0 @@ -environment: - matrix: - - julia_version: 1 - SCIPOPTDIR: C:\scipoptdir - -platform: - - x64 # 64-bit - -branches: - only: - - master - -notifications: - - provider: Email - on_build_success: false - on_build_failure: false - on_build_status_changed: false - -install: - - ps: iex ((new-object net.webclient).DownloadString("https://raw.githubusercontent.com/JuliaCI/Appveyor.jl/version-1/bin/install.ps1")) - - 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: - - echo "%JL_BUILD_SCRIPT%" - - C:\julia\bin\julia -e "%JL_BUILD_SCRIPT%" - -test_script: - - echo "%JL_TEST_SCRIPT%" - - C:\julia\bin\julia -e "%JL_TEST_SCRIPT%" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..600ce0b3 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,38 @@ +name: CI +on: + push: + branches: [master] + pull_request: + types: [opened, synchronize, reopened] +jobs: + test: + name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + version: ['1.3', '1'] # Test against current minor release (at least 1.3) + os: [ubuntu-latest, macOS-latest] + arch: [x64] + steps: + - uses: actions/checkout@v2 + - uses: julia-actions/setup-julia@v1 + with: + version: ${{ matrix.version }} + arch: ${{ matrix.arch }} + - uses: actions/cache@v1 + env: + cache-name: cache-artifacts + with: + path: ~/.julia/artifacts + key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} + restore-keys: | + ${{ runner.os }}-test-${{ env.cache-name }}- + ${{ runner.os }}-test- + ${{ runner.os }}- + - uses: julia-actions/julia-buildpkg@v1 + - uses: julia-actions/julia-runtest@v1 + - uses: julia-actions/julia-processcoverage@v1 + - uses: codecov/codecov-action@v1 + with: + file: lcov.info diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5b67e843..00000000 --- a/.travis.yml +++ /dev/null @@ -1,54 +0,0 @@ -## Documentation: http://docs.travis-ci.com/user/languages/julia/ -language: julia -os: - - linux - - osx -dist: bionic -sudo: true -julia: - - 1.0 - - 1.3 -notifications: - email: false -git: - depth: 99999999 -addons: - apt: - packages: - - libblas3 - - libc6 - - libgcc1 - - libgfortran4 - - libgmp10 - - libgsl23 - - liblapack3 - - libquadmath0 - - libstdc++6 - - libtbb2 - - zlib1g -before_install: - - export VERSION=7.0.0 - - export DEBFILE=SCIPOptSuite-$VERSION-Linux.deb - - if [ "$TRAVIS_OS_NAME" = "linux" ]; then wget --no-check-certificate 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 --no-check-certificate 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 - - if [ "$TRAVIS_OS_NAME" = "osx" ]; then cd .. && export SCIPOPTDIR=$(pwd)/install && cd ..; fi -# Use default build script. -# script: -# - julia -e 'using Pkg; Pkg.clone(pwd()); Pkg.build("SCIP"); Pkg.test("SCIP"; coverage=true)' -jobs: - allow_failures: - - stage: "MINLPTests" - include: - - stage: "MINLPTests" - julia: 1.0 - os: linux - script: - - julia --project=test/MINLPTests -e 'using Pkg; Pkg.instantiate(); Pkg.add(PackageSpec(path=pwd()))' - - julia --project=test/MINLPTests --color=yes test/MINLPTests/run_minlptests.jl -after_success: - # push coverage results to Codecov, Coveralls - - julia -e 'using Pkg; cd(Pkg.dir("SCIP")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder()); Coveralls.submit(Coveralls.process_folder())' diff --git a/Project.toml b/Project.toml index fa970b5c..71382860 100644 --- a/Project.toml +++ b/Project.toml @@ -3,12 +3,16 @@ uuid = "82193955-e24f-5292-bf16-6f2c5261a85f" version = "0.9.7" [deps] +Ipopt_jll = "9cc047cb-c261-5740-88fc-0cf96f7bdcc7" Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" MathOptInterface = "b8f27783-ece8-5eb3-8dc8-9495eed66fee" +SCIP_jll = "e5ac4fe4-a920-5659-9bf8-f9f73e9e79ce" [compat] +Ipopt_jll = "^3.13.2" MathOptInterface = "^0.9.6" -julia = "^1.0.0" +SCIP_jll = "^0.1.2" +julia = "1" [extras] Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" diff --git a/README.md b/README.md index b7c18194..f5c06d2f 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,28 @@ Julia interface to [SCIP](http://scip.zib.de) solver. -[![Build Status](https://travis-ci.org/SCIP-Interfaces/SCIP.jl.svg?branch=master)](https://travis-ci.org/SCIP-Interfaces/SCIP.jl) +[![Build Status](https://github.com/scipopt/SCIP.jl/workflows/CI/badge.svg?branch=master)](https://github.com/scipopt/SCIP.jl/actions?query=workflow%3ACI) [![Coverage Status](https://coveralls.io/repos/github/SCIP-Interfaces/SCIP.jl/badge.svg?branch=master)](https://coveralls.io/github/SCIP-Interfaces/SCIP.jl?branch=master) [![codecov](https://codecov.io/gh/SCIP-Interfaces/SCIP.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/SCIP-Interfaces/SCIP.jl) See [NEWS.md](https://github.com/SCIP-Interfaces/SCIP.jl/blob/master/NEWS.md) for changes in each (recent) release. +## Update (August 2020) + +On MacOS and Linux, it is no longer required to install the [SCIP](https://scipopt.org/) binaries using this package. There now exists a +[BinaryBuilder.jl](https://github.com/JuliaPackaging/BinaryBuilder.jl) generated +package [SCIP_jll.jl](https://github.com/JuliaBinaryWrappers/SCIP_jll.jl) which +is installed automatically as a dependency. + + +On Windows, the separate installation of SCIP is still mandatory. + +Under Julia 1.3 or more recent, you can use this default installation: + + pkg> add SCIP + +If you use an older Julia version, Windows or want a custom SCIP installation, see below for the build steps. + ## Update (March 2019) We have completely rewritten the interface from scratch, using @@ -23,26 +39,19 @@ Currently, we support LP, MIP and QCP problems, as well as some nonlinear constr It is now possible to implement SCIP constraint handlers in Julia. Other plugin types are not yet supported. -## Getting Started - -To use SCIP.jl, you will need [SCIP](http://scip.zib.de) installed on your -system. [SCIP's license](https://scip.zib.de/index.php#license) does not allow -(automatic) redistribution, so please -[download](https://scip.zib.de/index.php#download) and install it yourself. +## Custom SCIP installations. -Currently, Linux, OS X and Windows are tested and supported. +If you prefer to link to your own installation of SCIP, please set the +environment variable `SCIPOPTDIR` to point to the **installation path**. That +is, either `$SCIPOPTDIR/lib/libscip.so`, `$SCIPOPTDIR/lib/libscip.dylib` or +`$SCIPOPTDIR/bin/scip.dll` should exist, depending on your operating system. -We recommend using one of the provided installers, e.g., -`SCIPOptSuite-6.0.1-Linux.deb` for systems based on Debian. Adding the SCIP.jl -package should then work out of the box: - - pkg> add SCIP +When this is set before you install this package, it should be recognized +automatically. Afterwards, you can trigger the build with -If you [build SCIP from source](https://scip.zib.de/doc-6.0.1/html/CMAKE.php) -you should set the environment variable `SCIPOPTDIR` to point the the -**installation path**. That is, either `$SCIPOPTDIR/lib/libscip.so`, -`$SCIPOPTDIR/lib/libscip.dylib` or `$SCIPOPTDIR/bin/scip.dll` should exist, -depending on your operating system. + pkg> build SCIP + +This step is also required if your Julia version is older than 1.3. ## Setting Parameters diff --git a/deps/build.jl b/deps/build.jl index 19fba61a..fa9cf305 100644 --- a/deps/build.jl +++ b/deps/build.jl @@ -1,5 +1,10 @@ using Libdl +if VERSION >= v"1.3" && !Sys.iswindows() && !haskey(ENV, "SCIPOPTDIR") + # Skip build in favor of SCIP_jll + exit() +end + depsfile = joinpath(dirname(@__FILE__), "deps.jl") if isfile(depsfile) rm(depsfile) diff --git a/src/init.jl b/src/init.jl index 743a862b..388721c4 100644 --- a/src/init.jl +++ b/src/init.jl @@ -1,9 +1,16 @@ import Libdl -const depsjl_path = joinpath(@__DIR__, "..", "deps", "deps.jl") -if !isfile(depsjl_path) - error("SCIP was not built properly, please run Pkg.build(\"SCIP\")") + +if VERSION < v"1.3" || haskey(ENV, "SCIPOPTDIR") + # User-provided SCIP library + const depsjl_path = joinpath(@__DIR__, "..", "deps", "deps.jl") + if !isfile(depsjl_path) + error("SCIP was not built properly, please run Pkg.build(\"SCIP\")") + end + include(depsjl_path) +else + # Artifact from BinaryBuilder package + using SCIP_jll: libscip end -include(depsjl_path) function __init__() major = SCIPmajorVersion()