Closed cburgard closed 2 years ago
@linev Since you introduced that dependency, can you take a look? Thanks!
Hi everyone,
the problem arises because /cvmfs/sft.cern.ch/lcg/releases/LCG_102/ROOT/6.26.04/x86_64-centos7-gcc11-opt/ROOT-env.sh
(or I guess whatever setupATLAS is doing) is not exporting the CMAKE_PREFIX_PATH to all dependencies.
exporting CMAKE_PREFIX_PATH to point to the folder for nlohmann_json fixes this.
I.e., this works
export PATH=/cvmfs/sft.cern.ch/lcg/contrib/CMake/3.23.1/Linux-x86_64/bin/:$PATH
source /cvmfs/sft.cern.ch/lcg/releases/LCG_102/ROOT/6.26.04/x86_64-centos7-gcc11-opt/ROOT-env.sh
export CMAKE_PREFIX_PATH=$JSONMCPP__HOME:$CMAKE_PREFIX_PATH
cat > CMakeLists.txt << EOF
cmake_minimum_required(VERSION 3.20)
project(test)
find_package( ROOT REQUIRED COMPONENTS Core RIO MathCore Matrix HistFactory RooFitCore RooFit Hist RooStats Minuit2 Minuit)
EOF
mkdir -p build
cd build
cmake ..
Cheers, Andre
Thanks @andresailer ! Then who should take care of this?
I think @cburgard just needs to export the CMAKE_PREFIX_PATH.
I don't know what setupATLAS
is doing, so I don't know if that relies on lcgenv, or does its own thing.
We can probably add the CMAKE_PREFIX_PATH exports to lcgenv, but this isn't going to show up on CVMFS for the existing releases.
@andresailer I'm happy to try whatever you send me, but I'm not going to be the only person encountering this issue, setupATLAS
is the default way the majority of ATLAS users setup root, unless they use an ATLAS analysis release that ships with ROOT.
I don't know who's in charge of doing this.
If your setup gives you the JSONMCPP__HOME
variable, please try:
export CMAKE_PREFIX_PATH=$JSONMCPP__HOME:$CMAKE_PREFIX_PATH
before running cmake
@bellenot
I guess issue is due to difference in shell environment between ROOT compilation and ROOT-based code.
One have to ensure that same nlohmann/json.hpp
version is detected in both cases.
Actually it has nothing to do with my last change which only set minimal accepted version to 3.9.
@andresailer This fixes it, which is great (for me), but perhaps you want to undertake some steps so that this obscure fix doesn't need to be performed by everyone in the future?
Totally, this is what I refer to here https://github.com/root-project/root/issues/10963#issuecomment-1186980925
Ok, great. Shall we close this issue here then or do you want to keep it open until this is done?
I think we can close this here. We can follow up in https://sft.its.cern.ch/jira/browse/SPI-2197
Ok, great. Thanks!
Hi @cburgard, @bellenot,
It appears this issue is closed, but wasn't yet added to a project. Please add upcoming versions that will include the fix, or 'not applicable' otherwise.
Sincerely, :robot:
To Reproduce
Use a CentOS7 machine and setup ROOT 6.26.04 from CVMFS (/cvmfs/sft.cern.ch/lcg/releases/LCG_102/ROOT/6.26.04/x86_64-centos7-gcc11-opt/bin/root).
Create a CMakeLists.txt file with the following contents:
find_package( ROOT REQUIRED COMPONENTS Core RIO MathCore Matrix HistFactory RooFitCore RooFit Hist RooStats Minuit2 Minuit )
Go to an empty folder, and call
cmake
on that CMakeLists.txt file.Setup
setupATLAS; lsetup "root 6.26.04-x86_64-centos7-gcc11-opt"