R3BROOT
R3B analysis software
|
Conan package manager is a widely-used package manager for large C++ projects. The benefits of using Conan, in the contrary to Spack, is the third-party packages are attached with the individual project, instead of an environment. Therefore, users don't need to go into a specific environment to use the packages. For more information, please refer to the Conan Documentation.
First make sure you have installed and updated the git submodule. If not, run the following command:
Then configure CMake and build the project
By default, CMake uses "Gnu Makefile" to build the project under the hood. However, "Gnu makefile" is pretty slow and it's recommended to use "ninja" if ninja is available in your system. To do this, instead run the configuration step with:
or put the following command in the .bashrc
(or .zshrc
if zsh is used):
Adding a package to the project is pretty easy. Suppose you want to use Eigen library (a famous linear algebra library used by Tensorflow) to R3BRoot. First go to the conan center and search for "eigen". You would find an entry related to "eigen/3.4.0", which contains further instructions how to add the package to your project. Under the "conanfile.py" tab, you could find a call to self.requires
. Add this line to the conanfile.py
located at the R3BRoot root folder:
Be aware that you shouldn't change other variables like "settings" or "generators".
Then in the CMakeLists.txt
, add
and link this target to your executable or library. See CMake usage about CMake target linkage.