From ec19e9a99c7186e02b7a7c3545f572a447a74982 Mon Sep 17 00:00:00 2001 From: Ben Morgan <Ben.Morgan@warwick.ac.uk> Date: Mon, 8 Jul 2019 17:31:39 +0200 Subject: [PATCH] Support building with Geant4 10.6 From version 10.6, Geant4 no longer exports G4MULTITHREADED in the compiler flags as "-DG4MULTITHREADED". This symbol must be the same between a build of Geant4 and any client application, so is instead exported into configuration header included in the commonn G4Types.hh header. Update components of Athena that rely on this symbol so that they explicitly #include G4Types.hh before using it. InnerDetector has a private dependency on Geant4 headers added so that it picks up the needed header path. --- Calorimeter/CaloG4Sim/CaloG4Sim/EscapedEnergyRegistry.h | 1 + InnerDetector/InDetSimEvent/CMakeLists.txt | 5 +++-- InnerDetector/InDetSimEvent/src/SiHitIdHelper.cxx | 1 + .../G4Atlas/G4AtlasAlg/G4AtlasAlg/G4AtlasMTRunManager.h | 1 + .../G4AtlasAlg/G4AtlasUserWorkerThreadInitialization.h | 1 + .../G4Atlas/G4AtlasAlg/G4AtlasAlg/G4AtlasWorkerRunManager.h | 1 + Simulation/G4Atlas/G4AtlasAlg/src/G4AtlasMTRunManager.cxx | 1 + .../G4AtlasAlg/src/G4AtlasUserWorkerThreadInitialization.cxx | 1 + .../G4Atlas/G4AtlasAlg/src/G4AtlasWorkerRunManager.cxx | 1 + .../G4Atlas/G4AtlasTools/G4AtlasTools/FastSimulationBase.h | 1 + .../G4AtlasTools/G4AtlasTools/SensitiveDetectorBase.h | 1 + Simulation/G4Extensions/Monopole/src/G4mplEquationSetup.hh | 1 + 12 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Calorimeter/CaloG4Sim/CaloG4Sim/EscapedEnergyRegistry.h b/Calorimeter/CaloG4Sim/CaloG4Sim/EscapedEnergyRegistry.h index 7c5168ef08d..d25bb6f0d59 100644 --- a/Calorimeter/CaloG4Sim/CaloG4Sim/EscapedEnergyRegistry.h +++ b/Calorimeter/CaloG4Sim/CaloG4Sim/EscapedEnergyRegistry.h @@ -11,6 +11,7 @@ #include <map> #include <thread> +#include "G4Types.hh" #ifdef G4MULTITHREADED # include "tbb/concurrent_unordered_map.h" #endif diff --git a/InnerDetector/InDetSimEvent/CMakeLists.txt b/InnerDetector/InDetSimEvent/CMakeLists.txt index 9598958e42e..043ba74be49 100644 --- a/InnerDetector/InDetSimEvent/CMakeLists.txt +++ b/InnerDetector/InDetSimEvent/CMakeLists.txt @@ -19,6 +19,7 @@ atlas_depends_on_subdirs( PUBLIC # External dependencies: find_package( CLHEP ) +find_package( Geant4 ) find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) # Component(s) in the package: @@ -26,7 +27,7 @@ atlas_add_library( InDetSimEvent src/*.cxx PUBLIC_HEADERS InDetSimEvent INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} - PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} + PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${GEANT4_INCLUDE_DIRS} DEFINITIONS ${CLHEP_DEFINITIONS} LINK_LIBRARIES ${CLHEP_LIBRARIES} AthAllocators AthenaKernel CxxUtils GeneratorObjects HitManagement StoreGateLib SGtests PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} InDetIdentifier ) @@ -34,6 +35,6 @@ atlas_add_library( InDetSimEvent atlas_add_dictionary( InDetSimEventDict InDetSimEvent/InDetSimEventDict.h InDetSimEvent/selection.xml - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${GEANT4_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthAllocators CxxUtils GeneratorObjects HitManagement StoreGateLib SGtests InDetIdentifier InDetSimEvent ) diff --git a/InnerDetector/InDetSimEvent/src/SiHitIdHelper.cxx b/InnerDetector/InDetSimEvent/src/SiHitIdHelper.cxx index a04ef8f6a65..5836be31e74 100755 --- a/InnerDetector/InDetSimEvent/src/SiHitIdHelper.cxx +++ b/InnerDetector/InDetSimEvent/src/SiHitIdHelper.cxx @@ -9,6 +9,7 @@ #include "StoreGate/StoreGate.h" #include "InDetIdentifier/PixelID.h" +#include "G4Types.hh" #ifdef G4MULTITHREADED # include "GaudiKernel/ContextSpecificPtr.h" #endif diff --git a/Simulation/G4Atlas/G4AtlasAlg/G4AtlasAlg/G4AtlasMTRunManager.h b/Simulation/G4Atlas/G4AtlasAlg/G4AtlasAlg/G4AtlasMTRunManager.h index 5ee60c179b6..26fcbc14056 100644 --- a/Simulation/G4Atlas/G4AtlasAlg/G4AtlasAlg/G4AtlasMTRunManager.h +++ b/Simulation/G4Atlas/G4AtlasAlg/G4AtlasAlg/G4AtlasMTRunManager.h @@ -6,6 +6,7 @@ #define G4ATLASALG_G4ATLASMTRUNMANAGER_H // Hide multi-threading classes from builds without G4MT +#include "G4Types.hh" #ifdef G4MULTITHREADED // Geant4 includes diff --git a/Simulation/G4Atlas/G4AtlasAlg/G4AtlasAlg/G4AtlasUserWorkerThreadInitialization.h b/Simulation/G4Atlas/G4AtlasAlg/G4AtlasAlg/G4AtlasUserWorkerThreadInitialization.h index bf20f3570c3..d732b320d52 100644 --- a/Simulation/G4Atlas/G4AtlasAlg/G4AtlasAlg/G4AtlasUserWorkerThreadInitialization.h +++ b/Simulation/G4Atlas/G4AtlasAlg/G4AtlasAlg/G4AtlasUserWorkerThreadInitialization.h @@ -6,6 +6,7 @@ #define G4ATLASALG_G4ATLASUSERWORKERTHREADINITIALIZATION_H // Hide multi-threading classes from builds without G4MT +#include "G4Types.hh" #ifdef G4MULTITHREADED #include "G4UserWorkerThreadInitialization.hh" diff --git a/Simulation/G4Atlas/G4AtlasAlg/G4AtlasAlg/G4AtlasWorkerRunManager.h b/Simulation/G4Atlas/G4AtlasAlg/G4AtlasAlg/G4AtlasWorkerRunManager.h index 974c11c36a0..f75f1e87945 100644 --- a/Simulation/G4Atlas/G4AtlasAlg/G4AtlasAlg/G4AtlasWorkerRunManager.h +++ b/Simulation/G4Atlas/G4AtlasAlg/G4AtlasAlg/G4AtlasWorkerRunManager.h @@ -6,6 +6,7 @@ #define G4ATLASALG_G4ATLASWORKERRUNMANAGER_H // Hide multi-threading classes from builds without G4MT +#include "G4Types.hh" #ifdef G4MULTITHREADED #include "GaudiKernel/ToolHandle.h" diff --git a/Simulation/G4Atlas/G4AtlasAlg/src/G4AtlasMTRunManager.cxx b/Simulation/G4Atlas/G4AtlasAlg/src/G4AtlasMTRunManager.cxx index 8a2966bb039..eaa395e812f 100644 --- a/Simulation/G4Atlas/G4AtlasAlg/src/G4AtlasMTRunManager.cxx +++ b/Simulation/G4Atlas/G4AtlasAlg/src/G4AtlasMTRunManager.cxx @@ -3,6 +3,7 @@ */ // Hide multi-threading classes from builds without G4MT +#include "G4Types.hh" #ifdef G4MULTITHREADED #include "G4AtlasAlg/G4AtlasMTRunManager.h" diff --git a/Simulation/G4Atlas/G4AtlasAlg/src/G4AtlasUserWorkerThreadInitialization.cxx b/Simulation/G4Atlas/G4AtlasAlg/src/G4AtlasUserWorkerThreadInitialization.cxx index 481e8768025..00f6b89561f 100644 --- a/Simulation/G4Atlas/G4AtlasAlg/src/G4AtlasUserWorkerThreadInitialization.cxx +++ b/Simulation/G4Atlas/G4AtlasAlg/src/G4AtlasUserWorkerThreadInitialization.cxx @@ -3,6 +3,7 @@ */ // Hide multi-threading classes from builds without G4MT +#include "G4Types.hh" #ifdef G4MULTITHREADED #include "G4AtlasAlg/G4AtlasUserWorkerThreadInitialization.h" diff --git a/Simulation/G4Atlas/G4AtlasAlg/src/G4AtlasWorkerRunManager.cxx b/Simulation/G4Atlas/G4AtlasAlg/src/G4AtlasWorkerRunManager.cxx index 2b3b31a36ec..a8df9171b80 100644 --- a/Simulation/G4Atlas/G4AtlasAlg/src/G4AtlasWorkerRunManager.cxx +++ b/Simulation/G4Atlas/G4AtlasAlg/src/G4AtlasWorkerRunManager.cxx @@ -3,6 +3,7 @@ */ // Hide multi-threading classes from builds without G4MT +#include "G4Types.hh" #ifdef G4MULTITHREADED #include "G4AtlasAlg/G4AtlasWorkerRunManager.h" diff --git a/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/FastSimulationBase.h b/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/FastSimulationBase.h index 1bebac3ea21..c8d4d2a99d3 100644 --- a/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/FastSimulationBase.h +++ b/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/FastSimulationBase.h @@ -11,6 +11,7 @@ #include "G4VFastSimulationModel.hh" // Members +#include "G4Types.hh" #include "G4VFastSimulationModel.hh" #ifdef G4MULTITHREADED # include "tbb/concurrent_unordered_map.h" diff --git a/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/SensitiveDetectorBase.h b/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/SensitiveDetectorBase.h index a3948ae1bbf..bcdb36ac44b 100644 --- a/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/SensitiveDetectorBase.h +++ b/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/SensitiveDetectorBase.h @@ -11,6 +11,7 @@ // Members #include "G4VSensitiveDetector.hh" +#include "G4Types.hh" #ifdef G4MULTITHREADED # include "tbb/concurrent_unordered_map.h" #endif diff --git a/Simulation/G4Extensions/Monopole/src/G4mplEquationSetup.hh b/Simulation/G4Extensions/Monopole/src/G4mplEquationSetup.hh index fca58626b2b..53cde5be4f9 100644 --- a/Simulation/G4Extensions/Monopole/src/G4mplEquationSetup.hh +++ b/Simulation/G4Extensions/Monopole/src/G4mplEquationSetup.hh @@ -46,6 +46,7 @@ #define MONOPOLE_G4mplEquationSetup_H #include <thread> +#include "G4Types.hh" #ifdef G4MULTITHREADED # include "tbb/concurrent_unordered_map.h" #endif -- GitLab