C++ Version of CERN's BLonD code
NOT Stable - Under heavy development
- cmake version >= 2.8 install
- gcc version >= 4.8.0 install
- System packages:
- Debian based distributions:
- python-dev
- libfreetype6
- libpng-dev
- python-tk
- Redhat based distributions:
- python-devel
- freetype-devel
- libpng-devel
- tcl
- tkinter
- Debian based distributions:
- Windows version >= 7
- cygwin x86_64 [install] (https://cygwin.com/install.html)
- clone the code into a directory (lets call it BLonD++/):
git clone --branch=master https://github.com/kiliakis/BLonD-cpp BLonD++
- To compile all dependencies and build blond library run the commands:
cd BLonD++
source install-linux.sh
mkdir build
cd build
cmake .. # Configuration
cmake --build . # Compilation
ctest -VV # Testing
What was happening here:
- We opened folder with downloaded BLonD source files
- We installed external dependencies and exported some needed environmental variables
- Created a folder to hold solution and project files
- On configuration step we generated all executables (demos + unit-tests):
- Compiled and linked default build configuration
- Executed unit tests
- The executables should be ready!
- Developer's Notes:
- 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..
- 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
.
- On Linux, by default, the Release version of the code is compiled. You can build a debug version by adding
- Download setup-x86_64.exe from cygwin installation page.
- Run setup-x86_64.exe, follow the on-screen instructions.
- In the "Select Packages" screen, the packages needed for a basic cygwin installation are already checked. Except from these, add:
- git (devel category, bin only)
- wget (web category, bin only)
- launch a cygwin terminal
- clone the code into a directory (lets call it BLonD++/):
git clone --branch=master https://github.com/kiliakis/BLonD-minimal-cpp BLonD++
- To compile all dependencies and build blond library run the commands:
cd BLonD++
source install-cygwin.sh
mkdir build
cd build
cmake .. # Configuration
cmake --build . # Compilation
ctest -VV # Testing
TODO
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++/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++/build
doxygen Doxyfile
To generate html documentation on unit tests coverage please install genhtml and lcov
cd BLonD++/build
lcov --capture --directory .. --output-file coverage.info
genhtml coverage.info --output-directory html
- 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)
- Oleg Jakushkin (oleg.jakushkin (at) gmail.com)
Dear all contributors, you are kindly requested to format your code using astyle format options found [here] (https://root.cern.ch/coding-conventions#Astyle).