Error building ROOT from source on MacOS 12.4

Hello,

I’m trying to build root from source.
System: MacOS 12.4, Intel chip, all command line tools upgraded to the latest version.

Build command:
cmake -DCMAKE_INSTALL-PREFIX=$HOME/Work/root -DPython3_EXECUTABLE=$HOME/envs/base/bin/python ..
cmake --build . -- -j6 install

This returns error:

[ 59%] Building CXX object interpreter/llvm/src/tools/clang/lib/Analysis/CMakeFiles/obj.clangAnalysis.dir/RetainSummaryManager.cpp.o
CMake Error at XROOTD-stamp/XROOTD-download-Release.cmake:49 (message):
  Command failed: 1

   '/usr/local/Cellar/cmake/3.22.3/bin/cmake' '-Dmake=' '-Dconfig=' '-P' '/Users/isaac/Work/root-6.26.02/build-root/builtins/xrootd/XROOTD-prefix/src/XROOTD-stamp/XROOTD-download-Release-impl.cmake'

  See also

    /Users/isaac/Work/root-6.26.02/build-root/builtins/xrootd/XROOTD-prefix/src/XROOTD-stamp/XROOTD-download-*.log


make[2]: *** [builtins/xrootd/XROOTD-prefix/src/XROOTD-stamp/XROOTD-download] Error 1
make[1]: *** [builtins/xrootd/CMakeFiles/XROOTD.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

_ROOT Version: 6.26.02
Platform: MacOS Monterey 12.4, Intel Chip
Compiler: AppleClang 13.1.6.13160021


Any idea for this?

Hi @QuarkQuartet ,

and welcome to the ROOT forum!

There is a known problem with xrootd in v6.26.02, you can see this popped up a few times on the forum. Can you please try emptying the build directory and build instead the v6-26-00-patches branch?

Also note that unless you have very specific needs you don’t have to build ROOT from source, see Installing ROOT - ROOT.

Cheers,
Enrico

Hi,

Thank you for your reply. I tried to build for v6.26.00, and another error comes out at 92%.

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/__functional/perfect_forward.h:14:10: 
fatal error: 'tuple' file not found
#include <tuple>

Any idea about this bug?

I would like to build from source because I want the pyroot to match my python version. The pre-build binary seems do not offer the option to select the python version. I’m using 3.9. Are the pre-build version using 3.7?

Hi @QuarkQuartet ,

the latest branch with all patches is v6-26-00-patches, not the v6.26.00 tag, could that be it?

That compilation error is extremely weird, maybe xcode is not completely up to date?

The pre-built package is built for the default Python version coming with the system. The homebrew package might come with a newer Python, I’m not sure.

@Axel might have more suggestions.

Cheers,
Enrico

Looks indeed like a broken Xcode install. Is installing ROOT through Conda an option for you?

@Axel @eguiraud
Thank you for your comments.

I finally figured it out. The problem is that the ROOT needs some lib, which is offered by llvm. I have already installed the full XCode and llvm, but for some reason, the llvm library is missing in the environment variables.

brew reinstall llvm, export LDFLAGS="-L/usr/local/opt/llvm/lib" export CPPFLAGS="-I/usr/local/opt/llvm/include" export PATH=$PATH:/usr/local/opt/llvm/bin
This solved the problem.

I also tried the recently released 6.26.04, but error appeared:

[ 76%] Linking CXX shared library ../lib/libCore.so
Undefined symbols for architecture x86_64:
  "TCollection::UseRWLock()", referenced from:
      vtable for TListOfTypes in TListOfTypes.cxx.o
      vtable for TQCommand in TQCommand.cxx.o
      vtable for TQUndoManager in TQCommand.cxx.o
      vtable for TQConnection in TQConnection.cxx.o
      vtable for TVirtualQConnection in TQConnection.cxx.o
      vtable for TQConnectionList in TQObject.cxx.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [lib/libCore.so] Error 1
make[1]: *** [core/CMakeFiles/Core.dir/all] Error 2
make: *** [all] Error 2

The configuration output is:

-- ROOT Configuration

System          Darwin-21.5.0
Processor       6 core Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz (x86_64)
Build type      Release
Install path    /usr/local
Compiler        AppleClang 13.1.6.13160021
Compiler flags:
C                -m64 -pipe -W -Wall -fsigned-char -fno-common -Qunused-arguments -pthread -O3 -DNDEBUG
C++              -std=c++14 -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++ -O3 -DNDEBUG
Linker flags:
Executable      -L/usr/local/opt/llvm/lib -mmacosx-version-min=12.4
Module          -L/usr/local/opt/llvm/lib
Shared          -L/usr/local/opt/llvm/lib

-- Enabled support for:  asimage builtin_afterimage builtin_clang builtin_cling builtin_freetype builtin_ftgl builtin_glew builtin_llvm builtin_nlohmannjson builtin_openssl builtin_openui5 builtin_xxhash clad cocoa dataframe davix exceptions fftw3 fitsio gdml http imt libcxx mathmore mlp minuit2 opengl pyroot roofit rpath runtime_cxxmodules shared sqlite ssl tmva tmva-cpu tmva-pymva spectrum vdt xml xrootd
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/isaac/Work/root-6.26.04/build-root-- ROOT Configuration

System          Darwin-21.5.0
Processor       6 core Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz (x86_64)
Build type      Release
Install path    /usr/local
Compiler        AppleClang 13.1.6.13160021
Compiler flags:
C                -m64 -pipe -W -Wall -fsigned-char -fno-common -Qunused-arguments -pthread -O3 -DNDEBUG
C++              -std=c++14 -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++ -O3 -DNDEBUG
Linker flags:
Executable      -L/usr/local/opt/llvm/lib -mmacosx-version-min=12.4
Module          -L/usr/local/opt/llvm/lib
Shared          -L/usr/local/opt/llvm/lib

-- Enabled support for:  asimage builtin_afterimage builtin_clang builtin_cling builtin_freetype builtin_ftgl builtin_glew builtin_llvm builtin_nlohmannjson builtin_openssl builtin_openui5 builtin_xxhash clad cocoa dataframe davix exceptions fftw3 fitsio gdml http imt libcxx mathmore mlp minuit2 opengl pyroot roofit rpath runtime_cxxmodules shared sqlite ssl tmva tmva-cpu tmva-pymva spectrum vdt xml xrootd
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/isaac/Work/root-6.26.04/build-root

Does it require the most recent update of Apple SDK (13.2)?

Any llvm library that ROOT would need is provided by ROOT itself; you cannot take that of llvm. I might be misunderstanding something here?

Undefined symbols for architecture x86_64:
  "TCollection::UseRWLock()",

That still hints at an inconsistent build. This symbol should be in core/cont/CMakeFiles/Cont.dir/src/TCollection.cxx.o. You can check with:

$ nm -C  core/cont/CMakeFiles/Cont.dir/src/TCollection.cxx.o | grep UseRWLock
00000000000027e0 T TCollection::UseRWLock(bool)

Thank you for your answer.


This is what I get. It found 0000000018b0 T TCollection::UseRWLock(bool) for me.

If I delete the \n in your command (I copy and paste, system regard there is an \n character)


Here is the result… I do not know why this happens.

But if I only run nm -C core/cont, it prints out a lot:

0000000000001eec s GCC_except_table0
0000000000001f3c s GCC_except_table10
0000000000001f4c s GCC_except_table11
0000000000001f5c s GCC_except_table12
0000000000001f6c s GCC_except_table14
0000000000001f7c s GCC_except_table18
0000000000001fc0 s GCC_except_table19
0000000000001fe8 s GCC_except_table20
0000000000001ff8 s GCC_except_table27
0000000000002014 s GCC_except_table28
000000000000205c s GCC_except_table29
0000000000002094 s GCC_except_table30
00000000000020a8 s GCC_except_table31
00000000000020b8 s GCC_except_table32
00000000000020d4 s GCC_except_table34
00000000000020e8 s GCC_except_table36
0000000000002118 s GCC_except_table37
0000000000002144 s GCC_except_table38
0000000000001efc s GCC_except_table4
0000000000002170 s GCC_except_table46
000000000000217c s GCC_except_table58
00000000000021c0 s GCC_except_table59
0000000000001f0c s GCC_except_table6
0000000000001f24 s GCC_except_table7
00000000000021e0 s __GLOBAL__sub_I_TCollection.cxx
                 U __Unwind_Resume
0000000000003840 b guard variable for ROOT::Internal::EmptyCollection()::sEmpty
00000000000017a0 T TCollection::GarbageCollect(TObject*)
0000000000003864 S TCollection::fgGarbageStack
0000000000001190 T TCollection::RecursiveRemove(TObject*)
0000000000003860 S TCollection::fgEmptyingGarbage
0000000000003850 S TCollection::fgCurrentCollection
0000000000003858 S TCollection::fgGarbageCollection
0000000000000c40 T TCollection::GetCurrentCollection()
0000000000000c30 T TCollection::SetCurrentCollection()
0000000000001690 T TCollection::EmptyGarbageCollection()
0000000000001570 T TCollection::StartGarbageCollection()
0000000000000500 T TCollection::Draw(char const*)
                 U TCollection::Class()
0000000000000bb0 T TCollection::Paint(char const*)
0000000000001550 T TCollection::Write(char const*, int, int)
00000000000000c0 T TCollection::AddAll(TCollection const*)
00000000000003c0 T TCollection::Browse(TBrowser*)
0000000000000ad0 T TCollection::Notify()
0000000000001890 T TCollection::SetOwner(bool)
00000000000012b0 T TCollection::Streamer(TBuffer&)
0000000000000140 T TCollection::AddVector(TObject*, ...)
0000000000001230 T TCollection::RemoveAll(TCollection*)
00000000000018b0 T TCollection::UseRWLock(bool)
00000000000000b0 T TCollection::~TCollection()
00000000000000a0 T TCollection::~TCollection()
0000000000000000 T TCollection::~TCollection()
                 U TObjectTable::Add(TObject*)
                 U TObjectTable::TObjectTable(int)
                 U TVersionCheck::TVersionCheck(int)
                 U ROOT::Class_ShowMembers(TClass*, void const*, TMemberInspector&)
                 U ROOT::TGenericClassInfo::SetImplFile(char const*, int)
                 U ROOT::GenerateInitInstance(TCollection const*)
                 U ROOT::GenerateInitInstance(TIter const*)
                 U ROOT::Internal::gROOTLocal
0000000000001a40 T ROOT::Internal::EmptyCollection()
0000000000001ac0 T ROOT::Internal::ContaineeInheritsFrom(TClass*, TClass*)
00000000000025c7 D ROOT::Internal::THashConsistencyHolder<TCollection const&>::fgHashConsistency
                 U ROOT::Internal::HasConsistentHashMember(char const*)
                 U ROOT::Internal::HasConsistentHashMember(TClass&)
00000000000037f8 b ROOT::Internal::gVersionCheck
0000000000001a20 T TIter::End()
00000000000019f0 T TIter::Begin()
0000000000001930 T TIter::TIter(TIter const&)
00000000000018d0 T TIter::TIter(TIter const&)
0000000000001990 T TIter::operator=(TIter const&)
                 U TROOT::IndentLevel()
                 U TROOT::DecreaseDirLevel()
                 U TROOT::IncreaseDirLevel()
                 U TObject::HandleTimer(TTimer*)
                 U TObject::SetUniqueID(unsigned int)
                 U TObject::ExecuteEvent(int, int, int)
                 U TObject::SavePrimitive(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*)
                 U TObject::SetDrawOption(char const*)
                 U TObject::UseCurrentStyle()
                 U TObject::DistancetoPrimitive(int, int)
                 U TObject::Pop()
                 U TObject::Read(char const*)
                 U TObject::Class()
                 U TObject::Browse(TBrowser*)
                 U TObject::Execute(TMethod*, TObjArray*, int*)
                 U TObject::Execute(char const*, char const*, int*)
                 U TObject::Streamer(TBuffer&)
                 U TObject::AppendPad(char const*)
                 U TObject::~TObject()
                 U TObject::operator delete(void*)
                 U TRegexp::TRegexp(char const*, bool)
                 U TRegexp::~TRegexp()
                 U TString::Streamer(TBuffer&)
                 U TString::TString(char const*)
                 U TString::~TString()
                 U TString::operator=(char const*)
                 U TBrowser::Add(TObject*, char const*, int)
                 U TPRegexp::Match(TString const&, TString const&, int, int, TArrayI*)
                 U TStorage::ObjectAlloc(unsigned long)
                 U TObjArray::TObjArray(int, int)
                 U TObjArray::~TObjArray()
00000000000006a0 T TCollection::FindObject(TObject const*) const
00000000000005f0 T TCollection::FindObject(char const*) const
0000000000001bf0 T TCollection::GetEntries() const
0000000000001b20 T TCollection::IsSortable() const
0000000000000250 T TCollection::AssertClass(TClass*) const
0000000000001bc0 T TCollection::ShowMembers(TMemberInspector&) const
0000000000001c30 T TCollection::MakeReverseIterator() const
0000000000000cd0 T TCollection::PrintCollectionEntry(TObject*, char const*, int) const
0000000000000c50 T TCollection::PrintCollectionHeader(char const*) const
0000000000000cb0 T TCollection::GetCollectionEntryName(TObject*) const
0000000000001b30 T TCollection::CheckTObjectHashConsistency() const
0000000000000800 T TCollection::ls(char const*) const
0000000000001480 T TCollection::IsA() const
0000000000000580 T TCollection::Dump() const
0000000000001af0 T TCollection::Hash() const
0000000000000480 T TCollection::Clone(char const*) const
0000000000000d50 T TCollection::Print(char const*) const
0000000000001030 T TCollection::Print(char const*, TPRegexp&, int) const
0000000000000e40 T TCollection::Print(char const*, char const*, int) const
0000000000000d70 T TCollection::Print(char const*, int) const
0000000000001490 T TCollection::Write(char const*, int, int) const
0000000000000770 T TCollection::GrowBy(int) const
00000000000004c0 T TCollection::Compare(TObject const*) const
0000000000000730 T TCollection::GetName() const
0000000000001c00 T TCollection::GetSize() const
0000000000001c10 T TCollection::IsEmpty() const
0000000000001b10 T TCollection::IsFolder() const
00000000000007d0 T TCollection::IsArgNull(char const*, TObject const*) const
0000000000000680 T TCollection::operator()(char const*) const
                 U TObject::GetIconName() const
                 U TObject::GetUniqueID() const
                 U TObject::InheritsFrom(TClass const*) const
                 U TObject::InheritsFrom(char const*) const
                 U TObject::GetDrawOption() const
                 U TObject::GetObjectInfo(int, int) const
                 U TObject::Copy(TObject&) const
                 U TObject::Info(char const*, char const*, ...) const
                 U TObject::Clone(char const*) const
                 U TObject::Error(char const*, char const*, ...) const
                 U TObject::Fatal(char const*, char const*, ...) const
                 U TObject::Write(char const*, int, int) const
                 U TObject::SaveAs(char const*, char const*) const
                 U TObject::DoError(int, char const*, char const*, __va_list_tag*) const
                 U TObject::Inspect() const
                 U TObject::IsEqual(TObject const*) const
                 U TObject::Warning(char const*, char const*, ...) const
                 U TObject::GetTitle() const
                 U TObject::SysError(char const*, char const*, ...) const
                 U TObject::ClassName() const
                 U TObject::DrawClass() const
                 U TObject::DrawClone(char const*) const
0000000000001ae0 T TObject::GetOption() const
                 U TString::Hash(TString::ECaseCompare) const
                 U TString::Index(TRegexp const&, int) const
                 U TString::CompareTo(char const*, TString::ECaseCompare) const
                 U std::__1::locale::use_facet(std::__1::locale::id&) const
                 U std::__1::ios_base::getloc() const
                 U std::__1::basic_ostream<char, std::__1::char_traits<char> >::put(char)
                 U std::__1::basic_ostream<char, std::__1::char_traits<char> >::flush()
                 U std::__1::basic_ostream<char, std::__1::char_traits<char> >::sentry::sentry(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)
                 U std::__1::basic_ostream<char, std::__1::char_traits<char> >::sentry::~sentry()
                 U std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(int)
0000000000001da0 T std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > std::__1::__pad_and_output<char, std::__1::char_traits<char> >(std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >, char const*, char const*, char const*, std::__1::ios_base&, char)
0000000000001c50 T std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long)
                 U std::__1::cout
                 U std::__1::ctype<char>::id
                 U std::__1::locale::~locale()
                 U std::__1::ios_base::__set_badbit_and_consider_rethrow()
                 U std::__1::ios_base::clear(unsigned int)
                 U std::terminate()
