Building ROOT 6.24 (the v6-24-00-patches branch)

This thread is a split of a previous topic: Error Installing ROOT-5.34.38

“The software” that you are using should already be compatible with ROOT 6 (but you will probably need ROOT binaries built with the “-std=c++11” or the “-std=c++14” standard → “root-config --cflags” and “geant4-config --cflags” must agree on it). :wink:

Yeah that’s right! But I installed a version-6-like of ROOT and I get `std=c++14´, but the software I am using needs c++11, how can I solve this?

Either you recompile your additional libraries so that they use “-std=c++14” (e.g., Geant4 should build OK), or you need to build ROOT 6 with “-std=c++11” (you can use the ROOT 6.24 patches branch or some older version).

Ok, so let me see if I got it right: I cannot build ROOT 6.24 using the binaries using -std=c++11, right? I need a build from source. How do I tell the compiling process to use that -std=c++11? Is just a flag in the cmake compiling process?

Thanks a lot.

Building ROOT from source → Setting the C++ standard

Thanks for all the help, however, after installing some required dependencies for the C++11 Standard (like Python2) I get this error while generating:

cmake -DCMAKE_CXX_STANDARD=11 -DCMAKE_INSTALL_PREFIX=../install ../root              ✔  4s 
-- Detected ROOT_VERSION 6.29.01
-- Checking internet connectivity
-- Checking internet connectivity - found
-- Looking for Python
-- Found Python2: /usr/local/bin/python2.7 (found version "2.7.18") found components: Interpreter Development NumPy Development.Module Development.Embed
CMake Error at cmake/modules/CheckCompiler.cmake:168 (message):
  Unsupported C++ standard: 11
Call Stack (most recent call first):
  CMakeLists.txt:165 (include)

Maybe I cannot compile using this C++ standard on this computer?

Didn’t I explicitly say: “you can use the ROOT 6.24 patches branch or some older version”

Oh, sorry, I just noticed there it says -- Detected ROOT_VERSION 6.29.01 but I cloned the repo you sent :confused:

I tried again and it keeps saying that the detected ROOT version is 6.29…

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

Ok thank you so much! It generated successfully. The problem now is that compilation breaks at this point:

[  0%] Performing configure step for 'XROOTD'
-- XROOTD configure command succeeded.  See also /Users/diiego/software/ROOT/ROOT_6.24/build/XROOTD-prefix/src/XROOTD-stamp/XROOTD-configure-*.log
[  0%] Performing build step for 'XROOTD'
CMake Error at /Users/diiego/software/ROOT/ROOT_6.24/build/XROOTD-prefix/src/XROOTD-stamp/XROOTD-build-Release.cmake:49 (message):
  Command failed: 2

   '/opt/homebrew/bin/gmake'

  See also

    /Users/diiego/software/ROOT/ROOT_6.24/build/XROOTD-prefix/src/XROOTD-stamp/XROOTD-build-*.log


gmake[2]: *** [CMakeFiles/XROOTD.dir/build.make:86: XROOTD-prefix/src/XROOTD-stamp/XROOTD-build] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:7220: CMakeFiles/XROOTD.dir/all] Error 2
gmake: *** [Makefile:156: all] Error 2

And I cannot understand why gmake is not working

Try to add -Dxrootd=OFF when configuring ROOT (switches the support for XRootD off).
Note: you need to remove the old build and configure it from scratch again.

Ok great, now the compilation is working. I will let you know if something else goes wrong. Thank you so much again :grinning:

You could try: -Dall=ON -Dxrootd=OFF

Hello again,

I tried with both option, only -Dxrootd=OFF and both -Dall=ON -Dxrootd=OFF, and the compilation always fails here:

[ 80%] Building CXX object bindings/pyroot/cppyy/CPyCppyy/CMakeFiles/cppyy3_11.dir/src/CPPConstructor.cxx.o
/Users/diiego/software/ROOT/ROOT_6.24/v6-24-00-patches/bindings/pyroot/cppyy/CPyCppyy/src/CPPConstructor.cxx:125:31: error: expression is not assignable
                Py_TYPE(self) = (PyTypeObject*)pyclass;
                ~~~~~~~~~~~~~ ^
1 error generated.
gmake[2]: *** [bindings/pyroot/cppyy/CPyCppyy/CMakeFiles/cppyy3_11.dir/build.make:132: bindings/pyroot/cppyy/CPyCppyy/CMakeFiles/cppyy3_11.dir/src/CPPConstructor.cxx.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:32585: bindings/pyroot/cppyy/CPyCppyy/CMakeFiles/cppyy3_11.dir/all] Error 2
gmake: *** [Makefile:156: all] Error 2

Any clue about what may be happening? I guess it has to be with PyROOT, but do not know what.

Thanks again

I’m afraid you face “cppyy3_11” problems, e.g., something like:

@bellenot @etejedor Could someone backport the required fixes to “v6-24-00-patches” (the last version which supports “-std=c++11”)?

So… Does this have a solution? I’m a bit lost at this point to be honest.

Wait until the relevant changes are committed in the v6-24-00-patches branch

@bellenot Was this the only fix needed for “cppyy3_11”? Here (see above) it actually complained about “expression is not assignable”, not about a missing “code.h”.