Skip to content

Add CMake options to only enable LTO in Geant4, VecGeom if requested

Benjamin Morgan requested to merge bmorgan/atlasexternals:optional-lto into main

LTO enabled builds of Geant4, VecGeom cause failures in Athena builds from the CheckerGCCPlugin which is currently LTO-unaware (see discussion in ATLASSIM-6058). Though LTO is wanted for mc23e, we do not want to compromise Athena code quality by disabling the checker (see athena!70766 (merged)).

To ease integration of LTO for simulation in Athena, add CMake options for enabling LTO in the Geant4 and VecGeom builds that default to OFF. Standard builds will therefore be unchanged, but specific builds for production/testing can set these options.

No changes to upstream VecGeom/Geant4 are required, as whilst patches were made to Geant4 to remove LTO link time warnings, these are pure C++ changes that do not depend on whether LTO is enabled on not.

NB: Per discussion in athena!70766 (merged), athena!70523 (merged) will be updated to add a similar option there.

Edited by Benjamin Morgan

Merge request reports