Can not deduce ROOT's C++ version from build flags

Hi all,

I am installing Allpix Squared on Ubuntu 22.04 LTS and I am having troubles having Allpix recognizing the C++ version of ROOT, even though I have thoroughly followed the steps in the installation guide.
I have followed the installation guide installing ROOT (version 6.32.00), GEANT4 (version 11.2.1), and of course the prerequisites for each, including LCIO, Xerces, and HEPMC3, with all passing the built in tests where applicable.

When trying to run “cmake …” when configuring during the allpix installation part, I get the following output:

CMake Error at CMakeLists.txt:200 (MESSAGE):
Could not deduce ROOT’s C++ version from build flags: -pipe -fsigned-char

and when looking at CMakeLists.txt line 200, it is (of course) the check for which C++ version ROOT is build with. But to me it should find it since when running “root-config -cflags” I get

-pthread -std=c++17 -m64 -I/home/usr/Documents/allpix/ROOT/root_install/include

and when running “root-config --cxxstandard” and “root-config --cxx” I get “17” and “c++” respectively.
It seems as if it only reads the first “-pthread” and not the second one that is relevat.

Any help is appreciated, and let me know if additional information is needed.

Thanks in advance.

I will give an answer here myself:
The problem as described was that allpix squared couldn’t deduce ROOTs C++ version. The solution, or a solution, was to append a compiler flag manually according to:

This solved the problem of building allpix, but if this is not recommended or if there is a better solution, please let me know!

Hi @rickard ,

Sorry for the slow response. This indeed seems to be an issue induced by a change in the way flags are set by root. There is a fix underway: fix: CMakeLists.txt unable to check ROOT C++compiled version by mmdonatti · Pull Request #49 · allpix-squared/allpix-squared · GitHub

Your solution however is also correct and should work for now.


Dear @simonspa

Thank you for the reply, good to know I didn’t break anything.