Root6 compilation on Centos7, g++17 on RooFitCore

Hello

After fix the problem described in https://root-forum.cern.ch/t/root6-compilation-fails-with-afterimage-installation-problem/53128/4

I’m facing another one, this time regarding the RDFUtils

**/Root6_26_10/root_src/tree/dataframe/src/RDFUtils.cxx:** In function '**std::string ROOT::Internal::RDF::GetBranchOrLeafTypeName(TTree&, const string&)**':

**/Root6_26_10/root_src/tree/dataframe/src/RDFUtils.cxx:182:67:** **error:** call of overloaded '**basic_string(TString)**' is ambiguous

return GetLeafTypeName(leaf, std::string(leaf->GetFullName()**)**);

The compilation ends with

[ 89%] Built target RooFitCore
gmake: *** [Makefile:156: all] Error 2

My cmake command is this

cmake -DCMAKE_INSTALL_PREFIX=../root_install ../root_src -DCMAKE_CXX_STANDARD=17 -Droot7=on

Also, during the compiling procedure, I got a lot of warning regarding "Clock skew detected. " but I don’t know exactly how to solve it since I cannot touch the timezone of the computer (in this case a Linux server - so without root privileges to change stuff)

Any hits?
Thanks

Hi @pedromendes,

Which compiler and compiler version are you using? Your compiler says the lookup is ambiguous; does it also output what are the candidates?

This is likely caused by modification times in the future (maybe a network or recovered filesystem?). To avoid problems, make sure that you are doing a build from scratch (not doing an incremental one).

Cheers,
J.

Dear @jalopezg

I’m using g++ (GCC) 8.3.1 20190311 (Red Hat 8.3.1-3)
Here it is the output with the candidates

/home/pmcorreia@UA.PT/Root6_26_10/root_src/tree/dataframe/src/RDFUtils.cxx: In function 'std::string ROOT::Internal::RDF::GetBranchOrLeafTypeName(TTree&, const string&)':
/home/pmcorreia@UA.PT/Root6_26_10/root_src/tree/dataframe/src/RDFUtils.cxx:182:67: error: call of overloaded 'basic_string(TString)' is ambiguous
       return GetLeafTypeName(leaf, std::string(leaf->GetFullName()));
                                                                   ^
In file included from /opt/rh/devtoolset-8/root/usr/include/c++/8/string:52,
                 from /home/pmcorreia@UA.PT/Root6_26_10/root_src/core/meta/inc/TSchemaHelper.h:17,
                 from /home/pmcorreia@UA.PT/Root6_26_10/root_src/core/meta/inc/TGenericClassInfo.h:21,
                 from /home/pmcorreia@UA.PT/Root6_26_10/root_src/core/base/inc/Rtypes.h:191,
                 from /home/pmcorreia@UA.PT/Root6_26_10/root_src/tree/dataframe/inc/ROOT/RDF/RColumnReaderBase.hxx:14,
                 from /home/pmcorreia@UA.PT/Root6_26_10/root_src/tree/dataframe/inc/ROOT/RDataSource.hxx:14,
                 from /home/pmcorreia@UA.PT/Root6_26_10/root_src/tree/dataframe/src/RDFUtils.cxx:12:
/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/basic_string.h:3571:7: note: candidate: 'std::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
       basic_string(basic_string&& __str)
       ^~~~~~~~~~~~
/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/basic_string.h:3554:7: note: candidate: 'std::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());
       ^~~~~~~~~~~~
/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/basic_string.h:3507:7: note: candidate: 'std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>'
       basic_string(const basic_string& __str);
       ^~~~~~~~~~~~
/home/pmcorreia@UA.PT/Root6_26_10/root_src/tree/dataframe/src/RDFUtils.cxx:210:70: error: call of overloaded 'basic_string(TString)' is ambiguous
          return GetLeafTypeName(leaf, std::string(leaf->GetFullName()));
                                                                      ^
In file included from /opt/rh/devtoolset-8/root/usr/include/c++/8/string:52,
                 from /home/pmcorreia@UA.PT/Root6_26_10/root_src/core/meta/inc/TSchemaHelper.h:17,
                 from /home/pmcorreia@UA.PT/Root6_26_10/root_src/core/meta/inc/TGenericClassInfo.h:21,
                 from /home/pmcorreia@UA.PT/Root6_26_10/root_src/core/base/inc/Rtypes.h:191,
                 from /home/pmcorreia@UA.PT/Root6_26_10/root_src/tree/dataframe/inc/ROOT/RDF/RColumnReaderBase.hxx:14,
                 from /home/pmcorreia@UA.PT/Root6_26_10/root_src/tree/dataframe/inc/ROOT/RDataSource.hxx:14,
                 from /home/pmcorreia@UA.PT/Root6_26_10/root_src/tree/dataframe/src/RDFUtils.cxx:12:
