Problem installing/compiling root in 15.4 (even with latest XCode)

Hello

While trying to build root I get


-- Found TBB: /opt/homebrew (found suitable version "2022.1", minimum required is "2020")
-- Looking for VDT
-- Found Vdt: /opt/local/include (found suitable version "0.4", minimum required is "0.4")
-- Looking for BLAS for optional parts of TMVA
-- Using GSL CBLAS for optional parts of TMVA
-- tmva-cpu disabled because BLAS was not found
-- TMVA: Numpy or Python development package not found for python /opt/homebrew/Caskroom/miniconda/base/bin/python3.12. Switching off tmva-pymva option
-- PyROOT: development package found. Building for version 3.12.9
-- Performing Test ROOT_HAVE_CXX_ATOMICS_WITHOUT_LIB
-- Performing Test ROOT_HAVE_CXX_ATOMICS_WITHOUT_LIB - Failed
-- Building LLVM in 'Release' mode.
CMake Deprecation Warning at interpreter/llvm-project/cmake/Modules/CMakePolicy.cmake:6 (cmake_policy):
  The OLD behavior for policy CMP0114 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
  interpreter/llvm-project/llvm/CMakeLists.txt:6 (include)


CMake Deprecation Warning at interpreter/llvm-project/cmake/Modules/CMakePolicy.cmake:11 (cmake_policy):
  The OLD behavior for policy CMP0116 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
  interpreter/llvm-project/llvm/CMakeLists.txt:6 (include)


CMake Error at interpreter/llvm-project/llvm/cmake/modules/CheckAtomic.cmake:59 (message):
  Host compiler appears to require libatomic, but cannot find it.
Call Stack (most recent call first):
  interpreter/llvm-project/llvm/cmake/config-ix.cmake:412 (include)
  interpreter/llvm-project/llvm/CMakeLists.txt:898 (include)

I have tried to cmake ../root -DCMAKE_OSX_SYSROOT=$(xcrun --sdk macosx --show-sdk-path) but this still does not resolve my errors.

I ve also tried installing with brew that finishes with no errors, but then when I try to open I get

root -l
fatal error: module map file '/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/c++/v1/std_darwin.modulemap' not found
<<< cling interactive line includer >>>: fatal error: module file '/private/tmp/root-20250408-18619-fisguy/root-6.34.08/builddir/lib/std.pcm' not found: module file not found
<<< cling interactive line includer >>>: note: imported by module 'Darwin' in '/opt/homebrew/Cellar/root/6.34.08/lib/root/Darwin.pcm'
Failed to load module Darwin
Module std not found.
Failed to load module ROOT_Foundation_C
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 SpectrumPainter
Failed to load module XMLParser
Failed to load module RooFitHS3
Failed to load module SPlot
Failed to load module TreePlayer
Failed to load module Foam
Failed to load module ROOTBrowserv7
Failed to load module ROOTBrowsable
Failed to load module Rint
Failed to load module FFTW
Failed to load module GCocoa
Failed to load module FITSIO
Failed to load module RIO
Failed to load module MathCore
Failed to load module Fumili
Failed to load module FitPanel
Failed to load module RHTTP
Failed to load module Spectrum
Failed to load module ASImageGui
Failed to load module pthread
Failed to load module ROOTHistDraw
Failed to load module Net
Failed to load module Gviz3d
Failed to load module Graf
Failed to load module WebGui6
Failed to load module Eve
Failed to load module GeomPainter
Failed to load module RMySQL
Failed to load module ROOTEve
Failed to load module Cling_Runtime_Extra
Failed to load module Darwin
Failed to load module RDAVIX
Failed to load module HistPainter
Failed to load module Ged
Failed to load module GuiBld
Failed to load module TMVAGui
Failed to load module ROOTWebDisplay
Failed to load module RootAuth
Failed to load module EG
Failed to load module Gui
Failed to load module RooFit
Failed to load module MathMore
Failed to load module Hist
Failed to load module ROOTDataFrame
Failed to load module TreeViewer
Failed to load module Gpad
Failed to load module Physics
Failed to load module RCsg
Failed to load module Minuit2
Failed to load module Thread
Failed to load module Imt
Failed to load module PyMVA
Failed to load module ROOTHist
Failed to load module Graf3d
Failed to load module Quadp
Failed to load module Hbook
Failed to load module Postscript
Failed to load module ROOTGraphicsPrimitives
Failed to load module Genetic
Failed to load module ROOT_Rtypes
Failed to load module RSQLite
Failed to load module HistFactory
Failed to load module RooFitMore
Failed to load module ROOTGeomViewer
Failed to load module ROOT_Foundation_Stage1_NoRTTI
Failed to load module Smatrix
Failed to load module ROOTFitPanelv7
Failed to load module Geom
Failed to load module MultiProc
Failed to load module Minuit
Failed to load module RooStats
Failed to load module TMVAUtils
Failed to load module ROOTGpadv7
Failed to load module GuiHtml
Failed to load module ROOTTPython
Failed to load module MLP
Failed to load module XMLIO
Failed to load module TMVA
Failed to load module RooFitXRooFit
Failed to load module NetxNG
Failed to load module Tree
Failed to load module SQLIO
Failed to load module RHTTPSniff
Failed to load module ROOTNTuple
Failed to load module ROOTTMVASofie
Failed to load module ROOTVecOps
Failed to load module ASImage
Failed to load module RGL
Failed to load module Matrix
Failed to load module RooFitJSONInterface
Failed to load module Recorder
Failed to load module Gdml
Failed to load module ROOT_Foundation_C
Failed to load module ROOTTreeViewer
Failed to load module GenVector
Failed to load module Cling_Runtime
Failed to load module RooFitCore
Failed to load module Core
Failed to load module ROOTNTupleUtil

 *** Break *** segmentation violation
