Xcode 13, CLT for Xcode 13 give problems to compile

Hi Everyone,

Recently I Change to a Mac M1 giving problems for root installations, finally, I install XCode 13 and the command line tools for XCode 13 following these steps:

git clone --branch v6-22-00-patches https://github.com/root-project/root.git root_src`
mkdir root_build root_install && cd root_build
cmake -DCMAKE_INSTALL_PREFIX=…/root_install …/root_src -Dimt=OFF -Dbuiltin_tbb=OFF # because Intel’s TBB still does not work out of the box
cmake --build . – install -j6 # if you have 6 cores available for the compilation

I able to run root, open the TBrowser(), but when I want to compile a code that works before all of thes I obtain:

ld: library not found for -lCoreEntitlements

clang: error: linker command failed with exit code 1 (use -v to see invocation)

Error in : Executing ‘cd “/Users/nicoviaux/Downloads/PseudoMassZmumuMC-InvMass-InvEta-InvPt” ; c++ -fPIC -c -O3 -DNDEBUG -std=c++11 -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 -Woverloaded-virtual -fsigned-char -fno-common -Qunused-arguments -pthread -stdlib=libc++ -I$ROOTSYS/include -isysroot “/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/” -I"/Users/nicoviaux/Downloads/root_build/etc/" -I"/Users/nicoviaux/Downloads/root_build/etc//cling" -I"/Users/nicoviaux/Downloads/root_build/include/" -I"/Users/nicoviaux/Downloads/root_build/include" -D__ACLIC__ “/Users/nicoviaux/Downloads/PseudoMassZmumuMC-InvMass-InvEta-InvPt/PhiCS_C_ACLiC_dict.cxx” ; c++ -O3 -DNDEBUG “/Users/nicoviaux/Downloads/PseudoMassZmumuMC-InvMass-InvEta-InvPt/PhiCS_C_ACLiC_dict.o” -dynamiclib -Wl,-headerpad_max_install_names -m64 -single_module -Wl,-dead_strip_dylibs -undefined dynamic_lookup “/opt/homebrew/Cellar/zstd/1.5.2/lib/libzstd.1.dylib” “/opt/homebrew/Cellar/lz4/1.9.3/lib/liblz4.1.dylib” “/Users/nicoviaux/Downloads/root_build/lib/libRint.so” “/Users/nicoviaux/Downloads/root_build/lib/libCore.so” “/opt/homebrew/Cellar/lz4/1.9.3/lib/liblz4.1.9.3.dylib” “/opt/homebrew/Cellar/zstd/1.5.2/lib/libzstd.1.5.2.dylib” “-lpcre.0” “-llzma.5” “-lz.1” “-lfakelink” “-lapple_nghttp2” “-lnetwork” “-lsqlite3” “-lenergytrace” “-lCoreEntitlements” “-lMobileGestalt” “-lcoretls” “-lcoretls_cfhelpers” “-lxar.1” “-lcompression” “-larchive.2” “-lxml2.2” “-lpcap.A” “-ldns_services” “-lbz2.1.0” “-liconv.2” “-lcharset.1” “-lCheckFix” “-lmecabra” “-lmecab” “-lgermantok” “-lThaiTokenizer” “-lChineseTokenizer” “-lcmph” “-lutil” “-lapp_launch_measurement” “-lxslt.1” “-lspindump” “-late” “-lexpat.1” “-lAudioStatistics” “-lSMC” “-lperfcheck” “-lmis” “-lIOReport” “-lheimdal-asn1” “/Users/nicoviaux/Downloads/root_build/lib/libRIO.so” “/Users/nicoviaux/Downloads/root_build/lib/libThread.so” “/Users/nicoviaux/Downloads/root_build/lib/libCling.so” “-lncurses.5.4” “/Users/nicoviaux/Downloads/root_build/lib/libMathCore.so” “-lsandbox.1” “-lCoreStorage” “-lcsfde” “-lMatch.1” -o “/Users/nicoviaux/Downloads/PseudoMassZmumuMC-InvMass-InvEta-InvPt/./PhiCS_C.so”’ failed!

Does someone have a clue?

Best

Nicolás V.

Hi Nicolás,

ROOT 6.22 doesn’t work on M1. Unless you really need to build yourself, just grab a nightly build from Index of /download/nightly

If you want to build yourself, consider taking the tip of v6-26-00-patches which should work perfectly well on M1. (We are about to release v6.26/00.)

Cheers, Axel

Hi Alex,

Ok, but with which version of XCode and the command lines tools? I tried with the las version of XCode and Root, but the same issue.

