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:
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).
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.
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:
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 Nauty and Sassy are shipped with SCIP. A version of Bliss that is compatible with SCIP is available at https://github.com/scipopt/bliss.
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:
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
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 | nauty, snauty, none, ... | SYM=[nauty, snauty, 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.
There is an extensive test suite written for CTest 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".
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 |
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.
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):
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:
Here is what you have to do to get SCIP running:
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, nauty, snauty, bliss, sbliss] | 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:
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:
After compiling you can install the headers, the libraries, and the binary. You do that by running the command:
where you substitute
For un-installing SCIP there exist the target uninstall which can be used in the same way as install.
Create necessary soft-links in the lib/static and lib/include/ subdirectories of SCIP:
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.
For each used operation system and architecture:
For example:
For each used operation system and architecture:
For example:
For each used operation system and architecture:
For example:
For each used operation system and architecture:
For example:
For each used operating system and architecture:
For example:
For example:
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.
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.
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.
Make sure to replace the paths with your installation location.
Make sure to replace the paths with your installation location.
To run SCIP enter bin/scip.$(OSTYPE).$(ARCH).$(COMP).$(OPT).$(LPS) (e.g. bin/scip.linux.x86.gnu.opt.spx) or just bin/scip for the last compiled version
To generate the documentation, you need to have doxygen installed, and enter make doc.
To check the code with lint, you need to have flexelint installed, and enter make lint. If you have pclint installed, enter make pclint.
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.
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.
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.
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):
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):
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):
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:
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.
If the soft-link query script does not work on your machine, read step 2 for instructions on manually creating the soft-links.
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.
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.
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.
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.
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.
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.
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.
On some systems, the option [-e] is not available for the read command. You have to compile with READ=read.
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 $(LINKCXX_l)lapack$(LINKLIBSUFFIX) from the LPSLDFLAGS in Makefile or make.project. Also removing $(LINKCXX_l)bz2$(LINKLIBSUFFIX) may help in some cases.
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.
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:
(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:
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.