00000000000025a0 S typeinfo for TCollection
                 U typeinfo for TObject
00000000000025b8 S typeinfo name for TCollection
0000000000002320 S vtable for TCollection
                 U vtable for TIter
                 U vtable for __cxxabiv1::__si_class_type_info
0000000000003800 b ROOT::Internal::EmptyCollection()::sEmpty
00000000000025c6 D TCollection::CheckTObjectHashConsistency() const::recurseBlocker
                 U operator delete(void*)
                 U operator==(TString const&, char const*)
                 U operator new(unsigned long)
0000000000000090 T ___clang_call_terminate
                 U ___cxa_atexit
                 U ___cxa_begin_catch
                 U ___cxa_end_catch
                 U ___cxa_guard_abort
                 U ___cxa_guard_acquire
                 U ___cxa_guard_release
                 U ___cxa_pure_virtual
                 U ___dso_handle
                 U ___dynamic_cast
                 U ___gxx_personality_v0
                 U ___stack_chk_fail
                 U ___stack_chk_guard
0000000000003848 S _gCollectionMutex
                 U _gGlobalMutex
                 U _memset
                 U _printf
                 U _strchr
                 U _strcmp
                 U _strlen

And then I past them into an editor and search for UseRWLock(bool):

Is this what you are expecting?