Problem when compiling REST with precompiled ROOT version

REST version ( git describe --long ): v2.2.18-0-g78471da [no rest-config, since it’s not instaleld yet]
ROOT version: 6.23/01
SO: Linux lhcb05 3.10.0-957.21.3.el7.x86_64 #1 SMP Tue Jun 18 16:35:19 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
gcc version: 4.8.5 20150623 (Red Hat 4.8.5-39)

Hi, we are trying to install REST on our computing server at Barcelona and we are having problems with the compilation.

I do not have admin privileges, but the admin is performing the installation. When doing so, he’s had some issues that I will try to explain:

He started by calling cmake3:

cmake3 … -DINSTALL_PREFIX=…/install/master/ -DREST_G4=ON

And found some libraries were missing during the installation. The libraries were already installed, but apparently cmake wouldn’t find them.

He found that the variables:

  • ${ROOT_LIBRARIES}
  • ${ROOT_INCLUDE_DIRS}
    were empty after the step were FindROOT.cmake is run.

More exactly, FindROOT.cmake is able to find and access the file “root-config”, but, after cmake calls

execute_process(
COMMAND ${ROOT_CONFIG_EXECUTABLE} --incdir
OUTPUT_VARIABLE ROOT_INCLUDE_DIRS
OUTPUT_STRIP_TRAILING_WHITESPACE)

being ROOT_CONFIG_EXECUTABLE = /opt/root/root_v6/bin/root-config
it returns: ROOT_INCLUDE_DIRS = “” , when it should return: ROOT_INCLUDE_DIRS =“/opt/root/root_v6/bin/root-config”
The same was found for other variables.

After noticing this, he decided to set the value for these variables by manually executing root-config, and setting them as follows:

set( ROOT_LIBRARY_DIR “$ENV{ROOTSYS}/lib” )
set( ROOT_INCLUDE_DIRS “$ENV{ROOTSYS}/inc” )
set( ROOT_VERSION “6.23/01” )
set( ROOT_LIBRARIES “-L/opt/root/root_v6/lib -lCore -lImt -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lROOTVecOps -lTree -lTreePlayer -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lMultiProc -lROOTDataFrame -pthread -lm -ldl -rdynamic” )
set( ROOT_BIN_DIR “$ENV{ROOTSYS}/bin” )

After doing so, he run the original command again:

cmake3 … -DINSTALL_PREFIX=…/install/master/ -DREST_G4=ON

And then, he run the make command. This time he didn’t get any errors regarding libraries and headers, but still the compilation crashed. Here’s the output for the make call:

