ACLiC <atomic> not working in v5-34-21 but v6-00-02

Hi!

Compiling a macro with ACLiC using fails with root v5-34-21 or v5-34-18 but succeeds with v6-00-02. I’m on a Mac OSX 10.9.5 with clang 6.0

Below a demo script and output from v5-34-21 and v6-00-02.

Is this a bug in v5-34-21 or do I have to do sth special to get this running on v5-34-21? Should I submit a Jira ticket? My root-config --features shows thread support and the cxx11 and libcxx switched on for v5-34-21.

The succeeding check my that triggers the error is
#if !__has_feature(cxx_atomic)
#error is not implemented
#else

Regards,
Hans

– macro AtomicDemo.C –
#if !defined(CINT) || defined(MAKECINT)
#include
#include
#endif

void AtomicDemo(){
std::atomic myAtomic;

myAtomic=5;
printf(“Great! Using atomic works %d\n”,myAtomic.load());

}

– output from v6-00-02 –
pcikf142:CbmMoni hbeck$ root -l AtomicDemo.C+
root [0]
Processing AtomicDemo.C+…
Info in TMacOSXSystem::ACLiC: creating shared library /Users/hbeck/CbmMoni/./AtomicDemo_C.so
Great! Using atomic works 5
root [1]

– output from v5-34-21 –
pcikf142:CbmMoni hbeck$ root -l AtomicDemo.C++
root [0]
Processing AtomicDemo.C++…
Info in TMacOSXSystem::ACLiC: creating shared library /Users/hbeck/CbmMoni/./AtomicDemo_C.so
In file included from /var/tmp/tmp.0.QDAivR_cint.cxx:1:
In file included from /var/tmp//rootcint_qKIG8O.h:3:
In file included from /Users/hbeck/CbmMoni/./AtomicDemo.C:2:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/…/include/c++/v1/atomic:539:2: error:
is not implemented
#error is not implemented
^
1 error generated.
Error: external preprocessing failed. :0:
!!!Removing /Users/hbeck/CbmMoni/AtomicDemo_C_ACLiC_dict.cxx /Users/hbeck/CbmMoni/AtomicDemo_C_ACLiC_dict.h !!!
Error: /opt/alice/root/v5-34-21/bin/rootcint: error loading headers…
Error in : Dictionary generation failed!
Info in : Invoking compiler to check macro’s validity
Info in : The compiler has not found any problem with your macro.
Probably your macro uses something rootcint can’t parse.
Check root.cern.ch/viewvc/branches/v5- … mitati.txt for Cint’s limitations.
Error: Function AtomicDemo() is not defined in current scope :0:
*** Interpreter error recovered ***
root [1]

I found a few other std:: headers that get messed up with ROOT 5. Here’s my old post: Functions called tuple and array

My workaround using ROOT5 is to compile separately using g++/clang++ instead of ACLiC.

Jean-François

Dear Jean-François,

Thanks for the link and your workaround! I wanted to avoid invoking clang directly as the program is supposed to be used by bachelor students. They are more familiar with running

than

The problem with the header also seems a bit different from your tuple() issue. But you’re right that the check in the

could easily fail when wrapped in some namespace.

Good point to have a look at the rootcint generated file! How can I see the created rootcint output /var/tmp/tmp.0.fsVsL5_cint.cxx and /var/tmp//rootcint_MCaeOT.h in the example below?

hbeck$ rootcint -v4 -f Parsed.C -c -p AtomicDemo.C In file included from /var/tmp/tmp.0.fsVsL5_cint.cxx:1: In file included from /var/tmp//rootcint_MCaeOT.h:3: In file included from ./AtomicDemo.C:2: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/atomic:539:2: error: <atomic> is not implemented #error <atomic> is not implemented ^ 1 error generated. Error: external preprocessing failed. :0: !!!Removing Parsed.C Parsed.h !!! Error: rootcint: error loading headers...

Thanks, regards,
Hans