ROOT 6 atomic error

Hi ROOTers,

I seem to be running into a problem whenever I try to run CMake to compile any of my macros. Below is some background information:

  1. I am running OSX 10.9.5 and downloaded the ROOT 6.02/00 source using git.

  2. I configured ROOT using ./configure --all. This version of ROOT was successfully installed and configured on my computer

  3. On my Mac I have CMake version 3.0.0

  4. In the CMakeLists.txt file in both my project directory and the project src directory I include the following lines:

include_directories(/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include /Users/alexclifton/ROOT/root/include /usr/include)

link_directories(/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib /Users/alexclifton/ROOT/root/lib /usr/lib)

Whenever I try to compile ANY macro in my src directory, I get errors at compile time like:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/atomic:539:2: error: <atomic> is not implemented

/Users/alexclifton/ROOT/root/include/Rtypes.h:217:14: error: no type named 'atomic' in namespace 'std'

/Users/alexclifton/ROOT/root/include/Rtypes.h:217:20: error: expected unqualified-id

/Users/alexclifton/ROOT/root/include/TStorage.h:82:4: error: unknown type name 'atomic_TClass_ptr'

/Users/alexclifton/ROOT/root/include/TObject.h:214:4: error: unknown type name 'atomic_TClass_ptr'

and so on. It seems to have to do with this piece of software called “atomic” but I am not sure how to correct these errors. Does anyone have any suggestions? I can provide the entire output at compile time in addition to attaching my CMakeLists.txt files as well. Thanks in advance.

Hi,

Update XCode, in a terminal run xcode-select --install

Does that help?

Cheers, Axel.

Hi Axel,

No it does not. I still get the same errors.

I have still been unable to find a solution to this issue, so I decided to go back to basics. I wrote a “Hello World” piece of code:

[code]#include
using namespace std;

int main(int argc, char *argv[]){
std::cout<<“HELLO WORLD!”<<std::endl;
return 0;
}
[/code]

and was able to compile and run the code just fine. Out of curiosity, I just included the ROOT header file TH1.h into the code:

[code]#include
#include <TH1.h>

using namespace std;

int main(int argc, char *argv[]){
std::cout<<“HELLO WORLD!”<<std::endl;
return 0;
}
[/code]

Including the TH1.h header file produces the following errors which I have attached to this post. It again seems to be coming from atomic, but I am not sure how to correct for this. Both of my CMakeLists.txt files (one in the project directory the other in the project src directory) have the following lines in them:

[code]include_directories(/usr/include /usr/local/include /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include /Users/alexclifton/ROOT/root/include /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1)

link_directories(/usr/lib /usr/local/lib /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib /Users/alexclifton/ROOT/root/lib /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib)
[/code]

so, I assume that I am linking everything correctly but perhaps this is not the case. Any feedback is much appreciated.
fullout.txt (11.7 KB)

Hi,

What does clang --version say? Did you build clang yourself? The output should be

$ /usr/bin/clang --version
Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix

Cheers, Axel.

It says exactly that:

/usr/bin$ clang --version Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn) Target: x86_64-apple-darwin13.4.0 Thread model: posix

Hi,

Okay, then the problem is with

You

  • must - on any current MacOSX without extra provisions (homebrew etc) - use clang as compiler; GCC is not available anymore;
  • must enable c++11;
  • should not pass the include paths pointing to the compiler’s standard library (it knows that itself); the need for this is a symptom that something fundamental is broken.

You might want to use ACLiC: .L MyCode.C+ (note the ‘+’ at the end) which does all these things automatically: calls the right compiler with the right flags and loads the resulting shared library into ROOT.

Cheers, Axel.

Dear Alex,
I am having the same issue when compiling another library WAT.
I do not understand how you implement the changes you propose. I real not an expert with env variables.Could you be more explicit?

I am using macos10.10 and root 6

Thank you,
Filipe

Hi,

That depends on the build system of this library, and as that’s not ROOT I’m afraid I won’t be of much help…

Cheers, Axel.

Hello,

I can’t seem to compile an example program in geant4 that uses root because of:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/…/include/c++/v1/atomic:539:2: error: is not implemented
#error is not implemented

Not sure how to overcome this.

Hi,

Where is that code? That’s not the complete error message - could you please provide it?

What MacOS X version is that, which xcode version and what does clang --version state?

Which version of ROOT do you use?

Cheers, Axel.