# Build failure with cxx14 and root7 enabled

**URL:** <https://root-forum.cern.ch/t/build-failure-with-cxx14-and-root7-enabled/32565>\
**Category:** ROOT\
**Created:** [February 2, 2019, 5:38pm UTC](https://root-forum.cern.ch/t/build-failure-with-cxx14-and-root7-enabled/32565 "2019-02-02T17:38:00Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Reik](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/reik/32/17302_2.png) [@Reik](https://root-forum.cern.ch/u/Reik)\
**Post date:** [February 2, 2019, 5:38pm UTC](https://root-forum.cern.ch/t/build-failure-with-cxx14-and-root7-enabled/32565/1 "2019-02-02T17:38:01Z")

</div>

* * *

_ROOT Version:_ [https://github.com/root-project/root/tree/v6-16-00-patches](https://github.com/root-project/root/tree/v6-16-00-patches)  
_OS_ : Manjaro  
_GCC_ : 7.4  
_CUDA 10_  
_Python 3.7.2_

* * *

```auto
[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.

---

<div class="post-metadata">

**Author:** ![pamputt](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pamputt/32/12526_2.png) [@pamputt](https://root-forum.cern.ch/u/pamputt)\
**Post date:** [February 3, 2019, 3:38pm UTC](https://root-forum.cern.ch/t/build-failure-with-cxx14-and-root7-enabled/32565/2 "2019-02-03T15:38:38Z")

</div>

This is not possible for now. More information here:

> [@Cyclic dependency in module 'ROOTGraphicsPrimitives' in ROOT 6.16](https://root-forum.cern.ch/t/cyclic-dependency-in-module-rootgraphicsprimitives-in-root-6-16/32435/2):
>
> Hi @pamputt, It is known issue which filed in Jira issue: [https://sft.its.cern.ch/jira/browse/ROOT-9409](https://sft.its.cern.ch/jira/browse/ROOT-9409) and expected to fixed in 6.16.02. For time being can you please try without root7 option?(e.g.-Droot7=OFF) Cheers, Oksana.

---

<div class="post-metadata">

**Author:** ![oshadura](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/oshadura/32/14460_2.png) [@oshadura](https://root-forum.cern.ch/u/oshadura)\
**Post date:** [February 3, 2019, 4:36pm UTC](https://root-forum.cern.ch/t/build-failure-with-cxx14-and-root7-enabled/32565/3 "2019-02-03T16:36:04Z")

</div>

@Reik, @pamputt ,

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

---

<div class="post-metadata">

**Author:** ![eguiraud](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/eguiraud/32/32217_2.png) [@eguiraud](https://root-forum.cern.ch/u/eguiraud)\
**Post date:** [February 3, 2019, 5:02pm UTC](https://root-forum.cern.ch/t/build-failure-with-cxx14-and-root7-enabled/32565/4 "2019-02-03T17:02:20Z")

</div>

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

@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.

---

<div class="post-metadata">

**Author:** ![Reik](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/reik/32/17302_2.png) [@Reik](https://root-forum.cern.ch/u/Reik)\
**Post date:** [February 3, 2019, 6:39pm UTC](https://root-forum.cern.ch/t/build-failure-with-cxx14-and-root7-enabled/32565/5 "2019-02-03T18:39:12Z")

</div>

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. ☹

---

<div class="post-metadata">

**Author:** ![eguiraud](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/eguiraud/32/32217_2.png) [@eguiraud](https://root-forum.cern.ch/u/eguiraud)\
**Post date:** [February 3, 2019, 7:28pm UTC](https://root-forum.cern.ch/t/build-failure-with-cxx14-and-root7-enabled/32565/6 "2019-02-03T19:28:35Z")

</div>

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

```auto
#undef R__HAS_STD_INDEX_SEQUENCE

```

?

---

<div class="post-metadata">

**Author:** ![amadio](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/amadio/32/12562_2.png) [@amadio](https://root-forum.cern.ch/u/amadio)\
**Post date:** [February 3, 2019, 10:43pm UTC](https://root-forum.cern.ch/t/build-failure-with-cxx14-and-root7-enabled/32565/7 "2019-02-03T22:43:57Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![Reik](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/reik/32/17302_2.png) [@Reik](https://root-forum.cern.ch/u/Reik)\
**Post date:** [February 4, 2019, 5:32pm UTC](https://root-forum.cern.ch/t/build-failure-with-cxx14-and-root7-enabled/32565/8 "2019-02-04T17:32:11Z")

</div>

@eguiraud

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`

@amadio

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

---

<div class="post-metadata">

**Author:** ![eguiraud](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/eguiraud/32/32217_2.png) [@eguiraud](https://root-forum.cern.ch/u/eguiraud)\
**Post date:** [February 4, 2019, 9:37pm UTC](https://root-forum.cern.ch/t/build-failure-with-cxx14-and-root7-enabled/32565/9 "2019-02-04T21:37:30Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Reik](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/reik/32/17302_2.png) [@Reik](https://root-forum.cern.ch/u/Reik)\
**Post date:** [February 6, 2019, 6:31am UTC](https://root-forum.cern.ch/t/build-failure-with-cxx14-and-root7-enabled/32565/10 "2019-02-06T06:31:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![eguiraud](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/eguiraud/32/32217_2.png) [@eguiraud](https://root-forum.cern.ch/u/eguiraud)\
**Post date:** [February 6, 2019, 9:15am UTC](https://root-forum.cern.ch/t/build-failure-with-cxx14-and-root7-enabled/32565/11 "2019-02-06T09:15:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Reik](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/reik/32/17302_2.png) [@Reik](https://root-forum.cern.ch/u/Reik)\
**Post date:** [February 7, 2019, 1:16pm UTC](https://root-forum.cern.ch/t/build-failure-with-cxx14-and-root7-enabled/32565/12 "2019-02-07T13:16:43Z")

</div>

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 🙂

Thanks.

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [February 21, 2019, 1:30pm UTC](https://root-forum.cern.ch/t/build-failure-with-cxx14-and-root7-enabled/32565/13 "2019-02-21T13:30:08Z")

</div>

Closed on February 21, 2019, 1:30pm UTC

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