Skip to content

Draft: FastCaloSim External Integration

Joshua Falco Beirer requested to merge 2.1.16.1-FastCaloSimExternal into 2.1.16-patches

Likely we don't ever want to merge this into this branch, but just meant to discuss / document the FastCaloSim external integration (as I don't see any issues site here):

With the added changes, the atlasexternals package builds fine using

asetup none,gcc13,cmakesetup --cmakeversion=3.27.5

# Athena-dependent extra arguments required (see e.g. https://gitlab.cern.ch/atlas/athena/-/blob/release/24.0.64/Projects/Athena/build_externals.sh?ref_type=tags)
ATLAS_EXTRA_CMAKE_ARGS=(-DLCG_VERSION_NUMBER=104
                        -DLCG_VERSION_POSTFIX="d_ATLAS_7"
                        -DATLAS_ONNXRUNTIME_USE_CUDA=FALSE
                        -DATLAS_GAUDI_SOURCE="URL;https://gitlab.cern.ch/atlas/Gaudi/-/archive/v38r0.003/Gaudi-v38r0.003.tar.gz;URL_MD5;85f00c880b20566baac647840f25af78"
                        -DATLAS_ACTS_SOURCE="URL;https://github.com/acts-project/acts/archive/refs/tags/v32.0.2.tar.gz;URL_HASH;SHA256=a817a9b6434ae206c36b1c25df6139ffcde95234944d09e718125e14da7996b8"
                        -DATLAS_GEOMODEL_SOURCE="URL;https://gitlab.cern.ch/GeoModelDev/GeoModel/-/archive/5.0.3/GeoModel-5.0.3.tar.bz2;URL_MD5;8f00da4b18a60c574e6f3e4badcde7d2"
			      -DATLAS_GEOMODEL_PATCH=""
                        -DATLAS_GEOMODEL_FORCEDOWNLOAD_MESSAGE="Forcing_the_re-download_of_GeoModel_(2024.01.27.)"
                        -DATLAS_GEANT4_USE_LTO=TRUE
                        -DATLAS_VECGEOM_USE_LTO=TRUE)
# Configure
cmake -DCMAKE_BUILD_TYPE=Release -DCTEST_USE_LAUNCHERS=TRUE \
      "${ATLAS_EXTRA_CMAKE_ARGS[@]}" \
      -S atlasexternals/Projects/AthenaExternals -B <EXTERNAL_BUILD_DIR>
# Build
cmake --build <EXTERNAL_BUILD_DIR> -j ${nproc}
# Install
DESTDIR=<EXTERNAL_INSTALL_DIR> cmake --install <EXTERNAL_BUILD_DIR>

Now, when building athena with the new external version with a

  1. Partial Athena build

    asetup Athena,24.0,2024-11-14T2101
    export CMAKE_PREFIX_PATH=<EXTERNAL_INSTALL_DIR>:$CMAKE_PREFIX_PATH
    cmake -DATLAS_PACKAGE_FILTER_FILE=../package_filters.txt ../athena/Projects/WorkDir/
    make -j${nproc}
  2. and trying to link against FastCaloSim::FastCaloSim in e.g. AthExHelloWorld :

# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration

# Declare the package name:
atlas_subdir( AthExHelloWorld )

find_package( Geant4 )
find_package( FastCaloSim )

# Component(s) in the package:
atlas_add_component( AthExHelloWorld
                     src/*.cxx
                     src/components/*.cxx
                     LINK_LIBRARIES FastCaloSim::FastCaloSim GaudiKernel AthenaBaseComps )

results in the following error:

-- Configuring done (37.1s)
-- Generating done (0.4s)
-- Build files have been written to: /home/j/jbeirer/external_tests/build-athena
Control/AthenaExamples/AthExHelloWorld/CMakeFiles/AthExHelloWorld.dir/build.make:148: *** target pattern contains no '%'.  Stop.
make[1]: *** [CMakeFiles/Makefile2:1499: Control/AthenaExamples/AthExHelloWorld/CMakeFiles/AthExHelloWorld.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[  1%] Generating test-bin/ISF_FastCaloSimServices_Config_test.exe
[  2%] Generating test-bin/AthExHelloWorld.exe

Taking a closer look into the make file:

x86_64-el9-gcc13-opt/lib/libAthExHelloWorld.so: $$<BUILD_INTERFACE:/cvmfs/atlas.cern.ch/repo/sw/software/24.0/sw/lcg/releases/LCG_104d_ATLAS_7/vdt/0.4.4/x86_64-el9-gcc13-opt/lib/libvdt.so>;$$<INSTALL_INTERFACE:$${LCG_RELEASE_BASE}/LCG_104d_ATLAS_7/vdt/0.4.4/x86_64-el9-gcc13-opt/lib/libvdt.so>

it becomes apparent that some vdt generator expressions seems to sneak in.

Similarly, when one performs the full build with:

# Setup build environment with custom externals
source athena/Projects/Athena/build_env.sh -b $(realpath install-atlasexternals)
#Build athena
mkdir -p build-athena && cd build-athena
cmake -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE ../athena/Projects/Athena/
cmake --build . 2\>&1 | tee build.log

One gets:

ninja: error: '$<BUILD_INTERFACE:/cvmfs/sft.cern.ch/lcg/releases/LCG_104d_ATLAS_7/vdt/0.4.4/x86_64-el9-gcc13-opt/lib/libvdt.so>;$<INSTALL_INTERFACE:${LCG_RELEASE_BASE}/LCG_104d_ATLAS_7/vdt/0.4.4/x86_64-el9-gcc13-opt/lib/libvdt.so>', needed by 'ForwardDetectors/ALFA/ALFA_G4_SD/test-bin/ALFA_SensitiveDetector_gtest.exe', missing and no known rule to make it

This is the first time we have an external that requires direct linking against ROOT and the suspicion is that some of the gaudi cmake configuration is interfering with the config.

fyi @mduehrss @akraszna

Edited by Joshua Falco Beirer

Merge request reports

Loading