Problem compiling root on Mac Ventura

Hello,
I am using ROOT 6.24/09 head of branch. I am on Mac OS Ventura Darwin Kernel Version 22.1.0.
Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: x86_64-apple-darwin22.1.0

I cannot install root if I do not apply this patch

diff --git a/cmake/modules/SearchInstalledSoftware.cmake b/cmake/modules/SearchInstalledSoftware.cmake
index e9a5223..53c3f5c 100644
--- a/cmake/modules/SearchInstalledSoftware.cmake
+++ b/cmake/modules/SearchInstalledSoftware.cmake
@@ -161,7 +161,7 @@ if(builtin_freetype)
   endif()
   set(FREETYPE_INCLUDE_DIR ${CMAKE_BINARY_DIR}/FREETYPE-prefix/src/FREETYPE/include)
   set(FREETYPE_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIR})
-  set(FREETYPE_LIBRARIES ${FREETYPE_LIBRARY})
+  set(FREETYPE_LIBRARIES ${FREETYPE_LIBRARY} /usr/local/lib/libbrotlidec.dylib)
   set(FREETYPE_TARGET FREETYPE)
 endif()

I understand that this is a brutal and non-portable patch… but it is just to make clear that a library seems to be missing…

Please read tips for efficient and successful posting and posting code

ROOT Version: 6.24/09
Platform: Mac OS Ventura Darwin Kernel Version 22.1.0.
Compiler: Apple clang version 14.0.0 (clang-1400.0.29.202)


Hello Federico,

The freetype library (low level text drawing) can be used externally but is also distributed with ROOT (in the graf2d directory). So it can be “built-in”. In your case, it looks like SearchInstalledSoftware.cmake is not able to find a pre-installed version on your machine (even if it is there). I would guess that, in that case, it should fall back to the built-in solution. Maybe @bellenot has some idea about it.
Olivier

Hi Federico,
I think you should take a newer version. See this commit and this one

Thanks Bertrand,
I tried to use the head but it is no better

In file included from input_line_10:34:
/usr/local/root-git/buildroot/include/TMPWorkerTree.h:101:22: error: no template named 'InvokeResult_t' in namespace 'ROOT::TypeTraits'
   ROOT::TypeTraits::InvokeResult_t<F, std::reference_wrapper<TTreeReader>> fReducedResult;
   ~~~~~~~~~~~~~~~~~~^
In file included from input_line_10:35:
/usr/local/root-git/buildroot/include/ROOT/TTreeProcessorMP.hxx:40:45: error: no template named 'InvokeResult_t' in namespace 'ROOT::TypeTraits'
   using InvokeResult_t = ROOT::TypeTraits::InvokeResult_t<F, Args...>;
                          ~~~~~~~~~~~~~~~~~~^
/usr/local/root-git/buildroot/include/ROOT/TTreeProcessorMP.hxx:67:38: error: no template named 'InvokeResult_t'
                                  -> InvokeResult_t<F, std::reference_wrapper<TTreeReader>>;
                                     ^
/usr/local/root-git/buildroot/include/ROOT/TTreeProcessorMP.hxx:70:38: error: no template named 'InvokeResult_t'
                                  -> InvokeResult_t<F, std::reference_wrapper<TTreeReader>>;
                                     ^
/usr/local/root-git/buildroot/include/ROOT/TTreeProcessorMP.hxx:73:38: error: no template named 'InvokeResult_t'
                                  -> InvokeResult_t<F, std::reference_wrapper<TTreeReader>>;
                                     ^
/usr/local/root-git/buildroot/include/ROOT/TTreeProcessorMP.hxx:76:38: error: no template named 'InvokeResult_t'
                                  -> InvokeResult_t<F, std::reference_wrapper<TTreeReader>>;
                                     ^
/usr/local/root-git/buildroot/include/ROOT/TTreeProcessorMP.hxx:79:38: error: no template named 'InvokeResult_t'
                                  -> InvokeResult_t<F, std::reference_wrapper<TTreeReader>>;
                                     ^
/usr/local/root-git/buildroot/include/ROOT/TTreeProcessorMP.hxx:98:38: error: no template named 'InvokeResult_t'
                                  -> InvokeResult_t<F, std::reference_wrapper<TTreeReader>>;
                                     ^
/usr/local/root-git/buildroot/include/ROOT/TTreeProcessorMP.hxx:101:38: error: no template named 'InvokeResult_t'
                                  -> InvokeResult_t<F, std::reference_wrapper<TTreeReader>>;
                                     ^
