Building Spirit on Unix/OSX¶
Binary packages are currently not provided! Therefore, you need to build the Spirit core library or the desktop user interface yourself.
The Spirit framework is designed to run across different
platforms and uses
CMake for its build process, which will
generate the appropriate build scripts for each platform.
System-wide installation is not actively supported.
While you can call
make install after building,
you may not achieve the desired results.
- cmake >= 3.2
- compiler with C++11 support, e.g. gcc >= 5.1
CMake is used to automatically generate makefiles.
# enter the top-level Spirit directory $ cd spirit # make a build directory and enter that $ mkdir build $ cd build # Generate makefiles $ cmake .. # Build $ make
Note that you can use the
-j option of make to run the
build in parallel.
To manually specify the build type (default is ‘Release’),
cmake --build . --config Release instead of
By default, the desktop GUI will try to build. The corresponding
CMake option is
- Qt >= 5.7 (including qt-charts)
- OpenGL drivers >= 3.3
Necessary OpenGL drivers should be available through the regular drivers for any remotely modern graphics card.
The Python package is built by default. The corresponding
CMake option is
The package is then located at
core/python. You can then
- make it locatable, e.g. by adding
pip install -e . --userto install it
Alternatively, the most recent release version can be
installed from the official package,
pip install spirit --user.
The OpenMP backend can be used to speed up calculations by using a multicore CPU.
At least version 4.5 of OpenMP needs to be supported by your compiler.
You need to set the corresponding CMake variable, e.g. by calling
cd build cmake -DSPIRIT_USE_OPENMP=ON .. cd ..
The CUDA backend can be used to speed up calculations by using a GPU.
Spirit uses unified memory. At least version 8 of the CUDA toolkit is required and the GPU needs compute capability 3.0 or higher!
If the GUI is used, compute capability 6.0 or higher is required! (see the CUDA programming guide: coherency)
Note: the precision of the core will be automatically set
float in order to avoid the performance cost of
precision operations on GPUs.
You need to set the corresponding
variable, e.g. by calling
cd build cmake -DSPIRIT_USE_CUDA=ON .. cd ..
You may additionally need to
- pass the
CUDA_TOOLKIT_ROOT_DIRto cmake or edit it in the root CMakeLists.txt
- select the appropriate arch for your GPU using the
Web assembly library¶
The CMake option you need to set to
ON is called
You need to have emscripten available, meaning you might
need to source, e.g.
Then to build, call
cd build cmake .. -DCMAKE_TOOLCHAIN_FILE=/usr/local/emsdk/emscripten/1.38.29/cmake/Modules/Platform/Emscripten.cmake make cd ..
Further build configuration options¶
More options than described above are available, allowing for example to deactivate building the Python library or the unit tests.
To list all available build options, call
cd build cmake -LH ..
The build options of Spirit all start with