# Installing ROOT

ROOT is available on Linux, Mac, and (as a beta release) on Windows.
The latest stable ROOT release is 6.24/06 (about ROOT versioning scheme).

There are several ways to install ROOT on your computer: they are all listed in the table of content on the right. Which one is best for you depends on your operating system and usage requirements. In all cases, make sure to always use the most recent ROOT release possible to get the latest bug fixes, features and quick user support.

We distribute pre-compiled ROOT for several major Linux distributions as well as MacOS and (as a beta) Windows. The steps to install a pre-compiled binary are simple:

1. Install all required dependencies with the system package manager
2. Download the release for the desired platform and ROOT version
3. Unpack the archive
4. Add the ROOT libraries and executables to your environment by sourcing the appropriate thisroot.* script. These setup scripts can be found in the ROOT binary release, in the bin directory.

For example, on Ubuntu 20, a user could execute the following bash commands to install ROOT v6.24/02, after installing all required dependencies:

$wget https://root.cern/download/root_v6.24.02.Linux-ubuntu20-x86_64-gcc9.3.tar.gz$ tar -xzvf root_v6.24.02.Linux-ubuntu20-x86_64-gcc9.3.tar.gz
$source root/bin/thisroot.sh # also available: thisroot.{csh,fish,bat}  To avoid having to source thisroot.sh every time one needs to use ROOT, it is typical to add the command to .bashrc, .profile or analogous configuration files. Note, however, that sourcing thisroot.sh might interfere with ROOT versions installed with different methods. And on Windows, for example, after the installation, open a x86 Native Tools Command Prompt for VS 2019, cd to your home directory (cd %USERPROFILE%) and call thisroot.bat (let’s assume you installed ROOT in C:\root). Then you can start ROOT: ********************************************************************** ** Visual Studio 2019 Developer Command Prompt v16.11.3 ** Copyright (c) 2021 Microsoft Corporation ********************************************************************** [vcvarsall.bat] Environment initialized for: 'x86' C:\Program Files (x86)\Microsoft Visual Studio\2019\Community>cd %USERPROFILE% C:\Users\username>c:\root\bin\thisroot.bat C:\Users\username>root ------------------------------------------------------------------ | Welcome to ROOT 6.25/01 https://root.cern | | (c) 1995-2021, The ROOT Team; conception: R. Brun, F. Rademakers | | Built for win32 on Sep 20 2021, 11:34:39 | | From heads/master@v6-25-01-1903-g6928212418 | | With MSVC 19.29.30133.0 | | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' | ------------------------------------------------------------------ root [0]  # Install via a package manager Supported by the community: these packages are not maintained by the ROOT team, but by helpful members of the community. Please go through each package manager’s standard channels to report any related issue. If you package ROOT and would like to be added to the list below, please contact us by clicking the letter icon at the bottom of the page. ## Conda For any Linux distribution and MacOS, ROOT is available as a conda package. To create a new conda environment containing ROOT and activate it, execute $ conda config --set channel_priority strict
$conda create -c conda-forge --name <my-environment> root$ conda activate <my-environment>


Setting channel_priority to strict is required to avoid conflicts on some platforms, see the relevant conda docs for more information.

The conda package uses C++17.

More instructions about using this package are available in this blog post.

Please report any issues with the conda package here.

## Snap

On many Linux distributions, ROOT can be installed via Snap. For example, on Ubuntu:

$sudo snap install root-framework$ snap run root-framework
# or if there is no fear of conflicts with other installations:
$root # and the output of which root should contain /snap  The Snap package uses C++17. See our dedicated blog post for more information, or visit the official ROOT Snap package page. ## Linux package managers ROOT can be directly installed from the operating system’s package manager in the following Linux distributions: ### Fedora Fedora’s ROOT package can be installed with $ yum install root


More typically, however, users will want more than just the base package. The full list of components can be seen at https://src.fedoraproject.org/rpms/root/ by clicking in one of the offered versions. To install ROOT with support for python and notebooks, for example, run

$yum install root  ### Arch Linux Arch’s ROOT package can be installed with $ pacman -Syu root


The Arch package uses C++17.

### Gentoo

The Gentoo package for ROOT is sci-physics/root. It can be installed with

$emerge sci-physics/root  ### NixOS/Nix/Nixpkgs The package name for ROOT in nixpkgs is root. It can be installed into the user environment using $ nix-env -f '<nixpkgs>' -iA root


