Unable to compile ROOT 6.28/04 with c++14

I may be missing something but I seem to be unable to compile ROOT 6.28/04 with c++14. I use

cmake ../root/root-6.28.04/ -DCMAKE_CXX_VERSION=14

And get the following confirmation at the end of the cmake output

System          Linux-3.10.0-1160.88.1.el7.x86_64
Processor       36 core Intel(R) Xeon(R) CPU E5-2695 v4 @ 2.10GHz (x86_64)
Build type      Release
Compiler        GNU 6.3.0
Compiler flags:
C                -pipe -Wall -W -pthread -O3 -DNDEBUG
C++              -std=c++14 -pipe  -Wshadow -Wall -W -Woverloaded-virtual -fsigned-char -pthread -O3 -DNDEBUG
Linker flags:
Executable       -rdynamic
Module
Shared           -Wl,--no-undefined -Wl,--hash-style="both"

As far as I can tell, gcc6.3.0 should have full c++14 capability. However, eventually I get the following errors:

Consolidate compiler generated dependencies of target Dictgen
Consolidate compiler generated dependencies of target ClingUtils
Consolidate compiler generated dependencies of target MetaCling
[ 78%] Built target ClingUtils
[ 78%] Built target Dictgen
Consolidate compiler generated dependencies of target rootcling_stage1
[ 78%] Built target rootcling_stage1
[ 78%] Built target MetaCling
[ 78%] Generating G__Core.cxx, ../lib/Core.pcm
[ 78%] Linking CXX shared library ../../../lib/libCling.so
/home/root-build/etc/cling/std.modulemap:462:12: error: header 'bits/invoke.h' not found
    header "bits/invoke.h"
           ^
input_line_1:1:10: note: submodule of top-level module 'std' implicitly imported here
#include <new>
         ^
Warning in cling::IncrementalParser::CheckABICompatibility():
  Failed to extract C++ standard library version.
While building module 'Core':
While building module 'Cling_Runtime' imported from input_line_2:1:
While building module 'Cling_Runtime_Extra' imported from /home/root-build/etc/cling/Interpreter/RuntimeUniverse.h:27:
/home/root-build/etc/cling/std.modulemap:462:12: error: header 'bits/invoke.h' not found
    header "bits/invoke.h"
           ^
/home/root-build/etc/cling/Interpreter/DynamicExprInfo.h:13:10: note: submodule of top-level module 'std' implicitly imported here
#include <string>
         ^
/home/root-build/etc/cling/Interpreter/DynamicExprInfo.h:40:7: error: use of undeclared identifier 'std'
      std::string m_Result;
      ^
While building module 'Core':
While building module 'Cling_Runtime' imported from input_line_2:1:
While building module 'Cling_Runtime_Extra' imported from /home/root-build/etc/cling/Interpreter/RuntimeUniverse.h:27:
/home/root-build/etc/cling/std.modulemap:462:12: error: header 'bits/invoke.h' not found
    header "bits/invoke.h"
           ^
/home/root-build/etc/cling/Interpreter/DynamicLookupLifetimeHandler.h:12:10: note: submodule of top-level module 'std' implicitly imported here
#include <string>
         ^
/home/root-build/etc/cling/Interpreter/DynamicLookupLifetimeHandler.h:56:7: error: use of undeclared identifier 'std'
      std::string m_Type;
      ^
While building module 'Core':
While building module 'Cling_Runtime' imported from input_line_2:1:
While building module 'Cling_Runtime_Extra' imported from /home/root-build/etc/cling/Interpreter/RuntimeUniverse.h:27:
/home/root-build/etc/cling/std.modulemap:462:12: error: header 'bits/invoke.h' not found
    header "bits/invoke.h"
           ^
/home/root-build/etc/cling/Interpreter/Value.h:17:10: note: submodule of top-level module 'std' implicitly imported here
#include <type_traits>
         ^
/home/root-build/etc/cling/Interpreter/Value.h:93:41: error: use of undeclared identifier 'std'
    template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
                                        ^
/home/root-build/etc/cling/Interpreter/Value.h:93:55: error: expected ',' or '>' in template-parameter-list
    template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
                                                      ^
