Root compatibility with c++17

Hey there!

I was wondering if there is a root precompiled library that was built using gcc 7.1.0.
My current root version was compiled using gcc 5.3.0, and it seems to fail when I’m running a modern compiler with std=c++1z flag. It seems to be all right with std=c++1y though.

Compiler version: gcc (GCC) 7.1.0
Compiler flags: -std=c++1z -O3 -Wall -fPIC -pthread -m64 -I/cvmfs/cms.cern.ch/slc6_amd64_gcc530/cms/cmssw/CMSSW_9_1_0_pre3/external/slc6_amd64_gcc530/bin/…/…/…/…/…/…/…/slc6_amd64_gcc530/lcg/root/6.08.06-mlhled2/include -fdiagnostics-color=always
Linked libs: -L/cvmfs/cms.cern.ch/slc6_amd64_gcc530/cms/cmssw/CMSSW_9_1_0_pre3/external/slc6_amd64_gcc530/bin/…/…/…/…/…/…/…/slc6_amd64_gcc530/lcg/root/6.08.06-mlhled2/lib -lCore -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lMultiProc -pthread -lm -ldl -rdynamic -lboost_system -lstdc++fs
Linker: g++
Linker flags: -O2 -m64

The error message I get starts with:

In file included from /cvmfs/cms.cern.ch/slc6_amd64_gcc530/cms/cmssw/CMSSW_9_1_0_pre3/external/slc6_amd64_gcc530/bin/../../../../../../../slc6_amd64_gcc530/lcg/root/6.08.06-mlhled2/include/TString.h:41:0,
                 from /cvmfs/cms.cern.ch/slc6_amd64_gcc530/cms/cmssw/CMSSW_9_1_0_pre3/external/slc6_amd64_gcc530/bin/../../../../../../../slc6_amd64_gcc530/lcg/root/6.08.06-mlhled2/include/TNamed.h:29,
                 from /cvmfs/cms.cern.ch/slc6_amd64_gcc530/cms/cmssw/CMSSW_9_1_0_pre3/external/slc6_amd64_gcc530/bin/../../../../../../../slc6_amd64_gcc530/lcg/root/6.08.06-mlhled2/include/TDirectory.h:28,
                 from /cvmfs/cms.cern.ch/slc6_amd64_gcc530/cms/cmssw/CMSSW_9_1_0_pre3/external/slc6_amd64_gcc530/bin/../../../../../../../slc6_amd64_gcc530/lcg/root/6.08.06-mlhled2/include/TROOT.h:29,
                 from src/programs/../../interface/DataStructures_v5.h:39,
                 from src/programs/efficiencyMain.cc:10:
/cvmfs/cms.cern.ch/slc6_amd64_gcc530/cms/cmssw/CMSSW_9_1_0_pre3/external/slc6_amd64_gcc530/bin/../../../../../../../slc6_amd64_gcc530/lcg/root/6.08.06-mlhled2/include/RStringView.h:32:84: error: conflicting declaration of template ‘templat
e<class _CharT, class _Traits> using basic_string_view = std::experimental::fundamentals_v1::basic_string_view<_CharT, _Traits>’
    using basic_string_view = ::std::experimental::basic_string_view<_CharT,_Traits>;
                                                                                    ^

Did you start from a ‘fresh’ build directory? With cmake you can not change (at least not easily) the compiler being used by a build.

Hi Adam,

we do not distribute yet binaries compiled with the c++17 standard. You can build ROOT with the “-Dcxx=17” option to enable the standard (https://root.cern.ch/building-root)

Cheers,
D

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