[/usr/lib/system/libsystem_platform.dylib] _sigtramp (no debug info)
[/opt/homebrew/Cellar/root/6.34.08/lib/root/libCling.so] ROOT::TMetaUtils::TNormalizedCtxtImpl::keepTypedef(cling::LookupHelper const&, char const*, bool) (no debug info)
[/opt/homebrew/Cellar/root/6.34.08/lib/root/libCling.so] ROOT::TMetaUtils::TNormalizedCtxtImpl::TNormalizedCtxtImpl(cling::LookupHelper const&) (no debug info)
[/opt/homebrew/Cellar/root/6.34.08/lib/root/libCling.so] ROOT::TMetaUtils::TNormalizedCtxt::TNormalizedCtxt(cling::LookupHelper const&) (no debug info)
[/opt/homebrew/Cellar/root/6.34.08/lib/root/libCling.so] TCling::TCling(char const*, char const*, char const* const*, void*) (no debug info)
[/opt/homebrew/Cellar/root/6.34.08/lib/root/libCling.so] CreateInterpreter (no debug info)
[/opt/homebrew/Cellar/root/6.34.08/lib/root/libCore.so] TROOT::InitInterpreter() (no debug info)
[/opt/homebrew/Cellar/root/6.34.08/lib/root/libCore.so] ROOT::Internal::GetROOT2() (no debug info)
[/opt/homebrew/Cellar/root/6.34.08/lib/root/libCore.so] TApplication::TApplication(char const*, int*, char**, void*, int) (no debug info)
[/opt/homebrew/Cellar/root/6.34.08/lib/root/libRint.so] TRint::TRint(char const*, int*, char**, void*, int, bool, bool) (no debug info)
[/opt/homebrew/Cellar/root/6.34.08/bin/root.exe] main (no debug info)
[/usr/lib/dyld] start (no debug info)

I have installed latest XCode etc.

Thanks
-a

Btw, just to mention that also precompiled links to 15.3 are dead

https://root.cern/download/root_v6.34.08.macos-15.3-arm64-clang160.pkg

Hi,

I am not sure whether you are trying to build on arm-chip processor or intel processor. I was facing some similar problems while installing root a while ago so I can only share my experience with you. It seems like some dependencies are missing since Xcode got updated with the new MacOS version. Maybe you can first run

