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

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


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

[  7%] Building CXX object 
src/CMakeFiles/XrdUtils.dir/XrdSys/XrdSysIOEvents.cc.o
cd 
/opt/local/var/macports/build/_Users_chris_Projects_MacPorts_ports_science_xrootd/xrootd/work/build/src 
&& /opt/local/bin/clang++-mp-3.9  -DHAVE_ATOMICS -DHAVE_CRYPT 
-DHAVE_ET_COM_ERR_H -DHAVE_GETIFADDRS -DHAVE_LIBZ -DHAVE_NAMEINFO 
-DHAVE_READLINE -DHAVE_SSL -DHAVE_STRLCPY -DHAVE_TLS1 -DHAVE_TLS11 
-DHAVE_TLS12 -DHAVE_XML2 -DHAVE_XRDCRYPTO -DLT_MODULE_EXT=\".dylib\" 
-DUSE_LIBC_SEMAPHORE=0 -DXRDPLUGIN_SOVERSION=\"4\" -DXrdUtils_EXPORTS 
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE 
-D__macos__=1 -I/opt/local/include 
-I/opt/local/var/macports/build/_Users_chris_Projects_MacPorts_ports_science_xrootd/xrootd/work/xrootd-4.7.0/src/.. 
-I/opt/local/var/macports/build/_Users_chris_Projects_MacPorts_ports_science_xrootd/xrootd/work/xrootd-4.7.0/src/. 
-I/opt/local/var/macports/build/_Users_chris_Projects_MacPorts_ports_science_xrootd/xrootd/work/xrootd-4.7.0/src 
-I/opt/local/var/macports/build/_Users_chris_Projects_MacPorts_ports_science_xrootd/xrootd/work/build/src 
-I/usr/local/include  -pipe -Os -stdlib=libstdc++ -std=c++0x 
-Wno-deprecated-declarations -DNDEBUG -arch x86_64 
-mmacosx-version-min=10.7 -fPIC   -o 
CMakeFiles/XrdUtils.dir/XrdSys/XrdSysIOEvents.cc.o -c 
/opt/local/var/macports/build/_Users_chris_Projects_MacPorts_ports_science_xrootd/xrootd/work/xrootd-4.7.0/src/XrdSys/XrdSysIOEvents.cc
In file included from 
/opt/local/var/macports/build/_Users_chris_Projects_MacPorts_ports_science_xrootd/xrootd/work/xrootd-4.7.0/src/XrdSys/XrdSysIOEvents.cc:36:
In file included from 
/opt/local/var/macports/build/_Users_chris_Projects_MacPorts_ports_science_xrootd/xrootd/work/xrootd-4.7.0/src/./XrdSys/XrdSysIOEvents.hh:38:
/opt/local/var/macports/build/_Users_chris_Projects_MacPorts_ports_science_xrootd/xrootd/work/xrootd-4.7.0/src/./XrdSys/XrdSysAtomics.hh:90:10: 
fatal error: 'atomic' file not found
#include <atomic>

Is there any way around this ? As far as I understand things (which 
could be wrong) this clang version should have support for atomics. 
Indeed the file

/opt/local/libexec/llvm-3.9/lib/c++/v1/atomic

exists, as does a number of system locations

/usr/clang-ide/lib/c++/v1/atomic
/usr/lib/c++/v1/atomic

So why is the compilation not picking it up by default. The compiler 
search paths are

  > clang++-mp-3.9 -print-search-dirs
programs: =/opt/local/libexec/llvm-3.9/bin
libraries: =/opt/local/libexec/llvm-3.9/bin/../lib/clang/3.9.1

which indeed is missing the above.

I am not though that familiar with this sort of thing. Does anyone have 
any suggestions on if this can be fixed or not ?

cheers Chris


More information about the macports-dev mailing list