Building Spirit’s Framework Components

The Spirit framework is designed to run across different platforms and so the build process is set up with CMake, which will generate the appropriate build scripts for each platform.

Please be aware that our CMake scripts are written for our use cases and you may need to adapt some paths and options in the Root CMakeLists.txt.

General Build Process

The following assumes you are in the Spirit root directory.


There are some important Options you may need to consider. You can find them under ### Build Flags ### in the Root `CMakeLists.txt <../CMakeLists.txt>`__. Otherwise, the developers’ defaults will be used.

Some Paths you can set under ### User Paths ### (just uncomment the corresponding line) are:

CMake Variable Use
USER_COMPILER_CUSER_COMPILER_CXX Name of the compiler you wish to use
USER_PATH_COMPILER Directory your compiler is located in
USER_PATHS_IFF use the default IFF (FZJ) cluster paths


Clear the build directory using

rm -rf build && mkdir build

Further helper scripts for clean-up are,,

Generate Build Files

./ lets cmake generate makefiles for your system inside a ‘build’ folder. Simply call

cd build && cmake .. && cd ..

Passing -debug to the script will cause it to create a debug configuration, meaning that you will be able to properly debug the entire application.

On Windows (no MSys) you can simply use the git bash to do this or use the CMake GUI. When using MSys etc., CMake will create corresponding MSys makefiles.

Building the Projects

To execute the build and linking of the executable, simply call

./ -jN
cd build && make -jN && cd ..

where -jN is optional, with N the number of parallel build processes you want to create.

On Windows (no MSys), CMake will by default have generated a Visual Studio Solution. Open the generated Solution in the Visual Studio IDE and build it there.

Running the Unit Tests

We use CMakes CTest for unit testing. You can run
cd build && ctest --output-on-failure && cd ..

or execute any of the test executables manually. To execute the tests from the Visual Studio IDE, simply rebuild the RUN_TESTS project.

Installing Components

This is not yet supported! however, you can already run

cd build && make install && cd ..

Which on OSX should build a .app bundle.

Core Library

For detailed build instructions concerning the standalone core library or how to include it in your own project, see core/docs/ * Shared and static library * Python bindings * Julia bindings * Transpiling to JavaScript * Unit Tests

The Root `CMakeLists.txt <../CMakeLists.txt>`__ has a few options you can set:

CMake Options Use
SPIRIT_USE_CUDA Use CUDA to spee d up nume rica lly inte nsiv e part s of the core
SPIRIT_USE_OPENMP Use Open MP to spee d up nume rica lly inte nsiv e part s of the core
SPIRIT_SCALAR_TYPE Shou ld be e.g. ``do uble `` or ``fl oat` `. Sets the C++ type for scal ar vari able s, arra ys etc.
SPIRIT_BUILD_TEST Buil d unit test s for the core libr ary
SPIRIT_BUILD_FOR_CXX Buil d the stat ic libr ary for C++ appl icat ions
SPIRIT_BUILD_FOR_JULI A Buil d the shar ed libr ary for Juli a
SPIRIT_BUILD_FOR_PYTH ON Buil d the shar ed libr ary for Pyth on
SPIRIT_BUILD_FOR_JS Buil d the Java Scri pt libr ary (use s a diff eren t tool chai n!)

Desktop User Interface

Dependencies Versions
OpenGL Drivers >= 3.3
CMake >= 3.1
QT >= 5.7 including QT-Charts

Note that in order to build with QT as a dependency on Windows, you may need to add path/to/qt/qtbase/bin to your PATH variable.

Necessary OpenGL drivers should be available through the regular drivers for any remotely modern graphics card.

CMake Options Use
SPIRIT_BUILD_FOR_C XX Buil d the C++ inte rfac es (con sole or QT) inst ead of othe rs
UI_CXX_USE_QT Buil d qt user inte rfac e inst ead of cons ole vers ion
USER_PATH_QT The path to your CMak e inst alla tion
BUNDLE_APP On OSX, crea te .app bund le (not yet full y func tion al)