Has anyone had any luck with compiling ROOT on Apple M1? I am getting issues with AfterImage and FreeType, where basically the configure steps are failing because they don’t recognise arch=arm64. This is the error for AfterImage, and it is basically the same error when trying to build the builtin FreeType. I can’t not use the builtin freetype as it’s for some reason needed for building a Cocoa app. Similarly I can’t find an up to date libAfterImage anywhere.
CMake Error at /Users/stuartwalker/repos/root/build/AFTERIMAGE-prefix/src/AFTERIMAGE-stamp/AFTERIMAGE-configure-Release.cmake:49 (message): Command failed: 1 './configure' '--prefix' '/Users/stuartwalker/repos/root/build' '--libdir=/Users/stuartwalker/repos/root/build/lib' '--with-ttf' '--with-ttf-includes=-I/Users/stuartwalker/repos/root/build/FREETYPE-prefix/src/FREETYPE/include' '--with-afterbase=no' '--without-svg' '--disable-glx' '--with-builtin-ungif' '--with-jpeg' '--without-x' '--with-builtin-jpeg' '--with-png' '--with-builtin-png' '--with-tiff=no' 'CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc' 'CFLAGS= -DHAVE_FREETYPE_FREETYPE -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk' See also /Users/stuartwalker/repos/root/build/AFTERIMAGE-prefix/src/AFTERIMAGE-stamp/AFTERIMAGE-configure-*.log
The contents of the referenced log file:
Invalid configuration `arm64-apple-darwin20.3.0': machine `arm64-apple' not recognized configure: error: /bin/sh ./config.sub arm64-apple-darwin20.3.0 failed
The problem is obvious. I tried some hacky fixes (like providing a more up to date FreeType and updating config.sub in libAfterImage to recognise arm64) which seems to work to first order, but then I get a linker error later on. The linker error:
Undefined symbols for architecture arm64: "_BrotliDecoderDecompress", referenced from: _woff2_open_font in libfreetype.a(sfnt.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [graf3d/ftgl/CMakeFiles/FTGL.dir/build.make:424: lib/libFTGL.so] Error 1 make: Target 'graf3d/ftgl/CMakeFiles/FTGL.dir/build' not remade because of errors. make: *** [CMakeFiles/Makefile2:24412: graf3d/ftgl/CMakeFiles/FTGL.dir/all] Error 2
which I truly do not understand at all.
You may say: try installing with conda instead, but this is simply not an option for me as I get errors with LLVM in a downstream dependent on ROOT. My only choice is to compile ROOT, which I’ve done many times over the years, and is mostly not a problem other than being quite slow.
What is baffling is that I managed to get ROOT to compile having set only a single flag, that of tbb=OFF a few days ago, but today needed to recompile and now it is impossible.
Has anyone here managed to get it to compile? Are there any special commands or settings one must set for arm64/apple silicon?
Thank you for your help, I am losing my mind here…
ROOT Version: 6.22.08
Platform: MacOS Big Sur Apple M1
Compiler: Apple clang version 12.0.0 (clang-1184.108.40.206), Target: arm64-apple-darwin20.3.0