So I am trying to compile some software using gcc under macOS 10.14.4 (Xcode 10.2) that apparently depends on c+±11 (I think) and this does not work with the homebrew version of gcc8 (8.3) that I am trying to use. My compilation breaks with the following error:
CXX StringRoutines.cpp In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/sysctl.h:83, from StringRoutines.cpp:14: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/ucred.h:94:2: error: '_Atomic' does not name a type _Atomic u_long cr_ref; /* reference count */ ^~~~~~~ make: *** [StringRoutines.o] Error 1 make: *** [install] Error 2 make: *** [build_cpptraj] Error 2 make: *** [serial] Error 2 make: *** [install] Error 2
I did some digging around and found that this issue arises from compiling GCC on macOS due to some headers or something. Apparently this should be resolved by applying this patch though this was not the case for me.
Trying to build gcc8 produces this error even after patching for me:
In file included from /usr/include/sys/sysctl.h:83, from ../../gcc/config/darwin-driver.c:30: /usr/include/sys/ucred.h:94:2: error: ‘_Atomic’ does not name a type _Atomic u_long cr_ref; /* reference count */ ^~~~~~~ make: *** [darwin-driver.o] Error 1 make: *** Waiting for unfinished jobs.... rm gcc.pod gfortran.pod make: *** [all-stage2-gcc] Error 2 make: *** [stage2-bubble] Error 2 make: *** [all] Error 2
Anyone else having any issues and potentially a solution?