G4DATA variables not correctly set in downstream projects
This has been observed when trying to set up the new CMake in Gaussino & Gauss-on-Gaussino. It consists of 2 main problems.
Problems
Order of projects
G4DATA variables will not be set if we ask first to find the lhcb/Geant4
project and then any other project that depends on LHCb
. The reason is that lhcb/Geant4
uses lhcb_env
which is not defined there.
Working example:
lhcb_find_package(Run2Support REQUIRED)
lhcb_find_package(Geant4 REQUIRED)
Not working example:
lhcb_find_package(Geant4 REQUIRED)
lhcb_find_package(Run2Support REQUIRED)
Downstream projects
The problem already appears in the first project that is built on top of the project with lhcb_find_package(Geant4)
. For example, in the Gaussino stack we have:
-
GaussinoExtLibs
where we fetch Geant4 vialhcb_find_package
, here the G4DATA variables are found correctly (why the double slash though?):
<env:default variable="G4DATA">/cvmfs/lhcb.cern.ch/lib/lhcb/PARAM/Geant4Files/v106r1/data</env:default>
<env:set variable="G4NEUTRONHPDATA">${G4DATA}//G4NDL4.6</env:set>
<env:set variable="G4LEDATA">${G4DATA}//G4EMLOW7.9.1</env:set>
<env:set variable="G4LEVELGAMMADATA">${G4DATA}//PhotonEvaporation5.5</env:set>
<env:set variable="G4RADIOACTIVEDATA">${G4DATA}//RadioactiveDecay5.4</env:set>
<env:set variable="G4PARTICLEXSDATA">${G4DATA}//G4PARTICLEXS2.1</env:set>
<env:set variable="G4PIIDATA">${G4DATA}//G4PII1.3</env:set>
<env:set variable="G4REALSURFACEDATA">${G4DATA}//RealSurface2.1.1</env:set>
<env:set variable="G4SAIDXSDATA">${G4DATA}//G4SAIDDATA2.0</env:set>
<env:set variable="G4ABLADATA">${G4DATA}//G4ABLA3.1</env:set>
<env:set variable="G4INCLDATA">${G4DATA}//G4INCL1.0</env:set>
-
Gaussino
that is built on top ofGaussinoExtLibs
, here the variables are not correctly found:
<env:default variable="G4DATA">/cvmfs/lhcb.cern.ch/lib/lhcb/PARAM/Geant4Files/v106r1/data</env:default>
<env:set variable="G4NEUTRONHPDATA">//G4NDL4.6</env:set>
<env:set variable="G4LEDATA">//G4EMLOW7.9.1</env:set>
<env:set variable="G4LEVELGAMMADATA">//PhotonEvaporation5.5</env:set>
<env:set variable="G4RADIOACTIVEDATA">//RadioactiveDecay5.4</env:set>
<env:set variable="G4PARTICLEXSDATA">//G4PARTICLEXS2.1</env:set>
<env:set variable="G4PIIDATA">//G4PII1.3</env:set>
<env:set variable="G4REALSURFACEDATA">//RealSurface2.1.1</env:set>
<env:set variable="G4SAIDXSDATA">//G4SAIDDATA2.0</env:set>
<env:set variable="G4ABLADATA">//G4ABLA3.1</env:set>
<env:set variable="G4INCLDATA">//G4INCL1.0</env:set>
<env:set variable="G4ENSDFSTATEDATA">//G4ENSDFSTATE2.2</env:set>
-
Gauss
that is built on top ofGaussino
, same as above
The workaround for this is in Gaussino: Gaussino/Gaussino!41 (8d23f8d6)