-
Notifications
You must be signed in to change notification settings - Fork 4
Building groot
This page describes the current known-good build path for groot.
groot is a ROOT-based C++ application and currently builds against a custom
CERN ROOT installation. Building against package-manager ROOT installations,
such as Homebrew or apt ROOT, is a project goal but has not yet been verified.
Known requirements:
- CERN ROOT with GUI support
- CMake 3.13 or newer
- A C++ compiler compatible with the ROOT build
- Make or another CMake-supported build tool
groot uses ROOT histograms, canvases, fitting, I/O, GUI widgets, and ROOT
dictionary generation. The ROOT installation must include the corresponding
components.
Useful ROOT checks:
root-config --version
root-config --features
root-config --cflags
root-config --libs
root-config --cmakedirSource the ROOT environment first:
source /path/to/root/bin/thisroot.shThen build from the top-level groot directory:
makeThe default make target:
- configures CMake in
build/ - builds the project
- copies the executable into
bin/
After a successful build, run:
./bin/grootTo start the GUI with a ROOT file:
./bin/groot -g data.rootYou can also call CMake directly:
cmake -S . -B build
cmake --build build -j4If CMake cannot find ROOT, explicitly pass ROOT's CMake package directory:
cmake -S . -B build -DROOT_DIR="$(root-config --cmakedir)"
cmake --build build -j4On macOS, the makefile also has an Xcode generator target:
make xcodeThis configures the project in build_xcode/ using CMake's Xcode generator.
To remove local build products created by the makefile:
make cleanThen rebuild:
makeThe project is intended to eventually build against externally packaged ROOT installations, but this path is not yet confirmed.
Examples of package-manager ROOT installs include:
- Homebrew ROOT on macOS
- apt ROOT on Ubuntu or WSL, where available
- distro-provided ROOT packages on Linux
Until this is verified, do not assume these installs work without CMake or source changes.
When testing a packaged ROOT build, record:
- operating system and version
- CPU architecture
- ROOT version
- how ROOT was installed
- output from
root-config --features - CMake configure command
- first compiler or linker error
Check whether ROOT is active in the shell:
which root-config
root-config --version
root-config --cmakedirThen configure with:
cmake -S . -B build -DROOT_DIR="$(root-config --cmakedir)"groot depends on ROOT GUI classes such as canvases and TG* widgets. If the
build fails on missing GUI headers or symbols, the ROOT installation may not
include GUI support or its GUI dependencies may be missing.
Check:
root-config --features
root-config --libsThe compiler used for groot should be compatible with the compiler and C++
standard used to build ROOT. If the build fails inside ROOT headers or Cling
dictionary generation, check:
root-config --cflagsand compare that with the compiler selected by CMake.
If ROOT paths or compiler settings have changed, remove the build directory and configure again:
make clean
makeor:
rm -rf build
cmake -S . -B build
cmake --build build -j4