Best and many thanks.

Nicolás V.

Hi,

The fix you’re after is in v6-26-00-patches.

I’m still not sure you really need to build ROOT yourself; taking the binary from the nightlies might be 1000x quicker :slight_smile:

Cheers, Axel

Hi Axel,

Ok so I install the last Xcode version, and I will use “root_v6.27.01.macos-10.15-x86_64-clang120.pkg”

If I have built previously, I suppose that I need to delete de .pcm files where are specifically those ones in mac?

Many thanks.

Nicolas V.

You can simply remove your ROOT install directory - that also removes the PCM files.

Ok, I am trying to download the root from here:

https://root.cern/download/nightly/?C=M;O=D

But after a while, it says that the download is canceled…

Best

Nicolás

Can you try on the terminal with curl -L -O ...? Which exact file did you try to download / what’s the URL?

Never mind, I can reproduce this!

https://root.cern/download/nightly/root_v6.27.01.macos-10.15-x86_64-clang120.pkg

Yeah and no I cannot reproduce this - once I fixed my out of disk space issue :sweat_smile: Does it still not work for you? Does curl -L -O https://root.cern/download/nightly/root_v6.27.01.macos-10.15-x86_64-clang120.pkg work?

Aparently for safary I can download “root_v6.26.99.macos-10.15-x86_64-clang120.pkg” now I am downloading and installing Xcode. to the install root, let you know

instaling the .pkg , and writing root on the coommand line I obtain:

nicoviaux@Nicolass-MacBook-Pro /Applications % root

input_line_1:1:2: error: module ‘Darwin’ uses additional module map ‘/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/mach_debug.modulemap’ used when the module was built

#include

^

input_line_1:1:2: note: imported by module ‘std’ in ‘/Applications/root_v6.26.99/lib/std.pcm’

Warning in cling::IncrementalParser::CheckABICompatibility():

Failed to extract C++ standard library version.

Warning in cling::IncrementalParser::CheckABICompatibility():

Possible C++ standard library mismatch, compiled with _LIBCPP_ABI_VERSION ‘1’

Extraction of runtime standard library version was: ‘’

input_line_2:1:2: fatal error: module file ‘/Applications/root_v6.26.99/lib/std.pcm’ is out of date and needs to be rebuilt

#include “cling/Interpreter/RuntimeUniverse.h”

^

input_line_2:1:2: note: imported by module ‘Cling_Runtime_Extra’ in ‘/Applications/root_v6.26.99/lib/Cling_Runtime_Extra.pcm’

input_line_2:1:2: note: imported by module ‘Cling_Runtime’ in ‘/Applications/root_v6.26.99/lib/Cling_Runtime.pcm’

Replaced symbol atexit cannot be found in JIT!

Replaced symbol at_quick_exit cannot be found in JIT!

<<< cling interactive line includer >>>: fatal error: module file ‘/Applications/root_v6.26.99/lib/Darwin.pcm’ is out of date and needs to be rebuilt

Failed to load module Darwin

Failed to load module std

Failed to load module _Builtin_intrinsics

Failed to load module ROOT_Foundation_C

Failed to load module ROOT_Config

Failed to load module ROOT_Rtypes

Failed to load module ROOT_Foundation_Stage1_NoRTTI

Failed to load module Core

Failed to load module Rint

Failed to load module RIO

Failed to load module MathCore

Failed to load module Hist

Failed to load module Darwin

Failed to load module Unfold

Failed to load module Imt

Failed to load module HistPainter

Failed to load module PyMVA

Failed to load module RHTTPSniff

Failed to load module RDAVIX

Failed to load module RHTTP

Failed to load module FitPanel

Failed to load module ROOTVecOps

Failed to load module ProofDraw

Failed to load module Unuran

Failed to load module Quadp

Failed to load module ROOT_Foundation_Stage1_NoRTTI

Failed to load module GeomPainter

Failed to load module Genetic

Failed to load module Eve

Failed to load module TreeViewer

Failed to load module Physics

Failed to load module EG

Failed to load module Tree

Failed to load module HistFactory

Failed to load module Spectrum

Failed to load module Matrix

Failed to load module Html

Failed to load module Hist

Failed to load module GuiHtml

Failed to load module _Builtin_intrinsics

Failed to load module Gpad

Failed to load module TMVAGui

Failed to load module Fumili

Failed to load module Net

Failed to load module RGL

Failed to load module Geom

Failed to load module Postscript

Failed to load module GCocoa

Failed to load module RCsg

