Skip to content

Always build AtlasGeant4 OBJECT libs with LTO enabled

Benjamin Morgan requested to merge bmorgan/athena:athenageant4-lto into 24.0

ATLASSIM-6058 has investigated the use of LTO to speed up AthSimulation, with a 3-5% increase in throughput possible via purely building/linking Geant4, VecGeom, and the AtlasGeant4/AtlasGeant4Lib "big" libraries with LTO enabled (leaving the remainder of Athena building as-is). The only change required locally in Athena is to set the INTERPROCEDURAL_OPTIMIZATION property on all of the OBJECT libraries that go into the big libraries, which is implemented here. CMake will automatically add the appropriate LTO compile/link flags for the compiler (GCC tested, Clang expected to be fine as CMake does know it).

To fully enable LTO and achieve the speedup also requires atlasexternals!1112 (merged) and atlasexternals!1115 (merged) (and thus a new externals tag), hence the current draft status of this MR.

It is also expected that the link stage of the big libraries will show some maybe-uninitialized and alloc-size-larger-than warnings. These do not lead to known failures or changes to physics, as a private build with LTO has passed physics validation (see ATLPHYSVAL-1011). Options are to disable/ignore them temporarily so the changes here can go into mc23e, or to fix them directly in Geant4. Whilst not extensive, they would take some time to resolve primarily due to the turnaround time needed for atlasexternals/Athena build cycles.

Pinging @mbandier, @jchapman, @whopkins for their info.

Edited by Benjamin Morgan

Merge request reports