Developing ROOT requires being able to build the project from source and knowing which components to configure depending on one's needs. See the following sections to set up your coding environment with ROOT.
ROOT depends on other libraries, some of them are necessary also in the build process. You can find a list dependencies on our website. Follow the instructions to install the dependencies on your system.
There are also some Python optional runtime dependencies which are nonetheless useful in a development environment. You can find them listed in requirements.txt.
The ROOT source code is built via CMake. Usually in a
development environment one would need a build of ROOT with debug symbols, i.e.
-DCMAKE_BUILD_TYPE=RelWithDebInfo
or -DCMAKE_BUILD_TYPE=Debug
. Detailed
instructions on how to build ROOT from source are available on our website.
Detailed instructions are available in the document step_by_step_instructions.md which is a walkthrough of all the steps required to build ROOT and things to look out for.
Alternatively, an automated Python build script is available. This can help you streamline the building process:
$: python launch_build.py -h
usage: launch_build.py [-h] [-j NJOBS] [-n NAME] (-m {default,debug,relwithdebinfo} | -c [CONFIG ...])
optional arguments:
-h, --help show this help message and exit
-j NJOBS As in 'cmake -jNJOBS'
-n NAME The name of this build. If specified, it takes precedence over the automatic choice for a name
CMake configuration [required]:
The 'mode' option allows to choose one of the predefined CMake configuration strings. Otherwise, specify a custom string via the 'config' option
-m {default,debug,relwithdebinfo}
One of the predefined CMake configuration modes
-c [CONFIG ...] Custom list of CMake options. Specify this option with an equal sign and quoted, as in:'-c="-DOpt1=ON -DOpt2=OFF"'
It creates the following directories in the current working directory:
- rootsrc/
- roottest/
- rootbuild/
- rootinstall/
rootsrc
is the directory where the ROOT source resides. If not already present, it will be downloaded.roottest
is the directory where the separate testing repository roottest source resides. If not already present, it will be downloaded.rootbuild
androotinstall
store respectively build and install directories produced by CMake. Every time thelaunch_build.py
script is launched, it creates two separate sub-directories for the current build and installation, for example:- rootbuild/ --> build1/ --> build2/ - rootinstall/ --> install1/ --> install2/
The script launches a CMake build with the appropriate flags, depending on
either one of the already available modes (see the m
option) or the flags
passed via the c
option. For example:
$: python launch_build.py -m relwithdebinfo
$: python launch_build.py -n mybuild -c="-Dminimal=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo"
To set up ROOT in the environment use the command:
$ source <installdir>/bin/thisroot.sh