Std::regex with ROOT interpreter

Hi,

Is this a compiler issue, or it is a ROOT issue?

root [0] #include <regex>
root [1] std::regex seventh ("[0-9A-Z]+", std::regex::ECMAScript);// with syntax option
Error in <TRint::HandleTermInput()>: std::regex_error caught: regex_error

For the moment, I am using TPRegexp.

I am suspicious about the compiler because it seems regex was not fully implemented in gcc 4.8.5

Thank you for your time.

Regards,
Alvaro.


ROOT Version: 6.18.0
Platform: CC7
Compiler: g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36)


Hi Alvaro,

indeed it’s not. Do you see the same error with gcc 4.9 or a more recent version?

Cheers,
P

Hi Alvaro,

If you are using Centos7, you are indeed out of luck. The system compiler is unfortunately really bad. Among other problems, the std::regex is completely broken.

You can move to a ROOT version that’s been compiled with a decent compiler, though. By setting up an LCG view from cvmfs, you can work with any compiler/operating system from this list:

ls -l /cvmfs/sft.cern.ch/lcg/views/LCG_96/
 x86_64-centos7-clang8-dbg
 x86_64-centos7-clang8-opt
 x86_64-centos7-gcc62-opt
 x86_64-centos7-gcc8-dbg
 x86_64-centos7-gcc8-opt
 x86_64-slc6-gcc8-opt
 x86_64-ubuntu1804-gcc8-dbg
 x86_64-ubuntu1804-gcc8-opt

Just source the setup.sh script from the respective directory.

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