Project

General

Profile

Building ROOT from source » History » Version 3

Ole Hansen, 05/18/2018 11:57 AM

1 1 Ole Hansen
h1. Building ROOT from source
2
3
ROOT 6 uses a "CMake":https://cmake.org based build system. The build process consists of three steps:
4
5
# Running @cmake@ with the desired configuration arguments in a "build directory," which is separate form the source directory
6
# Executing @make@ to build the package
7
# Doing @make install@ to copy the relevant subset of sources and generated binaries to the installation directory
8
9
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":https://root.cern/building-root. Let us walk through a typical build process here.
10
11 3 Ole Hansen
# Make sure that your system compiler is at least @gcc 4.8@. It needs to support @C++11@ fully. If you do not have such a compiler, you should upgrade your system, unless you have a lot of patience and skill. On rpm-based Linux distributions, the @gcc-c++@ and @libstdc++@ packages need to be installed. To fin dout your compiler version:
12
<pre>
13
$ g++ --version
14
g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28)
15
...
16
</pre>
17 2 Ole Hansen
# Verify that you have at least CMake version 3.4.3. On some systems, this command may be called @cmake3@. On RHEL7/CentOS 7, @cmake3@ is availale from "EPEL":https://fedoraproject.org/wiki/EPEL.
18 1 Ole Hansen
<pre>
19
$ cmake --version
20
cmake version 3.11.1
21
</pre>
22
# Download the ROOT source tarball from the "download page":https://root.cern/downloading-root. Always pick the latest production ("pro") version; it should work even on old platforms.
23
# Unpack the source distribution wherever you like. This will create a subdirectory named "root-<version>".
24
<pre>
25
$ tar xf root_v6.12.06.source.tar.gz
26
$ ls
27
root-6.12.06
28
</pre>
29
# Create and switch to the build directory, for example
30
<pre>
31
$ mkdir -p ~/Develop/BUILD/root
32
$ cd ~/Develop/BUILD/root
33
</pre>
34
# Now prepare to run @cmake@ to 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:
35
<pre>
36
$ cmake -DCMAKE_INSTALL_PREFIX=<path-to-where-you-want-ROOT-to-be-installed> -D.... <path-to-unpacked-ROOT-source>
37
</pre>
38
39
(to be continued)