/home/root-build/etc/cling/Interpreter/Value.h:93:75: error: no type named 'value' in the global namespace; did you mean 'Value'?
    template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
                                                                          ^~~~~~~
                                                                          Value
/home/root-build/etc/cling/Interpreter/Value.h:42:26: note: 'Value' declared here
  class CLING_LIB_EXPORT Value {
                         ^
/home/root-build/etc/cling/Interpreter/Value.h:93:82: error: expected member name or ';' after declaration specifiers
    template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
                                                                          ~~~~~~~^
/home/root-build/etc/cling/Interpreter/Value.h:198:11: error: use of undeclared identifier 'std'
        = std::is_reference<T>::value ?
          ^
/home/root-build/etc/cling/Interpreter/Value.h:198:29: error: 'T' does not refer to a value
        = std::is_reference<T>::value ?
                            ^
/home/root-build/etc/cling/Interpreter/Value.h:195:21: note: declared here
    template <class T>
                    ^
/home/root-build/etc/cling/Interpreter/Value.h:198:33: error: no member named 'value' in the global namespace
        = std::is_reference<T>::value ?
                              ~~^
/home/root-build/etc/cling/Interpreter/Value.h:199:40: error: use of undeclared identifier 'std'
       determineStorageTypeT((typename std::remove_reference<T>::type**)nullptr)
                                       ^
/home/root-build/etc/cling/Interpreter/Value.h:199:61: error: expected ')'
       determineStorageTypeT((typename std::remove_reference<T>::type**)nullptr)
                                                            ^
/home/root-build/etc/cling/Interpreter/Value.h:199:30: note: to match this '('
       determineStorageTypeT((typename std::remove_reference<T>::type**)nullptr)
                             ^
While building module 'Core':
While building module 'Cling_Runtime' imported from input_line_2:1:
In file included from <module-includes>:1:
/home/root-build/etc/cling/Interpreter/RuntimeUniverse.h:27:10: fatal error: could not build module 'Cling_Runtime_Extra'
#include "cling/Interpreter/Visibility.h"
 ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input_line_2:1:10: fatal error: could not build module 'Cling_Runtime'
#include <cling/Interpreter/RuntimeUniverse.h>
 ~~~~~~~~^
../../../etc/cling//plugins/lib/libcladDifferentiator.a: member ../../../etc/cling//plugins/lib/libcladDifferentiator.a(MultiplexExternalRMVSource.cpp.o) in archive is not an object
collect2: error: ld returned 1 exit status
make[2]: *** [lib/libCling.so] Error 1
make[1]: *** [core/metacling/src/CMakeFiles/Cling.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
In file included from input_line_3:1:
In file included from /home/root-build/etc/cling/lib/clang/13.0.0/include/assert.h:8:
In file included from /usr/include/assert.h:36:
In file included from /usr/include/features.h:399:
/usr/include/gnu/stubs.h:7:11: fatal error: 'gnu/stubs-32.h' file not found
# include <gnu/stubs-32.h>
          ^~~~~~~~~~~~~~~~
While building module 'Core':
While building module 'ROOT_Rtypes' imported from /home/root-build/include/Rtypes.h:23:
/home/root-build/etc/cling/std.modulemap:462:12: error: header 'bits/invoke.h' not found
    header "bits/invoke.h"
           ^
/home/root-build/include/RtypesCore.h:28:10: note: submodule of top-level module 'std' implicitly imported here
#include <cstddef> // size_t, NULL
         ^
/home/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 /home/root-build/include/Rtypes.h:195:
/home/root-build/etc/cling/std.modulemap:462:12: error: header 'bits/invoke.h' not found
    header "bits/invoke.h"
           ^
/home/root-build/include/ROOT/RStringView.hxx:30:12: note: submodule of top-level module 'std' implicitly imported here
#  include <experimental/string_view>
           ^
/home/root-build/include/ROOT/RStringView.hxx:37:48: error: no template named 'char_traits' in namespace 'std'
   template<class _CharT, class _Traits = std::char_traits<_CharT> >
                                          ~~~~~^
/home/root-build/include/ROOT/RStringView.hxx:38:37: error: no member named 'experimental' in namespace 'std'
   using basic_string_view = ::std::experimental::basic_string_view<_CharT,_Traits>;
                             ~~~~~~~^
/home/root-build/include/ROOT/RStringView.hxx:41:12: error: no template named 'basic_string_view'
   typedef basic_string_view<char> string_view;
           ^
/home/root-build/include/ROOT/RStringView.hxx:42:12: error: no template named 'basic_string_view'
   typedef basic_string_view<char16_t> u16string_view;
           ^
/home/root-build/include/ROOT/RStringView.hxx:43:12: error: no template named 'basic_string_view'
   typedef basic_string_view<char32_t> u32string_view;
           ^
/home/root-build/include/ROOT/RStringView.hxx:44:12: error: no template named 'basic_string_view'
   typedef basic_string_view<wchar_t> wstring_view;
           ^
/home/root-build/include/ROOT/RStringView.hxx:54:45: error: unknown type name 'size_t'
   inline double stod(std::string_view str, size_t *pos)
                                            ^
/home/root-build/include/ROOT/RStringView.hxx:56:39: error: member reference base type 'std::string_view' (aka 'int') is not a structure or union
      return std::stod(std::string(str.data(), str.size()),pos);
                                   ~~~^~~~~
/home/root-build/include/ROOT/RStringView.hxx:56:51: error: member reference base type 'std::string_view' (aka 'int') is not a structure or union
      return std::stod(std::string(str.data(), str.size()),pos);
                                               ~~~^~~~~
/home/root-build/include/ROOT/RStringView.hxx:56:29: error: no member named 'string' in namespace 'std'
      return std::stod(std::string(str.data(), str.size()),pos);
                       ~~~~~^
While building module 'Core':
While building module 'ROOT_Foundation_Stage1_NoRTTI' imported from /home/root-build/include/Rtypes.h:195:
/home/root-build/etc/cling/std.modulemap:462:12: error: header 'bits/invoke.h' not found
    header "bits/invoke.h"
           ^
/home/root-build/include/ROOT/RStringView.hxx:66:10: note: submodule of top-level module 'std' implicitly imported here
#include <string>
         ^
/home/root-build/include/ROOT/RStringView.hxx:71:13: error: no type named 'string' in namespace 'std'
inline std::string &operator+=(std::string &left, std::string_view right)
       ~~~~~^
/home/root-build/include/ROOT/RStringView.hxx:71:37: error: no type named 'string' in namespace 'std'
inline std::string &operator+=(std::string &left, std::string_view right)
                               ~~~~~^
/home/root-build/include/ROOT/RStringView.hxx:73:28: error: member reference base type 'std::string_view' (aka 'int') is not a structure or union
   return left.append(right.data(), right.size());
                      ~~~~~^~~~~
/home/root-build/include/ROOT/RStringView.hxx:73:42: error: member reference base type 'std::string_view' (aka 'int') is not a structure or union
   return left.append(right.data(), right.size());
                                    ~~~~~^~~~~
/home/root-build/include/ROOT/RStringView.hxx:85:8: error: unknown type name 'size_t'
       size_t      fLength{0};
       ^
/home/root-build/include/ROOT/RStringView.hxx:88:47: error: unknown type name 'size_t'
       explicit TStringView(const char *cstr, size_t len) : fData(cstr), fLength(len) {}
                                              ^
While building module 'Core':
While building module 'ROOT_Foundation_Stage1_NoRTTI' imported from /home/root-build/include/Rtypes.h:195:
/home/root-build/etc/cling/std.modulemap:462:12: error: header 'bits/invoke.h' not found
    header "bits/invoke.h"
           ^
/home/root-build/include/TClassEdit.h:29:10: note: submodule of top-level module 'std' implicitly imported here
#include <cxxabi.h>
         ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
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

Which I’m guessing is an indication that c++17 features are required. Is version 6.28/04 incompatible with c++14? I have put this as an issue here, not sure if that’s the appropriate place or not.

Thanks

_ROOT Version: 6.28
_Platform: Linux
_Compiler: gcc 6.3.0


Try with

cmake ../root/root-6.28.04/ -DCMAKE_CXX_STANDARD=14

Same error unfortunately

Well, I just built ROOT v6.28.04 with gcc 9.4.0 and -DCMAKE_CXX_STANDARD=14 without any problem. Then maybe @axel knows what could be the issue?

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