# Problem compiling ASPECT on M1 Mac

**URL:** <https://community.geodynamics.org/t/problem-compiling-aspect-on-m1-mac/2798>\
**Category:** ASPECT\
**Created:** [February 5, 2023, 4:33am UTC](https://community.geodynamics.org/t/problem-compiling-aspect-on-m1-mac/2798 "2023-02-05T04:33:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![emcgowen](https://avatars.discourse-cdn.com/v4/letter/e/82dd89/32.png) [@emcgowen](https://community.geodynamics.org/u/emcgowen)\
**Post date:** [February 5, 2023, 4:33am UTC](https://community.geodynamics.org/t/problem-compiling-aspect-on-m1-mac/2798/1 "2023-02-05T04:33:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![emcgowen](https://avatars.discourse-cdn.com/v4/letter/e/82dd89/32.png) [@emcgowen](https://community.geodynamics.org/u/emcgowen)\
**Post date:** [February 8, 2023, 2:02am UTC](https://community.geodynamics.org/t/problem-compiling-aspect-on-m1-mac/2798/2 "2023-02-08T02:02:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![bobmyhill](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/bobmyhill/32/38_2.png) [@bobmyhill](https://community.geodynamics.org/u/bobmyhill)\
**Post date:** [February 8, 2023, 12:01pm UTC](https://community.geodynamics.org/t/problem-compiling-aspect-on-m1-mac/2798/3 "2023-02-08T12:01:41Z")

</div>

For others coming here for help, please see [MacOS ARM build is broken · Issue #309 · dealii/candi · GitHub](https://github.com/dealii/candi/issues/309)