Running in a temporary environment can be achieved with

$nix-shell -p root --run root  A root5 package is provided for the legacy software support. If you encounter any issues, feel free report them to the nixpkgs issue tracker. ### Ubuntu and Debian-based distributions The ROOT team is working on the release of an official .deb package. More news on this topic very soon. In the meanwhile, ROOT is available on Ubuntu via conda or our pre-compiled binaries. ## MacOS package managers ### Homebrew On Mac, ROOT is also available as a homebrew formula. You can install it with $ brew install root


### Macports

After installing macports, the ROOT port can be installed with

$sudo port install root6  ### Nix/Nixpkgs The same instructions as for Linux apply when running on macOS. # LCG releases on CVMFS ## Standalone ROOT If your platform mounts CVMFS ROOT is directly available via LCG releases. ROOT installations with minimal external dependencies are available for Fedora, Ubuntu, CentOS7 and MacOS at: /cvmfs/sft.cern.ch/lcg/app/releases/ROOT/<version>/<platform>  For example, to set up ROOT 6.24/02 on a CentOS7 machine, just run: source /cvmfs/sft.cern.ch/lcg/app/releases/ROOT/6.24.02/x86_64-centos7-gcc48-opt/bin/thisroot.sh  Make sure you use your system’s default compiler, just like this ROOT build. ## Complete environment ROOT, Geant4 and many other packages with all their dependencies are available as LCG views: /cvmfs/sft.cern.ch/lcg/views/LCG_<version>/<platform>  LCG views are available for CentOS7, CentOS8 and the latest MacOS and Ubuntu releases. For example, on CERN LXPLUS, you can set up a full environment that contains ROOT 6.24/00 with: source /cvmfs/sft.cern.ch/lcg/views/LCG_100/x86_64-centos7-gcc10-opt/setup.sh  To check what ROOT version is contained in an LCG release, you can visit lcginfo.cern.ch. ## Gentoo Prefix on CVMFS ROOT is also experimentally available in a Gentoo Prefix installation inside the contrib area of the SFT CVMFS repository. To use it from there, run $ /cvmfs/sft.cern.ch/lcg/contrib/gentoo/linux/x86_64/startprefix


This will drop you into a new shell where all software from the prefix is available.

# Run in a Docker container

ROOT Docker containers for several linux flavours are available at ROOT’s official DockerHub.

For example, to try out the latest ROOT release just run docker run -it rootproject/root.

# Run on CERN LXPLUS

Users with a CERN computing account can simply connect to lxplus.cern.ch via SSH and start root: the latest stable version is installed as a normal system package.

Note that certain features (e.g. multi-threading capabilities) are not available on lxplus.cern.ch (or, equivalently, lxplus7.cern.ch) due to incompatible versions of certain ROOT dependencies on CentOS7. You can use lxplus8.cern.ch to get access to CentOS8, where this limitation is not present.

# Build from source

In case no other installation method is available, or if you want full control over the options ROOT is built with, it is possible to compile ROOT from source. See Building ROOT from source for detailed instructions.

As a quick summary, after installing all required dependencies, ROOT can be compiled with these commands on most UNIX-like systems:

# The latest stable branch gets updated automatically on each release.
# You may update your local copy by issuing a git pull command from within root_src/.
$git clone --branch latest-stable https://github.com/root-project/root.git root_src$ mkdir root_build root_install && cd root_build
$cmake -DCMAKE_INSTALL_PREFIX=../root_install ../root_src # && check cmake configuration output for warnings or errors$ cmake --build . -- install -j4 # if you have 4 cores available for compilation
\$ source ../root_install/bin/thisroot.sh # or thisroot.{fish,csh}


And similarly, on Windows, inside a x86 Native Tools Command Prompt for VS 2019, ROOT can be compiled with these commands:

rem The latest-stable branch gets updated automatically on each release.
rem You may update your local copy by issuing a git pull command from within root_src.
C:\Users\username>git clone --branch latest-stable https://github.com/root-project/root.git root_src
C:\Users\username>mkdir root_build root_install && cd root_build
C:\Users\username>cmake -G"Visual Studio 16 2019" -A Win32 -Thost=x64 -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_PREFIX=../root_install ../root_src
C:\Users\username>cmake --build . --config Release --target install