There are two ways to compile the code: CMake and plain Makefiles. Using CMake is highly recommended.
CMake is a build system generator that can create, e.g., Makefiles for UNIX and macOS or Visual Studio project files for Windows.
mkdir build cd build cmake <path/to/SoPlex> make # optional: run a quick test make test #optional: run a (slow) memory check ctest -T MemCheck # optional: install SoPlex executable, library, and headers make install
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, e.g,
build. From within this directory, run
cmake <path/to/SoPlex> to configure your build, followed by
make to compile the code according to the current configuration.
Afterwards, successive calls to
make are going to recompile modified source code, without requiring another call to
cmake. The generated executable and libraries are put in directories
There are several options that can be passed to the
cmake <path/to/SoPlex> 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
cmake <path/to/SoPlex> -LH:
|CMake option||Available values||Makefile equivalent||Remarks|
|CMAKE_BUILD_TYPE||Release, Debug, ...||OPT=[opt, dbg]|
|GMP||on, off||GMP=[true, false]|
|MT||on, off||–||use static runtime libraries for Visual Studio compiler on Windows|
|SANITIZE_...||on, off||–||enable sanitizer in debug mode if available|
|BOOST||on, off||BOOST=[true,false]||necessary for the binary, optional for building libsoplex|
|QUADMATH||on, off||QUADMATH=[true,false]||to run SoPlex with Quadruple precision|
Parameters can be set all at once or in subsequent calls to
cmake - extending or modifying the existing configuration.
CMake uses a default directory for installation, e.g.,
/usr/local on Linux. This can be modified using
The plain Makefile system only reliably works on UNIX systems:
|On systems with GNU g++|
|Linux/x86 with Intel C++|
|Tru64 with Compaq C++|
|Solaris with SUN Forte C++|
|IRIX with SGI Mips Pro C++|
|HP-UX with HP aCC|
|AIX with VisualAge C++|
make COMP=<as before> OPT=<as before> test. This should report no fails.
If ZLIB is not available, building may fail. In this case try
make COMP=<as before> OPT=<as before> ZLIB=false
which will deactivate the possibility to read gzipped LP and MPS files.
Boost is required for higher precision and rational solving methods. By default, building with boost is enabled. If you wish to only build the SoPlex library
make BOOST=false makelibfile.
make COMP=<as before> OPT=<as before> GMP=false.
If you use a different build system than the provided Makefile and want to build with GMP support, you need to define
SOPLEX_WITH_GMP for the preprocessor and link with the GMP callable library.