Roottest and required C++ standard


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.

-- 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
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:

/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:

git clone
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

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

#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?

1 Like

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.

1 Like

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

1 Like

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

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

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.

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 Thanks for reporting!

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

1 Like

Thank you for filling an issue, @Axel!