Failed to load module Cling_Runtime

Failed to load module SPlot

Failed to load module RooFit

Failed to load module GeomBuilder

Failed to load module ROOT_Config

Failed to load module RooFitMore

Failed to load module Rint

Failed to load module XMLParser

Failed to load module MultiProc

Failed to load module RooStats

Failed to load module Proof

Failed to load module RooFitRDataFrameHelpers

Failed to load module FITSIO

Failed to load module Ged

Failed to load module Recorder

Failed to load module FFTW

Failed to load module GuiBld

Failed to load module Vc

Failed to load module RooFitCore

Failed to load module Gui

Failed to load module SQLIO

Failed to load module XMLIO

Failed to load module ROOT_Rtypes

Failed to load module std

Failed to load module RIO

Failed to load module ProofPlayer

Failed to load module ROOTTMVASofie

Failed to load module ASImage

Failed to load module ROOT_Foundation_C

Failed to load module MathMore

Failed to load module RooFitHS3

Failed to load module Foam

Failed to load module RSQLite

Failed to load module SpectrumPainter

Failed to load module Minuit2

Failed to load module Core

Failed to load module MLP

Failed to load module ROOTDataFrame

Failed to load module GenVector

Failed to load module NetxNG

Failed to load module Minuit

Failed to load module RootAuth

Failed to load module Graf3d

Failed to load module TMVA

Failed to load module ASImageGui

Failed to load module Graf

Failed to load module Gdml

Failed to load module ProofBench

Failed to load module Cling_Runtime_Extra

Failed to load module MathCore

Failed to load module Gviz3d

Failed to load module ROOTTPython

Failed to load module TreePlayer

Failed to load module Smatrix

Failed to load module SessionViewer

Failed to load module Thread

*** Break *** segmentation violation

[/usr/lib/system/libsystem_platform.dylib] _sigtramp (no debug info)

[] (no debug info)

[/Applications/root_v6.26.99/lib/libCling.6.26.99.so] ROOT::TMetaUtils::TNormalizedCtxtImpl::keepTypedef(cling::LookupHelper const&, char const*, bool) (no debug info)

[/Applications/root_v6.26.99/lib/libCling.6.26.99.so] ROOT::TMetaUtils::TNormalizedCtxtImpl::TNormalizedCtxtImpl(cling::LookupHelper const&) (no debug info)

[/Applications/root_v6.26.99/lib/libCling.6.26.99.so] ROOT::TMetaUtils::TNormalizedCtxt::TNormalizedCtxt(cling::LookupHelper const&) (no debug info)

[/Applications/root_v6.26.99/lib/libCling.6.26.99.so] TCling::TCling(char const*, char const*, char const* const*) (no debug info)

[/Applications/root_v6.26.99/lib/libCling.6.26.99.so] CreateInterpreter (no debug info)

[/Applications/root_v6.26.99/lib/libCore.6.26.99.so] TROOT::InitInterpreter() (no debug info)

[/Applications/root_v6.26.99/lib/libCore.6.26.99.so] ROOT::Internal::GetROOT2() (no debug info)

[/Applications/root_v6.26.99/lib/libCore.6.26.99.so] TApplication::TApplication(char const*, int*, char**, void*, int) (no debug info)

[/Applications/root_v6.26.99/lib/libRint.6.26.99.so] TRint::TRint(char const*, int*, char**, void*, int, bool) (no debug info)

[/Applications/root_v6.26.99/bin/root.exe] main (no debug info)

[/usr/lib/dyld] start (no debug info)

[] (no debug info)

nicoviaux@Nicolass-MacBook-Pro /Applications %

And in a terminal, xcode-select --install shows what? (i.e. do you have the command line tools or Xcode installed?)

nicoviaux@Nicolass-MacBook-Pro ~ % xcode-select --install
xcode-select: error: command line tools are already installed, use “Software Update” to install updates
nicoviaux@Nicolass-MacBook-Pro ~ %

Bummer. Do you have the file /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/mach_debug.modulemap pm disk?

@vvassilev any hints on what might cause this?

I think recent OSX versions come with prebuilt Darwin.pcm file (hooray!). We try to use it but we are missing some alignment of details on how Apple built it. I need to debug this to confirm…

Yes I have this:

/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/mach_debug.modulemap

Hello folks
Which is the current update on this topic?
I.e.: how can I install root on macOS 10.12 with Xcode 13 and Command Lines 13.2?
It is enough to take the nightly?
Thanks!

Hi,

Have you tried using the nightly ? It should work.
If not let us know,

Lorenzo