Macports Clang 3.9 compilation failures due to missing <atomic> include

Chris Jones jonesc at hep.phy.cam.ac.uk
Thu Sep 28 14:57:22 UTC 2017


Hi,

Thanks. In fact I tried adding

PortGroup           cxx11 1.1

but that gave me the error below. Presumably I am missiong something else ?

cheers Chris


-- Check for working CXX compiler: /opt/local/bin/clang++-mp-3.9
-- Check for working CXX compiler: /opt/local/bin/clang++-mp-3.9 -- broken
CMake Error at 
/opt/local/share/cmake-3.9/Modules/CMakeTestCXXCompiler.cmake:44 (message):
   The C++ compiler "/opt/local/bin/clang++-mp-3.9" is not able to compile a
   simple test program.

   It fails with the following output:

    Change Dir: 
/opt/local/var/macports/build/_Users_chris_Projects_MacPorts_ports_science_xrootd/xrootd/work/build/CMakeFiles/CMakeTmp



   Run Build Command:"/usr/bin/make" "cmTC_8f947/fast"

   /usr/bin/make -f CMakeFiles/cmTC_8f947.dir/build.make
   CMakeFiles/cmTC_8f947.dir/build

   Building CXX object CMakeFiles/cmTC_8f947.dir/testCXXCompiler.cxx.o

   /opt/local/bin/clang++-mp-3.9 -pipe -Os -D_GLIBCXX_USE_CXX11_ABI=0
   -stdlib=macports-libstdc++ -arch x86_64 -mmacosx-version-min=10.7 -o
   CMakeFiles/cmTC_8f947.dir/testCXXCompiler.cxx.o -c
 
/opt/local/var/macports/build/_Users_chris_Projects_MacPorts_ports_science_xrootd/xrootd/work/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx


   clang: error: invalid library name in argument 
'-stdlib=macports-libstdc++'

   make[1]: *** [CMakeFiles/cmTC_8f947.dir/testCXXCompiler.cxx.o] Error 1

   make: *** [cmTC_8f947/fast] Error 2




On 28/09/17 15:51, Mojca Miklavec wrote:
> Dear Chris,
> 
> On 28 September 2017 at 16:48, Chris Jones wrote:
>> Hi All,
>>
>> I am investigating some build failures, with port that are being built with
>> macports clang 3.9 What I am seeing is on some older systems, OSX10.(6,7,8)
>> failures like
>>
>> fatal error: 'atomic' file not found
>> #include <atomic>
>>
>> Is there any way around this?
> 
> You need to compile against libc++ (that is: with -stdlib=libc++).
> 
> Or with the "cxx11 1.1" trick.
> 
> Mojca
> 


More information about the macports-dev mailing list