C++ version in Root

Hi,
My question is, how the compiler version is tied to a root build? Generally in the past, I’ve always rebuilt root from source using the desired version of a compiler. But is it recommended that to always do this if one needed a specific compiler to work in root?

Let’s say I was using C++17 (and rebuilt root using the C++17 compatible compiler) but now need to upgrade to a compiler that has C++20 accessible, do I need to rebuild root using the C++20 compiler to take advantage of C++20 features?


Please read tips for efficient and successful posting and posting code

_ROOT Version:6.26/00
_Platform:macOS Monterey (version 12.5)
_Compiler:Apple clang version 13.1.6 (clang-1316.0.21.2.5)
Target: x86_64-apple-darwin21.6.0


Yes, the safest thing to do is to compile ROOT with the same compiler that you compile ROOT-based applications with.

In particular you must compile ROOT with the same C++ standard you will use for ROOT-based programs. Note however that ROOT currently does not support C++20. Work is in progress to improve the situation for the next release.

Cheers,
Enrico