If you want to compile SCIP yourself, it is recommended to download the SCIP Optimization Suite tarball from scipopt.org as it contains also the LP solver SoPlex and the presolver PaPILO.
We provide two different systems to compile the code:
- the CMake build system (recommended for new users) (local link).
- the traditional Makefile system (local link).
Be aware that generated libraries and binaries of both systems might be different and incompatible. For further information please refer to the online documentation of SCIP.
The easiest way to install SCIP is to use the SCIP Optimization Suite, which contains SCIP, SoPlex, and ZIMPL. For that we refer to the README.md
file of the SCIP Optimization Suite (in case of the SCIP Optimization Suite there is no need to specify any directories, the compiling process is fully automated).
Building SCIP using CMake
CMake is a build system generator that can create, e.g., Makefiles for UNIX and Mac or Visual Studio project files for Windows.
CMake provides an extensive documentation explaining available features and use cases as well as an FAQ section. It's recommended to use the latest stable CMake version available. cmake --help
is also a good first step to see available options and usage information.
Windows and platform independent build instructions
To build SCIP you may use the CMake GUI to specify the path to SCIP and the desired location for the build. Available options are listed and can be modified to fit your needs. After the configuration step is done, open the generated Visual Studio solution file and compile it. Note that compilation is tested on MSVC version >= 12.
Alternatively, you may use the command line to configure and build SCIP by creating a build
directory and then building the configuration:
Command line instructions (Linux, macOS)
Compiling SCIP directly can be done as follows:
Note: For a full ctest run ctest
instead of make check
after compilation.
CMake checks for available third-party libraries like GMP or ZLIB and sets up the configuration accordingly. Note that the symmetry codes Bliss and Sassy are shipped with SCIP.
Note: Here is a list of apt package requirements for ubuntu or debian users that want to build the entire SCIP Optimization Suite from source tarball:
Additionally the following dependencies need to be downloaded, compiled and installed:
- Hmetis
- Metis
- Ipopt with Mumps
- Gmp During the CMake configuration of the SCIP Optimization Suite the can be specified, see CMake (local link) .
Troubleshooting
If you have a problem with your cmake configuration and just want to build scip with all the available dependencies, the simplest solution is to activate the AUTOBUILD
option:
This option activates the automatic search for dependent packages like GMP, IPOPT, PaPILO, Readline, WORHP, ZIMPL, ZLIB, and deactivates the missing ones.
If you need a specific package that is not automatically found, you should try setting a hint to the installation with the specified variable. Specific packages can also be disabled individually.
Examples of errors and possible solutions:
Problem:
Solution: add -DPAPILO_DIR=/path/to/papilo/installation
or disable PaPILO by setting -DPAPILO=off
.
Problem:
Solution: add -DZIMPL_DIR=/path/to/zimpl/installation
or disable ZIMPL by setting -DZIMPL=off
.
Problem:
Solution: add -DIPOPT_DIR=/path/to/ipopt/installation
or disable IPOPT by setting -DIPOPT=off
.
Problem:
Solution: add -DSOPLEX_DIR=/path/to/soplex/installation
or disable SOPLEX by setting -DLPS=none
or select a different lp solver you have available by -DLPS=grb -DGUROBI_DIR=/path/to/gurobi/installation
or -DLPS=xprs -DXPRESS_DIR=/path/to/xpress/installation
or -DLPS=msk -DMOSEK_DIR=/path/to/mosek/installation
or -DLPS=cpx -DCPLEX_DIR=/path/to/cplex/installation
or -DLPS=glob -DGLOB_DIR=/path/to/glob/installation
Modifying a CMake configuration
CMake uses an out-of-source build, i.e., compiled binaries and object files are separated from the source tree and located in another directory. Usually this directory is called build
or debug
or whatever you prefer. From within this directory, run cmake <path/to/SCIP>
to configure your build, followed by make
to compile the code according to the current configuration (this assumes that you chose Linux Makefiles as CMake Generator). By default, SCIP searches for SoPlex as LP solver. If SoPlex is not installed systemwide, the path to a CMake build directory of SoPlex must be specified (i.e. one that contains "soplex-config.cmake"). Alternatively, a different LP solver can be specified with the LPS
variable.
Afterwards, successive calls to make
are going to recompile modified source code, without requiring another call to cmake
. The initial configuration step checks your environment for available third-party libraries and packages and sets up the configuration accordingly, e.g., disabling support for GMP if not installed.
The generated executable and libraries are put in directories bin
and lib
respectively and will simply be named scip
or libscip.so
. This is different from the naming convention of the Makefile setup that appended the configuration details like OS and third party dependencies directly to the name of the binary or library. The CMake setup tries to follow the established Linux/UNIX compilation conventions to facilitate the use of the libraries in other applications. The previously generated sub-libraries like liblpi.so
or libobjscip.so
are not created by default anymore. They can be built using the respective targets liblpi
, libobjscip
, etc. The main library libscip.so
will contain all SCIP sources and won't have dependencies to the other sub-libraries.
There are several options that can be passed to the cmake <path/to/SCIP>
call to modify how the code is built. For all of these options and parameters you have to use -D<Parameter_name>=<value>
. Following a list of available options, for the full list run
and set them by running cmake .. -D<option>=<value>
. Options can be chained together or be specified in subsequent calls to cmake. The existing configuration will be updated or extended. e.g., cmake </path/to/SCIP> -DSOPLEX_DIR=<path/to/SoPlex/build/or/install>
.
CMake option | Available values | Makefile equivalent | Remarks |
---|---|---|---|
AUTOBUILD | on , off | – | automatically find dependencies on availability, ignores individual flags of these packages |
CMAKE_BUILD_TYPE | Release , Debug , ... | OPT=[opt, dbg] | |
GMP | on , off | GMP=[true, false] | specify GMP_DIR if not found automatically |
IPOPT | on , off | IPOPT=[true,false] | requires IPOPT version >= 3.12.0; specify IPOPT_DIR if not found automatically |
LAPACK | on , off | LAPACK=[true,false] | requires Lapack to be installed on the system |
LPS | spx , cpx , grb , xprs , ... | LPS=... | specify SOPLEX_DIR , CPLEX_DIR , MOSEK_DIR , ... if LP solver is not found automatically |
SYM | bliss , sbliss , none , ... | SYM=[bliss, sbliss, none] | choose symmetry handling |
WORHP | on , off | WORHP=[true,false] | should worhp be linked; specify WORHP_DIR if not found automatically |
ZIMPL | on , off | ZIMPL=[true, false] | specify ZIMPL_DIR if not found automatically |
AMPL | on , off | AMPL=[true, false] | |
READLINE | on , off | READLINE=[true, false] | |
..._DIR | <custom/path/to/.../package> | – | e.g. IPOPT_DIR , CPLEX_DIR , WORHP_DIR , Readline_DIR ... |
BOOST_ROOT | <custom/path/to/.../boost> | – | hint for location of boost |
CMAKE_INSTALL_PREFIX | \<path\> | INSTALLDIR=\<path\> | |
SHARED | on , off | SHARED=[true, false] | |
CXXONLY | on , off | – | use a C++ compiler for all source files |
COVERAGE | on , off | – | use with gcc, lcov, gcov in debug mode |
COVERAGE_CTEST_ARGS | ctest argument string | – | see ctest --help for arguments |
DEBUGSOL | on , off | DEBUGSOL=[true,false] | specify a debugging solution by setting the "misc/debugsol" parameter of SCIP |
LPSCHECK | on , off | LPSCHECK=[true,false] | double check SoPlex results with CPLEX |
NOBLKMEM | on , off | NOBLKMEM=[true,false] | |
NOBUFMEM | on , off | NOBUFMEM=[true,false] | |
NOBLKBUFMEM | on , off | NOBLKBUFMEM=[true,false] | |
MT | on , off | use static runtime libraries for Visual Studio compiler on Windows | |
THREADSAFE | on , off | THREADSAFE=[true,false] | thread safe compilation |
SANITIZE_... | on , off | – | enable sanitizer in debug mode if available |
TPI | tny , omp , none | TPI=[tny,omp,none] | enable task processing interface required for concurrent solver |
Parameters can be set all at once or in subsequent calls to cmake
- extending or modifying the existing configuration.
Testing with CTest
There is an extensive test suite written for [CTest]("https://cmake.org/cmake/help/latest/manual/ctest.1.html) that may take a while to complete. To perform a quick test to see whether the compilation was really successful you may run make check
. To see all available tests, run
and to perform a memory check, run
If Criterion is installed (set custom path with -DCRITERION_DIR=<path>
) the target unittests
can be used to compile and run the available unit tests.
A coverage report for the entire test suite can be generated. This requires a modification of the compilation process. Two variables govern the report generation, COVERAGE
and COVERAGE_CTEST_ARGS
. It is recommended to use the Debug build type.
In this example, coverage is enabled in combination with the build type Debug. In addition, only the coverage for tests with "MIP" in the name are run, excluding those that have "stein" in the name. The tests are performed in parallel using 4 cores.
Use the coverage
target, e.g., make coverage
, to build the coverage report. The generated report can be found under "coverage/index.html".
Additional targets
There are several further targets available, which can be listed using make help
. For instance, there are some examples that can be built with make examples
or by specifying a certain one: make <example-name>
. For detailed instructions see the installation instructions for applications and examples (local link).
CMake target | Description | Requirements |
---|---|---|
scip | build SCIP executable | |
applications | build executables for all applications | |
examples | build executables for all examples | |
unittests | build unit tests | the Criterion package |
all_executables | build all of the above | |
libscip | build the SCIP library | |
install | install SCIP | |
coverage | run the test suite and create a coverage report | build flag -DCOVERAGE=on |
liblpi | build the LPI library | |
libobjscip | build the ObjSCIP library for the C++ wrapper classes |
Building SCIP using the Makefile system
For Linux and Mac, reading the section "Brief installation description" below should usually be enough. If this is not the case, you can find the "Detailed installation description" below as well as some examples.
We recommend using GCC version 4.8 or later.
Brief installation description
The easiest way to install SCIP is to use the SCIP Optimization Suite which contains SCIP, SoPlex, and ZIMPL. For that we refer to the README.md
file of the SCIP Optimization Suite (main advantage: there is no need to specify any directories, the compiling process is fully automated).
Compiling SCIP directly can be done as follows:
On your first compilation you will be asked for some soft-link targets, depending on the LP solver you want to use. Usually, SCIP needs the following information a. the directory where the include files of the LP solver are located b. the library file(s) lib*.a
or/and lib*.so
Besides that, SCIP needs similar soft-link targets for ZIMPL a. the directory where the include files of ZIMPL are located b. the library file(s) lib*.a
or/and lib*.so
You will need either the .a
or the .so
files and can skip the others by just pressing return.
The most common compiling issue is that some libraries are missing on your system or that they are outdated. SCIP by default requires the following packages (with usual names for Linux systems in parentheses):
- zlib (libz-dev)
- gmp (libgmp-dev),
- readline (libreadline-dev), and
- ncurses (libncurses-dev)
Note that under Linux-based systems, you need to install the developer-versions of gmp/zlib/readline, in order to also have the header-files available.
If you are not able or do not want to install these packages, try compiling with:
Detailed installation description
Here is what you have to do to get SCIP running:
1. Compile the library and the solver program
In your SCIP main directory, enter make [options]
with the following options:
parameter and default | options | description |
---|---|---|
ARCH=x86_64 | [x86_64, x86, sparc, mips, hppa, ppc, pwr4] | the architecture: try to autodetect |
AMPL=true | [true, false] | to enable or disable AMPL .nl file reader and support for using SCIP executable as solver in AMPL |
COMP=gnu | [gnu, clang, intel] | Use Gnu, Clang or Intel compiler. |
EXPRINT=cppad | [cppad, none] | to use CppAD as expressions interpreter |
FILTERSQP=false | [false, true] | to enable or disable FilterSQP interface |
GMP=true | [true, false] | to enable or disable GMP library for exact counting and Zimpl support |
IPOPT=false | [false, true] | to disable or enable IPOPT interface (needs IPOPT >= 3.12.0) |
LAPACK=false | [false, true] | link with Lapack; requires Lapack to be installed on the system |
LPS=spx | [spx1, cpx, grb, xprs, msk, clp, glop, qso, highs, none] | determines the LP-Solver, should be installed seperately. Options to use SoPlex (> version 2.0), SoPlex (>= version 1.4), CPLEX, Gurobi, XPRESS, MOSEK, CLP, Glop, QSopt, HiGHS as LP solver, no LP solver |
LPSOPT=opt | [opt, dbg, opt-gccold] | Choose the debug or optimized version (or old GCC optimized) version of the LP-solver (currently only available for SoPlex and CLP). |
NOBLKMEM=false | [false, true] | Turns the internal SCIP block memory off or on. |
NOBUFMEM=false | [false, true] | Turns the internal SCIP buffer memory off or on. |
NOBLKBUFMEM=false | [false, true] | Turns the internal SCIP block and buffer memory off or on. This way the code can be checked by valgrind or similar tools. |
OPT=opt | [opt, dbg, perf] | to use optimized, debug, performance (only with Gnu compiler) analysis compilation mode. dbg turns on debug mode. This enables asserts and avoids macros for several function in order to ease debugging. |
OSTYPE | [linux, darwin, cygwin, irix, windows, mingw] | the operating system: try to autedetect |
PAPILO=false | [false, true] | to disable or disable the MILP presolver based on the presolving library PaPILO |
READLINE=true | [true, false] | to enable or disable readline library for interactive shell |
SHARED=false | [false, true] | to suppress or create shared libraries (only Gnu compiler) |
SYM=none | [none, bliss, sbliss, nauty, snauty] | to choose method for computing symmetries in mixed nonlinear integer programs |
TPI=none | [none, omp, tny] | to disable the task processing interface or use it with the openmp or tinycthreads interface for concurrent solves |
VERBOSE=false | [false, true] | to suppress or display of compiler and linker invocations |
WORHP=false | [false, true] | to disable or enable WORHP interface (needs WORHP >= 2.00) |
ZIMPL=false | [false, true, auto] | to enable or disable ZIMPL file reader (needs ZIMPL and GMP to be installed) |
ZLIB=true | [true, false] | to enable or disable zlib for reading of compressed files |
For example, if you want to install SCIP on a Linux system with a x86 processor using the gnu compiler in debug mode, using Soplex version as LP solver, and neither an expressions interpreter nor symmetry handling techniques or multi-threading, you would use following:
On some machines, you should use gmake
instead of make
.
On your first compilation you will be asked for some soft-link targets, depending on the external software you want to use. Usually, SCIP needs the following information:
- the directory where the include files of the external software
- the library file(s)
lib*.a
or/andlib*.so
You will need either the.a
or the.so
files and can skip the others by just pressing return.
On MAC systems, GMP is often not installed in the library and include paths, e.g. in /sw/include
and /sw/lib
. In this case, you have to add the paths explicitly. In the above example add the settings:
2. Installing SCIP
After compiling you can install the headers, the libraries, and the binary. You do that by running the command:
where you substitute
INSTALLDIR=
to install in current directory (default)INSTALLDIR=/usr/local
to install the headers (/usr/local/include/
), the libraries (/usr/local/lib/
), and binary (/usr/local/bin/
) in the directory/usr/local
For un-installing SCIP there exist the target uninstall
which can be used in the same way as install
.
3. Instructions for manually creating the soft-links, if the query script fails:
Create necessary soft-links in the lib/static
and lib/include/
subdirectories of SCIP:
a) to use SOPLEX (Version >= 1.4.0)
For each used operating system and architecture:
For example:
Warning! The .opt
in the name of the SOPLEX library does not appear in the name of the soft-link.
b) to use CPLEX (Version >= 10.0)
For each used operation system and architecture:
For example:
c) to use Gurobi
For each used operation system and architecture:
For example:
d) to use XPRESS
For each used operation system and architecture:
For example:
e) to use MOSEK
For each used operation system and architecture:
For example:
f) to use CLP
For each used operating system and architecture:
For example:
g) to use Glop
For example:
h) to use ZIMPL
Use ZIMPL as additional file reader for reading *.zpl files:
Note that ZIMPL needs the GNU multiprecision library (GMP) to be installed on your system.
i) to use IPOPT as NLP solver
The path to the IPOPT installation is the path under where the Ipopt build has been installed. It should contain the directories include/coin-or
with the Ipopt header files, the directory lib
with the Ipopt libraries, and the file lib/pkgconfig/ipopt.pc
.
j) to use WORHP as NLP solver
For example:
The path to the WORHP installation is the path under where the Worhp build has been installed. It should contain the directories include/worhp
with the WORHP header files and the directory lib
with the WORHP libraries.
k) to use FilterSQP as NLP solver
Make sure to replace the paths with your installation location.
l) to use GAMS
Make sure to replace the paths with your installation location.
m) to use HiGHS
4. Run SCIP
To run SCIP enter bin/scip.....
(e.g. bin/scip.linux.x86.gnu.opt.spx
) or just bin/scip
for the last compiled version
5. Generate documentation
To generate the documentation, you need to have doxygen installed, and enter make doc
.
6. Check Code with (pc)lint
To check the code with lint, you need to have flexelint installed, and enter make lint
. If you have pclint installed, enter make pclint
.
7. Run a short test
To run a short test, enter make [options] test
with the same options with which you compiled SCIP in step 1. If you use EXPRINT=none
, a few MINLP instances might be aborted. If you use LPS=none
, many instances will fail or take ages to be solved.
Further targets
The SCIP makefile supports several targets (used via make ... "target"
):
target | description |
---|---|
all | (or no target) Build SCIP library and binary. |
links | Reconfigures the links in the lib directory. |
doc | Creates documentation in the doc directory. |
clean | Removes all object files. |
depend | Updates dependencies files. This is only needed if you add checks for preprocessor-defines WITH_* in source files. |
check | or test . Runs the check script. |
lint | Statically checks the code via flexelint. The call produces the file lint.out which contains all the detected warnings. |
tags | Generates tags which can be used in the editor emacs and xemacs. |
The SCIP makefiles are structured as follows.
Makefile
This is the basic makefile in the SCIP root directory. It loads additional makefile information depending on the parameters set.make/make.project
This file contains definitions that are useful for all codes that use SCIP, for instance, the examples.make.\<sys\>.\<machine\>.\<compiler\>.\<dbg|opt|prf|opt-gccold\>
These file contain system/compiler specific definitions. If you have an unsupported compiler, you can copy one of these and modify it accordingly.
If your platform or compiler is not supported by SCIP you might try and copy one of the existing makefiles in the make
directory and modify it. If you succeed, we are always interested in including more Makefiles into the system.
Examples
Example 1 (defaults: SoPlex, with ZIMPL support):
Typing make
uses SoPlex as LP solver and includes support for the modeling language ZIMPL. You will be asked the following questions on the first call to make
(example answers are already given):
Example 2 (CPLEX, no ZIMPL):
Typing make LPS=cpx ZIMPL=false
uses CPLEX as LP solver. You will be asked the following questions on the first call to make
(example answers are already given):
Example 3 (CLP, IPOPT, no ZIMPL):
Typing make LPS=clp ZIMPL=false IPOPT=true
uses CLP as LP solver, and activates the interface to IPOPT. You will be asked the following questions on the first call to make
(example answers are already given):
Example 4 (default: SoPlex, IPOPT, WORHP, FILTERSQP):
Typing make IPOPT=true WORHP=true FILTERSQP=true
uses SoPlex as LP solver, and activates the interfaces to IPOPT, WORHP, and FilterSQP. You will be asked the following questions on the first call to make
(example answers are already given):
Note on how to (locally) install CLP:
- create a target directory for the installation, e.g.
clp-build
(this is the directory SCIP has to link to) - from within
clp-build
, run theconfigure
script of coin-Clp, followed bymake install
If you ever need to modify the soft-link targets, delete the soft-links in the lib/
subdirectory and enter make links
to generate them again.
After the soft-links have been created, the compilation of the source files should start.
Compilation problems
If the soft-link query script does not work on your machine, read step 2 for instructions on manually creating the soft-links.
No rule to make target lib/???
If you get an error message of the type
the corresponding soft-link was not created or points to a wrong location. Check the soft-link targets in the lib/include
, lib/static
, lib/shared
subdirectories. Try to delete all soft-links from those directories and call make links
to generate them again. If this still fails, read step 2 for instructions on manually creating the soft-links.
No rule to make target make/make
If you get an error message of the type
the corresponding machine dependent makefile for your architecture and compiler is missing. Create one of the given name in the make/
subdirectory. You may take make/make.linux.x86.gnu.opt
or any other file in the make subdirectory as example.
No support for remove_history call
The readline library seems to differ slightly on different OS distributions. Some versions do not support the remove_history()
call. In this case, you have to either add -DNO_REMOVE_HISTORY
to the FLAGS in the appropriate make/make.*
file, or to compile with make USRFLAGS=-DNO_REMOVE_HISTORY
. Make sure, the file src/scip/dialog.c
is recompiled. If this doesn't work either, disable the readline library with make READLINE=false
.
No support for sigaction method
On some systems, the sigaction()
method is not available. In this case, you have to either add -DNO_SIGACTION
to the FLAGS in the appropriate make/make.*
file, or to compile with make USRFLAGS=-DNO_SIGACTION
. Make sure, the file src/scip/interrupt.c
is recompiled.
No support for rand_r method
On some systems, the rand_r()
method is not available. In this case, you have to either add -DNO_RAND_R
to the FLAGS in the appropriate make/make.*
file, or to compile with make USRFLAGS=-DNO_RAND_R
. Make sure, the file src/scip/misc.c
is recompiled.
No support for strtok_r method
On some systems, the strtok_r()
method is not available. In this case, you have to either add -DNO_STRTOK_R
to the FLAGS in the appropriate make/make.*
file, or to compile with make USRFLAGS=-DNO_STRTOK_R
. Make sure, the file src/scip/misc.c
is recompiled.
No support for strerror_r method
On some systems, the strerror_r()
method is not available. In this case, you have to either add -DNO_STRERROR_R
to the FLAGS in the appropriate make/make.*
file, or to compile with make USRFLAGS=-DNO_STRERROR_R
. Make sure, the file src/scip/misc.c
is recompiled.
No support for read command
On some systems, the option [-e] is not available for the read command. You have to compile with READ=read
.
Problems with Clp
In some situations, it may be necessary to adjust the flags for linking against Clp. SCIP's makefile tries to find the file clp_addlibs.txt
, which specifies the needed libraries. The first thing you should check is whether clp_addlibs.txt
is present at in path libclp.*/share/coin/doc/Clp/
(you may have to correct this path for some Clp versions). If this file is not present in your Clp version, SCIP tries to guess the paths and libraries: it assumes that Blas and Lapack are installed as system libraries (libblas.a
, liblapack.a
) and are not build into the CoinUtils library. If that is different in your build of Clp, you may have to remove lapack
from the LPSLDFLAGS
in Makefile
or make.project
. Also removing bz2
may help in some cases.
Compiler or linker errors
If you encounter other compiler or linker errors, you should recompile with make VERBOSE=true ...
in order to get the full compiler invocation. This might help to fix the corresponding machine dependent makefile in the make subdirectory.
Remarks on Installing under Windows using MinGW
To build your own Windows binaries under Windows, we recommend using the MinGW-Compiler with MSYS from mingw.org.
First install MSYS, then MinGW to the mingw folder inside the msys folder. Now you need to install the following packages to the mingw folder:
- zlib (or use
ZLIB=false
) - pcre (or use
ZIMPL=false
since pcre is needed for ZIMPL and ZIMPL-support in SCIP) - gmplib (or use
ZIMPL=false
since gmplib is needed for ZIMPL and ZIMPL-support in SCIP)
(After calling make clean
in the ZIMPL folder you will also need flex and bison to remake ZIMPL. We recommend NOT to use make clean
inside the ZIMPL-folder if you do not have these packages installed.)
You can download these additional packages as precompiled binaries:
- zlib&pcre
- gmplib or compile the source on your own from the project homepages:
- zlib
- pcre
- gmplib (The command
./configure --prefix=/mingw ; make ; make install
should succeed without problems and installs the packages into the mingw folder.)
Now make READLINE=false
should be compiling without errors. Please note that we do NOT support creating the doxygen documentation or readline-usage under Windows.
Since there are no real symlinks in MSYS, the include and library files of SoPlex and ZIMPL are actually copied into the SCIP-lib-folder. When you recompile ZIMPL or SoPlex after compiling SCIP you have to copy the libraries manually into the SCIP-lib-folder and recompile SCIP afterwards.