C++ Version of CERN's BLonD code
NOT Stable - Under heavy development
- cmake version >= 2.8 install
####Linux
- gcc version >= 4.8.0 install
####Windows
- Visual Studio version >= 2015 with C++ compiler install
- clone the code into a directory (lets call it BLonD-minimal-cpp/):
git clone --branch=master https://github.com/kiliakis/BLonD-minimal-cpp
- To compile all dependencies and build blond library run the commands:
cd BLonD-minimal-cpp
mkdir build
cd build
cmake -DWITH_FFTW=True -DWITH_GOOGLETEST=True -DWITH_BENCHMARK=True -DBUILD_EXTERNALS=True -DCMAKE_BUILD_TYPE=Release .. # Configuration
cmake --build . # Compilation
ctest -VV # Testing
What was happening here:
- we opened folder with downloaded Blond source files
- created a folder to hold solution and project files
- On configuration step:
1. Downloaded build and installed external libraries (FFTW, GoogleTest, GoogleBenchmark) into
BLonD-minimal-cpp\external\install
2. Generated solution and project files - Compiled and linked default build configuration
- Executed unit tests
- The executables should be ready!
- Developer's Notes:
- set
-DWITH_COMPUTE=True
and-DOPENCL_SDK_PATH=$CUDA_OR_INTELL_OR_AMD_SDK
to build OpenCL benchmarks with boost - On Linux, by default, the Release version of the code is compiled. You can build a debug version by adding
-DCMAKE_BUILD_TYPE=Debug
argument to configuration command, before..
- On Windows by default, the Debug version of the code is compiled. You can build a debug version by adding
--target ALL_BUILD --config Release
argument to Compilation command after.
- On Windows one shall copy contents of
external/install/bin/fftw/$(configuration)
into corresponding to given build configuration folder to be able to test and run executables. - To commit properly formatted code, reformatted by clang-format on each build please add
-DWITH_FORMAT=True
argument to configuration command, before..
, note clang-format shall be installed - To set data refrence files path's one can set
-DDATAFILES_DIR_DEMOS
and-DDATAFILES_DIR_TESTS
. - To use CLion IDE please add
-DABSOLUTE_DATA_PATHS=True
to embed absolute test data path's instead of default relative to build forder
- set
If FFTW, GoogleTest or GoogleBenchmark are already installed in your system you can set -DWITH_*
to False
or skip this arguments when calling configuration commands
The following definitions, found in file include/blond/configuration.h, can be commented / uncommented to alter simulation's configuration:
#define TIMING
#define PRINT_RESULTS
Note that a re-compile is needed every time a change is made.
The following optional command line arguments can be specified in order to specify some basic simulation parameters:
- -m , --threads=<num> : Number of OpenMP threads that will be used in the simulation (default: 1)
- -p , --particles=<num> : Number of macro particles that will be simulated (default: 10k)
- -t , --turns=<num> : Number of simulation turns (default: 10k)
- -s , --slices=<num> : Number of slices that will be used to generate the beam's histogram (default: 100)
Example: ./testcase -t 1000 -p2000
Or type: ./testcase -h
for more
Once you have successfully compiled the code you can run the tests:
cd BLonD-minimal-cpp/build
ctest -VV
Then you can generate unit-test documentation:
To generate html documentation with search and graphical class hierarchy's please install Doxygen and Graphviz and run:
cd BLonD-minimal-cpp/build
doxygen Doxyfile
To generate html documentation on unit tests coverage please install genhtml and lcov
cd BLonD-minimal-cpp/build
lcov --capture --directory .. --output-file coverage.info
genhtml coverage.info --output-directory html
Developers FAQ and TLDR are located here
- Repository: https://gitlab.cern.ch/dquartul/BLonD
- Documentation: http://blond-documentation.web.cern.ch/
- Project website: http://blond.web.cern.ch
- Alexandre Lasheen (alexandre.lasheen (at) cern.ch)
- Juan Esteban Muller (juan.fem (at) cern.ch)
- Danilo Quartullo (danilo.quartullo (at) cern.ch)
- Helga Timko (Helga.Timko (at) cern.ch)
- Konstantinos Iliakis (konstantinos.iliakis (at) cern.ch)
Dear all contributors, you are kindly requested to format your code using astyle format options found [here] (https://root.cern.ch/coding-conventions#Astyle).