/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/basic_string.h:3571:7: note: candidate: 'std::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
       basic_string(basic_string&& __str)
       ^~~~~~~~~~~~
/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/basic_string.h:3554:7: note: candidate: 'std::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());
       ^~~~~~~~~~~~
/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/basic_string.h:3507:7: note: candidate: 'std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>'
       basic_string(const basic_string& __str);
       ^~~~~~~~~~~~
[ 87%] Building CXX object roofit/roofitcore/CMakeFiles/RooFitCore.dir/src/RooAbsStudy.cxx.o
[ 87%] Building CXX object tree/dataframe/CMakeFiles/ROOTDataFrame.dir/src/RJittedDefine.cxx.o
[ 87%] Building CXX object roofit/roofitcore/CMakeFiles/RooFitCore.dir/src/RooAbsTestStatistic.cxx.o
[ 87%] Building CXX object gui/ged/CMakeFiles/Ged.dir/src/TGedEditor.cxx.o
gmake[2]: *** [tree/dataframe/CMakeFiles/ROOTDataFrame.dir/build.make:258: tree/dataframe/CMakeFiles/ROOTDataFrame.dir/src/RDFUtils.cxx.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
[ 87%] Building CXX object gui/ged/CMakeFiles/Ged.dir/src/TGedFrame.cxx.o
[ 87%] Building CXX object gui/ged/CMakeFiles/Ged.dir/src/TGedMarkerSelect.cxx.o
[ 87%] Building CXX object roofit/roofitcore/CMakeFiles/RooFitCore.dir/src/RooAcceptReject.cxx.o
[ 87%] Building CXX object roofit/roofitcore/CMakeFiles/RooFitCore.dir/src/RooAdaptiveIntegratorND.cxx.o
/home/pmcorreia@UA.PT/Root6_26_10/root_src/tree/dataframe/src/RDFInterfaceUtils.cxx: In function 'std::string {anonymous}::EscapeDots(const string&)':
/home/pmcorreia@UA.PT/Root6_26_10/root_src/tree/dataframe/src/RDFInterfaceUtils.cxx:147:37: error: call of overloaded 'basic_string(std::remove_reference<TString&>::type)' is ambiguous
    return std::string(std::move(out));
                                     ^
In file included from /opt/rh/devtoolset-8/root/usr/include/c++/8/string:52,
                 from /home/pmcorreia@UA.PT/Root6_26_10/root_src/core/meta/inc/TSchemaHelper.h:17,
                 from /home/pmcorreia@UA.PT/Root6_26_10/root_src/core/meta/inc/TGenericClassInfo.h:21,
                 from /home/pmcorreia@UA.PT/Root6_26_10/root_src/core/base/inc/Rtypes.h:191,
                 from /home/pmcorreia@UA.PT/Root6_26_10/root_src/core/base/inc/TString.h:26,
                 from /home/pmcorreia@UA.PT/Root6_26_10/root_src/tree/dataframe/inc/ROOT/RDF/RColumnRegister.hxx:14,
                 from /home/pmcorreia@UA.PT/Root6_26_10/root_src/tree/dataframe/inc/ROOT/RDF/InterfaceUtils.hxx:14,
                 from /home/pmcorreia@UA.PT/Root6_26_10/root_src/tree/dataframe/src/RDFInterfaceUtils.cxx:11:
/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/basic_string.h:3571:7: note: candidate: 'std::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
       basic_string(basic_string&& __str)
       ^~~~~~~~~~~~
/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/basic_string.h:3554:7: note: candidate: 'std::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());
       ^~~~~~~~~~~~
/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/basic_string.h:3507:7: note: candidate: 'std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>'
       basic_string(const basic_string& __str);
       ^~~~~~~~~~~~
/home/pmcorreia@UA.PT/Root6_26_10/root_src/tree/dataframe/src/RDFInterfaceUtils.cxx: In function '{anonymous}::ParsedExpression {anonymous}::ParseRDFExpression(std::string_view, const ColumnNames_t&, const ROOT::Internal::RDF::RColumnRegister&, const ColumnNames_t&)':
/home/pmcorreia@UA.PT/Root6_26_10/root_src/tree/dataframe/src/RDFInterfaceUtils.cxx:178:58: error: call of overloaded 'basic_string(TString&)' is ambiguous
       FindUsedColsAndAliases(std::string(preProcessedExpr), treeBranchNames, colRegister, dataSourceColNames);
                                                          ^
In file included from /opt/rh/devtoolset-8/root/usr/include/c++/8/string:52,
                 from /home/pmcorreia@UA.PT/Root6_26_10/root_src/core/meta/inc/TSchemaHelper.h:17,
                 from /home/pmcorreia@UA.PT/Root6_26_10/root_src/core/meta/inc/TGenericClassInfo.h:21,
                 from /home/pmcorreia@UA.PT/Root6_26_10/root_src/core/base/inc/Rtypes.h:191,
                 from /home/pmcorreia@UA.PT/Root6_26_10/root_src/core/base/inc/TString.h:26,
                 from /home/pmcorreia@UA.PT/Root6_26_10/root_src/tree/dataframe/inc/ROOT/RDF/RColumnRegister.hxx:14,
                 from /home/pmcorreia@UA.PT/Root6_26_10/root_src/tree/dataframe/inc/ROOT/RDF/InterfaceUtils.hxx:14,
                 from /home/pmcorreia@UA.PT/Root6_26_10/root_src/tree/dataframe/src/RDFInterfaceUtils.cxx:11:
/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/basic_string.h:3571:7: note: candidate: 'std::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
       basic_string(basic_string&& __str)
       ^~~~~~~~~~~~
/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/basic_string.h:3554:7: note: candidate: 'std::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());
       ^~~~~~~~~~~~
/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/basic_string.h:3507:7: note: candidate: 'std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>'
       basic_string(const basic_string& __str);
       ^~~~~~~~~~~~
/home/pmcorreia@UA.PT/Root6_26_10/root_src/tree/dataframe/src/RDFInterfaceUtils.cxx:203:63: error: call of overloaded 'basic_string(std::remove_reference<TString&>::type)' is ambiguous
    return ParsedExpression{std::string(std::move(exprWithVars)), std::move(usedCols), std::move(varNames)};
                                                               ^
In file included from /opt/rh/devtoolset-8/root/usr/include/c++/8/string:52,
                 from /home/pmcorreia@UA.PT/Root6_26_10/root_src/core/meta/inc/TSchemaHelper.h:17,
                 from /home/pmcorreia@UA.PT/Root6_26_10/root_src/core/meta/inc/TGenericClassInfo.h:21,
                 from /home/pmcorreia@UA.PT/Root6_26_10/root_src/core/base/inc/Rtypes.h:191,
                 from /home/pmcorreia@UA.PT/Root6_26_10/root_src/core/base/inc/TString.h:26,
                 from /home/pmcorreia@UA.PT/Root6_26_10/root_src/tree/dataframe/inc/ROOT/RDF/RColumnRegister.hxx:14,
                 from /home/pmcorreia@UA.PT/Root6_26_10/root_src/tree/dataframe/inc/ROOT/RDF/InterfaceUtils.hxx:14,
                 from /home/pmcorreia@UA.PT/Root6_26_10/root_src/tree/dataframe/src/RDFInterfaceUtils.cxx:11:
/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/basic_string.h:3571:7: note: candidate: 'std::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
       basic_string(basic_string&& __str)
       ^~~~~~~~~~~~
/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/basic_string.h:3554:7: note: candidate: 'std::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());
       ^~~~~~~~~~~~
/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/basic_string.h:3507:7: note: candidate: 'std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>'
       basic_string(const basic_string& __str);
       ^~~~~~~~~~~~
[ 87%] Building CXX object gui/ged/CMakeFiles/Ged.dir/src/TGedPatternSelect.cxx.o
[ 87%] Building CXX object roofit/roofitcore/CMakeFiles/RooFitCore.dir/src/RooAddGenContext.cxx.o
[ 87%] Building CXX object roofit/roofitcore/CMakeFiles/RooFitCore.dir/src/RooAddition.cxx.o
[ 87%] Building CXX object gui/ged/CMakeFiles/Ged.dir/src/TGraphEditor.cxx.o
[ 87%] Building CXX object roofit/roofitcore/CMakeFiles/RooFitCore.dir/src/RooAddModel.cxx.o
[ 87%] Building CXX object roofit/roofitcore/CMakeFiles/RooFitCore.dir/src/RooAddPdf.cxx.o
[ 87%] Linking CXX shared library ../../lib/libProofPlayer.so
[ 87%] Building CXX object roofit/roofitcore/CMakeFiles/RooFitCore.dir/src/RooAICRegistry.cxx.o
[ 87%] Built target ProofPlayer
[ 87%] Building CXX object gui/ged/CMakeFiles/Ged.dir/src/TH1Editor.cxx.o
[ 87%] Building CXX object roofit/roofitcore/CMakeFiles/RooFitCore.dir/src/RooArgList.cxx.o
/home/pmcorreia@UA.PT/Root6_26_10/root_src/tree/dataframe/src/RDFInterfaceUtils.cxx: At global scope:
/home/pmcorreia@UA.PT/Root6_26_10/root_src/tree/dataframe/src/RDFInterfaceUtils.cxx:80:1: warning: 'std::pair<std::vector<std::basic_string<char> >, std::vector<std::basic_string<char> > > {anonymous}::FindUsedColsAndAliases(const string&, const ColumnNames_t&, const ROOT::Internal::RDF::RColumnRegister&, const ColumnNames_t&)' defined but not used [-Wunused-function]
 FindUsedColsAndAliases(const std::string &expr, const ColumnNames_t &treeBranchNames,
 ^~~~~~~~~~~~~~~~~~~~~~
gmake[2]: *** [tree/dataframe/CMakeFiles/ROOTDataFrame.dir/build.make:230: tree/dataframe/CMakeFiles/ROOTDataFrame.dir/src/RDFInterfaceUtils.cxx.o] Error 1
[ 87%] Building CXX object roofit/roofitcore/CMakeFiles/RooFitCore.dir/src/RooArgProxy.cxx.o
[ 87%] Building CXX object roofit/roofitcore/CMakeFiles/RooFitCore.dir/src/RooArgSet.cxx.o
[ 87%] Building CXX object roofit/roofitcore/CMakeFiles/RooFitCore.dir/src/Initialisation.cxx.o
[ 87%] Building CXX object gui/ged/CMakeFiles/Ged.dir/src/TH2Editor.cxx.o
[ 87%] Building CXX object gui/ged/CMakeFiles/Ged.dir/src/TLineEditor.cxx.o
gmake[1]: *** [CMakeFiles/Makefile2:29133: tree/dataframe/CMakeFiles/ROOTDataFrame.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....

Hello, @pedromendes!

Here Building ROOT from source - ROOT it is said that

Also note that compatibility with compilers shipped with devtoolsets on CentOS or Red Hat is not guaranteed.

Also look here Devtoolset/gcc-toolset compatibility

So I on CentOS 7.9 got same error messages and had to build devtoolset components from source on my own, and also their prerequisites, because Centos 7 repos are outdated. It was very long and tedious process with many errors but I finally was able to compile ROOT 6.26 on my machine.
Probably that’s bad way because it is hard to maintain and update. Moreover, now I need to handle with LDCONFIG and other build options so my applications are built with proper gcc version and linked against proper libraries.
So, sadly, my experience with coping with this problem is hardly reproducible and I can only advise you to change Linux distro or build ROOT inside Docker container.

I hope my answer would be useful for you.

Possible solution might be using mambaforge, as mentioned in this thread

I was able to easily install latest version of gcc in Ubuntu with following commands:

curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-$(uname)-$(uname -m).sh"
bash Mambaforge-$(uname)-$(uname -m).sh
source mambaforge/bin/activate
mamba create -n gcctest gxx -c conda-forge
conda activate gcctest

I guess that this should work in Centos also.
So you could get latest gcc version in this way and try to build ROOT with it.

Hi,
I would advise against building ROOT from source, unless you specifically need to make some modifications to the source code, or you have ROOT in the cmake build of your own project.

Yes, devtoolset cannot be used to build ROOT reliably.

Please, if you only need to use ROOT, install it via one of the supported installation methods at Installing ROOT - ROOT. For example, use mamba as the previous post was suggesting to install the conda package of ROOT.

On Centos7 in particular, another very good possibility to get your software stack set up is cvmfs

1 Like

I just saw this comment and it is a good chance to remind you that ROOT is also shipped in Docker containers as specified in the installation instructions

1 Like

Hello all

Docker unfortunately is not a solution as well, is neither installed nor I have privileges to install it in the server.
I’m gonna try mamba.

Thanks

Maybe they provide the “apptainer” / “singularity”, which do not require any privileges (and can use “docker” images).

So Mamba worked like a charm, I’ve followed this instructions in addition with mamba install root and finally I got Root6_26_10 working in Centos7 without problems.

Thank you all!