Import Geant4 10.5.0.beta source tree
This commit is contained in:
+58
-6
@@ -31,25 +31,77 @@ add this in the documentation for the changed file as [BUGFIX #BUGNUMBER].
|
||||
|
||||
----------------------------------------------------------
|
||||
|
||||
23rd May 2018 - Gunter Folger (cmake-V10-03-54)
|
||||
19th June 2018 - Gunter Folger (cmake-V10-04-14)
|
||||
- Templates/geant4_validate_sources.cmake.in, revert addition of .c and .h
|
||||
Skip checking sources for zlib
|
||||
(.c and .h match far too many other files)
|
||||
- Switch to G4EMLOW7.4
|
||||
|
||||
14th June 2018 - Gunter Folger (cmake-V10-04-13)
|
||||
- Templates/geant4_validate_sources.cmake.in: add C sources and headers
|
||||
|
||||
8th June 2018 - Ben Morgan (cmake-V10-04-12)
|
||||
- Add "auto" dummy Thread Local Storage model
|
||||
Per request from CERN, when "auto" is used,
|
||||
no explicit compiler flag to select the TLS model is
|
||||
set. Record this in Geant4Config.cmake and geant4-config
|
||||
as unset/empty variables.
|
||||
|
||||
6th Jun 2018 - Jonathan Madsen (cmake-V10-04-11)
|
||||
- Addition of TiMemory as an optional package
|
||||
|
||||
23rd May 2018 - Ben Morgan (cmake-V10-04-10)
|
||||
- Remove CMake warning about building MT DLLs on Windows, as
|
||||
these are now supported.
|
||||
|
||||
23rd May 2018 - Gunter Folger (cmake-V10-04-09)
|
||||
- Update Geant4DatasetDefinitions to use G4RealSurface 2.1.1
|
||||
patched version bringing back data lost in 2.1
|
||||
|
||||
26th February 2018 - Ben Morgan (cmake-V10-03-53, 52)
|
||||
14st May 2018 - Gunter Folger (cmake-V10-04-08)
|
||||
- Update Geant4DatasetDefinitions to use G4NEUTRONXS 2.0
|
||||
|
||||
21st March 2018 - Ben Morgan (cmake-V10-04-07)
|
||||
- G4BuildSettings.cmake: Allow Windows MT builds to use DLLs, but warn.
|
||||
|
||||
26th February 2018 - Ben Morgan (cmake-V10-04-06)
|
||||
- Geant4InstallData.cmake, Geant4CTest.cmake: Update URL for downloads
|
||||
to "cern.ch/geant4-data" as the correct alias to new EOS area, seperate
|
||||
from main website. Superceeds cmake-V10-03-51.
|
||||
from main website.
|
||||
|
||||
26th February 2018 - Ben Morgan (cmake-V10-03-51)
|
||||
26th February 2018 - Ben Morgan (cmake-V10-04-05)
|
||||
- Geant4InstallData.cmake, Geant4CTest.cmake: Update URL for downloads
|
||||
to "cern.ch/geant4" as the correct alias.
|
||||
|
||||
26th February 2018 - Ben Morgan (cmake-V10-03-50)
|
||||
26th February 2018 - Ben Morgan (cmake-V10-04-04)
|
||||
- G4BuildSettings.cmake: Add 17/c++17 to C++ standards against which
|
||||
Geant4 can be compiled. Will require a minimum CMake version of
|
||||
3.8 to enable, but this is not checked.
|
||||
|
||||
8th December 2017 - Ben Morgan
|
||||
20th February 2018 - Ben Morgan (cmake-V10-04-03)
|
||||
- Initial configuration support for MT on Windows
|
||||
- Modules/G4BuildSettings.cmake: Remove restrictions and warnings on enabling
|
||||
MT on Windows. Add restriction on building MT DLLs, emitting a fatal error
|
||||
if this combination is selcted, and report needed settings to enable
|
||||
static MT libraries.
|
||||
|
||||
18th January 2018 - Ben Morgan (cmake-V10-04-02)
|
||||
- Support use of WINDOWS_EXPORT_ALL_SYMBOLS for DLL builds with cmake >=3.4
|
||||
retaining old capability for CMake 3.3.
|
||||
- Modules/G4WindowsDLLSupport.cmake: New module to hold old DLL support.
|
||||
Create old `genwindef` support program, moved from G4BuildSettings.
|
||||
Implement `__geant4_add_dll_old` macro which expands to the pre cmake 3.4
|
||||
use of `genwindef` to export symbols and create DLL.
|
||||
- Modules/G4DeveloperAPI_OLD.cmake: Include G4WindowsDLLSupport module, and
|
||||
use functionality to create DLL when CMake is <3.4. Otherwise, use
|
||||
new WINDOWS_EXPORT_ALL_SYMBOLS property when building a shared library.
|
||||
|
||||
11th January 2018 - Gabriele Cosmo (cmake-V10-04-01)
|
||||
- Modules/Geant4OptionalComponents.cmake: add TESSELLATEDSOLID flag to enable
|
||||
wrapping of G4TessellatedSolid in GEANT4_USOLIDS_SHAPES.
|
||||
Coworks with tag geom-specific-V10-04-03.
|
||||
|
||||
8th December 2017 - Ben Morgan (cmake-V10-04-00)
|
||||
- Templates/UseGeant4_internal.cmake: When running test driver directly,
|
||||
make it run in WORKING_DIRECTORY if this is supplied.
|
||||
|
||||
|
||||
@@ -217,14 +217,9 @@ set(GEANT4_CXXSTD_FLAGS "${CMAKE_CXX${GEANT4_BUILD_CXXSTD}_STANDARD_COMPILE_OPTI
|
||||
# - ``GEANT4_BUILD_MULTITHREADED`` (Default: ``OFF``)
|
||||
#
|
||||
# If set to ``ON``, compile Geant4 with support for multithreading.
|
||||
# At present, this is only supported on Unix platforms.
|
||||
# On Win32, this option requires use of static libraries only
|
||||
#
|
||||
option(GEANT4_BUILD_MULTITHREADED "Enable multithreading in Geant4" OFF)
|
||||
|
||||
if(WIN32)
|
||||
mark_as_advanced(GEANT4_BUILD_MULTITHREADED)
|
||||
endif()
|
||||
|
||||
geant4_add_feature(GEANT4_BUILD_MULTITHREADED "Build multithread enabled libraries")
|
||||
|
||||
#.rst:
|
||||
@@ -233,8 +228,10 @@ geant4_add_feature(GEANT4_BUILD_MULTITHREADED "Build multithread enabled librari
|
||||
# If ``GEANT4_BUILD_MULTITHREADED`` is ``ON`` and a GNU/Clang/Intel
|
||||
# compiler is being used, then this option may be used to choose the
|
||||
# Thread Local Storage model. A default of ``initial-exec`` is used
|
||||
# to provide optimize performance for applications directly linking
|
||||
# to the Geant4 libraries
|
||||
# to provide optimal performance for applications directly linking
|
||||
# to the Geant4 libraries. The dummy ``auto`` model may be selected
|
||||
# to leave model selection to the compiler, with no additional flag(s)
|
||||
# passed to the compiler.
|
||||
#
|
||||
if(GEANT4_BUILD_MULTITHREADED)
|
||||
# - Need Thread Local Storage support (POSIX)
|
||||
@@ -245,12 +242,6 @@ if(GEANT4_BUILD_MULTITHREADED)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# - Emit warning on Windows - message will format oddly on CMake prior
|
||||
# to 2.8, but still print
|
||||
if(WIN32)
|
||||
message(WARNING "GEANT4_BUILD_MULTITHREADED IS NOT SUPPORTED on Win32. This option should only be activated by developers")
|
||||
endif()
|
||||
|
||||
# - Allow advanced users to select the thread local storage model,
|
||||
# if the compiler supports it, defaulting to that recommended by Geant4
|
||||
if(TLSMODEL_IS_AVAILABLE)
|
||||
@@ -260,9 +251,14 @@ if(GEANT4_BUILD_MULTITHREADED)
|
||||
CASE_INSENSITIVE
|
||||
)
|
||||
mark_as_advanced(GEANT4_BUILD_TLS_MODEL)
|
||||
geant4_add_feature(GEANT4_BUILD_TLS_MODEL "Building with TLS model '${GEANT4_BUILD_TLS_MODEL}'")
|
||||
|
||||
set(GEANT4_MULTITHREADED_CXX_FLAGS "${GEANT4_MULTITHREADED_CXX_FLAGS} ${${GEANT4_BUILD_TLS_MODEL}_FLAGS}")
|
||||
if(GEANT4_BUILD_TLS_MODEL STREQUAL "auto")
|
||||
geant4_add_feature(GEANT4_BUILD_TLS_MODEL "Building without explicit TLS model")
|
||||
else()
|
||||
geant4_add_feature(GEANT4_BUILD_TLS_MODEL "Building with TLS model '${GEANT4_BUILD_TLS_MODEL}'")
|
||||
endif()
|
||||
|
||||
set(GEANT4_MULTITHREADED_CXX_FLAGS "${GEANT4_MULTITHREADED_CXX_FLAGS} ${${GEANT4_BUILD_TLS_MODEL}_TLSMODEL_FLAGS}")
|
||||
endif()
|
||||
|
||||
# Set Defs/Compiler Flags
|
||||
@@ -349,8 +345,6 @@ endif()
|
||||
# Library Mode and Link Options
|
||||
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
#
|
||||
|
||||
#.rst:
|
||||
# - ``BUILD_SHARED_LIBS`` (Default: ``ON``)
|
||||
#
|
||||
# - Build shared libraries (`.so` on Unix, `.dylib` on macOS, `.dll/.lib` on Windows)
|
||||
@@ -378,24 +372,6 @@ if(GEANT4_BUILD_GRANULAR_LIBS)
|
||||
message(FATAL_ERROR " Granular libraries are no longer supported!")
|
||||
endif()
|
||||
|
||||
# On WIN32, we need to build the genwindef application to create export
|
||||
# def files for building DLLs.
|
||||
# We only use it as a helper application at the moment so we exclude it from
|
||||
# the ALL target.
|
||||
# TODO: We could move this section into the Geant4MacroLibraryTargets.cmake
|
||||
# if it can be protected so that the genwindef target wouldn't be defined
|
||||
# more than once... Put it here for now...
|
||||
# TODO: Investigate use of CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS from CMake 3.4
|
||||
# and/or other forms of symbol visibility
|
||||
if(WIN32)
|
||||
# Assume the sources are co-located
|
||||
get_filename_component(_genwindef_src_dir ${CMAKE_CURRENT_LIST_FILE} PATH)
|
||||
add_executable(genwindef EXCLUDE_FROM_ALL
|
||||
${_genwindef_src_dir}/genwindef/genwindef.cpp
|
||||
${_genwindef_src_dir}/genwindef/LibSymbolInfo.h
|
||||
${_genwindef_src_dir}/genwindef/LibSymbolInfo.cpp)
|
||||
endif()
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#.rst:
|
||||
# Build Output Directories
|
||||
|
||||
@@ -42,6 +42,7 @@ endif()
|
||||
|
||||
# - Needed CMake modules
|
||||
include(CMakeParseArguments)
|
||||
include(G4WindowsDLLSupport)
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
#.rst:
|
||||
@@ -246,60 +247,23 @@ macro(geant4_library_target)
|
||||
|
||||
if(BUILD_SHARED_LIBS)
|
||||
# Add the shared library target and link its dependencies
|
||||
# WIN32 first
|
||||
if(WIN32)
|
||||
# We have to generate the def export file from an archive library.
|
||||
# This is a temporary separate from a real archive library, and
|
||||
# even though it's static, we need to mark that it will have
|
||||
# DLL symbols via the G4LIB_BUILD_DLL macro
|
||||
add_library(_${G4LIBTARGET_NAME}-archive STATIC EXCLUDE_FROM_ALL ${G4LIBTARGET_SOURCES})
|
||||
set(_archive _${G4LIBTARGET_NAME}-archive)
|
||||
target_compile_features(${_archive} PUBLIC ${GEANT4_TARGET_COMPILE_FEATURES})
|
||||
target_compile_definitions(${_archive} PUBLIC -DG4LIB_BUILD_DLL)
|
||||
|
||||
# - Add the config specific compile definitions
|
||||
geant4_compile_definitions_config(${_archive})
|
||||
|
||||
# - Create the .def file for this library
|
||||
# Use generator expressions to get path to per-mode lib and
|
||||
# older CMAKE_CFG_INTDIR variable to set name of per-mode def
|
||||
# file (Needed as generator expressions cannot be used in argument
|
||||
# to OUTPUT...
|
||||
add_custom_command(OUTPUT _${G4LIBTARGET_NAME}-${CMAKE_CFG_INTDIR}.def
|
||||
COMMAND genwindef -o _${G4LIBTARGET_NAME}-${CMAKE_CFG_INTDIR}.def -l ${G4LIBTARGET_NAME} $<TARGET_FILE:${_archive}>
|
||||
DEPENDS ${_archive} genwindef)
|
||||
|
||||
# - Now we can build the DLL
|
||||
# We create it from a dummy empty C++ file plus the def file.
|
||||
# Also set the public compile definition on it so that clients
|
||||
# will set correct macro automatically.
|
||||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/_${G4LIBTARGET_NAME}.cpp
|
||||
"// empty _${G4LIBTARGET_NAME}.cpp\n")
|
||||
|
||||
add_library(${G4LIBTARGET_NAME} SHARED _${G4LIBTARGET_NAME}.cpp
|
||||
_${G4LIBTARGET_NAME}-${CMAKE_CFG_INTDIR}.def)
|
||||
target_compile_definitions(${G4LIBTARGET_NAME} PUBLIC -DG4LIB_BUILD_DLL)
|
||||
target_compile_features(${G4LIBTARGET_NAME} PUBLIC ${GEANT4_TARGET_COMPILE_FEATURES})
|
||||
|
||||
# - Link the DLL.
|
||||
# We link it to the archive, and the supplied libraries,
|
||||
# but then remove the archive from the LINK_INTERFACE.
|
||||
target_link_libraries(${G4LIBTARGET_NAME}
|
||||
${_archive}
|
||||
${G4LIBTARGET_GEANT4_LINK_LIBRARIES}
|
||||
${G4LIBTARGET_LINK_LIBRARIES})
|
||||
|
||||
set_target_properties(${G4LIBTARGET_NAME}
|
||||
PROPERTIES INTERFACE_LINK_LIBRARIES "${G4LIBTARGET_GEANT4_LINK_LIBRARIES};${G4LIBTARGET_LINK_LIBRARIES}")
|
||||
|
||||
# WIN32/CMake<3.4 workaround
|
||||
if(WIN32 AND (CMAKE_VERSION VERSION_LESS 3.4))
|
||||
__geant4_add_dll_old(${ARGV})
|
||||
else()
|
||||
# - We build a Shared library in the usual fashion...
|
||||
# - Common shared lib commands
|
||||
add_library(${G4LIBTARGET_NAME} SHARED ${G4LIBTARGET_SOURCES})
|
||||
geant4_compile_definitions_config(${G4LIBTARGET_NAME})
|
||||
target_compile_features(${G4LIBTARGET_NAME} PUBLIC ${GEANT4_TARGET_COMPILE_FEATURES})
|
||||
target_link_libraries(${G4LIBTARGET_NAME}
|
||||
${G4LIBTARGET_GEANT4_LINK_LIBRARIES}
|
||||
${G4LIBTARGET_LINK_LIBRARIES})
|
||||
# DLL support, portable to all platforms
|
||||
# G4LIB_BUILD_DLL is public as despite the name it indicates the shared/archive mode
|
||||
# and clients must apply it when linking to the shared libs. The global
|
||||
# category handles the exact import/export statements
|
||||
target_compile_definitions(${G4LIBTARGET_NAME} PUBLIC G4LIB_BUILD_DLL)
|
||||
set_target_properties(${G4LIBTARGET_NAME} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||
endif()
|
||||
|
||||
# This property is set to prevent concurrent builds of static and
|
||||
@@ -365,9 +329,8 @@ macro(geant4_library_target)
|
||||
${G4LIBTARGET_LINK_LIBRARIES_STATIC})
|
||||
|
||||
# But we can rename the output library to the correct name
|
||||
# On WIN32 we *retain* the -static postfix because otherwise
|
||||
# we'll conflict with the .lib from the DLL build...
|
||||
# We could also install differently...
|
||||
# On WIN32 we *retain* the -static postfix to avoid name clashes
|
||||
# with the DLL import lib.
|
||||
if(NOT WIN32)
|
||||
set_target_properties(${G4LIBTARGET_NAME}-static
|
||||
PROPERTIES OUTPUT_NAME ${G4LIBTARGET_NAME})
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
#.rst:
|
||||
# G4WindowsDLLSupport
|
||||
# -------------------
|
||||
#
|
||||
# Provides functions needed to support builds of DLLs both pre and post
|
||||
# CMake 3.4. This version introduced the WINDOWS_EXPORT_ALL_SYMBOLS
|
||||
# property, removing the need for the shipped `genwindef` program.
|
||||
#
|
||||
# With Geant4 10.4 and below having a minimum version requirement of
|
||||
# CMake 3.3, we need to provide both so that patches can be applied
|
||||
# to these versions without requiring clients to bump their CMake version.
|
||||
#
|
||||
|
||||
#-----------------------------------------------------------------
|
||||
# License and Disclaimer
|
||||
#
|
||||
# The Geant4 software is copyright of the Copyright Holders of
|
||||
# the Geant4 Collaboration. It is provided under the terms and
|
||||
# conditions of the Geant4 Software License, included in the file
|
||||
# LICENSE and available at http://cern.ch/geant4/license . These
|
||||
# include a list of copyright holders.
|
||||
#
|
||||
# Neither the authors of this software system, nor their employing
|
||||
# institutes,nor the agencies providing financial support for this
|
||||
# work make any representation or warranty, express or implied,
|
||||
# regarding this software system or assume any liability for its
|
||||
# use. Please see the license in the file LICENSE and URL above
|
||||
# for the full disclaimer and the limitation of liability.
|
||||
#
|
||||
# This code implementation is the result of the scientific and
|
||||
# technical work of the GEANT4 collaboration.
|
||||
# By using, copying, modifying or distributing the software (or
|
||||
# any work based on the software) you agree to acknowledge its
|
||||
# use in resulting scientific publications, and indicate your
|
||||
# acceptance of all terms of the Geant4 Software license.
|
||||
#
|
||||
#-----------------------------------------------------------------
|
||||
|
||||
if(NOT __G4WINDOWSDLLSUPPORT_INCLUDED)
|
||||
set(__G4WINDOWSDLLSUPPORT_INCLUDED)
|
||||
else()
|
||||
return()
|
||||
endif()
|
||||
|
||||
# On WIN32, we need to build the genwindef application to create export
|
||||
# def files for building DLLs.
|
||||
# We only use it as a helper application at the moment so we exclude it from
|
||||
# the ALL target.
|
||||
if(WIN32)
|
||||
# Assume the sources are co-located
|
||||
get_filename_component(_genwindef_src_dir ${CMAKE_CURRENT_LIST_FILE} PATH)
|
||||
add_executable(genwindef EXCLUDE_FROM_ALL
|
||||
${_genwindef_src_dir}/genwindef/genwindef.cpp
|
||||
${_genwindef_src_dir}/genwindef/LibSymbolInfo.h
|
||||
${_genwindef_src_dir}/genwindef/LibSymbolInfo.cpp)
|
||||
endif()
|
||||
|
||||
#.rst:
|
||||
# Macro for supporting DLL build on CMake < 3.4
|
||||
macro(__geant4_add_dll_old)
|
||||
# It's an error to call this on non-WIN32 platforms
|
||||
if(NOT WIN32)
|
||||
message(FATAL_ERROR "__geant4_add_dll_old is not callable on non-Windows platforms!")
|
||||
endif()
|
||||
|
||||
# - Takes same args as geant4_library_target for compatibility
|
||||
cmake_parse_arguments(__G4ADDOLDDLL
|
||||
""
|
||||
"NAME" "SOURCES;GEANT4_LINK_LIBRARIES;LINK_LIBRARIES"
|
||||
${ARGN}
|
||||
)
|
||||
|
||||
# We have to generate the def export file from an archive library.
|
||||
# This is a temporary separate from a real archive library, and
|
||||
# even though it's static, we need to mark that it will have
|
||||
# DLL symbols via the G4LIB_BUILD_DLL macro
|
||||
add_library(_${__G4ADDOLDDLL_NAME}-archive STATIC EXCLUDE_FROM_ALL ${__G4ADDOLDDLL_SOURCES})
|
||||
set(_archive _${__G4ADDOLDDLL_NAME}-archive)
|
||||
target_compile_features(${_archive} PUBLIC ${GEANT4_TARGET_COMPILE_FEATURES})
|
||||
target_compile_definitions(${_archive} PUBLIC -DG4LIB_BUILD_DLL)
|
||||
|
||||
# - Add the config specific compile definitions
|
||||
geant4_compile_definitions_config(${_archive})
|
||||
|
||||
# - Create the .def file for this library
|
||||
# Use generator expressions to get path to per-mode lib and
|
||||
# older CMAKE_CFG_INTDIR variable to set name of per-mode def
|
||||
# file (Needed as generator expressions cannot be used in argument
|
||||
# to OUTPUT...
|
||||
add_custom_command(OUTPUT _${__G4ADDOLDDLL_NAME}-${CMAKE_CFG_INTDIR}.def
|
||||
COMMAND genwindef -o _${__G4ADDOLDDLL_NAME}-${CMAKE_CFG_INTDIR}.def -l ${__G4ADDOLDDLL_NAME} $<TARGET_FILE:${_archive}>
|
||||
DEPENDS ${_archive} genwindef)
|
||||
|
||||
# - Now we can build the DLL
|
||||
# We create it from a dummy empty C++ file plus the def file.
|
||||
# Also set the public compile definition on it so that clients
|
||||
# will set correct macro automatically.
|
||||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/_${__G4ADDOLDDLL_NAME}.cpp
|
||||
"// empty _${__G4ADDOLDDLL_NAME}.cpp\n")
|
||||
|
||||
add_library(${__G4ADDOLDDLL_NAME} SHARED _${__G4ADDOLDDLL_NAME}.cpp
|
||||
_${__G4ADDOLDDLL_NAME}-${CMAKE_CFG_INTDIR}.def)
|
||||
target_compile_definitions(${__G4ADDOLDDLL_NAME} PUBLIC -DG4LIB_BUILD_DLL)
|
||||
target_compile_features(${__G4ADDOLDDLL_NAME} PUBLIC ${GEANT4_TARGET_COMPILE_FEATURES})
|
||||
|
||||
# - Link the DLL.
|
||||
# We link it to the archive, and the supplied libraries,
|
||||
# but then remove the archive from the LINK_INTERFACE.
|
||||
target_link_libraries(${__G4ADDOLDDLL_NAME}
|
||||
${_archive}
|
||||
${__G4ADDOLDDLL_GEANT4_LINK_LIBRARIES}
|
||||
${__G4ADDOLDDLL_LINK_LIBRARIES})
|
||||
|
||||
set_target_properties(${__G4ADDOLDDLL_NAME}
|
||||
PROPERTIES INTERFACE_LINK_LIBRARIES "${__G4ADDOLDDLL_GEANT4_LINK_LIBRARIES};${__G4ADDOLDDLL_LINK_LIBRARIES}")
|
||||
endmacro()
|
||||
@@ -18,11 +18,11 @@ geant4_add_dataset(
|
||||
# - Low energy electromagnetics
|
||||
geant4_add_dataset(
|
||||
NAME G4EMLOW
|
||||
VERSION 7.3
|
||||
VERSION 7.4
|
||||
FILENAME G4EMLOW
|
||||
EXTENSION tar.gz
|
||||
ENVVAR G4LEDATA
|
||||
MD5SUM 0446e7f53af993343956e5d3900157b8
|
||||
MD5SUM a4443411b1a8782640b6eec691e7c25f
|
||||
)
|
||||
|
||||
# - Photon evaporation
|
||||
@@ -48,11 +48,11 @@ geant4_add_dataset(
|
||||
# - Neutron XS
|
||||
geant4_add_dataset(
|
||||
NAME G4NEUTRONXS
|
||||
VERSION 1.4
|
||||
VERSION 2.0
|
||||
FILENAME G4NEUTRONXS
|
||||
EXTENSION tar.gz
|
||||
ENVVAR G4NEUTRONXSDATA
|
||||
MD5SUM 665a12771267e3b31a08c622ba1238a7
|
||||
MD5SUM c3af588c26522f289ec60dcb7c847ade
|
||||
)
|
||||
|
||||
# - PII
|
||||
|
||||
@@ -7,16 +7,20 @@
|
||||
#-----------------------------------------------------------------------
|
||||
# function __configure_tls_models()
|
||||
# Set available thread local storage models. Valid for GNU,
|
||||
# Clang and Intel compilers.
|
||||
# Clang and Intel compilers. Adds an additional "auto"
|
||||
# dummy model to indicate that no flag should be added.
|
||||
#
|
||||
function(__configure_tls_models)
|
||||
# available models, default first
|
||||
set(_TLSMODELS initial-exec local-exec global-dynamic local-dynamic)
|
||||
foreach(_s ${_TLSMODELS})
|
||||
set(${_s}_TLSMODEL_FLAGS "-ftls-model=${_s}" PARENT_SCOPE)
|
||||
endforeach()
|
||||
|
||||
list(APPEND _TLSMODELS auto)
|
||||
set(auto_TLSMODEL_FLAGS "" PARENT_SCOPE)
|
||||
|
||||
set(TLSMODEL_IS_AVAILABLE ${_TLSMODELS} PARENT_SCOPE)
|
||||
foreach(_s ${_TLSMODELS})
|
||||
set(${_s}_FLAGS "-ftls-model=${_s}" PARENT_SCOPE)
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
@@ -191,6 +191,32 @@ endif()
|
||||
|
||||
GEANT4_ADD_FEATURE(GEANT4_USE_GDML "Building Geant4 with GDML support")
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# Optional Support for TiMemory -- cross-language timing and memory
|
||||
# easily installed via:
|
||||
# "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
|
||||
#
|
||||
if(TiMemory_DIR)
|
||||
set(_default_use_timemory ON)
|
||||
else()
|
||||
set(_default_use_timemory OFF)
|
||||
endif()
|
||||
|
||||
option(GEANT4_USE_TIMEMORY "Build Geant4 with TiMemory support"
|
||||
${_default_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")
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# Optional support for G3TOG4 convertion interface.
|
||||
# We do not build the rztog4 application.
|
||||
@@ -226,6 +252,7 @@ set(GEANT4_USOLIDS_SHAPES
|
||||
POLYCONE
|
||||
POLYHEDRA
|
||||
SPHERE
|
||||
TESSELLATEDSOLID
|
||||
TET
|
||||
TRAP
|
||||
TRD
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
# help setup CMake variables
|
||||
# Geant4_CXXSTD - C++ Standard used to compile Geant4, e.g. c++98
|
||||
# Geant4_TLS_MODEL - Thread Local Storage model used. Only set if
|
||||
# the install provides multithreading support.
|
||||
# the build used an explicit model.
|
||||
#
|
||||
# You may supply a version number through find_package which will be checked
|
||||
# against the version of this build. Standard CMake logic is used so that
|
||||
@@ -305,6 +305,9 @@ if(Geant4_multithreaded_FOUND)
|
||||
|
||||
# - Define variable to indicate TLS model used
|
||||
set(Geant4_TLS_MODEL "@GEANT4_BUILD_TLS_MODEL@")
|
||||
if(Geant4_TLS_MODEL STREQUAL "auto")
|
||||
unset(Geant4_TLS_MODEL)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# - Muonic Atom support
|
||||
@@ -319,6 +322,21 @@ if(Geant4_gdml_FOUND)
|
||||
list(REMOVE_ITEM Geant4_FIND_COMPONENTS gdml)
|
||||
endif()
|
||||
|
||||
# - TiMemory
|
||||
set(Geant4_timemory_FOUND @GEANT4_USE_TIMEMORY@)
|
||||
if(Geant4_timemory_FOUND)
|
||||
list(REMOVE_ITEM Geant4_FIND_COMPONENTS timemory)
|
||||
list(APPEND Geant4_DEFINITIONS -DGEANT4_USE_TIMEMORY)
|
||||
set(_geant4_timemory_dir "@TiMemory_DIR@")
|
||||
# always use same installation
|
||||
unset(TiMemory_DIR CACHE)
|
||||
set(TiMemory_DIR "${_geant4_timemory_dir}" CACHE PATH
|
||||
"TiMemory installation of Geant4")
|
||||
find_package(TiMemory REQUIRED QUIET)
|
||||
include_directories(${TiMemory_INCLUDE_DIRS})
|
||||
set(_geant4_use_timemory_library ON)
|
||||
endif(Geant4_timemory_FOUND)
|
||||
|
||||
# - G3toG4
|
||||
set(Geant4_g3tog4_FOUND @GEANT4_USE_G3TOG4@)
|
||||
if(Geant4_g3tog4_FOUND)
|
||||
@@ -587,6 +605,11 @@ if(_geant4_use_g3tog4_library)
|
||||
set(_geant4_g3tog4_library G3toG4${_geant4_lib_use_suffix})
|
||||
endif()
|
||||
|
||||
# - link to TiMemory library if activated
|
||||
if(_geant4_use_timemory_library)
|
||||
list(APPEND _geant4_internal_libraries ${TiMemory_LIBRARIES})
|
||||
endif()
|
||||
|
||||
# - Factory registration mechanism in physics_lists requires whole
|
||||
# archive to be linked when using static libs, so requires wrapping
|
||||
# with suitable compiler dependent flags
|
||||
|
||||
@@ -88,6 +88,9 @@ have_multithreading="@G4_BUILTWITH_MULTITHREADING@"
|
||||
feature_list="${feature_list} multithreading[${have_multithreading}]"
|
||||
if test "x${have_multithreading}" = "xyes" ; then
|
||||
geant4_tls_model="@GEANT4_BUILD_TLS_MODEL@"
|
||||
if test "x${geant4_tls_model}" = "xauto" ; then
|
||||
geant4_tls_model=""
|
||||
fi
|
||||
cflags="${cflags} -DG4MULTITHREADED"
|
||||
else
|
||||
geant4_tls_model=""
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# We have to parse the sources.cmake files for the headers and sources
|
||||
# because these files use the include_directories command, which is non
|
||||
# scriptable. A simple REGEX is used to find all the .cc, .hh and .icc
|
||||
# files listed in eah sources.cmake file. These lists are compared with
|
||||
# files listed in each sources.cmake file. These lists are compared with
|
||||
# a GLOB of those in the include and src directories of the module
|
||||
# corresponding to the sources.cmake file.
|
||||
#
|
||||
@@ -44,7 +44,7 @@ set(GEANT4_FALSEPOSITIVE_SOURCES
|
||||
G4VRML1SceneHandlerFunc.icc
|
||||
G4VRML2SceneHandlerFunc.icc
|
||||
# - Documentation of processes/hadronic/models/cascade/cascade
|
||||
# lists some sources in in comments. These do not correspond to
|
||||
# lists some sources in comments. These do not correspond to
|
||||
# real sources so we can safely filter them
|
||||
# TODO : Improve regex to identify comments!!!!
|
||||
T1xxChannel.cc
|
||||
@@ -63,6 +63,9 @@ message(STATUS "Scanning source tree ${GEANT4_SOURCE_TREE}")
|
||||
file(GLOB_RECURSE GEANT4_SOURCESCMAKE_FILES
|
||||
${GEANT4_SOURCE_TREE}/*/sources.cmake
|
||||
)
|
||||
|
||||
list(FILTER GEANT4_SOURCESCMAKE_FILES EXCLUDE REGEX "externals\\/zlib\\/sources.cmake")
|
||||
|
||||
list(LENGTH GEANT4_SOURCESCMAKE_FILES GEANT4_SOURCESCMAKE_COUNT)
|
||||
message(STATUS "Located ${GEANT4_SOURCESCMAKE_COUNT} sources.cmake files")
|
||||
|
||||
@@ -70,7 +73,7 @@ message(STATUS "Located ${GEANT4_SOURCESCMAKE_COUNT} sources.cmake files")
|
||||
# Parse each modules and process...
|
||||
#
|
||||
foreach(_sourcesfile ${GEANT4_SOURCESCMAKE_FILES})
|
||||
# - Where are we?
|
||||
# - Where are we?
|
||||
get_filename_component(_sourcesfile_location ${_sourcesfile} PATH)
|
||||
|
||||
# - Find on disk files...
|
||||
|
||||
Reference in New Issue
Block a user