Number 5 is Alive!

For Halloween, I decided to dig the good old ROOT 5 up out of its grave.
Guess what? It resurrected! Spooky, no?

This is Ubuntu 22.04 LTS / x86_64 / GCC 11.3 here.

Below you can find some notes on how to easily build the head of the v5-34-00-patches branch.

First, make sure you have a β€œcomprehensive” set of system packages installed:

sudo apt install binutils gcc g++ gfortran make cmake git curl dpkg-dev
sudo apt install libx11-dev libxpm-dev libxft-dev libxext-dev
sudo apt install libafterimage-dev libgif-dev
sudo apt install liblzma-dev liblz4-dev libxxhash-dev
sudo apt install libfftw3-dev libfftw3-mpi-dev libgsl-dev
sudo apt install libssl-dev libxml2-dev
sudo apt install mesa-common-dev freeglut3-dev libftgl-dev libglew-dev
sudo apt install python3-numpy python3-all-dev python-all-dev
# some optional packages
sudo apt install libgraphviz-dev
sudo apt install libcfitsio-dev
sudo apt install libldap-dev libkrb5-dev
sudo apt install davix-dev libprotobuf-dev
sudo apt install libavahi-compat-libdnssd-dev libavahi-core-dev
sudo apt install unixodbc-dev libpq-dev libsqlite3-dev
sudo apt install default-libmysqlclient-dev # MySQL 8.0.x

Then you can easily build ROOT β€œin-place” ... using its β€œ./configure” script:

rm -rf v5-34-00-patches
git clone --depth 1 --branch v5-34-00-patches https://github.com/root-project/root.git v5-34-00-patches
cd v5-34-00-patches
unset ROOTSYS # just a precaution
# build ... using C++11 compatible mode
./configure --enable-cxx11 --all --disable-builtin-afterimage --disable-builtin-lz4 --enable-gsl-shared --disable-memstat --enable-soversion --disable-xrootd 2>&1 | tee -a configure.out.txt
# ... or ... using C++14 compatible mode
# ./configure --enable-cxx14 --all --disable-builtin-afterimage --disable-builtin-lz4 --enable-gsl-shared --disable-memstat --enable-soversion --disable-xrootd 2>&1 | tee -a configure.out.txt
nice make -k -j$(($(nproc)+1)) 2>&1 | tee -a make.out.txt
cd ..

... or using CMake:

rm -rf v5-34-00-patches
git clone --depth 1 --branch v5-34-00-patches https://github.com/root-project/root.git v5-34-00-patches
rm -rf v5-34-00-patches-build
mkdir v5-34-00-patches-build
cd v5-34-00-patches-build
unset ROOTSYS # just a precaution
# build ... using C++11 compatible mode
cmake -Dcxx11=ON -Dall=ON -Dbuiltin_afterimage=OFF -Dbuiltin_glew=OFF -Dbuiltin_ftgl=OFF -Dgsl_shared=ON -Dmemstat=OFF -Dsoversion=ON -Dxrootd=OFF ../v5-34-00-patches 2>&1 | tee -a cmake.out.txt
# ... or ... using C++14 compatible mode
# cmake -Dcxx14=ON -Dall=ON -Dbuiltin_afterimage=OFF -Dbuiltin_glew=OFF -Dbuiltin_ftgl=OFF -Dgsl_shared=ON -Dmemstat=OFF -Dsoversion=ON -Dxrootd=OFF ../v5-34-00-patches 2>&1 | tee -a cmake.out.txt
nice cmake --build . -- -j$(($(nproc)+1)) 2>&1 | tee -a cmake.build.out.txt
cd ..

In case anything goes wrong, you have two additional β€œ*.out.txt” files to look into.

If you want to debug your code, you might like to add the β€œ--build=debug” option in the β€œ./configure” command line (β€œ-DCMAKE_BUILD_TYPE=Debug” in CMake).

If you want to rebuild your ROOT, remember to always start from a clean source code (so that no remnants of any β€œold build” are present, for example, run β€œmake distclean” or maybe better β€œmake maintainer-clean” before the new β€œ./configure” step).

Known quirks:

  • The β€œ./configure” script tries to execute the β€œpython” executable, which may not be present.
    So, if you want the β€œpython” feature enabled, execute first, e.g., β€œln -fs /usr/bin/python3 ${HOME}/bin/python” or β€œln -fs /usr/bin/python2 ${HOME}/bin/python”.
    I think one needs the β€œpython” symbolic link only when building ROOT. Afterward, one can simply explicitly call β€œpython3” (β€œpython2”) and β€œimport ROOT”.
    This problem does not exist when using CMake (and one can also explicitly use, e.g., β€œ-DPYTHON_EXECUTABLE=/usr/bin/python3” or β€œ-DPYTHON_EXECUTABLE=/usr/bin/python2”).
    Note: I do not know how good or how bad the support for a modern β€œpython3” is.

  • The β€œ./configure” script tries to execute the β€œfreetype-config” script, which is no longer provided by the new β€œlibfreetype-dev” package. As a result, it will always enable the β€œbuiltin_freetype” feature.
    This problem does not exist when using CMake.

  • When the β€œbuiltin_afterimage” feature is enabled, the β€œ./configure” script cannot find the β€œtiffio.h” file (which is actually present in the β€œ/usr/include/x86_64-linux-gnu” directory). Well, this may possibly create some problems with the TIFF graphics format support.

  • The β€œ--enable-cxx11” (β€œ-Dcxx11=ON” in CMake) or β€œ--enable-cxx14” (β€œ-Dcxx14=ON” in CMake) option is needed for compilers that default to C++17 (GCC 11 and newer).

9 Likes

Awesome, thanks!
Maybe your binaries for Ubuntu 22 could be added here? Release 53438 - ROOT

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.