Building from source
This page gives instructions on how to build and install Parfis from the source code on various systems.
Obtain the code
We describe the whole process, from cloning the repo to running tests.
- Clone the repo:
To clone the repo, run the following command from the folder where you want the
parfis
folder to be created:git clone https://github.com/GinkoBalboa/parfis.git
CMake options
You can add build options through command-line arguments with the call to cmake. Build options:
BUILD_LIB
(defaultON
). Should library be build at all (usefull when you want to generate documentation.PARFIS_STATE_TYPE_DOUBLE
(defaultON
). The parameter defines the type for the state vector used in parfis. The state vector defines the position and velocity of particles. The default type is float. If state type is double, the memory needed for particle states is twice the size of the float state.BUILD_DEBUG
(defaultOFF
). Build all binaries in debug mode. Debug version get thed
suffix.BUILD_PARFISAPP
(defaultOFF
). Builds executable fileparfisApp
that functions as a terminal interface towards the Parfis program. The executable is build in the location/build/bin/parfisApp
.BUILD_DOXYGEN
(defaultOFF
). Builds doxygen documentation in the folderbuild/doc/doxygen
.BUILD_SPHINX
(defaultOFF
). Builds sphinx documentation in the folderbuild/doc/sphinx
.BUILD_GOOGLE_TEST
(defaultOFF
). Clones the googletest repo and builds the project needed for testing. The build location is/build/lib/googletest
.BUILD_GTESTALL
(defaultOFF
). Builds executablegtestAll
that runs all google tests. The location of the executable is/build/bin/gtestAll
.COPY_LIB_PYTHON
(defaultOFF
). Should parfis lib files be copied to the python-pacage for generating pypi package.NBSPHINX_EXECUTE
(defaultON
). Should nbsphinx be executed when generating doc.PARFIS_LOG_LEVEL
(default 0). Bitmask for the Logger, corresponds to bitmasks defined inparfis::LogMask
.
- For example:
If we want to build debug version with full logging for the first four levels we can use the following cmake settings:
Build
After obtaining the code, go into the parfis dir, create build dir and run cmake configuration and cmake build.
For Linux/Windows we use CMake, and we run it from the build directory. The full set of commands, with default settings for cmake, is given in the following block of code:
cd parfis
mkdir build
cd build
cmake ..
cmake --build . --config Release
Other configurations and build scripts are given in the parfis/script
folder.