Installing ROOT 6.22.08 on Apple Silicon (arm64) AfterImage, FreeType issues and a linker error

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[2]: *** [graf3d/ftgl/CMakeFiles/FTGL.dir/build.make:424: lib/libFTGL.so] Error 1
make[2]: Target 'graf3d/ftgl/CMakeFiles/FTGL.dir/build' not remade because of errors.
make[1]: *** [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-1200.0.32.29), Target: arm64-apple-darwin20.3.0


It might be that your parent process (terminal, CMake - whatever) is using the Rosetta mechanism - which causes all child processes to be amd64. Maybe _BrotliDecoderDecompress was built with amd64, and then later on other .o-s were built with arm64? Just guessing.

For M1, I’d vividly recommend to use the tip of v6-24-00-patches, or download the nightly binary https://root.cern/download/nightly/root_v6.24.99.macos-11.1-arm64-clang120.pkg This contains are a couple of crucial M1 fixes not available in 6.22/08 yet.

(And yes, we build and test on M1 on a nightly basis.)

OK I will try this out. On a tangent, why are these downloads currently so slow? I’ve been downloading and trying out various versions of root over the past few days and I’m currently seeing 11kB/s download speeds. I saw similar speeds all weekend.

This just makes me feel sad.

Is there a mirror for this download? CERN downloads just seem impossibly slow at the moment.

Hi @sdwalker ,
sorry for the delay. I don’t think there are mirrors, but the upload bandwidth of the server seems ok at the moment, I can download that file at 3 MB/s with my connection.

Let us know if 6.24 is working out for you! It is getting officially released as I type.

Cheers,
Enrico

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.