Specify rootcint compiler


ROOT Version: 6.06.08
Platform: Linux
Compiler: Well… hopefully g++ 4.9


Hi ROOTers. I compiled ROOT with g++4.9, but due to annoying issues with container creation, my standard /usr/bin/g++ links to g++6, and this gives me ABI problems. The easiest way for me to solve this is to define CXX=/usr/bin/g++-4.9 in my Makefiles, but this doesn’t seem to be respected by rootcint, which continues to use g++6.

Can anyone please tell me how to specify which compiler rootcint should use?

Try:

export CC=`root-config --cc`
export CXX=`root-config --cxx`
export FC=`root-config --f77`

Perhaps because ROOT was compiled with /usr/bin/g++ symlinked to g+±4.9 at the time, these output cc and g++. However, exporting CC, CXX and FC to /usr/bin/g++-4.9 seems to be ignored.

I guess you will need to rebuild your ROOT from scratch (with the new compiler).

Perhaps I didn’t explain the problem quite right: ROOT itself was built with the correct compiler. But since then, /usr/bin/g++ has changed to point to a different g++ version, and building dictionaries with rootcling uses this new, wrong version.
ROOT itself isn’t the problem, and rebuilding ROOT as-is would probably result in all of ROOT using the wrong g++ version, rather than just rootcling.

I was able to work around it by making a folder containing symbolic links from g++ to /usr/bin/g++-4.9, and placing the directory for those links at the front of my PATH environmental variable. A bit hacky, but it’ll do until we can fix the containers. :slight_smile:

Thanks for the feedback all the same.

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