How to build & install ROOT from source without sudo

I recommend this to install ROOT into $HOME/usr. It is based closely on the official docs on how to build ROOT from source.

If you have no suitable Python available, you might want to use

-Dpyroot=OFF -Dpyroot_experimental=OFF

for the first cmake command.

git clone –branch v6-25-02 –depth=1 https://github.com/root-project/root.git root_src

git clone --branch latest-stable --depth=1 https://github.com/root-project/root.git root_src
mkdir root_build && cd root_build
cmake  -DCMAKE_INSTALL_PREFIX=$HOME/usr ../root_src
cmake --build . -- install -j$(nproc)

Then add to your ~/.bashrc or similar:

source $HOME/usr/bin/thisroot.sh