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.
Platform independent build instructions:
Linux/macOS Makefile-based build instructions:
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/UG>
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, UG searches for SCIP as base solver. If SCIP is not installed systemwide, the path to a CMake build directory of SCIP must be specified (ie one that contains "scip-config.cmake").
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 bin
and lib
respectively and will simply be named fscip
.
There are several options that can be passed to the cmake <path/to/UG>
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 option | Available values | Makefile equivalent | Remarks |
---|---|---|---|
CMAKE_BUILD_TYPE | Release, Debug, ... | OPT=[opt, dbg] | |
SCIP_DIR | /path/to/scip/install |
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 by either changing the configuration using -DCMAKE_INSTALL_PREFIX
as explained in Modifying a CMake configuration or by setting the environment variable DESTDIR
during or before the install command, e.g., DESTDIR=<custom/install/dir> make install
.
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>
.
CMake target | Description | Requirements |
---|---|---|
fiberscip | build fiberscip UG executable | |
parascip | build parascip UG executable | |
githash | build executables for all applications |