wiki:InstallingFACT++

Version 17 (modified by tbretz, 6 years ago) ( diff )

--

Checking out FACT++

First you need to get FACT++ 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 FACT++.

[0] svn checkout https://www.fact-project.org/svn/trunk/FACT++ [directory]
[1] cd FACT++

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

And call cmake from there (the ".." is intentional!)

[4] cmake ..

To compile with clang, you might want to change the compilers by calling

[4] cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ..

instead. Note that not all versions of clang are compatible with all version of the boost-libraries on Ubuntu. You might have to try different versions. (However, it is worth it, because clang is much faster).

If you only want to compile the basic tools (rootifysql, root2sql, fits2sql, fitsdump and zfits) you can add -DTOOLS_ONLY=1 when calling cmake. This simplifies compilation because less packages are required (for example the whole QT stuff is not needed).

If a package is missing, you will see an error which looks like this

Line 
1CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
2 Could NOT find Nova (missing: NOVA_LIBRARY NOVA_INCLUDE_DIR)
3Call 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). You can then do, for exmaple

[4] cmake -DMYSQL_INCLUDE_DIR=~/mysql/include -DMYSQL_LIBRARY=~/mysql/libmysqlclient.so

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.

Packaging FACT++

Once successfully compiled, you can package the tool-set and build a tar-archive and a Debian package by

[6] make package

The Debian package can then be installed system wide with

[7] dpkg -i fact++-YYWWDDHH.deb

where YYWWDDHH is the version number compiled from the time when cmake was called.

Old Information

Some older information can be found here https://fact-project.org/FACT++/. It describes the old build system, but apart from that should be more or less accurate.

Compilation on our systems

ISDC

/swdev_nfs/cmake-3.5.0-Linux-x86_64/bin/cmake \
-DTOOLS_ONLY=1 \
-DBOOST_ROOT=/swdev_nfs/boost_1_47_0/ \
-DMYSQL_LIBRARY=/swdev_nfs/mysql-5.7.23-linux-glibc2.12-x86_64/lib/libmysqlclient.so \
-DMYSQL_INCLUDE_DIR=/swdev_nfs/mysql-5.7.23-linux-glibc2.12-x86_64/include/ \
-DMYSQLPP_LIBRARY=/swdev_nfs/mysql++-3.2.4/libmysqlpp.so \
-DMYSQLPP_INCLUDE_DIR=/swdev_nfs/mysql++-3.2.4/lib/ \
-DNOVA_INCLUDE_DIR=/swdev_nfs/libnova-0.15.0/include/libnova/ \
-DNOVA_LIBRARY=/swdev_nfs/libnova-0.15.0/lib/libnova.so  /path/to/CMakeList.txt

It is all a newer version, a newer required version, or compiled with mysqlclient 5.7.23, or all of that.

ETH (PC45)

cmake -DMYSQL_LIBRARY=/usr/lib/x86_64-linux-gnu/libmysqlclient.so.20 /path/to/CMakeList.txt

MySQL++ was compiled with mysqlclient 5.7, on pc45, the default mysqlclient library is 8.0.12, thus -- to avoid confusion for the linker -- better use the older version for FACT++ (and root!).

Note: See TracWiki for help on using the wiki.