[[TOC]] == 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 }}} To install FACT++, it is rcommended to have a working ROOT environment. For the installation of ROOT, plese refer to [[InstallingROOT]]. Before you run *cmake*, please make sure that your root environment has been properly initialized. If you have `root-config` in your path (or `root -b` starts up properly) this is usually not necessary. In any case, if it is required, you should find `cmake` complaining about missing root. If you have to initialize the root environment or switch to a different root version call *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. 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 you only want to compile the *viewer* you can add {{{-DVIEWER_ONLY=1}}} when calling {{{cmake}}}. This simplifies compilation because less packages are required, but all the Qt stuff is required. The two options {{{-DTOOLS_ONLY=1}}} and {{{-DVIEWER_ONLY=1}}} can be combined. If a package is missing, you will see an error which looks like this {{{#!default lineno=1 CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message): Could NOT find Nova (missing: NOVA_LIBRARY NOVA_INCLUDE_DIR) Call Stack (most recent call first): /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE) cmake/FindNova.cmake:11 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) 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 .. }}} To check what cmake actually found, you can call {{{ [4] cmake-gui . }}} == Observatory == The default observatory is build in during compile time. This should avoid that by mistake and changed resource files, a wrong observatory location is selected. The default is La Palma (`ORM`). If you want to select a different location (ORM, HAWC, SPM, RWTH), you can do that when running cmake, for example, by {{{ [4] cmake -DOBSERVATORY=HAWC .. }}} == 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 the following instructions. This is usually *not* recommended. It is mainly meant for system wide installations not for userspace installations. {{{ [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. == FACT++ and ROOT v6 == In root versions >=6.18, the {{{qt}}} integration has been discarded. Therefore, the graphical interfaces {{{fact}}} is turned off if compiled with a root version >=6.18. == 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 === Make sure that the root-version you wanna use is properly initialized by calling {{{ /swdev_nfs/root_v5.34.38/bin/thisroot.sh }}} The start cmake before calling make: {{{ /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. Make sure that the root-version cmake finds is also compiled with the same mysqlclient-library, e.g. by {{{ /swdev_nfs/cmake-3.5.0-Linux-x86_64/bin/cmake \ -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 \ /swdev_nfs/root_v5.34.38-source/ }}} == Known to work == * cmake 3.5.0 / 3.5.1 / 3.10.2 * Scientific Linux 6.10 with Boost 1.47.0 and gcc 4.4.7 * Ubuntu 16.04 with Boost 1.58.0 and clang 3.8 / 4 .0 / 5.0 / 6.0 or gcc 5.4.0 * Ubuntu 18.04 with Boost 1.65.1 and clang 6.0 or gcc 7.3.0 / 7.4.0 * Peppermint 9 with Boost 1.65.1 and clang 6.0 or gcc 7.3.0 * root 5.34/36, 5.34/38, 6.12/06, 6.14/04, 6.14/06 (with Qt support compiled in) * root binary packages might work if TOOLS_ONLY is enabled * Qt4 4.8.7 * libqwt 5.2.3 * libz 1.2.3 / 1.2.8 / 1.2.11 * mysqlclient 5.7.23, 5.7.24, 5.7.27 (20.3.10) / 8.0.12 (21.0.12) * mysql++ 3.2.2 / 3.2.4 (3v5) * libssl 1.0.1e / 1.0.2g / 1.0.2n / 1.1.0g (openssl) * libnova 0.12 / 0.15.0 / 0.16.0 * libv8 3.14.5 * libreadline 7.0 * libncurses 5 (6.1) * libcfitsio 5 (3.430) * libccfits 0v5 (2.5) * groff 1.22.3 Not all combinations might work though. (There are known problems with openssl 1.1.0 and Ubuntu 16.04: downgrade openssl to 1.0.*) It might already be enough to downgrade the development package (libssl-dev). As a default, from cmake 3.6 onwards, the libmysqlclient (MySQL) to which the project is linked is automatically obtained from the libmysqlpp library (MySQL++). If you have a too old version of cmake, you can download binary packages at https://cmake.org/download/. Usually, it is enough to call cmake with its full path to switch version. So just unpack the tar-ball and call the cmake binary in the package. Note that root already imposes requirements on cmake which can be found at InstallingROOT. == Packages == This is a list of packages known to be required for a full installation on some Ubuntu (this list might not be correct for all systems not complete). Package names might differ. In some cases not all dependent packages (e.g. libbost-all-dev) might be required but only a subset. * subversion * cmake cmake-qt-gui cmake-curses-gui * pkgconf (--recommended--) * libz-dev ("Could NOT find ZLIB") * libncurses-dev ("Could NOT find Curses") * libreadline-dev ("Could NOT find Readline") * libgl-dev ("Could NOT find OpenGL") * libv8-dev ("Could NOT find V8") * libccfits-dev ("Could NOT find Cfitsio") * libssl-dev ("Could NOT find OpenSSL") * libnova-dev ("Could NOT find Nova") * libmysql++-dev ("Could NOT find MySQL++") * libboost-all-dev ("Unable to find the requested Boost libraries") * libsource-highlight-dev ("Could NOT find Highlight") * qt4-qmake ("qmake: could not exec 'qmake': No such file or directory") * libqt4-dev ("Qt is NOT installed correctly") * libqwt5-qt4-dev ("Could NOT find Qwt") * libqt4-opengl-dev ("Could NOT find Qt4 (missing: QT_QTOPENGL_INCLUDE_DIR QT_QTOPENGL_LIBRARY)") * help2man groff * curl * bsd-mailx * jsdoc-toolkit == Known Problems == There are many different build systems for root (e.g. root 5, root 6), different ways to install root (use build dir, run install, install your own package, install root binary builds). All these build systems interact differently with cmake. I believe that right now, it should work for most root installations, but I can not guarantee. If there is any hint that your installation files due to root issues, please contact me. Also, make sure that the version of root-config that is found by cmake is consistent with your ROOTSYS and the root version you are actually going to use.