I’d need a way to query the system include path that will be used by rootcling to search for e.g. C++ standard headers. I think it’s feasible with some grep magic on libCling.so, but I’d prefer a more streamlined way. For the record, I tried root-config --cxx but it simply returns g++ so it’s of no help here.
For those needing more details: I’m using a Root package relocated from a spack build cache, but in the cache there are several packages of the GCC version I need and spack install seems to pick not the one used to compile Root.
It does not contain the GCC folder Used to compile.
To be even more clear, this is the error I get when compiling my program against Root:
[ 1%] Generating _ROOT_DICT_GSeaEvent.cxx, ../../stage/lib64/libGSeaEvent_rdict.pcm, ../../stage/lib64/libGSeaEvent.rootmap
ERROR in cling::CIFactory::createCI(): cannot extract standard library include paths!
Invoking:
LC_ALL=C /software/install/linux-x86_64_v3/gcc-15.2.0-kwwgn3pquytap7a7wkq5amjkpwudnrsr/bin/g++ -xc++ -E -v /dev/null 2>&1 | sed -n -e '/^.include/,${' -e '/^ \/.*++/p' -e '}'
Results was:
With exit code 0
I’m searching a way to retrieve gcc-15.2.0-kwwgn3pquytap7a7wkq5amjkpwudnrsr so that I can install that exact version from the spack build cache, and at the moment I’m trying to do so by retrieving the path of system include folders from which that pattern could be extracted, but it can be done also by getting the full compiler path, if it’s feasible in some way.
There is the COMPILER macro defined there, but for a spack build it refers to compiler-wrapper, not to the actual compiler.
Nevermind, with a grep I’ve been able to extract the info from libCling.so, and it seems to work, so for the moment I’m happy with this. Thanks anyway for your help!