After downloading/cloning the source (see root.cern.ch/downloading-root), I usually checkout whatever version I want to use
git checkout vX-XX-X
Change into the build/
directory (which is part of the project source for whatevery reason, but that seems not
to interfere)
cd build
Call cmake with the following additional parameters to link to the correct python version.
cmake -DCMAKE_INSTALL_PREFIX=/opt/root \
-DPYTHON_EXECUTABLE=$(which python3) \
-DPYTHON_INCLUDE_DIR=$(python3-config --prefix)/include \
-DPYTHON_LIBRARY=$(python3-config --prefix)/lib \
..
Now let the CPU do it's job
cmake --build . -- -j
Then I'll get some coffee... Do some other things... Get another coffee... And run
cmake --build . --target install
Finally make sure that you
source /opt/root/bin/thisroot.sh
before using root.
Here you go 🎉