Skip to content

FindActs.cmake, master branch (2022.06.02.)

Introduced a FindActs.cmake module. It is meant to ensure that Acts's include- and library paths would enter the runtime environment setup of the built release. Even if Acts is picked up from outside of an ATLAS offline project.

I realised this shortcoming while looking at the build issues seen by @ncalace. I had to find that Acts was only working correctly so far in our offline runtime environment because its headers and libraries were put into directories that were added to the runtime environment through other means as well. With this setup it will now be possible to pick up Acts from any location for the build/runtime. (Unfortunately overriding a nightly's Acts version is still going to be difficult, since the paths of AthenaExternals are still put before all the paths set up by env_setup.sh. But that's a bit of a different story.)

Note that I simply tested this behaviour with the following project:

cmake_minimum_required( VERSION 3.18 )
project( ActsUserTest VERSION 1.0.0 LANGUAGES CXX )

find_package( AthenaExternals REQUIRED )
find_package( Acts REQUIRED )

lcg_generate_env( SH_FILE "${CMAKE_BINARY_DIR}/env_setup.sh" )

Which, after the changes of this MR, would generate the following file:

bash][atlas]:acts-user-build > more env_setup.sh
# Generated by lcg_generate_env...
if [ -z "${LCG_RELEASE_BASE}" ]; then
   export LCG_RELEASE_BASE=/cvmfs/sft.cern.ch/lcg/releases
fi
if [ -z "${LCG_PLATFORM}" ]; then
   export LCG_PLATFORM=x86_64-centos7-gcc11-opt
fi
if [ -z "${LD_LIBRARY_PATH}" ]; then
   export LD_LIBRARY_PATH=${LCG_RELEASE_BASE}/LCG_101_ATLAS_2/Boost/1.77.0/x86_64-centos7-gcc11-opt/lib::/data/hdd-4tb/projects/externals/atlasexternals-install/AthenaExternals/22.0.0/InstallArea/x86_64-centos7-gcc11-opt/lib:
else
   export LD_LIBRARY_PATH=${LCG_RELEASE_BASE}/LCG_101_ATLAS_2/Boost/1.77.0/x86_64-centos7-gcc11-opt/lib::/data/hdd-4tb/projects/externals/atlasexternals-install/AthenaExternals/22.0.0/InstallArea/x86_64-centos7-gcc11-opt/lib::${LD_LIBRARY_PATH}
fi
if [ -z "${ROOT_INCLUDE_PATH}" ]; then
   export ROOT_INCLUDE_PATH=${LCG_RELEASE_BASE}/LCG_101_ATLAS_2/Boost/1.77.0/x86_64-centos7-gcc11-opt/include::${LCG_RELEASE_BASE}/LCG_101_ATLAS_2/eigen/3.3.7/x86_64-centos7-gcc11-opt/include/eigen3:${LCG_RELEASE_BASE}/LCG_101_ATLAS_2/jsonmcpp/3.9.1/x86_64-centos7-gcc11-opt/include:/data/hdd-4tb/projects/externals/atlasexternals-install/AthenaExternals/22.0.0/InstallArea/x86_64-centos7-gcc11-opt/include:
else
   export ROOT_INCLUDE_PATH=${LCG_RELEASE_BASE}/LCG_101_ATLAS_2/Boost/1.77.0/x86_64-centos7-gcc11-opt/include::${LCG_RELEASE_BASE}/LCG_101_ATLAS_2/eigen/3.3.7/x86_64-centos7-gcc11-opt/include/eigen3:${LCG_RELEASE_BASE}/LCG_101_ATLAS_2/jsonmcpp/3.9.1/x86_64-centos7-gcc11-opt/include:/data/hdd-4tb/projects/externals/atlasexternals-install/AthenaExternals/22.0.0/InstallArea/x86_64-centos7-gcc11-opt/include::${ROOT_INCLUDE_PATH}
fi
[bash][atlas]:acts-user-build >

(I.e. it would include the AthenaExternals directories, as it should.)

Pinging @pagessin as well for good measure. 😉

Merge request reports