brew install --only-dependencies root

and then try to rebuild it (clean build).
While building root v6-34-08 you must keep the -Dbuiltin_afterimage flag OFF.

Also, while building use CMake v3.31 or any other CMake v3 but not CMake v4.0.0

thanks, indeed I am on arm64. I ve tried downgraded cmake from 4.0 to 3.31 but still the compilation fails at the same spot…

Have you tried installing libatomic package directly from the brew package itself?

brew intall libatomic

yes, and it is actually brew install libatomic_ops - still, compilation fails…

I found a similar problem reported on root forum (very old, also a different OS and a different root version) but maybe this can help you figure out the problem.

There is another link within the problem attached above. All I understood was that it has something to do with the compiler. Can you provide any information what complier you are using? (basically the Xcode version and the Apple clang version)

although I am not sure how to use the info on the thread you provided (not sure it actually points to a solution, rather than generically describing what solved the problem, but I will take a closer look), to answer your other question

clang --version
Apple clang version 17.0.0 (clang-1700.0.13.3)
Target: arm64-apple-darwin24.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

and

xcodebuild -version
Xcode 16.3
Build version 16E140

Hi, I’ve been having an identical issue for about a week or so. It began when I updated to Sequoia 15.4 and updated XCode. I’m not sure which triggered the problem, because I did both at the same time.

It caused my previous installation of root to no longer work. I’d seen this happen before and only had to redo the build and install steps (I typically build from source). This didn’t work this time. Looking at the versioning you posted in this thread, mine are identical. I’ve tried all of the things that you did as well as the other suggestions in this thread to no avail.

However, I did just get it working through homebrew a few minutes ago. Instead of building from source myself or using the pre-made brew installation, I requested brew to install it from source via

brew install --build-from-source root

It took a little while to complete, but it seems to now be working. Maybe give this a try?

Best,
Tyler

I checked the installed directory of clang on my PC
It shows /Library/Developer/CommandLineTools/usr/bin

So I guess that you have installed the full Xcode app and not just command-line-tools. I don’t no whether clang is able to find other libraries installed in your computer if one installs it via Xcode app. (You can see some discussion about Xcode and command line tools here : What is the relationship between Xcode and Xcode command line tools - Ask Different)

So I suggest the following (If you do not use Xcode as your IDE)

  1. Remove the Xcode app
  2. Open a terminal. Install just the command line tools
xcode-select --install
  1. Clean build root-v6.34.08

Hello

Just to close the topic, I was able to build and install (even with cmake 4.0.1)

then

brew install --cask miniconda
conda create -n root-env python=3.12 numpy
brew install xrootd glew freetype pcre lz4 zstd libpng jpeg tbb xxhash giflib libtiff openssl sqlite
git clone https://github.com/root-project/root.git
mkdir build  && cd build
cmake ../root   -DCMAKE_INSTALL_PREFIX=$HOME/root-install   -DCMAKE_BUILD_TYPE=Release   -Droofit=ON   -Dtmva=ON   -Dtmva-pymva=ON   -Dbuiltin_glew=ON   -Dxrootd=ON   -DXROOTD_INCLUDE_DIR="/opt/homebrew/include"   -DXROOTD_CLIENT_LIBRARIES="/opt/homebrew/lib/libXrdClient.dylib"   -DXROOTD_UTILS_LIBRARIES="/opt/homebrew/lib/libXrdUtils.dylib"   -Dnetx=OFF   -DPython3_EXECUTABLE=$(which python3)   -DCMAKE_OSX_SYSROOT=$(xcrun --show-sdk-path)   -DCMAKE_PREFIX_PATH="$(brew --prefix)"   -DNCURSES_INCLUDE_PATH="$(xcrun --show-sdk-path)/usr/include"   -DNCURSES_LIBRARIES="$(xcrun --show-sdk-path)/usr/lib/libncurses.tbd"
cmake --build . -- -j8
cmake --install .

Take note that I had eventually to dectivate xroot option as compilation was failing due to that, but I dont really need it for my local root installation.

Regards
-a