Configuration options
CMake options
Some of these options are enabled by default ("Defaults to ON") otherwise they must be explicitly set to ON.
You can pass any CMake variable or option with -DVARIABLE_NAME=VALUE (note the
-D in front) to the CMake command.
You can also overwrite the generator with the -G parameter or the
build-directory with the -B parameter.
General
CMake switches to enable / disable parts of OGS.
OGS_BUILD_CLI- Builds the simulator. Defaults to ON. If set to OFF all processes are also disabled (see variableOGS_BUILD_PROCESSESbelow).OGS_BUILD_GUI- Builds the Data Explorer. Defaults to OFF.OGS_BUILD_TESTING- Builds the test executables. Defaults to ON.OGS_BUILD_UTILS- Builds several utilities.OGS_BUILD_PROCESS_X- For enabling/disabling compilation of processX. Run the CMake-GUI /ccmaketo see a list of processes.OGS_BUILD_PROCESSES- A;-separated list specifying processes to build, e.g.-DOGS_BUILD_PROCESSES="HT;LIE". Can be set to ON which means all processes are built or can be set to OFF to disable all processes. Attention: Setting this variable overrides individualOGS_BUILD_PROCESS_X-variables! This option is mainly used for CI and automation. Also the value of this variable is not cached.
Python virtual environment
OGS_USE_PIP- Creates a python virtual environment in the .venv-directory inside the build directory, that includes useful packages like OGSTools, Jupyter and more. Defaults to OFF. See also https://www.opengeosys.org/docs/devguide/packages/python-env/ .
Debugging
CMAKE_BUILD_TYPE- Defaults toDebugwhich builds with debugging information, set toReleasefor an optimized build.OGS_PROFILE- Builds with profiling flags (-pg).
Optimization
CMAKE_BUILD_TYPE- Set toReleaseto build with optimization flags, set toDebugfor debugging.
Testing
OGS_COVERAGE- Enables code coverage measurements withgcov/lcov. TODO
Advanced options
-
OGS_CPU_ARCHITECTURE- Optimizes for the given CPU architecture see -march -flag. Defaults tonative. For redistributable binaries set togenericon Linux andcore2on Mac OS. Can be disabled when set toOFF. -
CMAKE_LIBRARY_SEARCH_PATH- Additional library installation path, e.g./opt/localorC:/libs -
OGS_DEPENDENCY_VERSIONS- Overwrite individual entries inweb/data/versions.json. Should be quoted and;-separated, e.g.:-DOGS_DEPENDENCY_VERSIONS="minimum_version.petsc=3.16.2;ctest.large_runtime=120". -
OGS_USE_MKL- Enables MKL support. Requires MKL (as part of the Intel oneAPI toolkit) to be installed on the system.Before configuring with CMake you also need to source the
setvars.sh-script. On a typical installation run this:source /opt/intel/oneapi/setvars.sh(Windows:& "C:\Program Files (x86)\Intel\oneAPI\setvars.bat"). This will set theMKLROOTenvironment variable and also theDYLD_LIBRARY_PATHto contain the MKL library locations (both variables will be checked by CMake).To enable 64-bit array indices in MKL add
-DMKL_INTERFACE=ilp64on the first CMake run (with a clean CMake cache) but this seems not supported by Eigen . -
OGS_EIGEN_PARALLEL_BACKEND- Defaults toOpenMP. Defaults toMKLwhenOGS_USE_MKL=ON. May be set toOpenMPwhen MKL is on which also enables OpenMP multithreading. This pulls in another OpenMP implementation besides the Intel MKL OpenMP which is an experimental feature!. If you want to use OpenMP parallelized assembly with MKL enabled you also need to explicitly setOGS_EIGEN_PARALLEL_BACKEND=OpenMP! -
OGS_PETSC_CONFIG_OPTIONS– Can be used to build a specific PETSc configuration, arguments are passed to PETSc’s./configure-command. E.g. to build with MUMPS:cmake --preset release-petsc -DOGS_PETSC_CONFIG_OPTIONS="--download-superlu --download-superlu_dist --download-scalapack --download-mumps --with-cc=mpicc --with-cxx=mpic++ --with-fc=mpif90"
This article was written by Lars Bilke. If you are missing something or you find an error please reach out
to us on our forum.
Generated with Hugo 0.164.0
in CI job 825193
|
Last revision: April 20, 2026
Commit: refactor(MeshLib): remove PropertyVector::push_back 870422dde
| Edit this page on