Fatal error: 'atomic' file not found

I am trying to compile a simple C++ file using a hand written Makefile, but I receive

In file included from /afs/cern.ch/sw/lcg/app/releases/ROOT/6.03.04/x86_64-slc6-gcc49-opt/root/include/TObject.h:31:
/afs/cern.ch/sw/lcg/app/releases/ROOT/6.03.04/x86_64-slc6-gcc49-opt/root/include/Rtypes.h:37:10: fatal error: ‘atomic’ file not found

I am running on lxplux SLC6 and using



As mentioned on this page, you have to set-up the environment for the version of gcc used to compile ROOT. So in your case:

source /afs/cern.ch/sw/lcg/external/gcc/4.9/x86_64-slc6/setup.[c]sh
Cheers, Bertrand.

thanks a lot, but this only works if I compile the code using gcc not clang++,
if I use calng then I receive the same error

May be you can post here your “simple C++ file” and “hand written Makefile” to see if we can reproduce this issue ?

this is the Makefile

clang++ -O3 -o Validate_Protos_AfterShower root-config --libs Validate_Protos_AfterShower.o
clang++ root-config --cflags -c Validate_Protos_AfterShower.C
Validate_Protos_AfterShower.C (15.6 KB)

Fine for me on Mac:

$ make
clang++ `root-config --cflags` -c Validate_Protos_AfterShower.C
clang++ -O3 -o Validate_Protos_AfterShower `root-config --libs` Validate_Protos_AfterShower.o

Can it be that you try to use a LCG ROOT binaries compiled by “gcc++ 4.9” together with the “clang++” compiler (of unknown origin)?
Are you sure that these two compilers are “binary compatible”?

I am using lxplus SCL6

Well, the fact that you can run both compilers on your system does NOT yet mean that the object files and libraries that they produce are “binary compatible” (i.e. that you can “mix” files produced by different compilers).

I understand your point, but if it is like that then it is a weakness in the design, when I use a library I would like to keep my right in choosing the compiler