Build
-
Create an out-of-source-build directory:
$ mkdir build
$ cd build
-
Run cmake:
$ cmake [options] ../
You have the following options:
- BUILD_TESTING [Default: TRUE]
- Compiles the tests.
- ENABLE_MEMORY_TEST [Default: FALSE]
- Compiles the memory tests. Note that this increases the duration of the test run significantly.
- DEBUGLEVEL [Default: logINFO]
- Sets the debug level. For available debug levels go to Provided Debug levels.
- CMAKE_INSTALL_PREFIX [Default: /usr/local]
- Allows to specify the installation path.
- CMAKE_BUILD_TYPE
- Controls the type of build:
-
None (CMAKE_C_FLAGS or CMAKE_CXX_FLAGS used)
-
Debug (CMAKE_C_FLAGS_DEBUG or CMAKE_CXX_FLAGS_DEBUG)
-
Release (CMAKE_C_FLAGS_RELEASE or CMAKE_CXX_FLAGS_RELEASE)
-
RelWithDebInfo (CMAKE_C_FLAGS_RELWITHDEBINFO or CMAKE_CXX_FLAGS_RELWITHDEBINFO
-
MinSizeRel (CMAKE_C_FLAGS_MINSIZEREL or CMAKE_CXX_FLAGS_MINSIZEREL)
A frequently used example would be:
$ cmake path_to_src -DCMAKE_BUILD_TYPE=Debug
-
To compile the project run:
$ make
-
To build the documentation, run:
$ make doc
Open build/doc/html/index.html.
Testing
To run the included tests:
-
Call cmake with the BUILD_TESTING=TRUE option:
$ cmake -DBUILD_TESTING=TRUE -DCMAKE_BUILD_TYPE=Debug path_to_src
-
To execute the tests run:
$ make test
Run
-
To set the number of cores in a multi-core environment:
$ export OMP_NUM_THREADS=num_of_threads
-
To run your-application, execute in build/apps/:
$ ./your-application