Hello everyone, i’ve been trying to compile ROOT (git cloning latest) as a dependency to gate on a MacM3 (Sequioa 15.0.1, XCode 16.0 (16A242d)) as a dependency to GATE9.0.
I was getting these errors with multiple versions of the precompiled binaries.
/opt/ROOT/install/include/ROOT/RConfig.hxx:48:2: error: "ROOT requires support for C++17 or higher."
48 | #error "ROOT requires support for C++17 or higher."
| ^
/opt/ROOT/install/include/ROOT/RConfig.hxx:50:2: error: "Pass `-std=c++17` as compiler argument."
50 | #error "Pass `-std=c++17` as compiler argument."
| ^
As such i decided to build it on my own and while i did force all the relevant flags (not just in ROOT also in Geant4):
The pesky error persists. I’m not sure why this is.
As a final note, if you comment out the lines RConfig.hxx it builds just fine.
However (and this is unrelated later i’m getting some linker errors on GATE, but it’s something probably coming off ITK.
Undefined symbols for architecture arm64:
"gdcm::Filename::GetPath()", referenced from:
GateDICOMImage::Read(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>) in GateDICOMImage.cc.o
ld: symbol(s) not found for architecture arm64
c++: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [Gate] Error 1
What i want to understand is why after building it with c++17 i’m still getting these errors.
As a final note, i was restarting the shell (zsh) with each different version and compilation (also tried c++14 but it’s not supported on the latest version of root) and sourcing the new thisroot.
I am not sure I understand the series of problems you list in detail.
I propose to start by confirming that you are able to build ROOT standalone from sources, and if not, to clearly point to the problem which is stopping the build.
I’m sorry if i wasn’t clear.
I’m managing to build ROOT from sources.
However when it’s used as a dependency it’s throwing and error coming from the RConfig.hxx file. I’ve already built it with c++17, so i’m unsure of how to troubleshoot this or if it’s even an inherent problem with ROOT or GATE.
The error message clearly indicates that the the compiler does not believe that the source is being compiled in C++17 mode.
To debug this, re-run the failed build in debug mode (i.e. make VERBOSE=true or ninja -v), capture the command line that is leading to the failing compile and examine it (and/or copy/paste it here). Most likely than not something went wrong in the configuration or re-configuration of the failing build.
Hello, thanks for the input everyone.
Out of curiosity i did open up root in cli to see if everything worked (on the version that managed to build).
However i encountered the following hinting at a severe problem with either pathing or the compiler itself. I’ll try to regenerate my entire env and try again and hopefully update this post if something comes up.
/Users/pki % root
ERROR in cling::CIFactory::createCI(): cannot extract standard library include paths!
Invoking:
LC_ALL=C /Library/Developer/CommandLineTools/usr/bin/c++ -O2 -DNDEBUG -xc++ -E -v /dev/null 2>&1 >/dev/null | awk '/^#include </,/^End of search/{if (!/^#include </ && !/^End of search/){ print }}' | GREP_OPTIONS= grep -E "(c|g)\+\+"
Results was:
With exit code 256
warning: no such sysroot directory: '/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk'
input_line_1:1:10: fatal error: 'new' file not found
#include <new>
^~~~~
input_line_3:37:10: fatal error: 'string' file not found
#include <string>
^~~~~~~~
------------------------------------------------------------
| Welcome to ROOT 6.18/04 https://root.cern |
| (c) 1995-2019, The ROOT Team |
| Built for macosx64 on Sep 11 2019, 15:38:23 |
| From tags/v6-18-04@v6-18-04 |
| Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
------------------------------------------------------------
input_line_7:1:10: fatal error: 'iostream' file not found
#include <iostream>
^~~~~~~~~~
root [0] exit
IncrementalExecutor::executeFunction: symbol '_ZN5cling7runtime6gClingE' unresolved while linking [cling interface function]!
You are probably missing the definition of cling::runtime::gCling
Maybe you need to load the corresponding shared library?
root [1] ^C
I just took a quick look at your last post and I saw this, indicating the SDK for MacOSX10.14. But in your first post you wrote your machine is a Sequioa 15.0.1, XCode 16.0. There seems to be some mismatch between your machine and the compiler infrastructure you are using to compile the code.
I’m guessing i should check the flags again…?
I do however see that macOS is using previous SDKs and points them to newer versions…
% ls -la /Library/Developer/CommandLineTools/SDKs/
total 0
drwxr-xr-x 7 root wheel 224 Oct 2 23:05 .
drwxr-xr-x 5 root wheel 160 Oct 1 20:56 ..
lrwxr-xr-x 1 root wheel 14 Oct 2 23:04 MacOSX.sdk -> MacOSX15.0.sdk
drwxr-xr-x 7 root wheel 224 May 1 00:16 MacOSX14.5.sdk
lrwxr-xr-x 1 root wheel 14 Oct 2 23:04 MacOSX14.sdk -> MacOSX14.5.sdk
drwxr-xr-x 7 root wheel 224 Aug 21 17:15 MacOSX15.0.sdk
lrwxr-xr-x 1 root wheel 14 Oct 2 23:04 MacOSX15.sdk -> MacOSX15.0.sdk
Maybe i could create one from 10.14 and point it to 15.0!
/Library/Developer/CommandLineTools/SDKs % ln -s MacOSX15.0.sdk MacOSX10.14.sdk
ln: MacOSX10.14.sdk: Permission denied
/Library/Developer/CommandLineTools/SDKs % sudo !!
sudo ln -s MacOSX15.0.sdk MacOSX10.14.sdk
/Library/Developer/CommandLineTools/SDKs % l
total 0
lrwxr-xr-x 1 root wheel 14 Oct 2 23:04 MacOSX.sdk -> MacOSX15.0.sdk
lrwxr-xr-x 1 root wheel 14 Oct 11 12:03 MacOSX10.14.sdk -> MacOSX15.0.sdk
drwxr-xr-x 7 root wheel 224 May 1 00:16 MacOSX14.5.sdk
lrwxr-xr-x 1 root wheel 14 Oct 2 23:04 MacOSX14.sdk -> MacOSX14.5.sdk
drwxr-xr-x 8 root wheel 256 Oct 11 12:01 MacOSX15.0.sdk
lrwxr-xr-x 1 root wheel 14 Oct 2 23:04 MacOSX15.sdk -> MacOSX15.0.sdk
/Library/Developer/CommandLineTools/SDKs % root
ERROR in cling::CIFactory::createCI(): cannot extract standard library include paths!
Invoking:
LC_ALL=C /Library/Developer/CommandLineTools/usr/bin/c++ -O2 -DNDEBUG -xc++ -E -v /dev/null 2>&1 >/dev/null | awk '/^#include </,/^End of search/{if (!/^#include </ && !/^End of search/){ print }}' | GREP_OPTIONS= grep -E "(c|g)\+\+"
Results was:
With exit code 256
In file included from input_line_3:39:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/v1/cassert:19:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/v1/__assert:13:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/v1/__assertion_handler:13:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/v1/__config:48:8: warning: "Libc++ only supports Clang 16 and later" [-W#warnings]
# warning "Libc++ only supports Clang 16 and later"
^
In file included from input_line_3:39:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/v1/cassert:19:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/v1/__assert:13:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/v1/__assertion_handler:14:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/v1/__verbose_abort:20:1: error: expected identifier or '{'
_LIBCPP_BEGIN_NAMESPACE_STD
^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/v1/__config:901:81: note: expanded from macro '_LIBCPP_BEGIN_NAMESPACE_STD'
# define _LIBCPP_BEGIN_NAMESPACE_STD namespace _LIBCPP_TYPE_VISIBILITY_DEFAULT std { \
^
In file included from input_line_3:39:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/v1/cassert:19:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/v1/__assert:13:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/v1/__assertion_handler:14:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/v1/__verbose_abort:20:1: error: C++ requires a type specifier for all declarations
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/v1/__config:901:81: note: expanded from macro '_LIBCPP_BEGIN_NAMESPACE_STD'
# define _LIBCPP_BEGIN_NAMESPACE_STD namespace _LIBCPP_TYPE_VISIBILITY_DEFAULT std { \
^
In file included from input_line_3:39:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/v1/cassert:19:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/v1/__assert:13:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/v1/__assertion_handler:14:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/v1/__verbose_abort:20:1: error: expected expression
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/v1/__config:902:32: note: expanded from macro '_LIBCPP_BEGIN_NAMESPACE_STD'
inline namespace _LIBCPP_ABI_NAMESPACE {
^
In file included from input_line_3:39:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/v1/cassert:19:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/v1/__assert:13:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/v1/__assertion_handler:14:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/v1/__verbose_abort:51:26: error: expected ';' after top level declarator
_LIBCPP_END_NAMESPACE_STD
^
------------------------------------------------------------
| Welcome to ROOT 6.18/04 https://root.cern |
| (c) 1995-2019, The ROOT Team |
| Built for macosx64 on Sep 11 2019, 15:38:23 |
| From tags/v6-18-04@v6-18-04 |
| Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
------------------------------------------------------------
root [0] exit
(void (*)(int) __attribute__((noreturn))) Function @0x7ff8043ab69c
at /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdlib.h:145:
void exit(int) _
root [1] %
[100%] Built target GateDigit_hits_digitizer
[100%] Built target GateDigit_coincidence_processor
[100%] Linking CXX executable Gate
ld: warning: ignoring duplicate libraries: '-lpthread'
[100%] Built target Gate
/opt/GATE/build %
A RESOUNDING VICTORY!
Thank you everyone, having more eyes look at something is surely more efficient than me banging my head against a wall and trying to bruteforce the changes.
Sorry to invade this thread, but it is recent and I seem to be having the very same problem as Petros.
However I was not able to understand what you did to solve it. I am trying to install root 28.04 in Mac OS Sequoia 15.1, updated command line tools and xcode and everything without any change in the final result that comes after 3 or 4 hours of expectation (up to 76% of the compilation). I get millions of different errors alternating with warnings stating that clang 16 is required (I am using clang 16).
I leave here a very tiny sample of the disaster:
While building module 'Core':
While building module 'std_new' imported from input_line_1:1:
While building module 'std_private_assert' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/new:89:
In file included from <module-includes>:1:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/__assert:13:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/__assertion_handler:13:
/Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/__config:48:8: warning: "Libc++ only supports Clang 16 and later" [-W#warnings]
# warning "Libc++ only supports Clang 16 and later"
^
While building module 'Core':
While building module 'std_new' imported from input_line_1:1:
While building module 'std_private_assert' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/new:89:
While building module 'std_private_verbose_abort' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/__assertion_handler:14:
In file included from <module-includes>:1:
/Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/__verbose_abort:20:1: error: expected identifier or '{'
_LIBCPP_BEGIN_NAMESPACE_STD
^
/Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/__config:901:81: note: expanded from macro '_LIBCPP_BEGIN_NAMESPACE_STD'
# define _LIBCPP_BEGIN_NAMESPACE_STD namespace _LIBCPP_TYPE_VISIBILITY_DEFAULT std { \
^
While building module 'Core':
While building module 'std_new' imported from input_line_1:1:
While building module 'std_private_assert' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/new:89:
While building module 'std_private_verbose_abort' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/__assertion_handler:14:
In file included from <module-includes>:1:
/Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/__verbose_abort:20:1: error: C++ requires a type specifier for all declarations
/Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/__config:901:81: note: expanded from macro '_LIBCPP_BEGIN_NAMESPACE_STD'
# define _LIBCPP_BEGIN_NAMESPACE_STD namespace _LIBCPP_TYPE_VISIBILITY_DEFAULT std { \
^
While building module 'Core':
While building module 'std_new' imported from input_line_1:1:
While building module 'std_private_assert' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/new:89:
While building module 'std_private_verbose_abort' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/__assertion_handler:14:
In file included from <module-includes>:1:
/Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/__verbose_abort:20:1: error: expected expression
/Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/__config:902:32: note: expanded from macro '_LIBCPP_BEGIN_NAMESPACE_STD'
inline namespace _LIBCPP_ABI_NAMESPACE {
^
While building module 'Core':
While building module 'std_new' imported from input_line_1:1:
While building module 'std_private_assert' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/new:89:
While building module 'std_private_verbose_abort' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/__assertion_handler:14:
In file included from <module-includes>:1:
/Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/__verbose_abort:51:26: error: expected ';' after top level declarator
_LIBCPP_END_NAMESPACE_STD
^
While building module 'Core':
While building module 'std_new' imported from input_line_1:1:
While building module 'std_private_assert' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/new:89:
In file included from <module-includes>:1:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/__assert:13:
/Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/__assertion_handler:14:10: fatal error: could not build module 'std_private_verbose_abort'
#include <__verbose_abort>
~~~~~~~~^
While building module 'Core':
While building module 'std_new' imported from input_line_1:1:
In file included from <module-includes>:1:
/Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/new:89:10: fatal error: could not build module 'std_private_assert'
#include <__assert> // all public C++ headers provide the assertion handler
~~~~~~~~^
While building module 'Core':
While building module 'std_new' imported from input_line_1:1:
While building module 'std_private_type_traits_is_function' imported from /Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/new:93:
In file included from <module-includes>:1:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/__type_traits/is_function.h:12:
/Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/__config:48:8: warning: "Libc++ only supports Clang 16 and later" [-W#warnings]
# warning "Libc++ only supports Clang 16 and later"
It starts like this and goes on over thousands of lines.
Does anyone have an idea of what I can be doing wrong?
It is a pity, though, because I had some things ready for v6.28… I guess I must improve my way of coding not to rely so much in the same version of root…