Skip to content

Build

Configure build with CMake

Remember to set -DCMAKE_PREFIX_PATH to the path of the dependencies if using pre-built dependencies, such as Simulator or or-tools (see this section).

The first time vcpkg will download and compile all dependencies. This can take a long time. Especially openmpi. Unless some dependencies are updated, nothing will be done on the next build. VCPKG store sources in a cache folder, removing your build folder will only remove the compiled dependencies. Meaning later builds will be faster than the first one even if you remove your build folder

cmake -B _build -S . -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows
cmake -B _build -S . -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-linux-release

Here is a list of available CMake configure options:

Option Default Description
CMAKE_BUILD_TYPE Release Define build type. Available values are Release and Debug.
DBUILD_antares_solver ON Enable build of antares-solver.
BUILD_not_system ON Enable build of external librairies not available on system package manager.
BUILD_ALL OFF Enable build of ALL external librairies.
BUILD_TESTING OFF Enable test build.

Additionnal vcpkg options:

Option Description
CMAKE_TOOLCHAIN_FILE Define vcpkg toolchain file.
VCPKG_TARGET_TRIPLET Define <vcpkg-triplet>.

You may need to install lsb_release Example on Ubuntu:

sudo apt install lsb-release

Build

cmake --build _build --config Release -j8
cmake --build _build --config Release -j8

Note

Compilation can be done on several processor with the -j option.