Import Geant4 10.6.0.beta source tree
This commit is contained in:
@@ -79,6 +79,15 @@ include(IntelCompileFeatures)
|
||||
#
|
||||
if(NOT WIN32)
|
||||
|
||||
#.rst:
|
||||
# - ``Debug_FPE``
|
||||
# For debugging with full Floating Point Exception checking
|
||||
#
|
||||
set(CMAKE_CXX_FLAGS_DEBUG_FPE "${CMAKE_CXX_FLAGS_DEBUG_FPE_INIT}"
|
||||
CACHE STRING "Flags used by the compiler during Debug_FPE builds"
|
||||
)
|
||||
mark_as_advanced(CMAKE_CXX_FLAGS_DEBUG_FPE)
|
||||
|
||||
#.rst:
|
||||
# - ``TestRelease``:
|
||||
# For trial production and extended testing. It has verbose
|
||||
@@ -110,18 +119,19 @@ if(NOT CMAKE_CONFIGURATION_TYPES)
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
# Default to a Release build if nothing else...
|
||||
set(CMAKE_BUILD_TYPE Release
|
||||
CACHE STRING "Choose the type of build, options are: None Release TestRelease MinSizeRel Debug RelWithDebInfo MinSizeRel Maintainer."
|
||||
CACHE STRING "Choose the type of build, options are: None Release TestRelease MinSizeRel Debug Debug_FPE RelWithDebInfo MinSizeRel Maintainer."
|
||||
FORCE
|
||||
)
|
||||
else()
|
||||
# Force to the cache, but use existing value.
|
||||
set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}"
|
||||
CACHE STRING "Choose the type of build, options are: None Release TestRelease MinSizeRel Debug RelWithDebInfo MinSizeRel Maintainer."
|
||||
CACHE STRING "Choose the type of build, options are: None Release TestRelease MinSizeRel Debug Debug_FPE RelWithDebInfo MinSizeRel Maintainer."
|
||||
FORCE
|
||||
)
|
||||
endif()
|
||||
else()
|
||||
# Multimode tools like VS, Xcode
|
||||
list(APPEND CMAKE_CONFIGURATION_TYPES Debug_FPE)
|
||||
list(APPEND CMAKE_CONFIGURATION_TYPES TestRelease)
|
||||
list(APPEND CMAKE_CONFIGURATION_TYPES Maintainer)
|
||||
list(REMOVE_DUPLICATES CMAKE_CONFIGURATION_TYPES)
|
||||
@@ -200,9 +210,6 @@ endif()
|
||||
# An example of where a workaround is needed
|
||||
# Rest of concurrency a library implementation feature
|
||||
|
||||
# Add Definition to flags for temporary back compatibility
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DG4USE_STD11")
|
||||
|
||||
# Hold any appropriate compile flag(s) in variable for later export to
|
||||
# config files. Needed to support clients using late CMake 2.8 where compile features
|
||||
# are not available.
|
||||
@@ -261,7 +268,6 @@ if(GEANT4_BUILD_MULTITHREADED)
|
||||
|
||||
# Set Defs/Compiler Flags
|
||||
# TODO: Migrate def to header
|
||||
add_definitions(-DG4MULTITHREADED)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GEANT4_MULTITHREADED_CXX_FLAGS}")
|
||||
endif()
|
||||
|
||||
@@ -280,11 +286,6 @@ option(GEANT4_BUILD_STORE_TRAJECTORY
|
||||
ON)
|
||||
mark_as_advanced(GEANT4_BUILD_STORE_TRAJECTORY)
|
||||
|
||||
# TODO: Migrate this to header
|
||||
if(GEANT4_BUILD_STORE_TRAJECTORY)
|
||||
add_definitions(-DG4_STORE_TRAJECTORY)
|
||||
endif()
|
||||
|
||||
#.rst:
|
||||
# - ``GEANT4_BUILD_VERBOSE_CODE`` (Default: ON)
|
||||
#
|
||||
@@ -297,29 +298,6 @@ option(GEANT4_BUILD_VERBOSE_CODE
|
||||
ON)
|
||||
mark_as_advanced(GEANT4_BUILD_VERBOSE_CODE)
|
||||
|
||||
# TODO: Migrate this to header
|
||||
if(GEANT4_BUILD_VERBOSE_CODE)
|
||||
add_definitions(-DG4VERBOSE)
|
||||
endif()
|
||||
|
||||
#.rst:
|
||||
# - ``GEANT4_BUILD_MUONIC_ATOMS_IN_USE`` (Default: OFF)
|
||||
#
|
||||
# - Switched off by default to improve performance when not using
|
||||
# Muonic Atom code. It should be switched on if the project requires
|
||||
# support for Muonic Atoms.
|
||||
# Mark as advanced because most users should not need to worry about it
|
||||
#
|
||||
option(GEANT4_BUILD_MUONIC_ATOMS_IN_USE
|
||||
"Enable turning on some if statements in track and event code. Switch on if using new Muonic Atom code."
|
||||
OFF)
|
||||
mark_as_advanced(GEANT4_BUILD_MUONIC_ATOMS_IN_USE)
|
||||
|
||||
# TODO: Migrate this to header
|
||||
if(GEANT4_BUILD_MUONIC_ATOMS_IN_USE)
|
||||
add_definitions(-DG4MUATOMS_INUSE)
|
||||
endif()
|
||||
|
||||
#.rst:
|
||||
# - ``GEANT4_BUILD_MSVC_MP`` (Windows only, Default: OFF)
|
||||
#
|
||||
|
||||
@@ -64,15 +64,6 @@ set(GEANT4_THIRD_PARTY_IMPORT_SETUP )
|
||||
# Externals libraries that may be present
|
||||
set(GEANT4_EXTERNALS_TARGETS )
|
||||
|
||||
# - Stuff from Geant4LibraryBuildOptions.cmake
|
||||
if(GEANT4_BUILD_STORE_TRAJECTORY)
|
||||
list(APPEND GEANT4_CORE_DEFINITIONS -DG4_STORE_TRAJECTORY)
|
||||
endif()
|
||||
|
||||
if(GEANT4_BUILD_VERBOSE_CODE)
|
||||
list(APPEND GEANT4_CORE_DEFINITIONS -DG4VERBOSE)
|
||||
endif()
|
||||
|
||||
# - Stuff from Geant4OptionalComponents.cmake
|
||||
# - CLHEP
|
||||
# If it's internal, add it to the externals list
|
||||
@@ -104,11 +95,11 @@ endif()
|
||||
# Compile definitions
|
||||
if(GEANT4_USE_USOLIDS OR GEANT4_USE_PARTIAL_USOLIDS)
|
||||
set(GEANT4_USE_USOLIDS_EITHER ON)
|
||||
list(APPEND GEANT4_CORE_DEFINITIONS ${GEANT4_USOLIDS_COMPILE_DEFINITIONS})
|
||||
|
||||
# System USolids headers, because these do appear in Geant4's
|
||||
# public interface. The library should be in the link interface
|
||||
# of G4geometry (may need refinding)
|
||||
list(APPEND GEANT4_CORE_DEFINITIONS ${VECGEOM_DEFINITIONS})
|
||||
list(APPEND GEANT4_THIRD_PARTY_INCLUDES "${USOLIDS_INCLUDE_DIRS} ${VECGEOM_EXTERNAL_INCLUDES}")
|
||||
endif()
|
||||
|
||||
|
||||
@@ -123,13 +123,6 @@ if(NOT GEANT4_BUILD_GRANULAR_LIBS AND UNIX)
|
||||
set(G4_BUILTWITH_MULTITHREADING "no")
|
||||
endif()
|
||||
|
||||
# - Muonic Atom support
|
||||
if(GEANT4_BUILD_MUONIC_ATOMS_IN_USE)
|
||||
set(G4_BUILTWITH_MUONIC_ATOMS "yes")
|
||||
else()
|
||||
set(G4_BUILTWITH_MUONIC_ATOMS "no")
|
||||
endif()
|
||||
|
||||
# - CLHEP
|
||||
if(GEANT4_USE_SYSTEM_CLHEP)
|
||||
set(G4_BUILTWITH_CLHEP "no")
|
||||
@@ -196,7 +189,7 @@ if(NOT GEANT4_BUILD_GRANULAR_LIBS AND UNIX)
|
||||
list(REMOVE_DUPLICATES G4_USOLIDS_INCLUDE_DIRS)
|
||||
list(REMOVE_ITEM G4_USOLIDS_INCLUDE_DIRS ${_cxx_compiler_dirs})
|
||||
|
||||
string(REPLACE ";" " " G4_USOLIDS_CFLAGS "${GEANT4_USOLIDS_COMPILE_DEFINITIONS}")
|
||||
string(REPLACE ";" " " G4_USOLIDS_CFLAGS "${VECGEOM_DEFINITIONS}")
|
||||
foreach(_dir ${G4_USOLIDS_INCLUDE_DIRS})
|
||||
set(G4_USOLIDS_CFLAGS "${G4_USOLIDS_CFLAGS} -I${_dir}")
|
||||
endforeach()
|
||||
|
||||
@@ -48,11 +48,11 @@ geant4_add_dataset(
|
||||
# - Particle XS - replaces Neutron XS
|
||||
geant4_add_dataset(
|
||||
NAME G4PARTICLEXS
|
||||
VERSION 1.1
|
||||
VERSION 2.0
|
||||
FILENAME G4PARTICLEXS
|
||||
EXTENSION tar.gz
|
||||
ENVVAR G4PARTICLEXSDATA
|
||||
MD5SUM 17dc6c6f11db7ca81dea1c2c2b3707d2
|
||||
MD5SUM bc115502d4524ef7625557d9cab355c0
|
||||
)
|
||||
|
||||
# - PII
|
||||
|
||||
@@ -34,7 +34,7 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES ".*Clang")
|
||||
set(CMAKE_CXX_FLAGS_INIT "${CMAKE_CXX_FLAGS_INIT} -pipe")
|
||||
|
||||
# Additional per-mode flags
|
||||
set(CMAKE_CXX_FLAGS_DEBUG_INIT "-g -DG4FPE_DEBUG")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE_INIT "-O3 -DNDEBUG")
|
||||
# Assist auto-vectorization
|
||||
set(CMAKE_CXX_FLAGS_RELEASE_INIT "${CMAKE_CXX_FLAGS_RELEASE_INIT} -fno-trapping-math -ftree-vectorize -fno-math-errno")
|
||||
@@ -52,6 +52,9 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES ".*Clang")
|
||||
endif()
|
||||
|
||||
# Extra Geant4 modes
|
||||
# - Debug_FPE: Core Debug mode plus FPE)
|
||||
set(CMAKE_CXX_FLAGS_DEBUG_FPE_INIT "${CMAKE_CXX_FLAGS_DEBUG_INIT} -DG4FPE_DEBUG")
|
||||
|
||||
# - TestRelease
|
||||
set(CMAKE_CXX_FLAGS_TESTRELEASE_INIT "-g -DG4DEBUG_VERBOSE -DG4FPE_DEBUG")
|
||||
|
||||
|
||||
@@ -196,7 +196,7 @@ GEANT4_ADD_FEATURE(GEANT4_USE_GDML "Building Geant4 with GDML support")
|
||||
# With this option, G4StackManager uses G4SmartTrackStack instead of
|
||||
# ordinary G4TrackStack as the Urgent stack. G4SmartTrackStack tries to
|
||||
# stick to the same kind of particle as the previous track when Pop()
|
||||
# is called. This G4SmartTrackStack may provide some performance
|
||||
# is called. This G4SmartTrackStack may provide some performance
|
||||
# improvements in particular for crystal calorimeters in high energy
|
||||
# physics experiments. On the other hand, G4SmartTrackStack won't give
|
||||
# any benefit for granular geometry or lower energy applications, while
|
||||
@@ -214,7 +214,7 @@ GEANT4_ADD_FEATURE(GEANT4_USE_SMARTSTACK "Use smart track stack")
|
||||
#-----------------------------------------------------------------------
|
||||
# Optional Support for TiMemory -- cross-language timing and memory
|
||||
# easily installed via:
|
||||
# "pip install timemory" and pointing TiMemory_DIR to
|
||||
# "pip install timemory" and pointing TiMemory_DIR to
|
||||
# <install-prefix>/share/cmake/TiMemory
|
||||
# e.g. -DTiMemory_DIR=/usr/local/share/cmake/TiMemory
|
||||
# for /usr/local/bin/pip
|
||||
@@ -232,8 +232,6 @@ mark_as_advanced(GEANT4_USE_TIMEMORY)
|
||||
|
||||
if(GEANT4_USE_TIMEMORY)
|
||||
find_package(TiMemory REQUIRED)
|
||||
# definition that enables macros
|
||||
add_definitions(-DGEANT4_USE_TIMEMORY)
|
||||
endif()
|
||||
|
||||
GEANT4_ADD_FEATURE(GEANT4_USE_TIMEMORY "Building Geant4 with TiMemory support")
|
||||
@@ -314,22 +312,19 @@ if(GEANT4_USE_ALL_USOLIDS OR GEANT4_USE_PARTIAL_USOLIDS)
|
||||
find_package(VecGeom REQUIRED)
|
||||
|
||||
if(GEANT4_USE_ALL_USOLIDS)
|
||||
set(GEANT4_USOLIDS_COMPILE_DEFINITIONS "-DG4GEOM_USE_USOLIDS")
|
||||
set(G4GEOM_USE_USOLIDS TRUE)
|
||||
GEANT4_ADD_FEATURE(GEANT4_USE_USOLIDS "Replacing Geant4 solids with all VecGeom equivalents (EXPERIMENTAL)")
|
||||
else()
|
||||
set(GEANT4_USOLIDS_COMPILE_DEFINITIONS "-DG4GEOM_USE_PARTIAL_USOLIDS")
|
||||
set(G4GEOM_USE_PARTIAL_USOLIDS TRUE)
|
||||
foreach(__g4_usolid_shape ${GEANT4_USE_PARTIAL_USOLIDS_SHAPE_LIST})
|
||||
list(APPEND GEANT4_USOLIDS_COMPILE_DEFINITIONS "-DG4GEOM_USE_U${__g4_usolid_shape}")
|
||||
set(G4GEOM_USE_U${__g4_usolid_shape} TRUE)
|
||||
endforeach()
|
||||
GEANT4_ADD_FEATURE(GEANT4_USE_USOLIDS "Replacing Geant4 solids with VecGeom equivalents for ${GEANT4_USE_PARTIAL_USOLIDS_SHAPE_LIST} (EXPERIMENTAL)")
|
||||
endif()
|
||||
list (APPEND GEANT4_USOLIDS_COMPILE_DEFINITIONS ${VECGEOM_DEFINITIONS})
|
||||
|
||||
# Combined definitions
|
||||
add_definitions(${GEANT4_USOLIDS_COMPILE_DEFINITIONS})
|
||||
|
||||
# Add VecGeom inc dirs here - can be removed once VecGeom supports
|
||||
# INTERFACE_INCLUDE_DIRECTORIES
|
||||
# Always need defs/includes for VecGeom until that supports usage reqs...
|
||||
# Or can create a "G4VecGeom" internal target to propagate these.
|
||||
add_definitions(${VECGEOM_DEFINITIONS})
|
||||
include_directories(${VECGEOM_INCLUDE_DIR} ${VECGEOM_EXTERNAL_INCLUDES})
|
||||
endif()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user