Repository: root-project/root

Issue #13101: [CMake] Existing ROOT headers from the system might be picked up when compiling ROOT
Created: 2023-06-26T19:20:23Z
Check duplicate issues.

 Checked for duplicates

Description
Can't install RooFit because of RooJSON.
/opt/root/src/roofit/hs3/src/JSONFactories_RooFitCore.cxx: In member function ‘virtual bool {anonymous}::RooExpPolyStreamer::exportObject(RooJSONFactoryWSTool*, const RooAbsArg*, RooFit::Detail::JSONNode&) const’:
/opt/root/src/roofit/hs3/src/JSONFactories_RooFitCore.cxx:448:25: error: ‘const class RooExpPoly’ has no member named ‘x’; did you mean ‘RooRealProxy RooExpPoly::_x’? (not accessible from this context)
  448 |       elem["x"] << pdf->x().GetName();
      |                         ^
In file included from /opt/root/src/roofit/hs3/src/JSONFactories_RooFitCore.cxx:20:
/opt/root/install/include/RooExpPoly.h:37:17: note: declared protected here
   37 |    RooRealProxy _x;
      |                 ^~
/opt/root/src/roofit/hs3/src/JSONFactories_RooFitCore.cxx:453:32: error: ‘const class RooExpPoly’ has no member named ‘lowestOrder’; did you mean ‘int RooExpPoly::_lowestOrder’? (not accessible from this context)
  453 |       for (int i = 0; i < pdf->lowestOrder(); ++i) {
      |                                ^~~~~~~~~~~
/opt/root/install/include/RooExpPoly.h:39:8: note: declared protected here
   39 |    int _lowestOrder;
      |        ^~~~~~~~~~~~
/opt/root/src/roofit/hs3/src/JSONFactories_RooFitCore.cxx:456:36: error: ‘const class RooExpPoly’ has no member named ‘coefList’; did you mean ‘RooListProxy RooExpPoly::_coefList’? (not accessible from this context)
  456 |       for (const auto &coef : pdf->coefList()) {
      |                                    ^~~~~~~~
/opt/root/install/include/RooExpPoly.h:38:17: note: declared protected here
   38 |    RooListProxy _coefList;
      |                 ^~~~~~~~~
make[2]: *** [roofit/hs3/CMakeFiles/RooFitHS3.dir/build.make:132: roofit/hs3/CMakeFiles/RooFitHS3.dir/src/JSONFactories_RooFitCore.cxx.o] Error 1

Tried to change method names to those with underscores, got another error about a protected field:
/opt/root/src/roofit/hs3/src/JSONFactories_RooFitCore.cxx: In member function ‘virtual bool {anonymous}::RooExpPolyStreamer::exportObject(RooJSONFactoryWSTool*, const RooAbsArg*, RooFit::Detail::JSONNode&) const’:
/opt/root/src/roofit/hs3/src/JSONFactories_RooFitCore.cxx:448:25: error: ‘RooRealProxy RooExpPoly::_x’ is protected within this context
  448 |       elem["x"] << pdf->_x().GetName();
      |                         ^~
In file included from /opt/root/src/roofit/hs3/src/JSONFactories_RooFitCore.cxx:20:
/opt/root/install/include/RooExpPoly.h:37:17: note: declared protected here
   37 |    RooRealProxy _x;
      |                 ^~
/opt/root/src/roofit/hs3/src/JSONFactories_RooFitCore.cxx:448:27: error: no match for call to ‘(const RooRealProxy {aka const RooTemplateProxy<RooAbsReal>}) ()’
  448 |       elem["x"] << pdf->_x().GetName();
      |                    ~~~~~~~^~
/opt/root/src/roofit/hs3/src/JSONFactories_RooFitCore.cxx:453:32: error: ‘int RooExpPoly::_lowestOrder’ is protected within this context
  453 |       for (int i = 0; i < pdf->_lowestOrder(); ++i) {
      |                                ^~~~~~~~~~~~
/opt/root/install/include/RooExpPoly.h:39:8: note: declared protected here
   39 |    int _lowestOrder;
      |        ^~~~~~~~~~~~
/opt/root/src/roofit/hs3/src/JSONFactories_RooFitCore.cxx:453:44: error: expression cannot be used as a function
  453 |       for (int i = 0; i < pdf->_lowestOrder(); ++i) {
      |                           ~~~~~~~~~~~~~~~~~^~
/opt/root/src/roofit/hs3/src/JSONFactories_RooFitCore.cxx:456:36: error: ‘RooListProxy RooExpPoly::_coefList’ is protected within this context
  456 |       for (const auto &coef : pdf->_coefList()) {
      |                                    ^~~~~~~~~
/opt/root/install/include/RooExpPoly.h:38:17: note: declared protected here
   38 |    RooListProxy _coefList;
      |                 ^~~~~~~~~
/opt/root/src/roofit/hs3/src/JSONFactories_RooFitCore.cxx:456:45: error: no match for call to ‘(const RooListProxy {aka const RooCollectionProxy<RooArgList>}) ()’
  456 |       for (const auto &coef : pdf->_coefList()) {
      |                               ~~~~~~~~~~~~~~^~
make[2]: *** [roofit/hs3/CMakeFiles/RooFitHS3.dir/build.make:132: roofit/hs3/CMakeFiles/RooFitHS3.dir/src/JSONFactories_RooFitCore.cxx.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:44184: roofit/hs3/CMakeFiles/RooFitHS3.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

Commented the body of the whole function. Got another error.
/opt/root/src/roofit/hs3/src/JSONFactories_RooFitCore.cxx: In member function ‘virtual bool {anonymous}::RooExpPolyStreamer::exportObject(RooJSONFactoryWSTool*, const RooAbsArg*, RooFit::Detail::JSONNode&) const’:
/opt/root/src/roofit/hs3/src/JSONFactories_RooFitCore.cxx:444:63: warning: unused parameter ‘func’ [-Wunused-parameter]
  444 |    bool exportObject(RooJSONFactoryWSTool *, const RooAbsArg *func, JSONNode &elem) const override
      |                                              ~~~~~~~~~~~~~~~~~^~~~
/opt/root/src/roofit/hs3/src/JSONFactories_RooFitCore.cxx:444:79: warning: unused parameter ‘elem’ [-Wunused-parameter]
  444 |    bool exportObject(RooJSONFactoryWSTool *, const RooAbsArg *func, JSONNode &elem) const override
      |                                                                     ~~~~~~~~~~^~~~
[ 98%] Linking CXX shared library ../../lib/libRooFitHS3.so
/usr/bin/ld: CMakeFiles/RooFitHS3.dir/src/JSONFactories_HistFactory.cxx.o: in function `std::vector<double, std::allocator<double> >& RooFit::Detail::operator<< <double>(std::vector<double, std::allocator<double> >&, RooFit::Detail::JSONNode const&) [clone .isra.0]':
JSONFactories_HistFactory.cxx:(.text+0xc212): undefined reference to `double RooFit::Detail::JSONNode::val_t<double>() const'
collect2: error: ld returned 1 exit status
make[2]: *** [roofit/hs3/CMakeFiles/RooFitHS3.dir/build.make:200: lib/libRooFitHS3.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:44184: roofit/hs3/CMakeFiles/RooFitHS3.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

Reproducer
Clone ROOT repository, go to the build directory,

cmake -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_INSTALL_PREFIX=../install ../src
cmake --build . -- install -j4

ROOT version
Most recent ROOT version from the master branch at that time.

commit 870618f (HEAD -> master, origin/master, origin/HEAD)

Should I use that? I thought there is continuous integration and people check for errors before committing.
Installation method
built from source
Operating system
Arch Linux
Additional context
Had to remove RooFit support from CMakeCache.txt.

Duplicate issue #14337: Cling issue at compilation 
Created: 2024-01-13T09:27:30Z
Check duplicate issues.

 Checked for duplicates

Description
Hello, I am trying to install a new version of ROOT. I wonder if this is related to newly enabled features maybe ?
$ cmake ../src -DCMAKE_INSTALL_PREFIX=$SOFTWARE/root/20240113 -Dimt=ON -Dbuiltin_glew=ON -Dmathmore=ON -DCMAKE_CXX_STANDARD=17 -DROOT7=ON
-- Detected ROOT_VERSION 6.26.10
-- Checking internet connectivity...
-- Yes
-- Looking for Python
-- Could NOT find Python3 (missing: Python3_NumPy_INCLUDE_DIRS NumPy) (found version "3.12.0")
-- Could NOT find Python2 (missing: Python2_EXECUTABLE Python2_INCLUDE_DIRS Python2_LIBRARIES Python2_NumPy_INCLUDE_DIRS Interpreter Development NumPy Development.Module Development.Embed) 
    Reason given by package: 
        Interpreter: Wrong major version for the interpreter "/opt/homebrew/bin/python"

-- Found a macOS system 14.2
-- Found an AArch64 system
-- ROOT Platform: macosx
-- ROOT Compiler: AppleClang 15.0.0.15000100
-- ROOT Processor: arm64
-- ROOT Architecture: macosxarm64
-- Build Type: 'Release' (flags = '-O3 -DNDEBUG')
-- Compiler Flags:  -std=c++17 -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
-- ROOT default compression algorithm: zlib
-- PyROOT will be built for version 3.12.0
-- Looking for ZLib
-- Building freetype version 2.12.1 included in ROOT itself
-- Looking for PCRE
-- Looking for LZMA
-- Looking for ZSTD
-- Looking for LZ4
-- Building AfterImage library included in ROOT itself
-- Looking for GSL
-- Looking for OpenGL
-- Looking for LibXml2
-- Looking for MySQL
-- Looking for SQLite
-- Looking for FFTW3
-- Looking for XROOTD
-- Found Xrootd version num: 5.5.0 (setting -DROOTXRDVERS=500050000)
--              libXrdMain not found: xproofd will be a wrapper around xrootd
--              libXrdClient not found: use built-in
--              include_dirs: /Users/marcomeyer/Software/xrootd/5.5.0/include/xrootd;/Users/marcomeyer/Software/root/src/proof/xrdinc
--              libraries: /Users/marcomeyer/Software/xrootd/5.5.0/lib/libXrdUtils.dylib;/Users/marcomeyer/Software/xrootd/5.5.0/lib/libXrdCl.dylib
-- Checking for module 'davix>=0.6.4'
--   Found davix, version 0.8.4
-- Cannot select cudnn without selecting cuda or tmva-gpu. Option is ignored
-- Looking for BLAS for optional parts of TMVA
-- Building LLVM in 'Release' mode.
-- Could NOT find Z3: Found unsuitable version "0.0.0", but required is at least "4.7.1" (found Z3_LIBRARIES-NOTFOUND)
-- Found libtool - /Library/Developer/CommandLineTools/usr/bin/libtool
-- Native target ARM is not selected; lli will not JIT code
-- Threads disabled.
-- Doxygen disabled.
-- Go bindings disabled.
-- Found ld64 - /Library/Developer/CommandLineTools/usr/bin/ld
-- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH) 
-- OCaml bindings disabled.
-- LLVM host triple: arm-apple-darwin23.2.0
-- LLVM default target triple: arm-apple-darwin23.2.0
-- Building with -fPIC
-- Constructing LLVMBuild project information
-- Linker detection: unknown
-- Targeting AArch64
-- Targeting NVPTX
-- Clang version: 9.0.1
-- Cling version (from VERSION file): ROOT_1.0~dev
CMake Warning at interpreter/cling/lib/Interpreter/CMakeLists.txt:278 (MESSAGE):
  Cannot determine location of C++ headers for runtime.


-- Cling will look for C++ headers in '' at runtime.
-- And then fallback to: 'clang'
-- Performing Test found_stdstringview
-- Performing Test found_stdstringview - Success
-- Performing Test found_stod_stringview
-- Performing Test found_stod_stringview - Failed
-- Performing Test found_stdapply
-- Performing Test found_stdapply - Success
-- Performing Test found_stdinvoke
-- Performing Test found_stdinvoke - Success
-- Performing Test found_stdindexsequence
-- Performing Test found_stdindexsequence - Success
-- ROOT Configuration 

System          Darwin-23.2.0
Processor       10 core Apple M1 Max (arm64)
Build type      Release
Install path    /Users/marcomeyer/Software/root/20240113
Compiler        AppleClang 15.0.0.15000100
Compiler flags:
C                -m64 -pipe -W -Wall -fsigned-char -fno-common -Qunused-arguments -pthread -O3 -DNDEBUG
C++              -std=c++17 -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       -mmacosx-version-min=14.2
Module          
Shared          

-- Enabled support for:  asimage builtin_afterimage builtin_clang builtin_cling builtin_freetype builtin_ftgl builtin_gl2ps builtin_glew builtin_llvm builtin_nlohmannjson builtin_openui5 builtin_tbb builtin_vdt builtin_xxhash clad cocoa dataframe davix exceptions fftw3 gdml http imt libcxx mathmore mlp minuit2 mysql opengl pyroot roofit webgui root7 rpath runtime_cxxmodules shared sqlite ssl tmva tmva-cpu spectrum vdt xml xrootd
-- Configuring done (6.2s)
-- Generating done (2.2s)
-- Build files have been written to: /Users/marcomeyer/Software/root/build

While building module 'Core':
While building module 'std' imported from input_line_1:1:
In file included from <module-includes>:17:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/math.h:315:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/limits:827:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:421:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__functional/invoke.h:23:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_member_object_pointer.h:35:56: error: use of undeclared identifier '__remove_cv_t'
    : public _BoolConstant< __libcpp_is_member_pointer<__remove_cv_t<_Tp> >::__is_obj >  {};
                                                       ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_member_object_pointer.h:35:78: error: no type named '__is_obj' in the global namespace
    : public _BoolConstant< __libcpp_is_member_pointer<__remove_cv_t<_Tp> >::__is_obj >  {};
                                                                           ~~^
While building module 'Core':
While building module 'std' imported from input_line_1:1:
In file included from <module-includes>:17:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/math.h:315:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/limits:827:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:456:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_compound.h:14:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_fundamental.h:38:38: error: missing '#include <__type_traits/is_arithmetic.h>'; declaration of 'is_arithmetic' must be imported from module 'std.type_traits.is_arithmetic' before it is required
                                     is_arithmetic<_Tp>::value> {};
                                     ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_arithmetic.h:23:50: note: previous declaration is here
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_arithmetic
                                                 ^
While building module 'Core':
While building module 'std' imported from input_line_1:1:
In file included from <module-includes>:17:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/math.h:315:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/limits:827:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:476:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_member_pointer.h:35:53: error: use of undeclared identifier '__remove_cv_t'
 : public _BoolConstant< __libcpp_is_member_pointer<__remove_cv_t<_Tp> >::__is_member > {};
                                                    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_member_pointer.h:35:75: error: no type named '__is_member' in the global namespace
 : public _BoolConstant< __libcpp_is_member_pointer<__remove_cv_t<_Tp> >::__is_member > {};
                                                                        ~~^
While building module 'Core':
While building module 'std' imported from input_line_1:1:
In file included from <module-includes>:17:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/math.h:315:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/limits:827:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:485:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_nothrow_destructible.h:16:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_scalar.h:51:51: error: missing '#include <cstddef>'; declaration of 'nullptr_t' must be imported from module 'std.compat.cstddef' before it is required
template <> struct _LIBCPP_TEMPLATE_VIS is_scalar<nullptr_t> : public true_type {};
                                                  ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cstddef:59:9: note: previous declaration is here
using ::nullptr_t;
        ^
While building module 'Core':
While building module 'std' imported from input_line_1:1:
In file included from <module-includes>:17:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/math.h:315:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/limits:827:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:510:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_trivially_destructible.h:34:2: error: is_trivially_destructible is not implemented
#error is_trivially_destructible is not implemented
 ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_trivially_destructible.h:40:53: error: no template named 'is_trivially_destructible'
inline constexpr bool is_trivially_destructible_v = is_trivially_destructible<_Tp>::value;
                                                    ^
While building module 'Core':
While building module 'std' imported from input_line_1:1:
In file included from <module-includes>:34:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/complex.h:27:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/ccomplex:21:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/complex:238:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/stdexcept:46:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cstdlib:144:9: error: no member named 'at_quick_exit' in the global namespace
using ::at_quick_exit _LIBCPP_USING_IF_EXISTS;
      ~~^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cstdlib:145:9: error: no member named 'quick_exit' in the global namespace
using ::quick_exit _LIBCPP_USING_IF_EXISTS;
      ~~^
While building module 'Core':
While building module 'std' imported from input_line_1:1:
In file included from <module-includes>:34:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/complex.h:27:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/ccomplex:21:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/complex:243:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/sstream:191:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/istream:165:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/ostream:170:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/bitset:131:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/string:576:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/string_view:1025:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/algorithm:1747:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__algorithm/inplace_merge.h:26:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/destruct_n.h:51:41: error: no template named 'is_trivially_destructible'
        {__incr(integral_constant<bool, is_trivially_destructible<_Tp>::value>());}
                                        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/destruct_n.h:55:45: error: no template named 'is_trivially_destructible'
        {__set(__s, integral_constant<bool, is_trivially_destructible<_Tp>::value>());}
                                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/destruct_n.h:59:49: error: no template named 'is_trivially_destructible'
        {__process(__p, integral_constant<bool, is_trivially_destructible<_Tp>::value>());}
                                                ^
While building module 'Core':
While building module 'std' imported from input_line_1:1:
In file included from <module-includes>:34:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/complex.h:27:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/ccomplex:21:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/complex:243:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/sstream:191:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/istream:165:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/ostream:170:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/bitset:131:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/string:576:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/string_view:1025:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/algorithm:1920:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/iterator:684:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__iterator/common_iterator.h:30:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/variant:473:24: error: use of undeclared identifier 'is_trivially_destructible'; did you mean 'is_trivially_destructible_v'?
      {__trait<_Types, is_trivially_destructible, is_destructible>...});
                       ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_trivially_destructible.h:40:23: note: 'is_trivially_destructible_v' declared here
inline constexpr bool is_trivially_destructible_v = is_trivially_destructible<_Tp>::value;
                      ^
While building module 'Core':
While building module 'std' imported from input_line_1:1:
In file included from <module-includes>:34:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/complex.h:27:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/ccomplex:21:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/complex:243:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/sstream:191:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/istream:165:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/ostream:170:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/bitset:131:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/string:576:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/string_view:1025:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/algorithm:1920:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/iterator:684:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__iterator/common_iterator.h:30:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/variant:473:24: error: use of variable template 'is_trivially_destructible_v' requires template arguments
      {__trait<_Types, is_trivially_destructible, is_destructible>...});
                       ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_trivially_destructible.h:40:23: note: template is declared here
inline constexpr bool is_trivially_destructible_v = is_trivially_destructible<_Tp>::value;
                      ^
While building module 'Core':
While building module 'std' imported from input_line_1:1:
In file included from <module-includes>:34:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/complex.h:27:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/ccomplex:21:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/complex:243:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/sstream:191:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/istream:165:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/ostream:170:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/bitset:131:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/string:576:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/string_view:1027:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/functional:515:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__functional/boyer_moore_searcher.h:25:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/unordered_map:530:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__node_handle:65:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/optional:228:29: error: no template named 'is_trivially_destructible'; did you mean 'is_trivially_constructible'?
template <class _Tp, bool = is_trivially_destructible<_Tp>::value>
                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_trivially_constructible.h:22:29: note: 'is_trivially_constructible' declared here
struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible
                            ^
While building module 'Core':
While building module 'std' imported from input_line_1:1:
In file included from <module-includes>:34:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/complex.h:27:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/ccomplex:21:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/complex:243:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/sstream:191:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/istream:165:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/ostream:170:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/bitset:131:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/string:576:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/string_view:1027:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/functional:515:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__functional/boyer_moore_searcher.h:25:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/unordered_map:530:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__node_handle:65:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/optional:547:5: error: no template named 'is_trivially_destructible'; did you mean 'is_trivially_constructible'?
    is_trivially_destructible<_Tp>::value &&
    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_trivially_constructible.h:22:29: note: 'is_trivially_constructible' declared here
struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible
                            ^
While building module 'Core':
While building module 'std' imported from input_line_1:1:
In file included from <module-includes>:34:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/complex.h:27:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/ccomplex:21:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/complex:243:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/sstream:191:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/istream:165:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/ostream:170:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/bitset:131:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/string:576:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/string_view:1027:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/functional:515:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__functional/boyer_moore_searcher.h:25:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/unordered_map:530:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__node_handle:65:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/optional:579:5: error: no template named 'is_trivially_destructible'; did you mean 'is_trivially_constructible'?
    is_trivially_destructible<_Tp>::value &&
    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_trivially_constructible.h:22:29: note: 'is_trivially_constructible' declared here
struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible
                            ^
While building module 'Core':
While building module 'std' imported from input_line_1:1:
In file included from <module-includes>:34:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/complex.h:27:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/ccomplex:21:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/complex:243:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/sstream:191:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/istream:165:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/ostream:170:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/bitset:131:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/string:576:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/string_view:1027:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/functional:518:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__functional/function.h:590:21: error: no template named 'is_trivially_destructible'; did you mean 'is_trivially_constructible'?
                    is_trivially_destructible<_Fun>::value> {};
                    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_trivially_constructible.h:22:29: note: 'is_trivially_constructible' declared here
struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible
                            ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
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/marcomeyer/Software/root/build/etc/cling/Interpreter/RuntimeUniverse.h:27:
In file included from <module-includes>:1:
/Users/marcomeyer/Software/root/build/etc/cling/Interpreter/DynamicExprInfo.h:13:10: fatal error: could not build module 'std'
#include <string>
 ~~~~~~~~^
/Users/marcomeyer/Software/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/marcomeyer/Software/root/build/include/Rtypes.h:23:
In file included from <module-includes>:1:
/Users/marcomeyer/Software/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/marcomeyer/Software/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/marcomeyer/Software/root/build/include/Rtypes.h:29:
In file included from <module-includes>:1:
/Users/marcomeyer/Software/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/marcomeyer/Software/root/build/include/Rtypes.h:195:
In file included from <module-includes>:2:
/Users/marcomeyer/Software/root/build/include/ROOT/RStringView.hxx:25:10: fatal error: could not build module 'std'
#include <string_view>
 ~~~~~~~~^
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


Reproducer
cmake ../src -DCMAKE_INSTALL_PREFIX=$SOFTWARE/root/20240113 -Dimt=ON -Dbuiltin_glew=ON -Dmathmore=ON -DCMAKE_CXX_STANDARD=17
make -j10

ROOT version
ROOT Version 6.26.10
Installation method
build from source
Operating system
macOS
Additional context
No response

Closing comment (2024-04-09T21:22:55Z): You are night, we need to make sure that ROOT compiles if there is already ROOT on the system, or at least that you get a clear error.
There is already an open issue about this, so I'll close this issue as duplicate:
#13101