From 658139d53e8e6a4e4b82a6d683e70b541d31c43e Mon Sep 17 00:00:00 2001 From: vvolkl Date: Mon, 12 Oct 2020 13:44:25 +0200 Subject: [PATCH] Fixes for LCG98 (#409) * add lcg 98 and corresponding fixes * fix * fix * fix * fix * fix --- .github/workflows/test.yml | 2 +- .gitignore | 1 + CMakeLists.txt | 2 ++ Detector/DetComponents/CMakeLists.txt | 4 +-- Detector/DetStudies/CMakeLists.txt | 4 +-- Examples/CMakeLists.txt | 4 +-- FWCore/CMakeLists.txt | 1 - FWCore/scripts/fcc_dump_joboptions | 1 + .../tests/scripts/check_coll_after_merge.py | 9 ++++-- Sim/SimG4Components/CMakeLists.txt | 4 +-- Sim/SimG4Fast/CMakeLists.txt | 8 ++--- Test/TestFWCore/CMakeLists.txt | 4 +-- Test/TestGeneration/CMakeLists.txt | 4 +-- Test/TestGeometry/CMakeLists.txt | 4 +-- Test/TestReconstruction/CMakeLists.txt | 4 +-- cmake/FindEvtGen.cmake | 2 +- init.sh | 2 +- init_lcg_97a_FCC_2.sh | 9 ++++++ init_lcg_98.sh | 29 +++++++++++++++++++ init_lcg.sh => test_lcg.sh | 7 +++++ 20 files changed, 78 insertions(+), 27 deletions(-) create mode 100644 init_lcg_97a_FCC_2.sh create mode 100644 init_lcg_98.sh rename init_lcg.sh => test_lcg.sh (57%) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 854fbcfc7..c50d4584c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,7 +8,7 @@ jobs: strategy: fail-fast: false matrix: - SETUP: ["init_key4hep.sh", 'init_lcg.sh'] + SETUP: ["init_key4hep.sh", 'init_lcg_97a_FCC_2.sh', 'init_lcg_98.sh'] steps: - uses: actions/checkout@v2 - name: Install CVMFS diff --git a/.gitignore b/.gitignore index 084de7f10..38faf196d 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ *.log build* +fcc-edm install* build.*.log Makefile diff --git a/CMakeLists.txt b/CMakeLists.txt index b10df92a7..6d3c4b927 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,6 +29,7 @@ find_package(DD4hep COMPONENTS DDG4 DDRec REQUIRED) find_package(Geant4) + # Load macros and functions for Gaudi-based projects find_package(GaudiProject) #--------------------------------------------------------------- @@ -75,6 +76,7 @@ install(FILES ${CMAKE_BINARY_DIR}/setup.sh WORLD_READ) +find_package(FCCEDM) gaudi_project(FCCSW v0r13 USE Gaudi v33r1 ) diff --git a/Detector/DetComponents/CMakeLists.txt b/Detector/DetComponents/CMakeLists.txt index 1f161a536..feed5649d 100644 --- a/Detector/DetComponents/CMakeLists.txt +++ b/Detector/DetComponents/CMakeLists.txt @@ -15,8 +15,8 @@ find_package(Eigen) gaudi_add_module(DetComponents src/*.cpp - INCLUDE_DIRS GaudiKernel ROOT DD4hep Geant4 FWCore DetInterface DetSegmentation DetCommon Eigen - LINK_LIBRARIES GaudiKernel ROOT DD4hep ${DD4hep_COMPONENT_LIBRARIES} DetSegmentation DetCommon FWCore) + INCLUDE_DIRS GaudiKernel ROOT DD4hep Geant4 FWCore DetInterface DetSegmentation DetCommon Eigen FCCEDM + LINK_LIBRARIES GaudiKernel ROOT DD4hep ${DD4hep_COMPONENT_LIBRARIES} DetSegmentation DetCommon FWCore FCCEDM) target_link_libraries(DetComponents ${Geant4_LIBRARIES}) include(CTest) gaudi_add_test(RedoSegmentationXYZ diff --git a/Detector/DetStudies/CMakeLists.txt b/Detector/DetStudies/CMakeLists.txt index d532ea822..b8f5862e5 100644 --- a/Detector/DetStudies/CMakeLists.txt +++ b/Detector/DetStudies/CMakeLists.txt @@ -15,8 +15,8 @@ find_package(CLHEP) gaudi_add_module(DetStudies src/components/*.cpp - INCLUDE_DIRS GaudiKernel ROOT DD4hep FWCore CLHEP - LINK_LIBRARIES GaudiKernel ROOT DD4hep ${DD4hep_COMPONENT_LIBRARIES} FWCore CLHEP) + INCLUDE_DIRS GaudiKernel ROOT DD4hep FWCore CLHEP FCCEDM + LINK_LIBRARIES GaudiKernel ROOT DD4hep ${DD4hep_COMPONENT_LIBRARIES} FWCore CLHEP FCCEDM) install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/tests DESTINATION ${CMAKE_INSTALL_DATADIR}/${CMAKE_PROJECT_NAME}/DetStudies) diff --git a/Examples/CMakeLists.txt b/Examples/CMakeLists.txt index 40fc34a69..20bdce338 100644 --- a/Examples/CMakeLists.txt +++ b/Examples/CMakeLists.txt @@ -14,8 +14,8 @@ install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/options DESTINATION ${CMAKE_INSTALL_ gaudi_add_module(Examples src/*.cpp - INCLUDE_DIRS ROOT GaudiKernel Geant4 DD4hep SimG4Interface DetInterface DetCommon - LINK_LIBRARIES GaudiAlgLib FWCore DetCommon ROOT GaudiKernel DD4hep + INCLUDE_DIRS ROOT GaudiKernel Geant4 DD4hep SimG4Interface DetInterface DetCommon FCCEDM + LINK_LIBRARIES GaudiAlgLib FWCore DetCommon ROOT GaudiKernel DD4hep FCCEDM ) target_link_libraries(Examples ${Geant4_LIBRARIES}) diff --git a/FWCore/CMakeLists.txt b/FWCore/CMakeLists.txt index 9aad4f8d7..993ced3bb 100644 --- a/FWCore/CMakeLists.txt +++ b/FWCore/CMakeLists.txt @@ -31,7 +31,6 @@ gaudi_add_test(ReadTest FRAMEWORK tests/options/simple_reader.py DEPENDS ProduceForReadTest) gaudi_add_test(CheckReadCollectionSize - ENVIRONMENT PYTHONPATH+=${PODIO_PYTHON_DIR} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND python FWCore/tests/scripts/check_coll_after_read.py DEPENDS ReadTest) diff --git a/FWCore/scripts/fcc_dump_joboptions b/FWCore/scripts/fcc_dump_joboptions index e9aecb226..fdd98c5be 100755 --- a/FWCore/scripts/fcc_dump_joboptions +++ b/FWCore/scripts/fcc_dump_joboptions @@ -32,6 +32,7 @@ def _sanitize(s): s: str The sanitized string that should be compatible with gaudirun.py """ + s = str(s) s = s.replace('"False"', 'False') s = s.replace('"True"', 'True') s = s.replace('"[', '[') diff --git a/FWCore/tests/scripts/check_coll_after_merge.py b/FWCore/tests/scripts/check_coll_after_merge.py index 18558d190..6da589f0a 100644 --- a/FWCore/tests/scripts/check_coll_after_merge.py +++ b/FWCore/tests/scripts/check_coll_after_merge.py @@ -27,11 +27,14 @@ total_px_pileup = 0 total_px_merged = 0 - for s, p in zip(particles_signal, particles_pileup): - + for i in range(len(particles_signal)): + s = particles_signal[i] total_px_signal += s.core().p4.px + for i in range(len(particles_pileup)): + p = particles_pileup[i] total_px_pileup += p.core().p4.px - for m in particles_merged: + for i in range(len(particles_merged)): + m = particles_merged[i] total_px_merged += m.core().p4.px # check that we merged the right particles diff --git a/Sim/SimG4Components/CMakeLists.txt b/Sim/SimG4Components/CMakeLists.txt index 0d4123e3d..f24f4e735 100644 --- a/Sim/SimG4Components/CMakeLists.txt +++ b/Sim/SimG4Components/CMakeLists.txt @@ -14,8 +14,8 @@ gaudi_install_python_modules() gaudi_add_module(SimG4Components src/*.cpp - INCLUDE_DIRS Geant4 FWCore SimG4Common SimG4Interface DetCommon DD4hep ROOT - LINK_LIBRARIES GaudiAlgLib FWCore SimG4Common DetCommon DD4hep ROOT) + INCLUDE_DIRS Geant4 FWCore SimG4Common SimG4Interface DetCommon DD4hep ROOT FCCEDM + LINK_LIBRARIES GaudiAlgLib FWCore SimG4Common DetCommon DD4hep ROOT FCCEDM) target_link_libraries(SimG4Components ${Geant4_LIBRARIES}) diff --git a/Sim/SimG4Fast/CMakeLists.txt b/Sim/SimG4Fast/CMakeLists.txt index c10e093a2..bfb1d772e 100644 --- a/Sim/SimG4Fast/CMakeLists.txt +++ b/Sim/SimG4Fast/CMakeLists.txt @@ -12,13 +12,13 @@ find_package(ROOT COMPONENTS Tree) gaudi_add_library(SimG4Fast src/lib/*.cpp - INCLUDE_DIRS SimG4Common FWCore SimG4Components SimG4Interface Geant4 ROOT - LINK_LIBRARIES GaudiAlgLib SimG4Common ROOT + INCLUDE_DIRS SimG4Common FWCore SimG4Components SimG4Interface Geant4 ROOT FCCEDM + LINK_LIBRARIES GaudiAlgLib SimG4Common ROOT FCCEDM PUBLIC_HEADERS SimG4Fast) target_link_libraries(SimG4Fast ${Geant4_LIBRARIES}) gaudi_add_module(SimG4FastPlugins src/components/*.cpp - INCLUDE_DIRS Geant4 SimG4Common SimG4Fast SimG4Interface - LINK_LIBRARIES GaudiAlgLib SimG4Fast SimG4Common) + INCLUDE_DIRS Geant4 SimG4Common SimG4Fast SimG4Interface FCCEDM + LINK_LIBRARIES GaudiAlgLib SimG4Fast SimG4Common FCCEDM) target_link_libraries(SimG4FastPlugins ${Geant4_LIBRARIES}) diff --git a/Test/TestFWCore/CMakeLists.txt b/Test/TestFWCore/CMakeLists.txt index 89c067d8e..a04975c51 100644 --- a/Test/TestFWCore/CMakeLists.txt +++ b/Test/TestFWCore/CMakeLists.txt @@ -10,8 +10,8 @@ gaudi_depends_on_subdirs(GaudiAlg GaudiKernel FWCore Generation) gaudi_add_module(TestFWCorePlugins src/components/*.cpp - INCLUDE_DIRS FWCore - LINK_LIBRARIES GaudiKernel FWCore) + INCLUDE_DIRS FWCore FCCEDM + LINK_LIBRARIES GaudiKernel FWCore FCCEDM) include(CTest) diff --git a/Test/TestGeneration/CMakeLists.txt b/Test/TestGeneration/CMakeLists.txt index 324f2e995..7d2b2173c 100644 --- a/Test/TestGeneration/CMakeLists.txt +++ b/Test/TestGeneration/CMakeLists.txt @@ -13,8 +13,8 @@ gaudi_depends_on_subdirs(GaudiAlg GaudiKernel FWCore Generation) gaudi_add_module(TestGenerationPlugins src/components/*.cpp - INCLUDE_DIRS FWCore HepMC - LINK_LIBRARIES GaudiKernel FWCore HepMC) + INCLUDE_DIRS FWCore HepMC FCCEDM + LINK_LIBRARIES GaudiKernel FWCore HepMC FCCEDM) include(CTest) gaudi_add_test(EDM2HepMCConverstion diff --git a/Test/TestGeometry/CMakeLists.txt b/Test/TestGeometry/CMakeLists.txt index fc1c40c57..54cc1f901 100644 --- a/Test/TestGeometry/CMakeLists.txt +++ b/Test/TestGeometry/CMakeLists.txt @@ -11,8 +11,8 @@ find_package(ROOT COMPONENTS MathCore GenVector Geom REQUIRED) gaudi_add_module(TestGeometry src/components/*.cpp - INCLUDE_DIRS Geant4 FWCore SimG4Interface SimG4Common DetInterface DetCommon TestGeometryLib - LINK_LIBRARIES GaudiKernel FWCore DetCommon TestGeometryLib) + INCLUDE_DIRS Geant4 FWCore SimG4Interface SimG4Common DetInterface DetCommon TestGeometryLib FCCEDM + LINK_LIBRARIES GaudiKernel FWCore DetCommon TestGeometryLib FCCEDM) target_link_libraries(TestGeometry ${Geant4_LIBRARIES}) diff --git a/Test/TestReconstruction/CMakeLists.txt b/Test/TestReconstruction/CMakeLists.txt index ae2fa7cb3..41016faa4 100644 --- a/Test/TestReconstruction/CMakeLists.txt +++ b/Test/TestReconstruction/CMakeLists.txt @@ -15,8 +15,8 @@ find_package(ROOT COMPONENTS Geom) gaudi_add_module(TestReconstructionPlugins src/*.cpp - INCLUDE_DIRS FWCore DetInterface TrackingUtils Geant4 DetCommon DetSegmentation GaudiKernel - LINK_LIBRARIES FWCore GaudiAlgLib FWCore TrackingUtils DetCommon DetSegmentation) + INCLUDE_DIRS FWCore DetInterface TrackingUtils Geant4 DetCommon DetSegmentation GaudiKernel FCCEDM + LINK_LIBRARIES FWCore GaudiAlgLib FWCore TrackingUtils DetCommon DetSegmentation FCCEDM) target_link_libraries(TestReconstructionPlugins ${Geant4_LIBRARIES}) include(CTest) diff --git a/cmake/FindEvtGen.cmake b/cmake/FindEvtGen.cmake index 4719c04fb..98391325c 100644 --- a/cmake/FindEvtGen.cmake +++ b/cmake/FindEvtGen.cmake @@ -19,7 +19,7 @@ FIND_PATH(EVTGEN_INCLUDE_DIR NAMES EvtGen/EvtGen.hh FIND_PATH(EVTGEN_LIBRARY_DIR NAMES libEvtGen.so HINTS ${searchpath} - PATH_SUFFIXES lib) + PATH_SUFFIXES lib lib64) set(EVTGEN_LIBRARIES ${EVTGEN_LIBRARY_DIR}/libEvtGen.so ${EVTGEN_LIBRARY_DIR}/libEvtGenExternal.so) diff --git a/init.sh b/init.sh index c84fe8a70..215dd7e88 120000 --- a/init.sh +++ b/init.sh @@ -1 +1 @@ -init_lcg.sh \ No newline at end of file +init_lcg_97a_FCC_2.sh \ No newline at end of file diff --git a/init_lcg_97a_FCC_2.sh b/init_lcg_97a_FCC_2.sh new file mode 100644 index 000000000..1cae60d3d --- /dev/null +++ b/init_lcg_97a_FCC_2.sh @@ -0,0 +1,9 @@ +LCGPREFIX=/cvmfs/sft.cern.ch/lcg +export BINARY_TAG=x86_64-centos7-gcc8-opt +LCGPATH=$LCGPREFIX/views/LCG_97a_FCC_2/$BINARY_TAG +source $LCGPATH/bin/thisdd4hep_only.sh +source $LCGPATH/setup.sh + + +export Gaudi_DIR=$(dirname $(readlink -f "$(which gaudirun.py)"))/../ +export CMAKE_PREFIX_PATH=$Gaudi_DIR:$CMAKE_PREFIX_PATH diff --git a/init_lcg_98.sh b/init_lcg_98.sh new file mode 100644 index 000000000..8244cd2bb --- /dev/null +++ b/init_lcg_98.sh @@ -0,0 +1,29 @@ +LCGPREFIX=/cvmfs/sft.cern.ch/lcg +export BINARY_TAG=x86_64-centos7-gcc8-opt +LCGPATH=$LCGPREFIX/views/LCG_98/$BINARY_TAG +source $LCGPATH/bin/thisdd4hep_only.sh +source $LCGPATH/setup.sh + + +# make sure Gaudi.xenv can be found + +export Gaudi_DIR=$(dirname $(readlink -f "$(which gaudirun.py)"))/../ +export CMAKE_PREFIX_PATH=$Gaudi_DIR:$CMAKE_PREFIX_PATH + +# build FCC-dependencies on top of LCG + +if [ ! -d "./fcc-edm" ] +then + git clone --depth=1 https://github.com/hep-fcc/fcc-edm + cd fcc-edm; mkdir build install; cd build; + cmake .. -DCMAKE_INSTALL_PREFIX=../install + make -j `getconf _NPROCESSORS_ONLN` install + cd ../ + export CMAKE_PREFIX_PATH=$PWD/install:$CMAKE_PREFIX_PATH + export ROOT_INCLUDE_PATH=$PWD/install/include/datamodel:$PWD/install/:$ROOT_INCLUDE_PATH + export LD_LIBRARY_PATH=$PWD/install/lib/:$PWD/install/lib64/$LD_LIBRARY_PATH + touch .gaudi_project_ignore + cd ../ +fi + + diff --git a/init_lcg.sh b/test_lcg.sh similarity index 57% rename from init_lcg.sh rename to test_lcg.sh index 6d47ce170..6912b7cfc 100644 --- a/init_lcg.sh +++ b/test_lcg.sh @@ -6,3 +6,10 @@ source $LCGPATH/bin/thisdd4hep_only.sh export Gaudi_DIR=/cvmfs/sft.cern.ch/lcg/releases/Gaudi/v33r1-2775b/x86_64-centos7-gcc8-opt export CMAKE_PREFIX_PATH=$Gaudi_DIR:$CMAKE_PREFIX_PATH source /cvmfs/sft.cern.ch/lcg/views/LCG_97a_FCC_2/x86_64-centos7-gcc8-opt/setup.sh + +export FCCSWBASEDIR=/cvmfs/sft.cern.ch/lcg/releases/fccsw/0.13-5b877/x86_64-centos7-gcc8-opt/ +export FCCSWSHAREDIR=$FCCSWBASEDIR/share/FCCSW +export FCC_DETECTORS=$FCCSWSHAREDIR +export FCC_PYTHIACARDS=$FCCSWSHAREDIR +export FCCSW=/cvmfs/sft.cern.ch/lcg/releases/fccsw/0.13-5b877/x86_64-centos7-gcc8-opt/share/FCCSW +