/usr/local/root-git/buildroot/include/ROOT/TTreeProcessorMP.hxx:104:38: error: no template named 'InvokeResult_t'
                                  -> InvokeResult_t<F, std::reference_wrapper<TTreeReader>>;
                                     ^
/usr/local/root-git/buildroot/include/ROOT/TTreeProcessorMP.hxx:107:38: error: no template named 'InvokeResult_t'
                                  -> InvokeResult_t<F, std::reference_wrapper<TTreeReader>>;
                                     ^
/usr/local/root-git/buildroot/include/ROOT/TTreeProcessorMP.hxx:109:38: error: no template named 'InvokeResult_t'
                                  -> InvokeResult_t<F, std::reference_wrapper<TTreeReader>>;
                                     ^
/usr/local/root-git/buildroot/include/ROOT/TTreeProcessorMP.hxx:194:35: error: no template named 'InvokeResult_t'
                               -> InvokeResult_t<F, std::reference_wrapper<TTreeReader>>
                                  ^
/usr/local/root-git/buildroot/include/ROOT/TTreeProcessorMP.hxx:196:20: error: no template named 'InvokeResult_t'
   using retType = InvokeResult_t<F, std::reference_wrapper<TTreeReader>>;
                   ^
/usr/local/root-git/buildroot/include/ROOT/TTreeProcessorMP.hxx:197:50: error: use of undeclared identifier 'retType'
   static_assert(std::is_constructible<TObject*, retType>::value,
                                                 ^
/usr/local/root-git/buildroot/include/ROOT/TTreeProcessorMP.hxx:218:14: error: cannot initialize return object of type 'int' with an rvalue of type 'nullptr_t'
      return nullptr;
             ^~~~~~~
/usr/local/root-git/buildroot/include/ROOT/TTreeProcessorMP.hxx:254:23: error: unknown type name 'retType'
   return static_cast<retType>(res);
                      ^
/usr/local/root-git/buildroot/include/ROOT/TTreeProcessorMP.hxx:254:32: error: cannot initialize return object of type 'int' with an lvalue of type 'TObject *'
   return static_cast<retType>(res);
                               ^~~
/usr/local/root-git/buildroot/include/ROOT/TTreeProcessorMP.hxx:261:35: error: no template named 'InvokeResult_t'
                               -> InvokeResult_t<F, std::reference_wrapper<TTreeReader>>
                                  ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]

I have been trying to compile any version of root on Ventura for three days with no luck… Best

I am using the builtin, but the reference is missing still. Best,

Hello Federico,

I downloaded ROOT from here. (ROOT 6.24)
I get the following error when I compile on Mac Ventura:

[ 74%] Linking CXX shared library ../../lib/libFTGL.so
Undefined symbols for architecture x86_64:
  "_BrotliDecoderDecompress", referenced from:
      _woff2_decompress in libfreetype.a(sfnt.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/libFTGL.so] Error 1
