Compiling ROOT v6.20.00 on RHEL9

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

Hi Sébastien,

Indeed 6.20 is an almost 5y old release.
We do not integrate it any more, therefore some issues when using a very recent compiler could arise.
I can see two rough options to solve your situation:

  1. Try an older compiler, from 2020 (gcc9, 10 and 4.8 where the ones available to us at the time)
  2. Try to #include <limits> header in string view

Of course, moving to a recent ROOT version would be in my opinion the preferred solution.

Cheers,
Danilo

Hi Danilo,

Thanks for your quick reply! Here is a quick follow-up on my issue.

I tried 2., and indeed it fixed the issue discussed. However I (still) had a few others after that, still related to differences between the C std lib between then and now… At the end, I gave up, too much trouble to make it compiling (and too much time used to try to fix things).

About 1., I am a bit reluctant to install an old GCC (that more users may use)… So I made a CentOS7 Apptainer to run this old ROOT version (still installed and available from our software area).

Of course the idea for this group is to finish some work before moving on to a recent ROOT version, so the Apptainer option is good enough.

Thanks again!
Cheers,

Sébastien

1 Like

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