Re: [AMBER] New compile-issue macOS, CPPTRAJ

From: Daniel Roe <>
Date: Mon, 1 Apr 2019 11:18:46 -0400


On Mon, Apr 1, 2019 at 8:04 AM Gustaf Olsson <> wrote:
> 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[4]: *** [StringRoutines.o] Error 1
> make[3]: *** [install] Error 2
> make[2]: *** [build_cpptraj] Error 2
> make[1]: *** [serial] Error 2
> make: *** [install] Error 2
> This is seemingly an issue with CPPTRAJ that does not show up when compiling using clang so I am assuming this is somehow related to gcc. Now, I know that macOS does not make it easy compiling though I am curious why something would be sourced from the Xcode CLT when not using the apple compiler.

This actually appears to be the result of Apple mucking with header
files and is GNU/C++ specific on Mojave; see
I'm not sure what the proper workaround is; maybe disabling C++11 for
cpptraj? Can you try configuring cpptraj standalone (either via
$AMBERHOME/AmberTools/src/cpptraj or via the GitHub version) with

> Trying to build from git, I get a NetCDF test error:
> Checking NetCDF:
> Test compile failed: g++ -Wall -O3 -std=gnu++11 -o testp testp.cpp -lnetcdf
> Error follows:
> testp.cpp:2:10: fatal error: netcdf.h: No such file or directory
> #include "netcdf.h"

This seems like you're using the standalone cpptraj configure from
inside AmberTools maybe? If so, you should execute it the same way
$AMBERHOME/AmberTools/src/configure2 does, specifying
'--with-netcdf=$AMBERHOME' etc so it knows where to get NetCDF etc
(search for 'Configure CPPTRAJ' in configure2).


AMBER mailing list
Received on Mon Apr 01 2019 - 08:30:03 PDT
Custom Search