What are the magic words to build root 6.14.08 w/ c++17 and gcc8.2 (or gcc8.3)? I have tried all combinations of
cmake -Dcxx=17
cmake -Dcxx17=ON
cmake -DCMAKE_CXX_STANDARD=17
and I still see the compilation commands littered with std=c++11 and std=c++1z, and then various failures due to standards mis-matches.
even when I use all three I see this from the cmake output:
– Compiler Flags: -Wno-implicit-fallthrough -Wno-noexcept-type -pipe -m64 -Wshadow -Wall -W -Woverloaded-virtual -fsigned-char -pthread -std=c++1z
thanks, Charles.
ROOT Version: 6.14.08 Platform: x86 (cori.lbl.gov) Compiler: gcc 8.2
Hi,
note that c++1z is an alternative name for c++17, so that cmake output looks ok.
If you get standard mismatches, try erasing the build directory and start clean.
In case it helps: if I remember correctly, for v6.14 -Dcxx17=ON should be the only flag required. In later versions we switched to the standard -DCMAKE_CXX_STANDARD=17. You can check the output you get when you give the cmake configuration command (cmake -Dcxx17=ON -D... path/to/root): it’s verbose, but it should tell you what standard is being set for the project.
It appears that-Dcxx17=ON did the trick (meaning I was able to use it with c++17 compliant code that was cmake’d with -DCMAKE_CXX_STANDARD=17). -Dcxx=17 and -DCMAKE_CXX_STANDARD=17 don’t work with 6.14.08.
I was a little confused by root-config --clfags which gave"-std=c++17" instead of the "-std=c++1z" I was expecting.