Version 5 (modified by 6 years ago) ( diff ) | ,
---|
Checking out Mars
First you need to get Mars from the svn-repository. The default command will checkout it into a sub-directory called "directory
" at the current directory. It will be created if not existing. If the argument is omitted, the default directory is Mars.
[0] svn checkout https://www.fact-project.org/svn/trunk/Mars [directory] [1] cd Mars
Creating the build system
Now create a new sub-directory build (or with your preferred name) in your main source directory (here assuming the default name was used)
[2] mkdir build [3] cd build
Before you run *cmake*, please make sure that your root environment has been properly initialized by calling *thisroot.sh*, for example:
[X] . /opt/root-6.14.04/bin/thisroot.sh
Note that switching from a newer to an older version in this way might fail (CMAKE_PREFIX_PATH will still point to the previous version).
Now call cmake
from there (the "..
" is intentional!)
[4] cmake ..
As a default, the project is compiled with the build type Release, thus all optimization is enabled and debug symbols are switched off. To enable debug symbols, you can use the build mode 'Debug' or 'RelWithDebInfo', e.g.
[4] cmake -DCMAKE_BUILD_TYPE=Debug ..
As a default, cmake will try to find the compiler suite 'clang/clang++', 'gcc/g++' and 'cc/c++' (in this order). If you want to define a compiler yourself, then you can call cmake like this
[4] cmake -DCMAKE_C_COMPILER=clang-4.0 -DCMAKE_CXX_COMPILER=clang++--4.0 ..
instead.
CMake will check for the availablility of all important packages. For Mars, this is mainly *root* and *libnova*. Although, we have managed to compile Mars with pre-installed binary packages, it is advised that you install root from scratch (see http://root.cern.ch). Libnova (if there is no package available -- don't forget the dev-package!) can be found here http://libnova.sourceforge.net/index.html and should be easy to compile (./configure && make
.
If a package is missing, you will see an error which looks like this
Line | |
---|---|
1 | CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message): |
2 | Could NOT find Nova (missing: NOVA_LIBRARY NOVA_INCLUDE_DIR) |
3 | Call Stack (most recent call first): |
4 | /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE) |
5 | cmake/FindNova.cmake:11 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) |
6 | CMakeLists.txt:131 (FIND_PACKAGE) |
It is a bit tricky to find out which package is missing at the moment. The important line is line #2
Could NOT find Nova (missing: NOVA_LIBRARY NOVA_INCLUDE_DIR)
In this case, it is the development package of the nova library (libnova-dev).
If you find something missing during compilation which is not checked, please let me know. As a good practice please attach the complete output of cmake
and of make
. To clean up your build tree and start from scratch simple remove the directory (rm -rf build
) and start over with step [2].
Hint: To get an idea what cmake is doing or has done, you can call cmake-gui .
in the build directory. Note that the .
is required.
Usually, there is XXX_INCLUDE_DIR which is a a path to the header files and XXX_LIBRARY which is the library filename (including path).
To check what cmake actually found, you can call
[4] cmake-gui .
Compiling FACT++
Then call
[5] make -jN
where N is the numbers of threads you want to utilize (check the number of CPU cores you can keep busy). Or you can omit the -jN
in case you want to run on a single CPU.
Known to work
- cmake 3.5.0 / 3.5.1 / 3.10.2
- Scientific Linux 6.10 and gcc 4.4.7
- Ubuntu 16.04 and clang 3.8 / 4 .0 / 5.0 / 6.0 or gcc 5.4.0
- Ubuntu 18.04 and clang 6.0 or gcc 7.3.0
- root 5.34/36, 5.34/38, 6.12/06, 6.14/04
- libnova 0.12 / 0.15.0
Not all combinations might work though.