Build failure with cxx14 and root7 enabled

ROOT Version:
OS : Manjaro
GCC : 7.4
Python 3.7.2

[ 72%] Generating G__Core.cxx, ../../lib/libCore.rootmap
In file included from input_line_9:154:
/home/reik/Downloads/root/build1/include/ROOT/RIntegerSequence.hxx:89:8: error: redefinition of 'integer_sequence'
struct integer_sequence {
/usr/lib/gcc/x86_64-pc-linux-gnu/7.4.1/include/c++/utility:319:12: note: previous definition is here
    struct integer_sequence
In file included from input_line_9:154:
/home/reik/Downloads/root/build1/include/ROOT/RIntegerSequence.hxx:115:7: error: type alias template redefinition with different types ('__make_integer_sequence<_Tp, _Np>' (aka 'typename __make_integer_sequence_checked<type-parameter-0-0, _Ep>::type') vs
      'typename _Make_integer_sequence<_Tp, _Num>::__type')
using make_integer_sequence = __make_integer_sequence<_Tp, _Np>;
/usr/lib/gcc/x86_64-pc-linux-gnu/7.4.1/include/c++/utility:340:11: note: previous definition is here
    using make_integer_sequence
Error: /home/reik/Downloads/root/build1/core/rootcling_stage1/src/rootcling_stage1: compilation failure (/home/reik/Downloads/root/build1/lib/libCore8b9d60e61c_dictUmbrella.h)
make[2]: *** [core/base/CMakeFiles/G__Core.dir/build.make:459: core/base/G__Core.cxx] Error 1
make[1]: *** [CMakeFiles/Makefile2:19013: core/base/CMakeFiles/G__Core.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 72%] Built target Cling
make: *** [Makefile:152: all] Error 2

I got the above error while building ROOT from source(the v6-16-00-patches branch) with c++14 and root7 enabled.

This is not possible for now. More information here:

@Reik, @pamputt ,

This is different issue, since my reply was about build with runtime C++ modules (-Druntime_cxxmodules=ON).

Hi @pamputt,
building with cxx14 is in fact the only way to get ROOT7 :smiley:

@Reik this errors usually appear when you build ROOT with the c++11 standard, and later you re-build, from the same build directory, specifying c++14. ROOT’s CMake is not able to do the late C++ standard swtich.

Building ROOT from an empty build directory should fix it.

To be on the safe side, I removed the entire root directory (including the build directory). I downloaded the source files and built it again(in an empty build directory).
I got the same error. :frowning:

Alright, what is the exact cmake configuration command you are giving? And can you confirm that include/RConfigure.h in the build directory contains the line



Are you adding -std=c++14 by hand to CXXFLAGS? To compile ROOT with C++14, you should call CMake with -Dcxx14=ON with 6.16.00, or -DCMAKE_CXX_STANDARD=14 with later versions (CMake’s way of configuring it).


The cmake configuration command I am using is - cmake -Dbuiltin_lz4=ON -Dbuiltin_lzma=ON -Dbuiltin_tbb=ON -Dbuiltin_zlib=ON -Dcuda=ON -Dcxx11=OFF -Dcxx14=ON -Dpyroot_experimental=ON -Dqt=ON -Dqt5web=ON -Droot7=ON -Dtmva-gpu=ON ..

Yes, include/RConfigure.h contains the line #undef R__HAS_STD_INDEX_SEQUENCE


No, I am not adding -std=c++14 by hand to CXXFLAGS. I am using -Dcxx14=ON.

Uhm i don’t see anything particularly out of place.
From an empty build directory, can you try just cmake -Droot7=ON path/to/root/source and then make?

If this works (root7 implies cxx14) you can work from there, adding options until it breaks.
If that doesn’t work… there’s something we are missing.

It seems like the -Dqt5web flag was causing the issue.

Are you sure? That’s odd, as far as I can tell that flag is completely harmless.
Can you copy-paste the minimal cmake configuration command that breaks ROOT compilation (when starting from an empty build directory)?

We need to be able to reproduce the problem to take a closer look.

The build completed successfully with all the flags I posted above.
This must have been some error on my side. It might have been because of a conflict with a previous installation - which I removed before performing this build (but, I did not source those files from my bashrc and they were simply present in my system in /usr/ so I am not sure why this error occurred).
Anyhow it is working perfectly now and all is good :slight_smile:


1 Like

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