Project

General

Profile

ROOT Installation Guide » History » Version 28

Ole Hansen, 06/29/2018 10:42 PM

1 1 Ole Hansen
h1. ROOT Installation Guide
2
3
{{toc}}
4
5
"ROOT":https://root.cern is an advanced software package developed at "CERN":https://home.cern, the European Organization for Nuclear Research. It is widely used for data analysis and visualization in high-energy physics and nuclear physics as well as other fields.
6
7
ROOT can easily run on any modern laptop. You will need at least 2 GB of memory (4 GB recommended) and about 1 GB of disk space (2-3 GB if building from source). 
8
9
Installing the software varies in difficulty from very easy to fairly high, depending on whether or not your computer is one of the "supported platforms":https://root.cern/supported-platforms. In general, there are three typical ways to get ROOT:
10
11
# A set of pre-compiled packages provided by your operating system's package manager
12 2 Ole Hansen
** Very easy to install and almost certain to work well
13 1 Ole Hansen
** Easy updating to new versions
14 27 Ole Hansen
** Requires administrative privilege on your machine
15
** Only one, usually very recent version can be installed at any given time (which is what most people want, of course)
16 1 Ole Hansen
** Recommended approach, if possible
17
# A pre-compiled "binary distribution package":https://root.cern/content/release-61206 provided by the ROOT team.
18
** Easy, but there is a certain risk of problems due to unexpected incompatibilities
19 27 Ole Hansen
** May have multiple versions installed in parallel
20 1 Ole Hansen
** Only available for the most recent operating system versions
21
** May be installed privately without administrative privilege
22
** Requires manual updating
23
# Building from "source":https://root.cern/building-root
24
** Moderately difficult. Experience with building large software packages recommended.
25
** Can take several hours to build. Cannot be done while running on laptop battery power.
26 27 Ole Hansen
** Configuration can be tricky. Updating must be done manually.
27
** Missing dependencies are detected during configuration and need to be identified and installed manually
28 1 Ole Hansen
** Gives access to all ROOT features, including very advanced ones (not generally needed)
29 27 Ole Hansen
** Multiple versions can be installed in parallel
30 1 Ole Hansen
31 24 Ole Hansen
The current version of ROOT is 6.14/00 at the time of his writing. Following are instructions to get up and running quickly with this version, if possible, on specific operating systems based on our experience.
32 1 Ole Hansen
33 8 Ole Hansen
h2{background:#D5D8DC}. Linux
34 1 Ole Hansen
35
h3. Red Hat Enterprise Linux (RHEL) 7, CentOS 7 and compatible
36
37 26 Ole Hansen
# Enable the "EPEL":https://fedoraproject.org/wiki/EPEL (Extra Packages for Enterprise Linux) repository. Follow the "EPEL Quickstart instructions":https://fedoraproject.org/wiki/EPEL#Quickstart.
38 6 Ole Hansen
# Install the core ROOT package. This will install the most commonly used libraries. More packages are available if you need advanced features later.
39 1 Ole Hansen
<pre>
40
sudo yum install root
41
</pre>
42 6 Ole Hansen
# To work with ROOT from within Python 3, also install python34-root. This will automatically install python 3.4 as well:
43 1 Ole Hansen
<pre>
44
sudo yum install python34-root
45
</pre>
46
47
h3. Fedora
48
49 7 Ole Hansen
For Fedora 24 and higher, ROOT 6 is available in the main Fedora repository. The current version of ROOT, 6.12/06, requires at least Fedora 26. Simply do
50 1 Ole Hansen
<pre>
51
sudo yum install root
52
sudo yum install python3-root
53
</pre>
54
55
For Fedora 20-22, CERN offers binary distributions of older versions of ROOT:
56
57 5 Ole Hansen
* "ROOT 6.08/06 for Fedora 22":https://root.cern/download/root_v6.08.06.Linux-fedora22-x86_64-gcc5.3.tar.gz
58 1 Ole Hansen
* "ROOT 6.06/08 for Fedora 21":https://root.cern/download/root_v6.06.08.Linux-fedora21-x86_64-gcc4.9.tar.gz
59
* "ROOT 6.06/08 for Fedora 20":https://root.cern/download/root_v6.06.08.Linux-fedora20-x86_64-gcc4.8.tar.gz
60
61 11 Ole Hansen
See [[Installing ROOT from a CERN binary distribution|installing a binary distribution]] for instructions.
62 1 Ole Hansen
63
h3. Ubuntu
64
65
At present, Ubuntu repositories only offer ROOT 5 packages, which should be considered obsolete. Do not install these. To get ROOT 6 on Ubuntu 14, 16 or 17, download and install the appropriate binary release from CERN:
66
67
* "ROOT 6.12/06 for Ubuntu 17":https://root.cern/download/root_v6.12.06.Linux-ubuntu17-x86_64-gcc7.2.tar.gz
68
* "ROOT 6.12/06 for Ubuntu 16":https://root.cern/download/root_v6.12.06.Linux-ubuntu16-x86_64-gcc5.4.tar.gz
69
* "ROOT 6.12/06 for Ubuntu 14":https://root.cern/download/root_v6.12.06.Linux-ubuntu14-x86_64-gcc4.8.tar.gz
70
71 12 Ole Hansen
See [[Installing ROOT from a CERN binary distribution|installing a binary distribution]] for instructions.
72 1 Ole Hansen
73
h3. Arch Linux, Debian, and other Linux varieties with at least gcc 4.8
74
75 10 Ole Hansen
[[Building ROOT from source|Build ROOT from source]].
76 1 Ole Hansen
77
h3. RHEL6, CentOS 6 and older Linux distributions
78
79
ROOT 6 cannot be installed easily on these systems, not even from source, because the system compiler is too old. (ROOT 6 requires a fully C++11-capable compiler.) Pre-built ROOT 5 packages are available, however.
80
81 14 Ole Hansen
Of course, it is possible to run ROOT 6 even on quite old Linux systems. One needs to install a modern compiler first, build ROOT from source using that compiler, and run ROOT with that compiler's runtime libraries. This procedure is beyond the scope of this document, however.
82 1 Ole Hansen
83 8 Ole Hansen
h2{background:#D5D8DC}. macOS
84 1 Ole Hansen
85 21 Ole Hansen
Before attempting to install ROOT, please set up the Xcode command line tools (unless already done). From a Terminal, run
86
<pre>
87
$ xcode-select --install
88
</pre>
89
Once this command completes, you should have a working compiler:
90
<pre>
91
$ g++ --version
92
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
93
Apple LLVM version 9.0.0 (clang-900.0.39.2)
94
...
95
</pre>
96 1 Ole Hansen
97 21 Ole Hansen
A quick way to get ROOT on macOS/OSX 10.8-10.13 is to download the appropriate binary distribution from CERN:
98
99 1 Ole Hansen
* "ROOT 6.12/06 for macOS 10.13":https://root.cern/download/root_v6.12.06.macosx64-10.13-clang90.tar.gz
100
* "ROOT 6.12/06 for macOS 10.12":https://root.cern/download/root_v6.12.06.macosx64-10.12-clang90.tar.gz
101
* "ROOT 6.10/08 for macOS 10.11":https://root.cern/download/root_v6.10.08.macosx64-10.11-clang80.tar.gz
102 13 Ole Hansen
* "ROOT 6.08/06 for macOS 10.10":https://root.cern/download/root_v6.08.06.macosx64-10.10-clang70.tar.gz
103 1 Ole Hansen
* "ROOT 6.06/08 for macOS 10.9":https://root.cern/download/root_v6.06.08.macosx64-10.9-clang60.tar.gz
104 18 Ole Hansen
* "ROOT 6.04/06 for macOS 10.8":https://root.cern/download/root_v6.04.06.macosx64-10.8-clang51.tar.gz
105 1 Ole Hansen
106
See [[Installing ROOT from a CERN binary distribution|installing a binary distribution]] for instructions.
107
108 21 Ole Hansen
However, please note that using versions of ROOT older than 6.08 is discouraged as those releases were quite buggy. If you still run an old version of macOS, it may be better to get the latest ROOT release and [[Building ROOT from source|build from source]].
109 1 Ole Hansen
110 21 Ole Hansen
ROOT is also available from "Homebrew":https://brew.sh (package root) and "MacPorts":https://www.macports.org (package root6). For example, you can install it from Homebrew on macOS 10.11-10.13 as follows:
111 1 Ole Hansen
112 21 Ole Hansen
# Install Homebrew (skip if you have already done that before):
113 1 Ole Hansen
<pre>
114
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
115
</pre>
116 21 Ole Hansen
Follow the text prompts to complete the installation.
117
# With Homebrew set up, installing ROOT and Python 3 is now very easy:
118 1 Ole Hansen
<pre>
119
brew install root python
120
</pre>
121 21 Ole Hansen
122 1 Ole Hansen
Homebrew's ROOT comes with support for Homebrew's Python 3, while the CERN binary distributions support Apple's native Python 2. However, CERN's binary releases are built with more features enabled.
123
124 8 Ole Hansen
h2{background:#D5D8DC}. Windows
125 1 Ole Hansen
126 24 Ole Hansen
Starting with ROOT 6.14/00, CERN offers a "prebuilt distribution":https://root.cern.ch/content/release-61400 for Windows. It requires the "VisualStudio 2017 Redistributable C++ Runtime":https://go.microsoft.com/fwlink/?LinkId=746572 and should work on Windows 7 and up. See also the general "Visual Studio 2017 download page":https://www.visualstudio.com/downloads/.
127 1 Ole Hansen
128 28 Ole Hansen
Alternatively, you can download and install "VirtualBox":https://www.virtualbox.org and run our "CentOS 7 virtual machine image":http://hallaweb.jlab.org/data_reduc/AnaWork2018/VirtualBox, where ROOT (and other useful software) is pre-installed. You will also find installation instructions there. Unfortunately, this requires a large download, about 20 GB of disk space for the uncompressed VM image, and at least 4 GB, preferably 8 GB, of memory on your host computer. Also, be warned that in some relatively rare cases VirtualBox may not run properly on your machine, depending on a variety of hardware or software details.
129 1 Ole Hansen
130
h2{background:#D5D8DC}. Testing your installation
131 9 Ole Hansen
132 24 Ole Hansen
If you installed ROOT from your distribution's package manager, or from Homebrew/MacPorts, no setup should be necessary to start using the software. Just type @root@, and you should see a startup banner similar to this:
133 9 Ole Hansen
<pre>
134 24 Ole Hansen
$ root
135 9 Ole Hansen
   ------------------------------------------------------------
136
  | Welcome to ROOT 6.12/06                http://root.cern.ch |
137
  |                               (c) 1995-2017, The ROOT Team |
138
  | Built for macosx64                                         |
139
  | From tag v6-12-06, 9 February 2018                         |
140
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
141
   ------------------------------------------------------------
142
143
root [0] 
144
</pre>
145
146
If you installed a binary distribution or from source, you will need to run a setup script first:
147
<pre>
148
source <dir-where-you-installed-root>/bin/thisroot.sh
149
</pre>
150
or, if you are using @tcsh@
151 22 Ole Hansen
<pre>
152 1 Ole Hansen
source <dir-where-you-installed-root>/bin/thisroot.csh
153
</pre>
154
After doing so, the @root@ command should be available, and you can start ROOT as shown above.
155
156
It is probably a good idea to set up ROOT from your shell's login script. To do so, simply put the above "source" command near the end of your @~/.bash_profile@ (or @~/.login@ for @csh/tcsh@).
157 22 Ole Hansen
158
Sourcing the setup script is also necessary on the JLab ifarm systems. There, you can find various ROOT versions installed under @/apps/root@. For example, to use the latest version, do
159
<pre>
160 9 Ole Hansen
ifarm1402.jlab.org$ source /apps/root/6.12.04/bin/thisroot.csh
161
</pre>
162 1 Ole Hansen
163 24 Ole Hansen
Once ROOT is set up and running, you can type
164
<pre>
165
root [0] .demo
166
</pre>
167
at the ROOT prompt for a demonstration of some of ROOT's graphics capabilities.
168
169 19 Ole Hansen
Sometimes it is interesting to find out more details about the installation of ROOT that you are working with. ROOT provides a command called @root-config@ for this purpose. For example, to show which "features" (capabilities) ROOT was compiled with, run @root-config --features@. Here is an example from JLab's RHEL7 ifarm systems, which you can run after setting up ROOT as described in the preceding paragraph:
170 9 Ole Hansen
<pre>
171 19 Ole Hansen
ifarm1402.jlab.org$ which root-config
172 9 Ole Hansen
/u/apps/root/6.12.04/root/bin/root-config
173 19 Ole Hansen
ifarm1402.jlab.org$ root-config --features
174 9 Ole Hansen
asimage astiff builtin_afterimage builtin_ftgl builtin_gl2ps builtin_glew builtin_llvm builtin_lz4 builtin_tbb
175
builtin_unuran cling cxx11 exceptions explicitlink fftw3 gdml genvector http imt mathmore minuit2 mysql opengl
176
pch pgsql python qt roofit shared soversion sqlite ssl thread tmva unuran x11 xft xml
177
</pre>
178
Some of these items are self-explanatory, others probably obscure. Consult the ROOT documentation for a full description.
179 19 Ole Hansen
180 24 Ole Hansen
h2{background:#D5D8DC}. Python support (PyROOT)
181 16 Ole Hansen
182 9 Ole Hansen
You can see "python" in the "feature list" above, indicating support for Python 2. We can check this further:
183 1 Ole Hansen
<pre>
184 20 Ole Hansen
ifarm1402.jlab.org$  root-config --python-version
185 9 Ole Hansen
2.7
186
</pre>
187 1 Ole Hansen
This version of ROOT therefore has support for Python 2.7. We can try it out:
188 17 Ole Hansen
<pre>
189 20 Ole Hansen
ifarm1402.jlab.org$  python -c 'import ROOT'
190 1 Ole Hansen
</pre>
191
If this finishes without error, this version of Python will probably work correctly with this version of ROOT. However, be careful; sometimes multiple versions of Python are installed on the same machine. On ifarm, there are two Python 2.7 versions:
192
<pre>
193 20 Ole Hansen
ifarm1402.jlab.org$  which python
194 9 Ole Hansen
/apps/bin/python
195 20 Ole Hansen
ifarm1402.jlab.org$  /apps/bin/python --version
196 9 Ole Hansen
Python 2.7.12
197 20 Ole Hansen
ifarm1402.jlab.org$  /usr/bin/python --version
198 9 Ole Hansen
Python 2.7.5
199 17 Ole Hansen
</pre>
200 24 Ole Hansen
In this case, do not be completely surprised if your PyROOT experience turns out to be a bit bumpy and be prepared to file a bug report. On your personal system, try to make sure that only one version is installed.