Failure during build

Hi,
I am trying to build root from source and followed the instructions from the website. This is not the first time I build root from source, however, this times I fail ending up with a valid build. This is the error I receive after running make:

[49%] Generating etc/dictpch/allLinkDefs.h, etc/dictpch/allHeaders.h, etc/dictpch/allCppflags.txt
  File "/home/nmeinert/root/build/unix/makepchinput.py", line 419
    print "\nGenerating PCH for %s\n" %" ".join(modulesList)
                                    ^
SyntaxError: invalid syntax
gmake[2]: *** [CMakeFiles/onepcm.dir/build.make:159: etc/dictpch/allLinkDefs.h] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:158: CMakeFiles/onepcm.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
...
[ 52%] Linking CXX shared library ../../lib/libGenVector.so
[ 52%] Built target GenVector
[ 52%] Linking CXX shared library ../../lib/libMathCore.so
[ 52%] Built target MathCore
[ 52%] Linking CXX shared library ../../lib/libXMLIO.so
[ 52%] Built target XMLIO
gmake: *** [Makefile:152: all] Error 2

The results are basically the same for g++ 6.4.0 and clang++ 6.0.0, and the latest version and v6-04-02. I only added RooFit and left all other options at their defaults.

I am not sure, whether this first error is causing the problem, but this seems to be a python 2 vs 3 issue, am I right? My default python version is 3.5.4 and not 2.x…

Is there a way to get a more verbose error log? The errors in CMakeFiles/CmakeError.log seems to be rather unrelated, e.g. last lines of the log file: checking some C++14/17 features

Run Build Command:"/usr/bin/gmake" "cmTC_9170e/fast"
/usr/bin/gmake -f CMakeFiles/cmTC_9170e.dir/build.make CMakeFiles/cmTC_9170e.dir/build
gmake[1]: Entering directory '/home/nmeinert/root-build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_9170e.dir/src.cxx.o
/usr/x86_64-pc-linux-gnu/gcc-bin/6.4.0/g++    -pipe -m64 -Wall -W -Woverloaded-virtual -fsigned-char -fPIC -pthread -std=c++11 -Wno-deprecated-declarations -Dfound_stdstringview   -o CMakeFiles/cmTC_9170e.dir/src.cxx.o -c /home/nmeinert/root-build/CMakeFiles/CMakeTmp/src.cxx
/home/nmeinert/root-build/CMakeFiles/CMakeTmp/src.cxx:1:23: fatal error: string_view: No such file or directory
 #include <string_view>
                       ^
compilation terminated.
gmake[1]: *** [CMakeFiles/cmTC_9170e.dir/build.make:66: CMakeFiles/cmTC_9170e.dir/src.cxx.o] Error 1
gmake[1]: Leaving directory '/home/nmeinert/root-build/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:126: cmTC_9170e/fast] Error 2

Source file was:
#include <string_view>
int main() { return 0; }

Performing C++ SOURCE FILE Test found_stdexpstringview failed with the following output:
Change Dir: /home/nmeinert/root-build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/gmake" "cmTC_418b3/fast"
/usr/bin/gmake -f CMakeFiles/cmTC_418b3.dir/build.make CMakeFiles/cmTC_418b3.dir/build
gmake[1]: Entering directory '/home/nmeinert/root-build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_418b3.dir/src.cxx.o
/usr/x86_64-pc-linux-gnu/gcc-bin/6.4.0/g++    -pipe -m64 -Wall -W -Woverloaded-virtual -fsigned-char -fPIC -pthread -std=c++11 -Wno-deprecated-declarations -Dfound_stdexpstringview   -o CMakeFiles/cmTC_418b3.dir/src.cxx.o -c /home/nmeinert/root-build/CMakeFiles/CMakeTmp/src.cxx
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/6.4.0/include/g++-v6/experimental/string_view:39:0,
                 from /home/nmeinert/root-build/CMakeFiles/CMakeTmp/src.cxx:1:
/usr/lib/gcc/x86_64-pc-linux-gnu/6.4.0/include/g++-v6/bits/c++14_warning.h:32:2: error: #error This file requires compiler and library support for the forthcoming ISO C++ 2014 standard. This support is currently experimental, and must be enabled with the -std=c++1y or -std=gnu++1y compiler options.
 #error This file requires compiler and library support for the forthcoming \
  ^~~~~
gmake[1]: *** [CMakeFiles/cmTC_418b3.dir/build.make:66: CMakeFiles/cmTC_418b3.dir/src.cxx.o] Error 1
gmake[1]: Leaving directory '/home/nmeinert/root-build/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:126: cmTC_418b3/fast] Error 2

Source file was:
#include <experimental/string_view>
int main() { return 0; }

Can you help me solving this issue?

Do you have to use ROOT 6.04? The Python script that generates the PCH was not ready for Python 3 in that version of ROOT. Please try building ROOT 6.12/04 if you can, and let us know if you have any problems with that.

thank you for your help. Version 6.12/04 works.

I was also fighting with the same compilation issue in ROOT/v6.12.04. I just changed the python version from 3.x to 2.x and it worked like charm. But the error logs were not giving any hint related to the python version. Anyways, this post helped me to solve the problem. Thanks!

Can you please paste the configuration command that you used and attach the configuration log? There have been some fixes for how to handle Python configuration in the master branch. If you want to use Python 3.x with ROOT, I recommend using the following configurations options: -Dpython=ON -DPYTHON_EXECUTABLE=$(which python3). You can replace $(which python3) by the full path to the Python interpreter that you want to use instead. That should work if your compiler and the one used to compile Python are ABI-compatible. Otherwise, try again with the master branch and the options above or with the options -Dpython=ON -Dpython_version=3, which should pick up your default Python 3.x.

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