Problem compiling ASPECT on M1 Mac

Thanks to the github discussion thread about installing Deal II/Candi, I have been able to build and test Deal II on my M1 Mac Pro running Ventura 13.2. But when I try to compile ASPECT using the same compiler environment I used to build Deal II, the World Builder files compile successfully, but then the Unity files give the error that g+±11 does not recognize the command line option -Xarch_arm64.

[ 66%] Building CXX object CMakeFiles/aspect.dir/contrib/world_builder/source/wrapper_cpp.cc.o
[ 66%] Building CXX object CMakeFiles/aspect.dir/contrib/world_builder/source/parameters.cc.o
[ 66%] Building CXX object CMakeFiles/aspect.dir/Unity/unity_37_cxx.cxx.o
[ 66%] Building CXX object CMakeFiles/aspect.dir/Unity/unity_40_cxx.cxx.o
[ 66%] Building CXX object CMakeFiles/aspect.dir/Unity/unity_39_cxx.cxx.o
[ 66%] Building CXX object CMakeFiles/aspect.dir/Unity/unity_34_cxx.cxx.o
[ 72%] Building CXX object CMakeFiles/aspect.dir/Unity/unity_35_cxx.cxx.o
[ 72%] Building CXX object CMakeFiles/aspect.dir/Unity/unity_38_cxx.cxx.o
[ 72%] Building CXX object CMakeFiles/aspect.dir/Unity/unity_41_cxx.cxx.o
[ 72%] Building CXX object CMakeFiles/aspect.dir/Unity/unity_36_cxx.cxx.o
g+±11: error: unrecognized command-line option ‘-Xarch_arm64
g+±11: error: unrecognized command-line option ‘-Xarch_arm64
g+±11: error: unrecognized command-line option ‘-Xarch_arm64
g+±11: error: unrecognized command-line option ‘-Xarch_arm64
make[2]: *** [CMakeFiles/aspect.dir/Unity/unity_34_cxx.cxx.o] Error 1
make[2]: *** Waiting for unfinished jobs…
make[2]: *** [CMakeFiles/aspect.dir/Unity/unity_36_cxx.cxx.o] Error 1
make[2]: *** [CMakeFiles/aspect.dir/Unity/unity_35_cxx.cxx.o] Error 1
make[2]: *** [CMakeFiles/aspect.dir/Unity/unity_41_cxx.cxx.o] Error 1
g+±11: error: unrecognized command-line option ‘-Xarch_arm64
g+±11: error: unrecognized command-line option ‘-Xarch_arm64
make[2]: *** [CMakeFiles/aspect.dir/Unity/unity_37_cxx.cxx.o] Error 1
make[2]: *** [CMakeFiles/aspect.dir/Unity/unity_40_cxx.cxx.o] Error 1
g+±11: error: unrecognized command-line option ‘-Xarch_arm64
make[2]: *** [CMakeFiles/aspect.dir/Unity/unity_38_cxx.cxx.o] Error 1
g+±11: error: unrecognized command-line option ‘-Xarch_arm64
make[2]: *** [CMakeFiles/aspect.dir/Unity/unity_39_cxx.cxx.o] Error 1
make[1]: *** [CMakeFiles/aspect.dir/all] Error 2
make: *** [all] Error 2

My compiler environment is:

FC=mpifort
FF=mpifort
OMPI_FC=gfortran-11
CC=mpicc
CXX=mpicxx
OMPI_CC=gcc-11
OMPI_CXX=g+±11

The non-native compilers were installed with homebrew per the instructions for building Deal II.
I’ve tried building both top-of-trunk ASPECT and ASPECT 2.4.0 with the same results.

Any help would be appreciated.

This problem was resolved with the help of Bob Myhill. Homebrew had installed gnu compilers for my mpicc and mpicxx, which needed to be redirected to the native Apple clang compiler.

1 Like

For others coming here for help, please see MacOS ARM build is broken · Issue #309 · dealii/candi · GitHub