Tried to build and install the latest version of root. Here are the commands I used.
git clone --branch latest-stable --depth=1 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
cmake --build . -- install -j4
Here are the errors that I get:
[ 76%] Linking CXX executable src/rootcling_stage1
[ 76%] Built target clad
[ 76%] Building CXX object core/metacling/src/CMakeFiles/MetaCling.dir/TClingTypeInfo.cxx.o
[ 76%] Building CXX object core/metacling/src/CMakeFiles/MetaCling.dir/TClingValue.cxx.o
[ 76%] Built target rootcling_stage1
[ 76%] Generating G__Core.cxx, ../lib/Core.pcm
While building module 'Core':
While building module 'std' imported from input_line_1:1:
In file included from <module-includes>:31:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/complex.h:28:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/ccomplex:20:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/complex:245:
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:321:9: error: missing '#include "/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/math.h"'; declaration of 'signbit' must be imported from module 'std.depr.math_h' before it is
required
using ::signbit;
^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/math.h:329:1: note: previous declaration is here
signbit(_A1 __lcpp_x) _NOEXCEPT
^
[ 76%] Built target MetaCling
Scanning dependencies of target Cling
[ 76%] Linking CXX shared library ../../../lib/libCling.so
input_line_1:1:10: fatal error: could not build module 'std'
#include <new>
~~~~~~~~^
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: ''
While building module 'Core':
While building module 'Cling_Runtime' imported from input_line_2:1:
While building module 'Cling_Runtime_Extra' imported from /Users/aregjan/root/root_build/etc/cling/Interpreter/RuntimeUniverse.h:27:
In file included from <module-includes>:1:
/Users/aregjan/root/root_build/etc/cling/Interpreter/DynamicExprInfo.h:13:10: fatal error: could not build module 'std'
#include <string>
~~~~~~~~^
/Users/aregjan/root/root_build/etc/cling/Interpreter/RuntimeUniverse.h:27:10: fatal error: could not build module 'Cling_Runtime_Extra'
#include "cling/Interpreter/Visibility.h"
~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
While building module 'Core':
While building module 'ROOT_Rtypes' imported from /Users/aregjan/root/root_build/include/Rtypes.h:23:
In file included from <module-includes>:1:
/Users/aregjan/root/root_build/include/RtypesCore.h:28:10: fatal error: could not build module 'std'
#include <cstddef> // size_t, NULL
~~~~~~~~^
In file included from input_line_3:2:
/Users/aregjan/root/root_build/include/Rtypes.h:23:10: fatal error: could not build module 'ROOT_Rtypes'
#include "RtypesCore.h"
~~~~~~~~^~~~~~~~~~~~~~
While building module 'Core':
While building module 'ROOT_Foundation_C' imported from /Users/aregjan/root/root_build/include/Rtypes.h:29:
In file included from <module-includes>:1:
/Users/aregjan/root/root_build/include/ThreadLocalStorage.h:60:10: fatal error: could not build module 'ROOT_Rtypes'
#include "RtypesCore.h"
~~~~~~~~^~~~~~~~~~~~~~
While building module 'Core':
While building module 'ROOT_Foundation_Stage1_NoRTTI' imported from /Users/aregjan/root/root_build/include/Rtypes.h:195:
In file included from <module-includes>:2:
/Users/aregjan/root/root_build/include/ROOT/RStringView.hxx:25:10: fatal error: could not build module 'std'
#include <string_view>
~~~~~~~~^
[ 76%] Built target Cling
Error: Error loading the default rootcling header files.
make[2]: *** [core/G__Core.cxx] Error 1
make[1]: *** [core/CMakeFiles/G__Core.dir/all] Error 2
make: *** [all] Error 2
Please read tips for efficient and successful posting and posting code
ROOT Version: the latest stable
Platform: Mac OS X Monterey 12.1
Compiler: not sure how to get it?