Import Geant4 11.3.0.beta source tree
This commit is contained in:
@@ -101,14 +101,14 @@ set(CMAKE_CXX_FLAGS_TESTRELEASE "${CMAKE_CXX_FLAGS_TESTRELEASE_INIT}"
|
||||
mark_as_advanced(CMAKE_CXX_FLAGS_TESTRELEASE)
|
||||
|
||||
#.rst:
|
||||
# - ``Maintainer``:
|
||||
# For development of the toolkit. It adds debugging, and enables the use
|
||||
# of library specific debugging via standardized definitions.
|
||||
# - ``FullRelWithDebInfo``:
|
||||
# For trial production and extended testing. Maximum optimization
|
||||
# and debugging symbols
|
||||
#
|
||||
set(CMAKE_CXX_FLAGS_MAINTAINER "${CMAKE_CXX_FLAGS_MAINTAINER_INIT}"
|
||||
CACHE STRING "Flags used by the compiler during Maintainer builds"
|
||||
set(CMAKE_CXX_FLAGS_FULLRELWITHDEBINFO "${CMAKE_CXX_FLAGS_FULLRELWITHDEBINFO_INIT}"
|
||||
CACHE STRING "Flags used by the compiler during FullRelWithDebInfo builds"
|
||||
)
|
||||
mark_as_advanced(CMAKE_CXX_FLAGS_MAINTAINER)
|
||||
mark_as_advanced(CMAKE_CXX_FLAGS_FULLRELWITHDEBINFO)
|
||||
|
||||
#.rst:
|
||||
# Compiler flags specific to these build types are set in the cache, and
|
||||
@@ -117,17 +117,17 @@ mark_as_advanced(CMAKE_CXX_FLAGS_MAINTAINER)
|
||||
#
|
||||
if(NOT CMAKE_CONFIGURATION_TYPES)
|
||||
# Single mode build tools like Make, Ninja,
|
||||
set(__g4buildmodes "" Release TestRelease MinSizeRel Debug Debug_FPE RelWithDebInfo MinSizeRel Maintainer)
|
||||
set(__g4buildmodes "" Release TestRelease MinSizeRel Debug Debug_FPE RelWithDebInfo FullRelWithDebInfo)
|
||||
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 Debug_FPE RelWithDebInfo MinSizeRel Maintainer."
|
||||
CACHE STRING "Choose the type of build, options are: None Release TestRelease MinSizeRel Debug Debug_FPE RelWithDebInfo FullRelWithDebInfo."
|
||||
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 Debug_FPE RelWithDebInfo MinSizeRel Maintainer."
|
||||
CACHE STRING "Choose the type of build, options are: None Release TestRelease MinSizeRel Debug Debug_FPE RelWithDebInfo FullRelWithDebInfo."
|
||||
FORCE
|
||||
)
|
||||
endif()
|
||||
@@ -136,7 +136,7 @@ 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(APPEND CMAKE_CONFIGURATION_TYPES FullRelWithDebInfo)
|
||||
list(REMOVE_DUPLICATES CMAKE_CONFIGURATION_TYPES)
|
||||
set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}"
|
||||
CACHE STRING "Geant4 configurations for multimode build tools"
|
||||
@@ -365,6 +365,19 @@ if(GEANT4_BUILD_MULTITHREADED)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GEANT4_MULTITHREADED_CXX_FLAGS}")
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# Link-time optimization
|
||||
#-----------------------------------------------------------------------
|
||||
# If LTO is enabled via CMAKE_INTERPROCEDURAL_OPTIMIZATION, then add
|
||||
# additional flags to force identify/check ODR violations for GCC only (at present)
|
||||
# Note that these are _nominally_ enabled by default in GCC with flto, so
|
||||
# they are added explicitly for the sake of clarity. Also, some are only valid for
|
||||
# older GCC versions, but they do not break things.
|
||||
# TODO: Review with experiments what recommended options are here.
|
||||
if(CMAKE_INTERPROCEDURAL_OPTIMIZATION AND (CMAKE_CXX_COMPILER_ID STREQUAL "GNU"))
|
||||
string(APPEND CMAKE_CXX_FLAGS " -Wodr -fipa-icf -flto-odr-type-merging")
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# Physics
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
@@ -18,11 +18,11 @@ geant4_add_dataset(
|
||||
# - Low energy electromagnetics
|
||||
geant4_add_dataset(
|
||||
NAME G4EMLOW
|
||||
VERSION 8.5
|
||||
VERSION 8.6
|
||||
FILENAME G4EMLOW
|
||||
EXTENSION tar.gz
|
||||
ENVVAR G4LEDATA
|
||||
MD5SUM 146d0625d8d39f294056e1618271bc46
|
||||
MD5SUM 080576674061a0649629649879655bb9
|
||||
)
|
||||
|
||||
# - Photon evaporation
|
||||
@@ -48,11 +48,11 @@ geant4_add_dataset(
|
||||
# - Particle XS - replaces Neutron XS
|
||||
geant4_add_dataset(
|
||||
NAME G4PARTICLEXS
|
||||
VERSION 4.0
|
||||
VERSION 4.1
|
||||
FILENAME G4PARTICLEXS
|
||||
EXTENSION tar.gz
|
||||
ENVVAR G4PARTICLEXSDATA
|
||||
MD5SUM d82a4d171d50f55864e28b6cd6f433c0
|
||||
MD5SUM 878252a464ba6b38f085741840f053e6
|
||||
)
|
||||
|
||||
# - PII
|
||||
@@ -115,7 +115,7 @@ geant4_add_dataset(
|
||||
ENVVAR G4ENSDFSTATEDATA
|
||||
MD5SUM 6f18fce8f217e7aaeaa3711be9b2c7bf
|
||||
)
|
||||
|
||||
|
||||
# - TENDL
|
||||
option(GEANT4_INSTALL_DATASETS_TENDL "Install optional TENDL dataset" OFF)
|
||||
mark_as_advanced(GEANT4_INSTALL_DATASETS_TENDL)
|
||||
@@ -129,6 +129,34 @@ if(GEANT4_INSTALL_DATASETS_TENDL)
|
||||
ENVVAR G4PARTICLEHPDATA
|
||||
MD5SUM ab17a1eec5ad4c8fcfafcfbc0de30ed8
|
||||
)
|
||||
|
||||
endif()
|
||||
|
||||
# - NuDEX
|
||||
option(GEANT4_INSTALL_DATASETS_NUDEXLIB "Install optional NuDEXLib dataset" OFF)
|
||||
mark_as_advanced(GEANT4_INSTALL_DATASETS_NUDEXLIB)
|
||||
|
||||
if(GEANT4_INSTALL_DATASETS_NUDEXLIB)
|
||||
geant4_add_dataset(
|
||||
NAME G4NUDEXLIB
|
||||
VERSION 1.0
|
||||
FILENAME G4NUDEXLIB
|
||||
EXTENSION tar.gz
|
||||
ENVVAR G4NUDEXLIBDATA
|
||||
MD5SUM 09a85f907d2282dbf234d1784f436db3
|
||||
)
|
||||
endif()
|
||||
|
||||
# - G4URRPT
|
||||
option(GEANT4_INSTALL_DATASETS_URRPT "Install optional URRPT dataset" OFF)
|
||||
mark_as_advanced(GEANT4_INSTALL_DATASETS_URRPT)
|
||||
|
||||
if(GEANT4_INSTALL_DATASETS_URRPT)
|
||||
geant4_add_dataset(
|
||||
NAME G4URRPT
|
||||
VERSION 1.0
|
||||
FILENAME G4URRPT
|
||||
EXTENSION tar.gz
|
||||
ENVVAR G4URRPTDATA
|
||||
MD5SUM acc94698e4199455b4fac33c3384ccb4
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -852,6 +852,59 @@ function(geant4_get_external_categories _result)
|
||||
set(${_result} ${__tmp} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
#-----------------------------------------------------------------------
|
||||
#.rst:
|
||||
# Test Program Commands
|
||||
# ^^^^^^^^^^^^^^^^^^^^^
|
||||
# .. cmake:command:: geant4_test_link_libraries
|
||||
#
|
||||
# .. code-block:: cmake
|
||||
#
|
||||
# geant4_test_link_libraries(<target>
|
||||
# [PUBLIC pub1 [pub2 ...]
|
||||
# [PRIVATE pri1 [pri2 ...]
|
||||
# [INTERFACE int1 [int2 ...])
|
||||
function(geant4_test_link_libraries _target)
|
||||
cmake_parse_arguments(G4TESTLINKLIB
|
||||
""
|
||||
""
|
||||
"PUBLIC;PRIVATE;INTERFACE"
|
||||
${ARGN}
|
||||
)
|
||||
__geant4_assert_no_unparsed_arguments(G4TESTLINKLIB geant4_test_link_libraries)
|
||||
|
||||
# Need defined libraries to be able to resolve between static/shared
|
||||
get_property(__g4definedlibraries GLOBAL PROPERTY GEANT4_DEFINED_CATEGORIES)
|
||||
|
||||
foreach(__prop PUBLIC PRIVATE INTERFACE)
|
||||
__geant4_resolve_link_libraries(G4TESTLINKLIB_${__prop})
|
||||
if(G4TESTLINKLIB_${__prop})
|
||||
# Filter list for internal static targets
|
||||
# NB: This only works assuming that the input target is an executable
|
||||
# If we introduce test libraries, would need same treatment as for main libraries
|
||||
if(BUILD_STATIC_LIBS AND NOT BUILD_SHARED_LIBS)
|
||||
set(_g4linklibs )
|
||||
foreach(_linklib ${G4TESTLINKLIB_${__prop}})
|
||||
# If the linklib is a G4Library, change name to "name-static"
|
||||
list(FIND __g4definedlibraries ${_linklib} _isg4lib)
|
||||
if(_isg4lib GREATER -1)
|
||||
list(APPEND _g4linklibs "${_linklib}-static")
|
||||
else()
|
||||
list(APPEND _g4linklibs "${_linklib}")
|
||||
endif()
|
||||
endforeach()
|
||||
message(STATUS "${_g4linklibs}")
|
||||
set(_linklibs ${_g4linklibs})
|
||||
else()
|
||||
set(_linklibs ${G4TESTLINKLIB_${__prop}})
|
||||
endif()
|
||||
|
||||
target_link_libraries(${_target} ${__prop} ${_linklibs})
|
||||
endif()
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
#-----------------------------------------------------------------------
|
||||
# Composition Functions
|
||||
@@ -1184,6 +1237,9 @@ function(__geant4_resolve_link_libraries _list)
|
||||
geant4_has_module(__is_module ${__lib})
|
||||
if(__is_module)
|
||||
geant4_get_module_property(__parent_lib ${__lib} PARENT_TARGET)
|
||||
if(NOT __parent_lib)
|
||||
message(FATAL_ERROR "Module '${__lib}' has no PARENT_TARGET set")
|
||||
endif()
|
||||
list(APPEND _resolved_list ${__parent_lib})
|
||||
else()
|
||||
list(APPEND _resolved_list ${__lib})
|
||||
|
||||
@@ -64,8 +64,6 @@ if(GEANT4_USE_INVENTOR_QT AND NOT GEANT4_USE_QT)
|
||||
set(GEANT4_USE_QT ON CACHE BOOL "Build Geant4 with Qt support" FORCE)
|
||||
message(STATUS "Forcing GEANT4_USE_QT to ON, required by selection of GEANT4_USE_INVENTOR_QT as ON")
|
||||
endif()
|
||||
set(GEANT4_USE_TOOLSSG_QT_GLES ${GEANT4_USE_QT})
|
||||
set(GEANT4_USE_TOOLSSG_QT_ZB ${GEANT4_USE_QT})
|
||||
|
||||
# TEMPORARY for 11.2 Beta Development
|
||||
# Decision still required on whether to allow selection of 5/6 in production
|
||||
@@ -76,15 +74,15 @@ mark_as_advanced(GEANT4_USE_QT_QT6)
|
||||
option(GEANT4_USE_VTK "Build Geant4 with VTK visualisation" OFF)
|
||||
if(GEANT4_USE_VTK)
|
||||
find_package(VTK 9 REQUIRED COMPONENTS
|
||||
CommonColor
|
||||
InteractionStyle
|
||||
IOExport
|
||||
IOGeometry
|
||||
IOLegacy
|
||||
IOPLY
|
||||
GUISupportQt
|
||||
RenderingVolumeOpenGL2
|
||||
)
|
||||
CommonColor
|
||||
InteractionStyle
|
||||
IOExport
|
||||
IOGeometry
|
||||
IOLegacy
|
||||
IOPLY
|
||||
GUISupportQt
|
||||
RenderingVolumeOpenGL2
|
||||
)
|
||||
geant4_save_package_variables(VTK VTK_DIR)
|
||||
endif()
|
||||
geant4_add_feature(GEANT4_USE_VTK "Using VTK for visualisation")
|
||||
@@ -100,19 +98,13 @@ if(UNIX)
|
||||
set(GEANT4_USE_XM ON CACHE BOOL "Build Geant4 with Motif (X11) support" FORCE)
|
||||
message(STATUS "Forcing GEANT4_USE_XM to ON, required by Inventor driver")
|
||||
endif()
|
||||
set(GEANT4_USE_TOOLSSG_XT_GLES ${GEANT4_USE_XM})
|
||||
set(GEANT4_USE_TOOLSSG_XT_ZB ${GEANT4_USE_XM})
|
||||
geant4_add_feature(GEANT4_USE_XM "Build Geant4 with Xm Support")
|
||||
|
||||
# - OpenGL/X11 Vis Driver
|
||||
# Selection also enables ToolsSG driver X11 backend
|
||||
option(GEANT4_USE_OPENGL_X11 "Build Geant4 OpenGL driver with X11 support" OFF)
|
||||
set(GEANT4_USE_TOOLSSG_X11_GLES ${GEANT4_USE_OPENGL_X11})
|
||||
geant4_add_feature(GEANT4_USE_OPENGL_X11 "Build Geant4 OpenGL driver with X11 support")
|
||||
|
||||
# tools/zb X11 Vis Driver
|
||||
set(GEANT4_USE_TOOLSSG_X11_ZB ${X11_FOUND})
|
||||
|
||||
# RayTracer driver with X11 support
|
||||
option(GEANT4_USE_RAYTRACER_X11 "Build RayTracer driver with X11 support" OFF)
|
||||
geant4_add_feature(GEANT4_USE_RAYTRACER_X11 "Build RayTracer driver with X11 support")
|
||||
@@ -121,10 +113,7 @@ endif()
|
||||
# Windows only
|
||||
if(WIN32)
|
||||
option(GEANT4_USE_OPENGL_WIN32 "Build OpenGL driver with Win32 support" OFF)
|
||||
set(GEANT4_USE_TOOLSSG_WINDOWS_GLES ${GEANT4_USE_OPENGL_WIN32})
|
||||
geant4_add_feature(GEANT4_USE_OPENGL_WIN32 "Build OpenGL driver with Win32 support")
|
||||
|
||||
set(GEANT4_USE_TOOLSSG_WINDOWS_ZB ON)
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
@@ -51,8 +51,8 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES ".*Clang")
|
||||
# - TestRelease
|
||||
set(CMAKE_CXX_FLAGS_TESTRELEASE_INIT "-g -DG4DEBUG_VERBOSE -DG4FPE_DEBUG")
|
||||
|
||||
# - Maintainer
|
||||
set(CMAKE_CXX_FLAGS_MAINTAINER_INIT "-g")
|
||||
# - Full optimization plus debug info (basically -O3 -g)
|
||||
set(CMAKE_CXX_FLAGS_FULLRELWITHDEBINFO_INIT "${CMAKE_CXX_FLAGS_RELEASE_INIT} -g")
|
||||
|
||||
# - Multithreading
|
||||
__configure_tls_models()
|
||||
@@ -72,7 +72,6 @@ if(MSVC)
|
||||
|
||||
# Extra modes
|
||||
set(CMAKE_CXX_FLAGS_TESTRELEASE_INIT "-MDd -Zi -G4DEBUG_VERBOSE")
|
||||
set(CMAKE_CXX_FLAGS_MAINTAINER_INIT "-MDd -Zi")
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
@@ -92,7 +91,6 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
|
||||
|
||||
# Extra modes
|
||||
set(CMAKE_CXX_FLAGS_TESTRELEASE_INIT "-g -G4DEBUG_VERBOSE")
|
||||
set(CMAKE_CXX_FLAGS_MAINTAINER_INIT "-g")
|
||||
|
||||
# - Multithreading
|
||||
__configure_tls_models()
|
||||
|
||||
@@ -183,42 +183,6 @@ option(GEANT4_USE_SMARTSTACK "Use smart track stack" OFF)
|
||||
mark_as_advanced(GEANT4_USE_SMARTSTACK)
|
||||
geant4_add_feature(GEANT4_USE_SMARTSTACK "Use smart track stack")
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# Optional Support for TiMemory -- timing, memory, HW counters, roofline, gperftools, etc.
|
||||
# easily installed via:
|
||||
# git clone https://github.com/NERSC/timemory.git timemory
|
||||
# pip install -vvv ./timemory
|
||||
# and prepending CMAKE_PREFIX_PATH with `python -c "import sys; print(sys.prefix)"`
|
||||
#
|
||||
set(_default_use_timemory OFF)
|
||||
if(TiMemory_DIR)
|
||||
set(_default_use_timemory ON)
|
||||
endif()
|
||||
|
||||
option(GEANT4_USE_TIMEMORY "Build Geant4 with TiMemory support" ${_default_use_timemory})
|
||||
mark_as_advanced(GEANT4_USE_TIMEMORY)
|
||||
|
||||
if(GEANT4_USE_TIMEMORY)
|
||||
# by default just use the library which will import all the components that it
|
||||
# was built with but once can add more
|
||||
if(BUILD_SHARED_LIBS)
|
||||
set(_G4timemory_DEFAULT_COMPONENTS cxx shared OPTIONAL_COMPONENTS)
|
||||
else()
|
||||
set(_G4timemory_DEFAULT_COMPONENTS cxx static OPTIONAL_COMPONENTS)
|
||||
endif()
|
||||
set(G4timemory_COMPONENTS "${_G4timemory_DEFAULT_COMPONENTS}" CACHE STRING
|
||||
"timemory INTERFACE libraries that activate various capabilities in toolkit")
|
||||
set(G4timemory_VERSION 3.2)
|
||||
set(timemory_FIND_COMPONENTS_INTERFACE geant4-timemory)
|
||||
add_library(geant4-timemory INTERFACE)
|
||||
find_package(timemory ${G4timemory_VERSION} REQUIRED COMPONENTS ${G4timemory_COMPONENTS})
|
||||
install(TARGETS geant4-timemory EXPORT Geant4LibraryDepends)
|
||||
set(timemory_LIBRARIES geant4-timemory)
|
||||
geant4_save_package_variables(timemory timemory_DIR)
|
||||
endif()
|
||||
|
||||
geant4_add_feature(GEANT4_USE_TIMEMORY "Building Geant4 with TiMemory support")
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# Optional support for G3TOG4 convertion interface.
|
||||
# We do not build the rztog4 application.
|
||||
|
||||
Reference in New Issue
Block a user