Home | News | Documentation | Download

Install from source on macOS 11 arm64

Hi,

I’m trying to compile a (minimal) version of root (from git master) on an Apple M1 machine.

cmake ../root -Dminimal=ON -DCMAKE_INSTALL_PREFIX=$HOME/tmp -DCMAKE_CXX_STANDARD=17 -DCOCOA=ON -DCMAKE_GENERATOR=Ninja

and I get :

FAILED: graf2d/cocoa/CMakeFiles/GCocoa.dir/src/TGCocoa.mm.o
/Users/laurent/github.com/spack/spack/lib/spack/env/clang/clang++  -I/Users/laurent/github.com/root-project/root/graf2d/cocoa/inc -I/Users/laurent/github.com/root-project/root/core/macosx/inc -I/Users/laurent/github.com/root-project/root/core/unix/inc -I/Users/laurent/github.com/root-project/root/core/foundation/v7/inc -I/Users/laurent/github.com/root-project/root/core/base/v7/inc -I/Users/laurent/github.com/root-project/root/core/clingutils/inc -I/Users/laurent/github.com/root-project/root/core/textinput/inc -I/Users/laurent/github.com/root-project/root/core/thread/inc -I/Users/laurent/github.com/root-project/root/core/zip/inc -I/Users/laurent/github.com/root-project/root/core/rint/inc -I/Users/laurent/github.com/root-project/root/core/clib/inc -I/Users/laurent/github.com/root-project/root/core/meta/inc -I/Users/laurent/github.com/root-project/root/core/gui/inc -I/Users/laurent/github.com/root-project/root/core/cont/inc -I/Users/laurent/github.com/root-project/root/core/foundation/inc -I/Users/laurent/github.com/root-project/root/core/base/inc -Iginclude -I/Users/laurent/github.com/root-project/root/graf2d/quartz/inc -I/Users/laurent/github.com/root-project/root/math/mathcore/inc -I/Users/laurent/github.com/root-project/root/math/mathcore/v7/inc -I/Users/laurent/github.com/root-project/root/graf3d/gl/inc -IFREETYPE-prefix/src/FREETYPE/include -I/Users/laurent/github.com/root-project/root/gui/gui/inc -I/Users/laurent/github.com/root-project/root/graf2d/gpad/inc -I/Users/laurent/github.com/root-project/root/graf2d/graf/inc -I/Users/laurent/github.com/root-project/root/hist/hist/inc -I/Users/laurent/github.com/root-project/root/math/matrix/inc -I/Users/laurent/github.com/root-project/root/io/io/inc -std=c++17 -Wc++11-narrowing -Wsign-compare -Wsometimes-uninitialized -Wconditional-uninitialized -Wheader-guard -Warray-bounds -Wcomment -Wtautological-compare -Wstrncat-size -Wloop-analysis -Wbool-conversion -m64 -pipe -W -Wall -Woverloaded-virtual -fsigned-char -fno-common -Qunused-arguments -pthread -stdlib=libc++ -O2 -DNDEBUG -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -fPIC -ObjC++ -Wno-deprecated-declarations -std=c++17 -MD -MT graf2d/cocoa/CMakeFiles/GCocoa.dir/src/TGCocoa.mm.o -MF graf2d/cocoa/CMakeFiles/GCocoa.dir/src/TGCocoa.mm.o.d -o graf2d/cocoa/CMakeFiles/GCocoa.dir/src/TGCocoa.mm.o -c /Users/laurent/github.com/root-project/root/graf2d/cocoa/src/TGCocoa.mm
/Users/laurent/github.com/root-project/root/graf2d/cocoa/src/TGCocoa.mm:20:10: fatal error: 'TGLIncludes.h' file not found
#include "TGLIncludes.h"
         ^~~~~~~~~~~~~~~
1 error generated.
[1072/1255] Building CXX object graf2d/cocoa/CMakeFiles/GCocoa.dir/src/X11Colors.mm.o   

Did I misunderstood and Root is not yet “arm64-ready” or am I making a stupid mistake somewhere ?

Thanks,

Hi @laurent.aphecetche,
see e.g. this thread for ROOT on Apple M1: it is supported as of ROOT v6.22/06.

You don’t even have to compile it from source, you can install it e.g. via conda (it takes a few minutes with a good internet connection).

With that said, I am not sure what’s causing the compilation errors you see, it has to do with Mac Graphics, maybe @Axel or @couet have an idea.

Cheers,
Enrico

I just installed ROOT on a M1 machine using the basic procedure explained in the GitHub page. I had no problem.

Did you run xcode-select --install before starting the build?

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

When enabling cocoa, you also need to enable opengl.

The issue is now recorded at MacOS: -Dcocoa=ON -Dopengl=OFF pass cmake but fail compilation · Issue #7160 · root-project/root · GitHub