Trouble builing root locally


Please read tips for efficient and successful posting and posting code

ROOT Version: Not Provided
Platform: CentOS 7
Compiler: Not Provided


Hi. Im trying to build ROOT locally on CentOS 7. When I clone the repo and create a buildroot directory, I run
cmake3 ../root to create the Makefile and then make to compile. However, I get this error.

/home/adhingra/Documents/root/core/foundation/inc/ROOT/RConfig.hxx:48:4: error: #error "ROOT requires support for C++14 or higher."
 #  error "ROOT requires support for C++14 or higher."

Adding the recommended prefix has no effect, Any ideas? Thanks in advace.
I tried updating gcc. It didnt help.

Starting with ROOT 6.26, you need a compiler which supports at least “c++14 (i.e., “-DCMAKE_CXX_STANDARD=14” or newer).

On CentOS 7, if you want to use the default gcc 4.8.5 compiler (supports “c++11”), you can take the head of the “v6-24-00-patches” branch.

Ah ok. But if I want to test PRs locally by compiling root, how would I do that?

git clone --branch v6-24-00-patches https://github.com/root-project/root.git

But how can I use this branch for testing PRs? Since the PRs will be in the master branch

Ok, I figured it out. I had to update gcc manually. For this I ran

sudo yum install centos-release-scl
sudo yum install devtoolset-10-gcc*
scl enable devtoolset-10 bash
which gcc
gcc --version

One can then successfully compile from source.

EDIT: While I thought that would work, it somehow doesnt anymore. :frowning:

Hi @AdvaitDhingra ,

If you want to work on ROOT’s master branch, I would strongly suggest to update to CentOS8 so that the default system compiler will not be ancient and will come with C++14 support. Building ROOT with devtoolset is unsupported and it is known to cause issues. The tip of the master branch should work with gcc>=5.

Cheers,
Enrico

Okay, I’ll give that a shot. Thanks!

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