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

**URL:** <https://root-forum.cern.ch/t/installing-root-6-22-08-on-apple-silicon-arm64-afterimage-freetype-issues-and-a-linker-error/44364>\
**Category:** ROOT\
**Created:** [April 11, 2021, 10:40am UTC](https://root-forum.cern.ch/t/installing-root-6-22-08-on-apple-silicon-arm64-afterimage-freetype-issues-and-a-linker-error/44364 "2021-04-11T10:40:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sdwalker](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/sdwalker/32/29151_2.png) [@sdwalker](https://root-forum.cern.ch/u/sdwalker)\
**Post date:** [April 11, 2021, 10:40am UTC](https://root-forum.cern.ch/t/installing-root-6-22-08-on-apple-silicon-arm64-afterimage-freetype-issues-and-a-linker-error/44364/1 "2021-04-11T10:40:30Z")

</div>

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.

```auto
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:

```auto
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:

```auto
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

* * *

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [April 12, 2021, 1:35pm UTC](https://root-forum.cern.ch/t/installing-root-6-22-08-on-apple-silicon-arm64-afterimage-freetype-issues-and-a-linker-error/44364/2 "2021-04-12T13:35:27Z")

</div>

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](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.)

---

<div class="post-metadata">

**Author:** ![sdwalker](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/sdwalker/32/29151_2.png) [@sdwalker](https://root-forum.cern.ch/u/sdwalker)\
**Post date:** [April 12, 2021, 4:14pm UTC](https://root-forum.cern.ch/t/installing-root-6-22-08-on-apple-silicon-arm64-afterimage-freetype-issues-and-a-linker-error/44364/3 "2021-04-12T16:14:38Z")

</div>

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.

 ![Screenshot 2021-04-12 at 18.51.28](https://root-forum.cern.ch/uploads/default/original/3X/7/0/7029ef42c0c40066955218774f502c6a64ce3c52.png)

This just makes me feel sad.

---

<div class="post-metadata">

**Author:** ![sdwalker](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/sdwalker/32/29151_2.png) [@sdwalker](https://root-forum.cern.ch/u/sdwalker)\
**Post date:** [April 12, 2021, 7:09pm UTC](https://root-forum.cern.ch/t/installing-root-6-22-08-on-apple-silicon-arm64-afterimage-freetype-issues-and-a-linker-error/44364/4 "2021-04-12T19:09:47Z")

</div>

![Screenshot 2021-04-12 at 21.09.13](https://root-forum.cern.ch/uploads/default/original/3X/0/6/064a7b052ad3e0982c77cab5085972574cb59002.png)

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

---

<div class="post-metadata">

**Author:** ![eguiraud](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/eguiraud/32/32217_2.png) [@eguiraud](https://root-forum.cern.ch/u/eguiraud)\
**Post date:** [April 15, 2021, 7:53am UTC](https://root-forum.cern.ch/t/installing-root-6-22-08-on-apple-silicon-arm64-afterimage-freetype-issues-and-a-linker-error/44364/5 "2021-04-15T07:53:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [April 29, 2021, 7:53am UTC](https://root-forum.cern.ch/t/installing-root-6-22-08-on-apple-silicon-arm64-afterimage-freetype-issues-and-a-linker-error/44364/6 "2021-04-29T07:53:54Z")

</div>

Closed on April 29, 2021, 7:53am UTC

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