Installing deal.II/Candi

reposting on the behalf of emcgowen

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.

ASPECT needs to be compiled with the same compiler that is used for compiling deal.II. If you follow the instructions at Apple ARM M1 OSX · dealii/dealii Wiki · GitHub, then you will use clang instead of GCC.
It looks like you might have switched to gcc for compiling ASPECT? Did you manually specify OMPI_CXX=g++11 for ASPECT? Try again without that.
For troubleshooting, please make sure mpicxx -v reports clang and not gcc.

This problem was fixed once I ensured that mpicxx -v reports clang, and thereafter dealii/candi and ASPECT built cleanly. I’m now working through the CIG 2020 workshop tutorials and running the cookbook models.

Thanks to everyone who helped with this.