Hello rooters !
I am trying to compile ROOT v6.20.00 on RHEL9 (GCC 11.5), but the compilation is failing so far.
I had compiled that version of ROOT on CentOS7 (a few years ago), with GCC 7.2.1 (from the devtoolset7). That version was C++11 compliant.
I therefore took the same configuration I then used, and enforced the C++11 compatibility when compiling on RHEL9, but, as said before, it is failing with the following error message:
[4057/8779] Building CXX object core/dictgen/CMakeFiles/Dictgen.dir/src/BaseSelectionRule.cxx.o
FAILED: core/dictgen/CMakeFiles/Dictgen.dir/src/BaseSelectionRule.cxx.o
/usr/bin/c++ -I[...] -std=c++11 -Wno-implicit-fallthrough -Wno-noexcept-type -pipe -Wshadow -Wall -W -Woverloaded-virtual -fsigned-char -pthread -fvisibility=hidden -Wno-shadow -fno-strict-aliasing -Wno-unused-parameter -Wwrite-strings -Wno-long-long -Wno-missing-field-initializers -DLLVM_BUILD_GLOBAL_ISEL -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -O3 -DNDEBUG -std=c++11 -fPIC -Wno-class-memaccess -MD -MT core/dictgen/CMakeFiles/Dictgen.dir/src/BaseSelectionRule.cxx.o -MF core/dictgen/CMakeFiles/Dictgen.dir/src/BaseSelectionRule.cxx.o.d -o core/dictgen/CMakeFiles/Dictgen.dir/src/BaseSelectionRule.cxx.o -c /software/redhat-9-x86_64/root/core/dictgen/src/BaseSelectionRule.cxx
In file included from /software/redhat-9-x86_64/build_v6-20-00/include/ROOT/RWrap_libcpp_string_view.h:545,
from /software/redhat-9-x86_64/build_v6-20-00/include/ROOT/RStringView.hxx:26,
from /software/redhat-9-x86_64/build_v6-20-00/include/TClassEdit.h:65,
from /software/redhat-9-x86_64/root/core/dictgen/src/BaseSelectionRule.cxx:23:
/software/redhat-9-x86_64/build_v6-20-00/include/ROOT/libcpp_string_view.h: In member function ‘constexpr std::experimental::__ROOT::basic_string_view<_CharT, _Traits>::size_type std::experimental::__ROOT::basic_string_view<_CharT, _Traits>::max_size() const’:
/software/redhat-9-x86_64/build_v6-20-00/include/ROOT/libcpp_string_view.h:275:63: error: ‘numeric_limits’ is not a member of ‘std’
275 | size_type max_size() const _NOEXCEPT { return (_VSTD::numeric_limits<size_type>::max)(); }
| ^~~~~~~~~~~~~~
/software/redhat-9-x86_64/build_v6-20-00/include/ROOT/libcpp_string_view.h:275:87: error: expected primary-expression before ‘>’ token
275 | size_type max_size() const _NOEXCEPT { return (_VSTD::numeric_limits<size_type>::max)(); }
| ^
/software/redhat-9-x86_64/build_v6-20-00/include/ROOT/libcpp_string_view.h:275:90: error: ‘::max’ has not been declared; did you mean ‘std::max’?
275 | size_type max_size() const _NOEXCEPT { return (_VSTD::numeric_limits<size_type>::max)(); }
| ^~~
| std::max
In file included from /usr/include/c++/11/algorithm:62,
from /software/redhat-9-x86_64/build_v6-20-00/include/ROOT/RWrap_libcpp_string_view.h:41,
from /software/redhat-9-x86_64/build_v6-20-00/include/ROOT/RStringView.hxx:26,
from /software/redhat-9-x86_64/build_v6-20-00/include/TClassEdit.h:65,
from /software/redhat-9-x86_64/root/core/dictgen/src/BaseSelectionRule.cxx:23:
/usr/include/c++/11/bits/stl_algo.h:3467:5: note: ‘std::max’ declared here
3467 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
[4066/8779] Building CXX object core/dictgen/CMakeFiles/Dictgen.dir/src/rootcling_impl.cxx.o
It seems to me that there are some changes in the standard library which make the compilation to fail…
Any way / idea to make it compiling?
ROOT Version: v6.20.00
Platform: RHEL9.5
Compiler: GCC 11.5
Thanks in advance,
Regards,
Sébastien