ROOT 6.26.10 compile problem on MacOSX Ventura

Dear ROOT experts,

I am trying to compile ROOT 6.26.10 on my MacBook AIR running MacOSX Ventura, after having the XCode command line tools installed, the “Apple clang version 14.0.0 (clang-1400.0.29.202)” version of C++, cmake version 3.25.1 and using the following instructions:

mkdir root_v6.26.10
mkdir root_v6.26.10_BUILD
tar xzf root_v6.26.10.source.tar.gz 
cd root_v6.26.10_BUILD/
cmake -DCMAKE_INSTALL_PREFIX=../root_v6.26.10 ../root-6.26.10 -Dbuiltin_glew=ON
cmake --build . --target install 

Unfortunately, I get the following error message:

[ 74%] Building CXX object core/base/CMakeFiles/Base.dir/src/String.cxx.o
In file included from /Users/govoni/private/job/cms/software/root-6.26.10/core/base/src/String.cxx:19:
In file included from /Users/govoni/private/job/cms/software/root-6.26.10/core/base/inc/TBuffer.h:24:
In file included from /usr/local/include/TDataType.h:26:
In file included from /usr/local/include/TDictionary.h:45:
In file included from /usr/local/include/TNamed.h:29:
In file included from /usr/local/include/TString.h:41:
**/usr/local/include/RStringView.h:24:12:** **fatal error:** **'experimental/string_view' file not found**
# include <experimental/string_view>
**^~~~~~~~~~~~~~~~~~~~~~~~~~**
1 error generated.
make[2]: *** [core/base/CMakeFiles/Base.dir/src/String.cxx.o] Error 1
make[1]: *** [core/base/CMakeFiles/Base.dir/all] Error 2
make: *** [all] Error 2

How may I fix it?

Best regards,

pietro


ROOT Version: 6.26.10
Platform: MacOSX Ventura
Compiler: Apple clang version 14.0.0 (clang-1400.0.29.202)


Hi @pietrogovoni,

First of all, welcome to the ROOT forum!

According to the /usr/local/include/... paths above, it might seem that you have a previous installation of ROOT lying around there.
FWIW, ROOT should not be picking up those headers during build anyways; I think this was solved in master but the proper fix wasn’t backported, @Axel.

That said, and unless otherwise justified, we discourage our users from building ROOT from source. Instead, binary distributions should be used. Please, tale a look at Installing ROOT - ROOT for installation instructions. For macOS, we recommend either installing via Conda or macOS-specific procedure.

Cheers,
J.

Dear Javier,

thanks a lot for your reply; I tried and use homebrew to install root, but something fishy happened, since when I try and compile a c++ program I get some inconsistencies:

bug:testo_e_soluzione $ c++ -o genera genera.cpp lib.cc `root-config --glibs --cflags`
ld: warning: ignoring file /usr/local/Cellar/root/6.26.06_2/lib/root/libImt.so, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file /usr/local/Cellar/root/6.26.06_2/lib/root/libNet.so, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file /usr/local/Cellar/root/6.26.06_2/lib/root/libRIO.so, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file /usr/local/Cellar/root/6.26.06_2/lib/root/libCore.so, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file /usr/local/Cellar/root/6.26.06_2/lib/root/libGraf.so, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file /usr/local/Cellar/root/6.26.06_2/lib/root/libHist.so, building for macOS-arm64 but attempting to link with file built for macOS-x86_64ld: warning: ignoring file /usr/local/Cellar/root/6.26.06_2/lib/root/libGpad.so, building for macOS-arm64 but attempting to link with file built for macOS-x86_64

which is why I tried to compile myself.
Anyways, following your comment I removed myself all old root include files and restarted the compilation from scratch, and yet I get to the same error it seems:

[ 74%] Building CXX object core/base/CMakeFiles/Base.dir/src/String.cxx.o
In file included from /Users/govoni/private/job/cms/software/root-6.26.10/core/base/src/String.cxx:19:
In file included from /Users/govoni/private/job/cms/software/root-6.26.10/core/base/inc/TBuffer.h:24:
In file included from /Users/govoni/private/job/cms/software/root-6.26.10/core/meta/inc/TDataType.h:25:
In file included from /Users/govoni/private/job/cms/software/root-6.26.10/core/meta/inc/TDictionary.h:44:
In file included from /Users/govoni/private/job/cms/software/root-6.26.10/core/base/inc/TNamed.h:26:
In file included from /Users/govoni/private/job/cms/software/root-6.26.10/core/base/inc/TString.h:29:
/Users/govoni/private/job/cms/software/root-6.26.10/core/foundation/inc/ROOT/RStringView.hxx:30:12: fatal error: 'experimental/string_view' file not found
#  include <experimental/string_view>
           ^~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [core/base/CMakeFiles/Base.dir/src/String.cxx.o] Error 1
make[1]: *** [core/base/CMakeFiles/Base.dir/all] Error 2
make: *** [all] Error 2

Is there anything I can do to solve this problem?
I am not willing to compile from scratch if not needed, of course :slight_smile :slight_smile:

Best regards,

pietro

Ciao Pietro,

I just tried an installation on one of our Mac nodes by following the simple steps I outlined here. I guess this should work for you as well, let me know.

Regarding the warning you saw when installing with brew, most probably they come from the conflicting installation in your system. In general, you should avoid having different versions of the same software in the same environment. Something like a Python virtual environment like the one you can create with the instructions I linked above kills two birds with one stone.

Alternatively, if you want to keep the brew installation, make sure you always have exactly one version of ROOT installed on the system (although I would advise against this in general).

Cheers,
Vincenzo

Ciao Vincenzo,

thanks a lot for the hint!
Regarding possible conflicts with Homebrew: to make sure, when I tried that I run brew uninstall root before any installation and even cleaned up the /usr/local/include from all root include files.

Anyhow, your recipe worked in the sense that the installation, which I had to do with python 3.10, worked in the sense that it seemed to end with no errors, but I cannot find root, what am I missing?

Cheers,

pietro

Ciao Vincenzo,

I eventually did manage to get root working, thanks to all for the help!

pietro

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.