6.16.00 Build Fails on gcc 8.1.0 with C++17 enabled

Hi All,

While building ROOT 6.16.00 with the C++17 option enabled using gcc 8.1.0 I encountered an error that prevented compilation. I used the following configuration command:

cmake root-6.16.00 -DCMAKE_INSTALL_PREFIX=/opt/root/6.16.00 -Dcxx17=ON -Dpythia8=OFF -Dsqlite=OFF

I then encounter this error:

[ 75%] Building CXX object hist/hist/CMakeFiles/Hist.dir/G__Hist.cxx.o
In file included from /projects/gress/dependencies/root/gcc_8.1.0/6.16.00/build/include/TF1.h:27,
                 from /projects/gress/dependencies/root/gcc_8.1.0/6.16.00/build/hist/hist/G__Hist.cxx:54:
/projects/gress/dependencies/root/gcc_8.1.0/6.16.00/build/include/TFormula.h: In member function ‘std::__cxx11::string TFormula::GetGradientFuncName() const’:
/projects/gress/dependencies/root/gcc_8.1.0/6.16.00/build/include/TFormula.h:125:36: error: call of overloaded ‘basic_string(const TString&)’ is ambiguous
       return std::string(fClingName) + "_grad";
                                    ^
In file included from /packages2/.packages2/x86_64-pc-linux-gnu-rhel6/gcc/8.1.0/include/c++/8.1.0/string:52,
                 from /projects/gress/dependencies/root/gcc_8.1.0/6.16.00/build/include/TSchemaHelper.h:17,
                 from /projects/gress/dependencies/root/gcc_8.1.0/6.16.00/build/include/TGenericClassInfo.h:16,
                 from /projects/gress/dependencies/root/gcc_8.1.0/6.16.00/build/include/Rtypes.h:192,
                 from /projects/gress/dependencies/root/gcc_8.1.0/6.16.00/build/include/TObject.h:17,
                 from /projects/gress/dependencies/root/gcc_8.1.0/6.16.00/build/include/TNamed.h:25,
                 from /projects/gress/dependencies/root/gcc_8.1.0/6.16.00/build/include/TDictionary.h:44,
                 from /projects/gress/dependencies/root/gcc_8.1.0/6.16.00/build/include/TClass.h:23,
                 from /projects/gress/dependencies/root/gcc_8.1.0/6.16.00/build/hist/hist/G__Hist.cxx:13:
/packages2/.packages2/x86_64-pc-linux-gnu-rhel6/gcc/8.1.0/include/c++/8.1.0/bits/basic_string.h:531:7: note: candidate: ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’
       basic_string(basic_string&& __str) noexcept
       ^~~~~~~~~~~~
/packages2/.packages2/x86_64-pc-linux-gnu-rhel6/gcc/8.1.0/include/c++/8.1.0/bits/basic_string.h:509:7: note: candidate: ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’
       basic_string(const _CharT* __s, const _Alloc& __a = _Alloc())
       ^~~~~~~~~~~~
/packages2/.packages2/x86_64-pc-linux-gnu-rhel6/gcc/8.1.0/include/c++/8.1.0/bits/basic_string.h:437:7: note: candidate: ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’
       basic_string(const basic_string& __str)
       ^~~~~~~~~~~~
make[2]: *** [hist/hist/CMakeFiles/Hist.dir/G__Hist.cxx.o] Error 1
make[1]: *** [hist/hist/CMakeFiles/Hist.dir/all] Error 2
make: *** [all] Error 2

Any help is appreciated.


ROOT Version: 6.16.00
Platform: RHEL 6
Compiler: gcc 8.1.0


Hi,

You need to apply: https://github.com/root-project/root/commit/97b25539d591a22955967d1ad49c8261e09edf0b

To you version of ROOT (and/or pull the tip of the v6-16-00-patches branch.

Cheers,
Philippe.

This is a production machine so I’ll stay away from those options.

Is there a timeline for the next 6.16 release with these fixes?
Is this also an issue with 6.14.06?

Thanks.

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