# Roottest and required C++ standard

**URL:** <https://root-forum.cern.ch/t/roottest-and-required-c-standard/46088>\
**Category:** Newbie\
**Created:** [July 30, 2021, 9:40am UTC](https://root-forum.cern.ch/t/roottest-and-required-c-standard/46088 "2021-07-30T09:40:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![omasanori](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/omasanori/32/26957_2.png) [@omasanori](https://root-forum.cern.ch/u/omasanori)\
**Post date:** [July 30, 2021, 9:40am UTC](https://root-forum.cern.ch/t/roottest-and-required-c-standard/46088/1 "2021-07-30T09:40:48Z")

</div>

Hi,

I had tested 6.24.02 built from scratch using the roottest test suite. Since the C7’s system compiler, GCC 4.8.5, has incomplete C++14 supports, I gave `-DCMAKE_CXX_STANDARD=11` to CMake.

```nohighlight
-- ROOT Configuration 

System Linux-3.10.0-1160.31.1.el7.x86_64
Processor 20 core Intel(R) Xeon(R) CPU E5-2640 v4 @ 2.40GHz (x86_64)
Build type Release
Install path /usr/local
Compiler GNU 4.8.5
Compiler flags:
C -pipe -Wall -W -pthread -O3 -DNDEBUG
C++ -std=c++11 -pipe -Wshadow -Wall -W -Woverloaded-virtual -fsigned-char -pthread -O3 -DNDEBUG
Linker flags:
Executable -rdynamic
Module          
Shared -Wl,--no-undefined -Wl,--hash-style="both"

```

Then, it fails to build the test suite due to `make_unique` which is introduced in C++14:

```cpp
/home/ogino/root/roottest/root/roofitstats/vectorisedPDFs/VectorisedPDFTests.cxx: In member function 'void PDFTest::makePlots(std::string&&) const':
/home/ogino/root/roottest/root/roofitstats/vectorisedPDFs/VectorisedPDFTests.cxx:133:17: error: 'make_unique' is not a member of 'std'
     auto canv = std::make_unique<TCanvas>();
                 ^
/home/ogino/root/roottest/root/roofitstats/vectorisedPDFs/VectorisedPDFTests.cxx:133:41: error: expected primary-expression before '>' token
     auto canv = std::make_unique<TCanvas>();
                                         ^
/home/ogino/root/roottest/root/roofitstats/vectorisedPDFs/VectorisedPDFTests.cxx:133:43: error: expected primary-expression before ')' token
     auto canv = std::make_unique<TCanvas>();
                                           ^

```

The question is: does roottest require the same C++ standard as the development branch of ROOT? (currently C++14)

Steps to reproduce:

```auto
git clone https://github.com/root-project/root.git
mkdir build
cd build
cmake3 -Dtesting=ON -Droottest=ON -DCMAKE_CXX_STANDARD=11 ../root
LANG=C make

```

* * *

_ROOT Version:_ 6.24.02  
_Platform:_ CentOS 7  
_Compiler:_ GCC 4.8.5

* * *

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [July 30, 2021, 10:35am UTC](https://root-forum.cern.ch/t/roottest-and-required-c-standard/46088/2 "2021-07-30T10:35:05Z")

</div>

Roottest on v6-24-00-patches branch requires only C++11. The file in question contains

```auto
#include "ROOT/RMakeUnique.hxx"

```

which injects a backport of `std::make_unique`. Can you share the compilation line, i.e. what flags the compiler is invoked with?

---

<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:** [July 30, 2021, 12:50pm UTC](https://root-forum.cern.ch/t/roottest-and-required-c-standard/46088/3 "2021-07-30T12:50:35Z")

</div>

> [@omasanori](#):
>
> `git clone https://github.com/root-project/root.git`

One possible issue is that this gets you master, not 6.24.02.

The other issue (most probably what you encountering): if my test is correct, `-Droottest=ON` gets you roottest _master_ no matter what ROOT branch you are on, which is not necessarily compatible with v6.24.02. A workaround is to enter the `roottest` directory that was cloned as a subdirectory of the ROOT repo, `git checkout v6-24-02` and restart the build.

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [July 30, 2021, 5:34pm UTC](https://root-forum.cern.ch/t/roottest-and-required-c-standard/46088/4 "2021-07-30T17:34:46Z")

</div>

@eguiraud argh really? That’d be a bug, I remember in the past we checked out the compatible dev branch / tag :-/ If that’s indeed not working: could you open an issue, please?

---

<div class="post-metadata">

**Author:** ![omasanori](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/omasanori/32/26957_2.png) [@omasanori](https://root-forum.cern.ch/u/omasanori)\
**Post date:** [July 30, 2021, 5:59pm UTC](https://root-forum.cern.ch/t/roottest-and-required-c-standard/46088/5 "2021-07-30T17:59:29Z")

</div>

Thank you for your replies, @eguiraud and @Axel!

> [@Axel](#):
>
> Roottest on v6-24-00-patches branch requires only C++11.

> [@eguiraud](#):
>
> The other issue (most probably what you encountering): if my test is correct, `-Droottest=ON` gets you roottest _master_ no matter what ROOT branch you are on, which is not necessarily compatible with v6.24.02. A workaround is to enter the `roottest` directory that was cloned as a subdirectory of the ROOT repo, `git checkout v6-24-02` and restart the build.

They seems the essential points, thanks! Probably I had combined `latest-stable` ROOT and `master` roottest. I will check it next week.

> [@eguiraud](#):
>
> One possible issue is that this gets you master, not 6.24.02.

This is my mistake when I wrote the topic. I actually checked out the `latest-stable` branch before executing CMake. I am sorry for a confusing post.

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [July 30, 2021, 6:16pm UTC](https://root-forum.cern.ch/t/roottest-and-required-c-standard/46088/6 "2021-07-30T18:16:05Z")

</div>

Ha! That’s the bug - we never thought of having to synchronize roottest with `latest-stable`! That’s now [Branch sync of roottest broken for latest-stable · Issue #8783 · root-project/root · GitHub](https://github.com/root-project/root/issues/8783) Thanks for reporting!

Just `cd roottest; git checkout v6-24-02` and things should start to work.

---

<div class="post-metadata">

**Author:** ![omasanori](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/omasanori/32/26957_2.png) [@omasanori](https://root-forum.cern.ch/u/omasanori)\
**Post date:** [August 1, 2021, 1:41pm UTC](https://root-forum.cern.ch/t/roottest-and-required-c-standard/46088/7 "2021-08-01T13:41:07Z")

</div>

Thank you for filling an issue, @Axel!
