Quick Start#

“Installing” the Library#

For using the MOCCA library, you need the following packages:

MOCCA is a header-only library, and thus, does not need to be pre-compiled. Instead, copy the mocca folder and include the mocca/mocca.h in your project to access all functionalities of the library. Alternatively, include only the headers from the MOCCA library that your project uses to improve compilation times. You can also precompile the headers to avoid having to parse all MOCCA headers everytime you compile your project. There is also a CMake configuration script for importing and configuring MOCCA as well as its dependencies.

MOCCA heavily depends on function inlining to achieve high performance, therefore, it is recommended to compile your project with at least -O2 as well as the -march=native and -fopenmp flags to enable SIMD and multithreading, respectively. By default, MOCCA will automatically detect the hardware capabilities of your system and then use the appropriate SIMD instruction set. You can explicitly specify the SIMD target by setting MOCCA_SIMD to auto, avx2, avx512 or openmp in your CMake script or defining preprocessing directive MOCCA_SIMD_TARGET before the inclusion of any MOCCA header.

Building and running tests#

MOCCA uses CMake and the Doctest framework to perform unit testing. The necessary files from the Doctest v2.4.9 package are already included in the MOCCA repository. Check the test/validation folder for all the available tests.