You installed gcc
with Homebrew, yet the error is from clang
. That should simply mean that your default compiler still points to clang
instead of the newly installed gcc
. If you read the comments in the Makefile, you'll see the following lines:
# choice of compiler, by default use system preference.
# export CC = gcc
# export CXX = g++
# export MPICXX = mpicxx
and in your case, you don't want the system one.
Note: gcc
for the system points to clang
:
$ which gcc
/usr/bin/gcc
$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.3.0 (clang-703.0.29)
Target: x86_64-apple-darwin15.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Instead, point those variables to something in /usr/local/bin
, e.g.:
$ export CC=/usr/local/bin/gcc
and similar for the other two variables, CXX
and MPICXX
, e.g.:
$ export CC=/usr/local/bin/gcc;CXX=/usr/local/bin/g++;MPICXX=/usr/local/bin/mpicxx
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…