Building ROOT from source » History » Revision 1
Building ROOT from source¶
ROOT 6 uses a CMake based build system. The build process consists of three steps:
cmakewith the desired configuration arguments in a "build directory," which is separate form the source directory
maketo build the package
make installto copy the relevant subset of sources and generated binaries to the installation directory
Step 1. is the most difficult one since one has to pick appropriate configuration options, of which ROOT has many. A detailed description of all options can be found on the relevant documentation page. Let us walk through a typical build process here.
- Make sure that your system compiler is at least
gcc 4.8. It needs to support
C++11fully. If you do not have such a compiler, you should upgrade your system, unless you have a lot of patience and skill.
- Make sure that you have at least CMake version 3.4.3. On some systems, this command may be called
cmake3. On RHEL7/CentOS 7,
cmake3is availale from EPEL.
$ cmake --version cmake version 3.11.1
- Download the ROOT source tarball from the download page. Always pick the latest production ("pro") version; it should work even on old platforms.
- Unpack the source distribution wherever you like. This will create a subdirectory named "root-<version>".
$ tar xf root_v6.12.06.source.tar.gz $ ls root-6.12.06
- Create and switch to the build directory, for example
$ mkdir -p ~/Develop/BUILD/root $ cd ~/Develop/BUILD/root
- Now prepare to run
cmaketo configure ROOT. This step will automatically detect if required dependencies are available. The most important dependencies are bundled with ROOT and are built automatically if they are not detected on the host system. Other dependencies are optional; if not found, the corresponding feature in ROOT is automatically disabled. (Example: MySQL database support.) You will get a functional version of ROOT even without these optional dependencies, so it is not essential to provide them. Getting them installed is best done through your system's package manager. Some obscure dependencies need to be build by hand from source first, which can be very time-consuming. Here's a basic CMake command that should give good results on most systems:
$ cmake -DCMAKE_INSTALL_PREFIX=<path-to-where-you-want-ROOT-to-be-installed> -D.... <path-to-unpacked-ROOT-source>
(to be continued)