[root@lhcb05 build]# make -j4
[ 0%] generating: /root/root_geant_rest_inst/REST_v2/build/rootdict/CINT_TRestTools.cxx with /root/root_geant_rest_inst/REST_v2/sourc
[ 0%] generating: /root/root_geant_rest_inst/REST_v2/build/rootdict/CINT_TRestReflector.cxx with /root/root_geant_rest_inst/REST_v2/s
[ 1%] generating: /root/root_geant_rest_inst/REST_v2/build/rootdict/CINT_TRestDataBase.cxx with /root/root_geant_rest_inst/REST_v2/so
[ 1%] generating: /root/root_geant_rest_inst/REST_v2/build/rootdict/CINT_TRestPhysics.cxx with /root/root_geant_rest_inst/REST_v2/sou
Warning: Unused class rule: TRestReflector
[ 1%] generating: /root/root_geant_rest_inst/REST_v2/build/rootdict/CINT_TRestStringHelper.cxx with /root/root_geant_rest_inst/REST_v
[ 1%] generating: /root/root_geant_rest_inst/REST_v2/build/rootdict/CINT_TRestStringOutput.cxx with /root/root_geant_rest_inst/REST_v
[ 2%] generating: /root/root_geant_rest_inst/REST_v2/build/rootdict/CINT_TRestSystemOfUnits.cxx with /root/root_geant_rest_inst/REST_
Warning: Unused class rule: TRestStringHelper
Warning: Unused class rule: TRestSystemOfUnits
Scanning dependencies of target RestTools
[ 2%] Building CXX object source/tools/CMakeFiles/RestTools.dir/resttools/src/TRestDataBase.cxx.o
[ 3%] Building CXX object source/tools/CMakeFiles/RestTools.dir/resttools/src/TRestPhysics.cxx.o
[ 3%] Building CXX object source/tools/CMakeFiles/RestTools.dir///rootdict/CINT_TRestPhysics.cxx.o
[ 3%] Building CXX object source/tools/CMakeFiles/RestTools.dir///rootdict/CINT_TRestDataBase.cxx.o
[ 3%] Building CXX object source/tools/CMakeFiles/RestTools.dir/resttools/src/TRestReflector.cxx.o
[ 3%] Building CXX object source/tools/CMakeFiles/RestTools.dir///rootdict/CINT_TRestReflector.cxx.o
[ 4%] Building CXX object source/tools/CMakeFiles/RestTools.dir/resttools/src/TRestStringHelper.cxx.o
[ 4%] Building CXX object source/tools/CMakeFiles/RestTools.dir///rootdict/CINT_TRestStringHelper.cxx.o
[ 4%] Building CXX object source/tools/CMakeFiles/RestTools.dir/resttools/src/TRestStringOutput.cxx.o
[ 4%] Building CXX object source/tools/CMakeFiles/RestTools.dir///rootdict/CINT_TRestStringOutput.cxx.o
[ 5%] Building CXX object source/tools/CMakeFiles/RestTools.dir/resttools/src/TRestSystemOfUnits.cxx.o
[ 5%] Building CXX object source/tools/CMakeFiles/RestTools.dir///rootdict/CINT_TRestSystemOfUnits.cxx.o
[ 5%] Building CXX object source/tools/CMakeFiles/RestTools.dir/resttools/src/TRestTools.cxx.o
[ 5%] Building CXX object source/tools/CMakeFiles/RestTools.dir///rootdict/CINT_TRestTools.cxx.o
[ 6%] Building CXX object source/tools/CMakeFiles/RestTools.dir/external/tinyxml/tinystr.cpp.o
[ 6%] Building CXX object source/tools/CMakeFiles/RestTools.dir/external/tinyxml/tinyxml.cpp.o
[ 6%] Building CXX object source/tools/CMakeFiles/RestTools.dir/external/tinyxml/tinyxmlerror.cpp.o
[ 6%] Building CXX object source/tools/CMakeFiles/RestTools.dir/external/tinyxml/tinyxmlparser.cpp.o
[ 7%] Building C object source/tools/CMakeFiles/RestTools.dir/external/tsp/src/allocrus.c.o
[ 7%] Building C object source/tools/CMakeFiles/RestTools.dir/external/tsp/src/edgelen.c.o
[ 7%] Building C object source/tools/CMakeFiles/RestTools.dir/external/tsp/src/edgeutil.c.o
[ 7%] Building C object source/tools/CMakeFiles/RestTools.dir/external/tsp/src/heldkarp.c.o
[ 8%] Building C object source/tools/CMakeFiles/RestTools.dir/external/tsp/src/trackMinimization.c.o
[ 8%] Linking CXX shared library libRestTools.so
[ 8%] Built target RestTools
[ 8%] generating: /root/root_geant_rest_inst/REST_v2/build/rootdict/CINT_TRestThread.cxx with /root/root_geant_rest_inst/REST_v2/sour
[ 8%] generating: /root/root_geant_rest_inst/REST_v2/build/rootdict/CINT_TRestAnalysisTree.cxx with /root/root_geant_rest_inst/REST_v
[ 8%] generating: /root/root_geant_rest_inst/REST_v2/build/rootdict/CINT_RmlUpdateTool.cxx with /root/root_geant_rest_inst/REST_v2/so
[ 8%] generating: /root/root_geant_rest_inst/REST_v2/build/rootdict/CINT_TRestAnalysisPlot.cxx with /root/root_geant_rest_inst/REST_v
[ 9%] generating: /root/root_geant_rest_inst/REST_v2/build/rootdict/CINT_TRestBrowser.cxx with /root/root_geant_rest_inst/REST_v2/sou
[ 9%] generating: /root/root_geant_rest_inst/REST_v2/build/rootdict/CINT_TRestEvent.cxx with /root/root_geant_rest_inst/REST_v2/sourc
[ 9%] generating: /root/root_geant_rest_inst/REST_v2/build/rootdict/CINT_TRestEventProcess.cxx with /root/root_geant_rest_inst/REST_v
[ 9%] generating: /root/root_geant_rest_inst/REST_v2/build/rootdict/CINT_TRestEventViewer.cxx with /root/root_geant_rest_inst/REST_v2
[ 10%] generating: /root/root_geant_rest_inst/REST_v2/build/rootdict/CINT_TRestManager.cxx with /root/root_geant_rest_inst/REST_v2/sou
[ 10%] generating: /root/root_geant_rest_inst/REST_v2/build/rootdict/CINT_TRestMetadata.cxx with /root/root_geant_rest_inst/REST_v2/so
[ 10%] generating: /root/root_geant_rest_inst/REST_v2/build/rootdict/CINT_TRestProcessRunner.cxx with /root/root_geant_rest_inst/REST_
[ 10%] generating: /root/root_geant_rest_inst/REST_v2/build/rootdict/CINT_TRestRun.cxx with /root/root_geant_rest_inst/REST_v2/source/
[ 11%] generating: /root/root_geant_rest_inst/REST_v2/build/rootdict/CINT_TRestTask.cxx with /root/root_geant_rest_inst/REST_v2/source
Scanning dependencies of target RestCore
[ 12%] Building CXX object source/restcore/CMakeFiles/RestCore.dir/src/TRestAnalysisPlot.cxx.o
[ 12%] Building CXX object source/restcore/CMakeFiles/RestCore.dir/src/RmlUpdateTool.cxx.o
[ 12%] Building CXX object source/restcore/CMakeFiles/RestCore.dir///rootdict/CINT_RmlUpdateTool.cxx.o
[ 12%] Building CXX object source/restcore/CMakeFiles/RestCore.dir///rootdict/CINT_TRestAnalysisPlot.cxx.o
[ 12%] Building CXX object source/restcore/CMakeFiles/RestCore.dir/src/TRestAnalysisTree.cxx.o
[ 12%] Building CXX object source/restcore/CMakeFiles/RestCore.dir///rootdict/CINT_TRestAnalysisTree.cxx.o
[ 13%] Building CXX object source/restcore/CMakeFiles/RestCore.dir/src/TRestBrowser.cxx.o
[ 13%] Building CXX object source/restcore/CMakeFiles/RestCore.dir///rootdict/CINT_TRestBrowser.cxx.o
[ 13%] Building CXX object source/restcore/CMakeFiles/RestCore.dir/src/TRestEvent.cxx.o
[ 13%] Building CXX object source/restcore/CMakeFiles/RestCore.dir///rootdict/CINT_TRestEvent.cxx.o
[ 14%] Building CXX object source/restcore/CMakeFiles/RestCore.dir/src/TRestEventProcess.cxx.o
[ 14%] Building CXX object source/restcore/CMakeFiles/RestCore.dir///rootdict/CINT_TRestEventProcess.cxx.o
[ 14%] Building CXX object source/restcore/CMakeFiles/RestCore.dir/src/TRestEventViewer.cxx.o
[ 14%] Building CXX object source/restcore/CMakeFiles/RestCore.dir///rootdict/CINT_TRestEventViewer.cxx.o
[ 15%] Building CXX object source/restcore/CMakeFiles/RestCore.dir/src/TRestManager.cxx.o
[ 15%] Building CXX object source/restcore/CMakeFiles/RestCore.dir///rootdict/CINT_TRestManager.cxx.o
[ 15%] Building CXX object source/restcore/CMakeFiles/RestCore.dir/src/TRestMetadata.cxx.o
[ 15%] Building CXX object source/restcore/CMakeFiles/RestCore.dir///rootdict/CINT_TRestMetadata.cxx.o
[ 16%] Building CXX object source/restcore/CMakeFiles/RestCore.dir/src/TRestProcessRunner.cxx.o
[ 16%] Building CXX object source/restcore/CMakeFiles/RestCore.dir///rootdict/CINT_TRestProcessRunner.cxx.o
[ 16%] Building CXX object source/restcore/CMakeFiles/RestCore.dir/src/TRestRun.cxx.o
/root/root_geant_rest_inst/REST_v2/source/restcore/src/TRestRun.cxx: In member function ‘void TRestRun::ReadInputFileMetadata()’:
/root/root_geant_rest_inst/REST_v2/source/restcore/src/TRestRun.cxx:452:9: error: ‘set’ was not declared in this scope
set addednames;
^
/root/root_geant_rest_inst/REST_v2/source/restcore/src/TRestRun.cxx:452:19: error: expected primary-expression before ‘>’ token
set addednames;
^
/root/root_geant_rest_inst/REST_v2/source/restcore/src/TRestRun.cxx:452:21: error: ‘addednames’ was not declared in this scope
set addednames;
^
/root/root_geant_rest_inst/REST_v2/source/restcore/src/TRestRun.cxx: In member function ‘std::vector TRestRun::GetEventEntriesWit
/root/root_geant_rest_inst/REST_v2/source/restcore/src/TRestRun.cxx:1191:5: error: ‘set’ is not a member of ‘std’
std::set branchNames;
^
/root/root_geant_rest_inst/REST_v2/source/restcore/src/TRestRun.cxx:1191:20: error: expected primary-expression before ‘>’ token
std::set branchNames;
^
/root/root_geant_rest_inst/REST_v2/source/restcore/src/TRestRun.cxx:1191:22: error: ‘branchNames’ was not declared in this scope
std::set branchNames;
^
/root/root_geant_rest_inst/REST_v2/source/restcore/src/TRestRun.cxx:1210:36: error: unable to deduce ‘auto&&’ from ‘branchNames’
for (auto branchName : branchNames) {
^
[ 16%] Building CXX object source/restcore/CMakeFiles/RestCore.dir///rootdict/CINT_TRestRun.cxx.o
make[2]: *** [source/restcore/CMakeFiles/RestCore.dir/src/TRestRun.cxx.o] Error 1
make[2]: *** Waiting for unfinished jobs…
make[1]: *** [source/restcore/CMakeFiles/RestCore.dir/all] Error 2
make: *** [all] Error 2

Could you give us any insight regarding where could this compilation error be coming from?
If you need us to perform some extra tests or changes, just let me know and I will ask him to.

Thanks in advance.
Cristian.

Ok, it is strange that ROOT it is not found. Did you load ROOT using source /opt/root/root_v6/bin/thisroot.sh?

It seems you are using the ROOT6 system installed version? I believe it is important that the compiler version you are using to compile REST is the same one used to compile ROOT at /opt/. Are you sure it is the case for you?

An straight forward solution would be to use the ./scripts/installation/installROOT.sh. I.e. manual installation at the user space, and perform the manual compilation of ROOT at $HOME/apps/ this will make sure that you are using the same compiler versions. Just to reject possible reasons, not sure if this is connected to your problem.

In the other hand, the compilation error your are getting

It is discussed at this thread

It is extrange that we didn’t face this error before, but maybe it is because of the older gcc 4.8 version you are using. Does adding #include <set> to TRestRun help to bypass the compilation error? @nkx reported recently issues using gcc-4.8, perhaps he might help give some insight and determine if this is really related to the compiler version.

Indeed there is no code like #include <set> in REST. We can try to include it explicitly.

We solved it. The problem was related to using a CERN precompield version of ROOT which was somehow broken.
I changed the title of the thread to accommodate properly the real problem.

Thanks a lot for your help.

1 Like

Great!

Then, I guess finally no need to add #include <set>?

With the compiled ROOT version, REST cmake identifies now the ROOT installation properly?