make[1]: *** [graf3d/ftgl/CMakeFiles/FTGL.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

But ROOT master is fine for me on Ventura. The latest stable (or maybe the coming 6.28). should be fine too I guess.

If i run the head, the first problem I encounter is

[ 28%] Building CXX object interpreter/llvm/src/lib/Support/CMakeFiles/LLVMSupport.dir/Valgrind.cpp.o
/usr/local/root-git/interpreter/llvm/src/lib/Support/Valgrind.cpp:20:10: fatal error: 'valgrind/valgrind.h' file not found
#include <valgrind/valgrind.h>
         ^~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [interpreter/llvm/src/lib/Support/CMakeFiles/LLVMSupport.dir/build.make:1812: interpreter/llvm/src/lib/Support/CMakeFiles/LLVMSupport.dir/Valgrind.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:8677: interpreter/llvm/src/lib/Support/CMakeFiles/LLVMSupport.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

I can solve this recompiling by hand and adding

-I/usr/local/include

For the rest the head compiles. Best,

Hi,

as a side note we plan to release packages for macos13 in the near future. In particular you can keep an eye on Nightlies - ROOT for nightly builds. @Axel might be able to provide further details.

Cheers,
Enrico

Long time no see @fca – sorry we’re giving you such a hard time :frowning:

The valgrind error is llvm finding you /usr/local/include/valgrind.h but then forgetting to -I/usr/local/include… Do you actually need the valgrind headers? (I guess you just built valgrind yourself at some point?) A simple sudo mv /usr/local/include/valgrind.h{,BAK} will probably solve this just fine.

Howdy Axel,
thanks for your help. Actually, I installed Valgrind but it does not work on Mac! (I do not even know why they propose it!). Thanks for your suggestion. Will you fix the cmake too? Best,

I’m compiling branch v6-26-00-patches as of yesterday with

cmake -DCMAKE_INSTALL_PREFIX=../root_install/ ../root_src/ -Dbuiltin_glew=ON

on my mac M1 chip

Ventura  arm-apple-darwin22.1.0
AppleClang 14.0.0.14000029

clang --version
Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: arm64-apple-darwin22.1.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

I am getting

/Users/rowang/sw/root/root_src/core/meta/inc/TClass.h:272:12: error: unknown type name 'Longptr_t'
   mutable Longptr_t  fOffsetStreamer;  //!saved info to call Streamer
           ^
/Users/rowang/sw/root/root_src/core/meta/inc/TClass.h:289:38: error: unknown type name 'Longptr_t'
   TMethod           *GetClassMethod(Longptr_t faddr);
                                     ^
/Users/rowang/sw/root/root_src/core/meta/inc/TClass.h:387:63: error: unknown type name 'Longptr_t'
   void               BuildEmulatedRealData(const char *name, Longptr_t offset, TClass *cl, Bool_t isTransient = kFALSE);
                                                              ^
/Users/rowang/sw/root/root_src/core/meta/inc/TClass.h:424:4: error: unknown type name 'Longptr_t'
   Longptr_t          GetDataMemberOffset(const char *membername) const;
   ^
/Users/rowang/sw/root/root_src/core/meta/inc/TClass.h:391:59: error: cannot initialize object parameter of type 'const TObject' with an expression of type 'TClass'
   Bool_t             CanIgnoreTObjectStreamer() { return TestBit(kIgnoreTObjectStreamer);}
                                                          ^~~~~~~
/Users/rowang/sw/root/root_src/core/meta/inc/TClass.h:396:51: error: cannot initialize object parameter of type 'const TObject' with an expression of type 'const TClass'
   void               Dump() const { TDictionary::Dump(); }
                                                  ^~~~
/Users/rowang/sw/root/root_src/core/meta/inc/TClass.h:431:33: error: cannot initialize object parameter of type 'const TObject' with an expression of type 'const TClass'
      if (fCanLoadClassInfo && !TestBit(kLoading))
                                ^~~~~~~
7 errors generated.
make[2]: *** [roofit/histfactory/CMakeFiles/HistFactory.dir/src/ConfigParser.cxx.o] Error 1
make[1]: *** [roofit/histfactory/CMakeFiles/HistFactory.dir/all] Error 2
make: *** [all] Error 2

I don’t have XCode but just CommandLineTool. Is this some mis-configuration on my end?

Thanks!
Rognkun

What is pwd where you run cmake?

I am in root_build under this directory structure:

  • root
    ±-- root_build
    ±-- root_src
    ±-- root_install

Thanks. Can you please post the output of pwd - I’d like to see the full directory name to correlate it with the diagnostics.

Hi Axel,

yes. it’s

/Users/rowang/sw/root/root_build

Thanks.

The error message has a few introductory lines, including the invocation of the compiler. Could you share that, too, please?

I pulled again from the same branch v6-26-00-patches

Rerun cmake and compile and here’s the updated error:

Scanning dependencies of target G__ROOTDataFrame
[ 52%] Building CXX object tree/dataframe/CMakeFiles/G__ROOTDataFrame.dir/G__ROOTDataFrame.cxx.o
[ 52%] Built target G__ROOTDataFrame
[ 52%] Building CXX object tree/dataframe/CMakeFiles/ROOTDataFrame.dir/src/RActionBase.cxx.o
[ 52%] Building CXX object tree/dataframe/CMakeFiles/ROOTDataFrame.dir/src/RCsvDS.cxx.o
In file included from /Users/rowang/sw/root/root_src/tree/dataframe/src/RCsvDS.cxx:76:
In file included from /Users/rowang/sw/root/root_src/tree/dataframe/inc/ROOT/RCsvDS.hxx:14:
In file included from /Users/rowang/sw/root/root_src/tree/dataframe/inc/ROOT/RDataFrame.hxx:21:
In file included from /Users/rowang/sw/root/root_src/tree/dataframe/inc/ROOT/RDF/RInterface.hxx:16:
/Users/rowang/sw/root/root_src/tree/dataframe/inc/ROOT/RDF/ActionHelpers.hxx:1537:26: error: no member named 'TBufferMerger' in namespace 'ROOT'
   std::unique_ptr<ROOT::TBufferMerger> fMerger; // must use a ptr because TBufferMerger is not movable
                   ~~~~~~^
/Users/rowang/sw/root/root_src/tree/dataframe/inc/ROOT/RDF/ActionHelpers.hxx:1538:38: error: no member named 'TBufferMergerFile' in namespace 'ROOT'
   std::vector<std::shared_ptr<ROOT::TBufferMergerFile>> fOutputFiles;
                               ~~~~~~^
/Users/rowang/sw/root/root_src/tree/dataframe/inc/ROOT/RDF/ActionHelpers.hxx:1662:40: error: no member named 'TBufferMerger' in namespace 'ROOT'
      fMerger = std::make_unique<ROOT::TBufferMerger>(std::unique_ptr<TFile>(out_file));
                                 ~~~~~~^
3 errors generated.
make[2]: *** [tree/dataframe/CMakeFiles/ROOTDataFrame.dir/src/RCsvDS.cxx.o] Error 1
make[1]: *** [tree/dataframe/CMakeFiles/ROOTDataFrame.dir/all] Error 2
make: *** [all] Error 2

Perhaps just more cmake changes needed?

This looks like an inconsistent set of headers. Do you have ROOT also in /usr/local/include?

If you re-run with make VERBOSE=1 you will see the invocation of the compiler. You can add the option -M to see the included files; all ROOT files should come from within /Users/rowang/sw/root/root_src/ or /Users/rowang/sw/root/root_build.

That’s the message I got from VERBOSE=1. I copied it split it and did a grep veto, of rowang/sw/root, didn’t see anything obviously wrong. There seems no -M option for make or cmake?

It is worth noting that the error changed after I pulled. (but both points to either header corruption or failure to include things correctly…?)

Consolidate compiler generated dependencies of target ROOTDataFrame
/Library/Developer/CommandLineTools/usr/bin/make  -f tree/dataframe/CMakeFiles/ROOTDataFrame.dir/build.make tree/dataframe/CMakeFiles/ROOTDataFrame.dir/build
[ 52%] Building CXX object tree/dataframe/CMakeFiles/ROOTDataFrame.dir/src/RCsvDS.cxx.o
cd /Users/rowang/sw/root/root_build/tree/dataframe && /Library/Developer/CommandLineTools/usr/bin/c++  -I/Users/rowang/sw/root/root_src/tree/dataframe/inc -I/Users/rowang/sw/root/root_src/core/macosx/inc -I/Users/rowang/sw/root/root_src/core/unix/inc -I/Users/rowang/sw/root/root_src/core/foundation/v7/inc -I/Users/rowang/sw/root/root_src/core/base/v7/inc -I/Users/rowang/sw/root/root_src/core/clingutils/inc -I/Users/rowang/sw/root/root_src/core/textinput/inc -I/Users/rowang/sw/root/root_src/core/thread/inc -I/Users/rowang/sw/root/root_src/core/zip/inc -I/Users/rowang/sw/root/root_src/core/rint/inc -I/Users/rowang/sw/root/root_src/core/clib/inc -I/Users/rowang/sw/root/root_src/core/meta/inc -I/Users/rowang/sw/root/root_src/core/gui/inc -I/Users/rowang/sw/root/root_src/core/cont/inc -I/Users/rowang/sw/root/root_src/core/foundation/inc -I/Users/rowang/sw/root/root_src/core/base/inc -I/Users/rowang/sw/root/root_build/ginclude -I/Users/rowang/sw/root/root_src/tree/tree/inc -I/Users/rowang/sw/root/root_src/core/imt/inc -I/Users/rowang/sw/root/root_src/core/multiproc/inc -I/Users/rowang/sw/root/root_src/math/mathcore/inc -I/Users/rowang/sw/root/root_src/math/mathcore/v7/inc -I/Users/rowang/sw/root/root_src/tree/treeplayer/inc -I/Users/rowang/sw/root/root_src/hist/hist/inc -I/Users/rowang/sw/root/root_src/math/matrix/inc -I/Users/rowang/sw/root/root_src/math/vecops/inc -I/Users/rowang/sw/root/root_install/include -I/Users/rowang/sw/root/root_src/net/net/inc -I/Users/rowang/sw/root/root_src/io/io/inc -I/Users/rowang/sw/root/root_src/graf2d/gpad/inc -I/Users/rowang/sw/root/root_src/graf2d/graf/inc -I/Users/rowang/sw/root/root_src/graf3d/g3d/inc -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 -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.0.sdk -fPIC -std=c++14 -MD -MT tree/dataframe/CMakeFiles/ROOTDataFrame.dir/src/RCsvDS.cxx.o -MF CMakeFiles/ROOTDataFrame.dir/src/RCsvDS.cxx.o.d -o CMakeFiles/ROOTDataFrame.dir/src/RCsvDS.cxx.o -c /Users/rowang/sw/root/root_src/tree/dataframe/src/RCsvDS.cxx
In file included from /Users/rowang/sw/root/root_src/tree/dataframe/src/RCsvDS.cxx:76:
In file included from /Users/rowang/sw/root/root_src/tree/dataframe/inc/ROOT/RCsvDS.hxx:14:
In file included from /Users/rowang/sw/root/root_src/tree/dataframe/inc/ROOT/RDataFrame.hxx:21:
In file included from /Users/rowang/sw/root/root_src/tree/dataframe/inc/ROOT/RDF/RInterface.hxx:16:
/Users/rowang/sw/root/root_src/tree/dataframe/inc/ROOT/RDF/ActionHelpers.hxx:1537:26: error: no member named 'TBufferMerger' in namespace 'ROOT'
   std::unique_ptr<ROOT::TBufferMerger> fMerger; // must use a ptr because TBufferMerger is not movable
                   ~~~~~~^
/Users/rowang/sw/root/root_src/tree/dataframe/inc/ROOT/RDF/ActionHelpers.hxx:1538:38: error: no member named 'TBufferMergerFile' in namespace 'ROOT'
   std::vector<std::shared_ptr<ROOT::TBufferMergerFile>> fOutputFiles;
                               ~~~~~~^
/Users/rowang/sw/root/root_src/tree/dataframe/inc/ROOT/RDF/ActionHelpers.hxx:1662:40: error: no member named 'TBufferMerger' in namespace 'ROOT'
      fMerger = std::make_unique<ROOT::TBufferMerger>(std::unique_ptr<TFile>(out_file));
                                 ~~~~~~^
3 errors generated.
make[2]: *** [tree/dataframe/CMakeFiles/ROOTDataFrame.dir/src/RCsvDS.cxx.o] Error 1
make[1]: *** [tree/dataframe/CMakeFiles/ROOTDataFrame.dir/all] Error 2
make: *** [all] Error 2

That’s the line we care about. What’s the output of

cd /Users/rowang/sw/root/root_build/tree/dataframe && /Library/Developer/CommandLineTools/usr/bin/c++ -I/Users/rowang/sw/root/root_src/tree/dataframe/inc -I/Users/rowang/sw/root/root_src/core/macosx/inc -I/Users/rowang/sw/root/root_src/core/unix/inc -I/Users/rowang/sw/root/root_src/core/foundation/v7/inc -I/Users/rowang/sw/root/root_src/core/base/v7/inc -I/Users/rowang/sw/root/root_src/core/clingutils/inc -I/Users/rowang/sw/root/root_src/core/textinput/inc -I/Users/rowang/sw/root/root_src/core/thread/inc -I/Users/rowang/sw/root/root_src/core/zip/inc -I/Users/rowang/sw/root/root_src/core/rint/inc -I/Users/rowang/sw/root/root_src/core/clib/inc -I/Users/rowang/sw/root/root_src/core/meta/inc -I/Users/rowang/sw/root/root_src/core/gui/inc -I/Users/rowang/sw/root/root_src/core/cont/inc -I/Users/rowang/sw/root/root_src/core/foundation/inc -I/Users/rowang/sw/root/root_src/core/base/inc -I/Users/rowang/sw/root/root_build/ginclude -I/Users/rowang/sw/root/root_src/tree/tree/inc -I/Users/rowang/sw/root/root_src/core/imt/inc -I/Users/rowang/sw/root/root_src/core/multiproc/inc -I/Users/rowang/sw/root/root_src/math/mathcore/inc -I/Users/rowang/sw/root/root_src/math/mathcore/v7/inc -I/Users/rowang/sw/root/root_src/tree/treeplayer/inc -I/Users/rowang/sw/root/root_src/hist/hist/inc -I/Users/rowang/sw/root/root_src/math/matrix/inc -I/Users/rowang/sw/root/root_src/math/vecops/inc -I/Users/rowang/sw/root/root_install/include -I/Users/rowang/sw/root/root_src/net/net/inc -I/Users/rowang/sw/root/root_src/io/io/inc -I/Users/rowang/sw/root/root_src/graf2d/gpad/inc -I/Users/rowang/sw/root/root_src/graf2d/graf/inc -I/Users/rowang/sw/root/root_src/graf3d/g3d/inc -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 -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.0.sdk -fPIC -std=c++14 -M -E /Users/rowang/sw/root/root_src/tree/dataframe/src/RCsvDS.cxx

? And in /Users/rowang/sw/root/root_src/, what does git status say?