How to use c++17 with root

Hi all,
I am working on Lxplus, trying to use “for_each” to do some parallel calculations wih c++17.
But the root can not load the head “execution”. Below is a test:

using namespace std;
int test(){
    return 1;

The error is

fatal error: 'execution' file not found

Do you have any idea about this problem? Thank you very much!

Please read tips for efficient and successful posting and posting code

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided

Hi @11111 ,
you need a ROOT installation that was built for C++17. You can check which standard ROOT was built with e.g. with root-config --cflags.

On LXPLUS, you can grab one such build from the LCG releases, e.g.:

[eguiraud@lxplus716 ~]$ source /cvmfs/
[eguiraud@lxplus716 ~]$ which root && root-config --cflags
-pthread -std=c++17 -m64 -I/cvmfs/


1 Like

Hi Enrico,
Yes, It works. Thank you very much!


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