Error: <atomic> is not implemented in version LLVM 5.1

I am trying to compile libcxxabi using cmake and running problems. I believe this is because I do not have a separate copy of llvm installed by llvm-config. So, I checked llvm and I'm trying to build that with cmake . I get an error message:

CMake Error at cmake/modules/HandleLLVMOptions.cmake:37 (message):
  Host Clang must be able to find libstdc++4.7 or newer!

And cmake / modules / HandleLLVMOptions.cmake: 37 is literally a block like:

check_cxx_source_compiles("
#include <atomic>
std::atomic<float> x(0.0f);
int main() { return (float)x; }"
    LLVM_NO_OLD_LIBSTDCXX)
if(NOT LLVM_NO_OLD_LIBSTDCXX)
    message(FATAL_ERROR "Host Clang must be able to find libstdc++4.7 or newer!")
endif()

and if I try to compile a 3 liner with a compiler flag -std=c++0x(which is higher in the cmake file), I get an error:

atomic.cpp:1:10: fatal error: 'atomic' file not found
#include <atomic>
         ^
1 error generated.

, ++ 11? OSX 10.8.5, 10.8.4 XCode 5.1.1, clang++ 5.1 (clang-503.0.40) ( LLVM 3.4svn). xcode , . XCode Mavericks?

+4
2

LLVM CMake.

svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
cd llvm/tools
svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
cd ../projects
svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt
cd ..
mkdir build
cd build
cmake .. -DLLVM_ENABLE_LIBCXX=ON
make
make install
+3

xCode 6.4. helloWorld , , CMake, "#error "

, CMake , ++ 11 mac... , (... if (UNIX) if (APPLE)), :

https://cmake.org/Wiki/CMake/Tutorials/C%2B%2B11Flags

...

cmake_minimum_required(VERSION 2.6)

PROJECT(Test)

if(UNIX)
    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=gnu++0x")
endif()

# MSVC does not require any special flags
0

All Articles