Import Geant4 10.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-10 12:08:39 +02:00
parent 286caacf06
commit c9b32a6c0a
5770 changed files with 1050949 additions and 367105 deletions
+224
View File
@@ -30,6 +30,230 @@ add this in the documentation for the changed file as [BUGFIX #BUGNUMBER].
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
01st December 2014 - Ben Morgan (cmake-V10-00-37)
- Modules/Geant4BuildProjectConfig.cmake: Correct export of USolids
system headers so that these are exported whether or not USolids
are used to replace G4 solids.
18th November 2014 - Ben Morgan (cmake-V10-00-36)
- Templates/UseGeant4.cmake : Include Geant4 headers as SYSTEM and after
other headers. This is to help to suppress warnings when user has
more stringent compiler settings than us.
12th November 2014 - Ben Morgan (cmake-V10-00-35)
- Modules/Geant4LibraryBuildOptions.cmake: Remove GEANT4_BUILD_TPMALLOC
as this is no longer required
11th November 2014 - Gunter Folger (cmake-V10-00-34)
- Modules/Geant4DatasetDefinitions.cmake: update md5sum
for G4EMLOW6.21 after correction of files access permissions.
10th November 2014 - Gunter Folger (cmake-V10-00-33)
- Modules/Geant4DatasetDefinitions.cmake: RadioactiveDecay4.2
and update md5sum for G4EMLOW6.21 after correction of files
access permissions.
07th November 2014 - Ben Morgan (cmake-V10-00-32)
- Modules/Geant4OptionalComponents.cmake : BUGFIX: Failures of static
builds traced to typo in USolids settings in static mode where
EXPAT_LIBRARIES was overwritten. Correct typo.
30th October 2014 - Ben Morgan (cmake-V10-00-31)(INTERNAL)
- Modules/Geant4OptionalComponents.cmake : Update USolids configuration
to decouple GEANT4_USE_USOLIDS and GEANT4_USE_SYSTEM_USOLIDS
options.
- GEANT4_USE_USOLIDS ON means that Geant4 solids are replaced with
USolids equivalents, OFF means Geant4 solids and USolids are available
- A USolids lib must ALWAYS be availble, so GEANT4_USE_SYSTEM_USOLIDS
simply switches between these.
- Templates/Geant4Config.cmake.in : decouple GEANT4_USE_USOLIDS and
GEANT4_USE_SYSTEM_USOLIDS
- Templates/geant4-config.in : decouple GEANT4_USE_USOLIDS and
GEANT4_USE_SYSTEM_USOLIDS
30th October 2014 - Ben Morgan (cmake-V10-00-30)(INTERNAL)
- Support builtin/system USolids library
- Modules/Geant4OptionalComponents.cmake : Update USolids configuration
use internal G4geomUSolids by default if USolids support requested.
Add dependent option to allow system USolids to be searched for.
This assumes that USolids will supply a "USolidsConfig.cmake" file
- Modules/Geant4BuildProjectConfig.cmake : Update to export USolids
settings as required.
- Templates/Geant4Config.cmake.in : Update to provide new USolids
component and relevant variables and settings
- Modules/Geant4ConfigureConfigScript.cmake : Update to export
USolids settings as required
- Templates/geant4-config.in : Update to support USolids builtin/system
switch.
23rd October 2014 - Ben Morgan (cmake-V10-00-29)
- Templates/geant4-config.in : Add command line arguments to report
C++ standard compiled against and TLS model used if multithreading
support available.
Add presence of static libs as a feature argument that can be checked.
- Modules/Geant4ConfigureConfigScript.cmake : Export yes/no value
indicating presence of static libraries to config script.
- Templates/Geant4Config.cmake.in : Add variables to indicate C++
standard compiled against and TLS model used. Latter is only set
if multithreading support is available.
- Modules/
22nd October 2014 - Gunter Folger (cmake-V10-00-28)
- Modules/Geant4DatasetDefinitions.cmake: G4EMLOW.6.41
21st October 2014 - Ben Morgan (cmake-V10-00-27)
- Modules/Geant4ConfigureModulefile.cmake : New file to configure
and install a basic Environment Modules modulefile for Geant4.
Provides basic Path/Datapath settings only, in line with geant4.(c)sh
scripts. Because the location of modulefiles can be highly system
dependent, install file in datarootdir with absolute paths coded in.
Allows file to be moved later on as required on the system and
patched accordingly.
- Templates/geant4-modulefile.in : basic template for a modulefile
- Modules/Geant4ToolchainBackwardCompatibility.cmake : include and
call functionality in Geant4ConfigureModulefile.
20th October 2014 - Ben Morgan
- Modules/Geant4ToolchainBackwardCompatibility.cmake,
Templates/geant4make-skeleton.in: Revert changes introduced to
support modulefiles due to uneeded variables being exported.
10th October 2014 - Andrea Dotti (cmake-V10-00-26)
- Modules/FindROOT.cmake add ROOT_BIN_DIR variable to point to the
path of root executables. Needed to use hadd application for
physics testings (merging of output files for MT)
08th October 2014 - Ben Morgan (cmake-V10-00-25)
- Templates/UseGeant4.cmake : BUGFIX #1663, Append existing CMake
CXX/EXE_LINKER flags to Geant4 flags when setting overall CMake flags.
This allows users to override the base set if needed, at their own
risk.
26th September 2014 - Ben Morgan (cmake-V10-00-24)
- Modules/Geant4ToolchainBackwardCompatibility.cmake,
Templates/geant4make-skeleton.in: Revert changes introduced to
support modulefiles due to incorrect installation names of scripts.
26th August 2014 - Gunter Folger (cmake-V10-00-23)
- Modules/Geant4CTest.cmake: Add variable for reference files for testing
26th August 2014 - Ben Morgan (cmake-V10-00-22)
- Modules/Geant4MacroLibraryTargets.cmake : Remove any self-links
from internal library link list when building global libraries.
26th August 2014 - Gunter Folger (cmake-V10-00-21)
- Modules/Geant4DatasetDefinitions.cmake: G4EMLOW.6.40
19th August 2014 - Gunter Folger (cmake-V10-00-20)
- Modules/Geant4DatasetDefinitions.cmake: G4NDL.4.5
08th July 2014 - Andrea Dotti (cmake-V10-00-19)
- Templates/UseGeant4_internal.cmake in geant4_add_test function convert
character '=' present in command line to be executed to '@'
- Modules/Geant4TestDriver.cmake convert back character '@' to '=' for
command line to be executed in test
Both changes are needed to support "offloading" of tests (e.g. will be
used by testing on Xeon Phi co-processors that require complex command
lines containing '=' character).
06th June 2014 - Ben Morgan (cmake-V10-00-18)
- Templates/geant4-config.in : Add zlib and g3tog4 to list of features
that --has-feature recognizes and can query (Patch from Ivana
Hrivnacova)
05th June 2014 - Gunter Folger (cmake-V10-00-17)
- Modules/Geant4DatasetDefinitions.cmake: G4EMLOW6.39
27th May 2014 - Ben Morgan (cmake-V10-00-16)
- Modules/Geant4MakeRules_cxx.cmake : Factor -ftls-model flag
out of GEANT4_MULTITHREADED_CXX_FLAGS and provide function
supplying available thread local storage model flag arguments.
Addresses JIRA DEV-142
- Modules/Geant4LibraryBuildOptions.cmake : Provide advanced option
to select thread local storage model when building multithreaded.
Default to supported initial-exec model. Addresses JIRA DEV-142.
26th May 2014 - Ben Morgan (cmake-V10-00-15)
- Modules/Geant4MakeRules_cxx.cmake : Add -DG4FPE_DEBUG to GNU/Clang
flags for Debug build mode. Added following discussion with Gunter
Folger to help developers diagnose FPE problems.
09th May 2014 - Gunter Folger (cmake-V10-00-14)
- Modules/Geant4DatasetDefinitions.cmake: G4EMLOW6.38
10th April - Ben Morgan (cmake-V10-00-13)
- Modules/Geant4LibraryBuildOptions.cmake: When building against the C++11
standard, append -DG4USE_STD11 to CMAKE_CXX_FLAGS. Requested by Gabriele
Cosmo (DEV-138). Known issues: Provides no guarantee that required
C++11 features are present. Does not work on MSVC yet, but neither
will the parts of the code making use of C++11 features.
18th March 2014 - Gunter Folger (cmake-V10-00-12)
- Modules/Geant4DatasetDefinitions.cmake: G4EMLOW6.37
20th March 2014 - Ben Morgan (cmake-V10-00-11)
- Templates/Geant4Config.cmake.in : Fixes by Witold Pokorski for correct
static archive flags on Clang and syntax fixes for GNU.
18th March 2014 - Gunter Folger (cmake-V10-00-10)
- Modules/Geant4DatasetDefinitions.cmake: G4EMLOW6.36
6th March 2014 - Ben Morgan (cmake-V10-00-09)
- Modules/Geant4Config.cmake.in : When static libraries are used,
wrap G4physicslists library with flags suitable to import whole
archive. Implemented for GNU/Clang/Intel compilers. Other compilers
require further checks on flags and how to apply to single library.
This functionality is needed to support global registration of
factories.
5th March 2014 - Ben Morgan (cmake-V10-00-08)
- Modules/Geant4MacroLibraryTargets.cmake : Fixup usage of shared/static
builtin libraries. Ensure that shared builtins do not get linked to
static.
- Templates/Geant4Config.cmake.in : Add new component 'static' allowing
user to select static Geant4 libraries if they are available.
26th February 2014 - Gunter Folger (cmake-V10-00-07)
- Modules/Geant4DatasetDefinitions.cmake: PhotonEvaporation3.1
26th February 2014 - Gunter Folger (cmake-V10-00-06)
- Modules/Geant4DatasetDefinitions.cmake: RadioactiveDecay4.1
18th February 2014 - Ben Morgan (cmake-V10-00-05)
- Modules/Geant4ConfigureConfigScript.cmake : Export use of builtin
zlib or otherwise to geant4-config (Bugfix #1572).
- Template/geant4-config.in : Add builtin zlib to list of features,
adding G4zlib to list of libraries when used (Bugfix #1572).
- Template/geant4-config.in : Replace use of GNU awk extension 'length'
for determining number of datasets. Use return value of split function
to get length of array. Problem reported on Hypernews:
http://hypernews.slac.stanford.edu/HyperNews/geant4/get/installconfig/1614.html
17th February 2014 - Ben Morgan (cmake-V10-00-04)
- Templates/geant4make-skeleton.in : Add variables for
G4LIB_{BUILD,USE}_EXPAT as for ZLIB. Fixes Bug #1567
- Modules/Geant4ToolchainBackwardCompatibility.cmake : Export
G4LIB_{BUILD,USE}_EXPAT based on value of GEANT4_USE_SYSTEM_EXPAT.
Fixes Bug #1567.
21st January 2014 - Jonathan Madsen (cmake-V10-00-03)
- Updated Modules/Geant4InterfaceOptions.cmake to include /opt/X11
paths that are now the standard places for X11 and OpenGL on Mac OSX
as of Mavericks (OS X 10.9). Without these paths configuring CMake with
GEANT4_USE_OPENGL_X11=ON fails
18th December 2013 - Gunter Folger (cmake-V10-00-02)
- Modules/Geant4TestDriver.cmake: CTEST_TEST_TIMEOUT is empty, or
its setting is not visible.
Directly using environment variable CTEST_TIMEOUT finally works.
16th December 2013 - Gunter Folger (cmake-V10-00-01)
- Modules/Geant4TestDriver.cmake: fix typo introduced in previous tag
16th December 2013 - Gunter Folger (cmake-V10-00-00)
- Modules/Geant4TestDriver.cmake: use CTEST_TEST_TIMEOUT if set to set
default timeout
28th November 2013 - Ben Morgan (cmake-V09-06-45)
- Modules/Geant4CTest.cmake : Remove G4ENSDFSTATE dataset from list
exported to the testing environment, as it should not be used by
+8 -1
View File
@@ -5,7 +5,8 @@
# ROOT_INCLUDE_DIR PATH to the include directory
# ROOT_LIBRARIES Most common libraries
# ROOT_LIBRARY_DIR PATH to the library directory
# ROOT_BIN_DIR PATH to the excutables directory
# ROOT_PYTHONVER Compatible python version string
find_program(ROOT_CONFIG_EXECUTABLE root-config
PATHS ${ROOTSYS}/bin $ENV{ROOTSYS}/bin)
@@ -40,6 +41,12 @@ else()
OUTPUT_VARIABLE ROOT_PYTHONVER
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(
COMMAND ${ROOT_CONFIG_EXECUTABLE} --bindir
OUTPUT_VARIABLE ROOT_BIN_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE)
#set(ROOT_LIBRARIES ${ROOT_LIBRARIES} -lThread -lMinuit -lHtml -lVMC -lEG -lGeom -lTreePlayer -lXMLIO -lProof)
#set(ROOT_LIBRARIES ${ROOT_LIBRARIES} -lProofPlayer -lMLP -lSpectrum -lEve -lRGL -lGed -lXMLParser -lPhysics)
set(ROOT_LIBRARY_DIR ${ROOTSYS}/lib)
+11 -1
View File
@@ -74,11 +74,21 @@ if(GEANT4_USE_GDML)
endif()
# - USolids
# Simple compile definition
# Compile definitions
if(GEANT4_USE_USOLIDS)
list(APPEND GEANT4_CORE_DEFINITIONS -DG4GEOM_USE_USOLIDS)
endif()
# If it's internal, add to the externals lib list
if(GEANT4_USE_SYSTEM_USOLIDS)
# System USolids headers, because these do appear in Geant4's
# public interface. The library should be in the link interface
# of G4geometry
list(APPEND GEANT4_THIRD_PARTY_INCLUDES ${USOLIDS_INCLUDE_DIRS})
else()
list(APPEND GEANT4_EXTERNALS_TARGETS G4geomUSolids)
endif()
# - Stuff from Geant4InterfaceOptions.cmake
if(GEANT4_USE_QT)
list(APPEND GEANT4_THIRD_PARTY_INCLUDES
+6
View File
@@ -21,6 +21,12 @@ if(GEANT4_ENABLE_TESTING)
geant4_get_dataset_property(${_ds} BUILD_DIR _dspath)
list(APPEND GEANT4_TEST_ENVIRONMENT ${_dsenvvar}=${_dspath})
endforeach()
# - Add base URL for test reference files
set (GEANT4_TEST_REFERENCES_URL "http://geant4.cern.ch/stt/references/" CACHE
STRING "base URL for test reference files")
mark_as_advanced(GEANT4_TEST_REFERENCES_URL)
endif()
#-----------------------------------------------------------------------
@@ -77,6 +77,13 @@ if(NOT GEANT4_BUILD_GRANULAR_LIBS AND UNIX)
get_system_include_dirs(_cxx_compiler_dirs)
# Setup variables needed for expansion in configuration file
# - Static libs
if(BUILD_STATIC_LIBS)
set(G4_BUILTWITH_STATICLIBS "yes")
else()
set(G4_BUILTWITH_STATICLIBS "no")
endif()
# - Multithreading
if(GEANT4_BUILD_MULTITHREADED)
set(G4_BUILTWITH_MULTITHREADING "yes")
@@ -98,6 +105,13 @@ if(NOT GEANT4_BUILD_GRANULAR_LIBS AND UNIX)
set(G4_BUILTWITH_EXPAT "yes")
endif()
# - ZLIB
if(GEANT4_USE_SYSTEM_ZLIB)
set(G4_BUILTWITH_ZLIB "no")
else()
set(G4_BUILTWITH_ZLIB "yes")
endif()
# - GDML
if(GEANT4_USE_GDML)
set(G4_BUILTWITH_GDML "yes")
@@ -127,6 +141,12 @@ if(NOT GEANT4_BUILD_GRANULAR_LIBS AND UNIX)
set(G4_BUILTWITH_USOLIDS "no")
endif()
if(GEANT4_USE_SYSTEM_USOLIDS)
set(G4_BUILTWITH_BUILTIN_USOLIDS "no")
else()
set(G4_BUILTWITH_BUILTIN_USOLIDS "yes")
endif()
# - Qt
if(GEANT4_USE_QT)
set(G4_BUILTWITH_QT "yes")
@@ -0,0 +1,55 @@
# - Script for configuring and installing a Modulefile for Geant4
#
# Environment Modules is a standard tool for configuring the environment
# for a package in a shel/intepreter agnostic way. See:
#
# http://modules.sourceforge.net/
#
# As with other Geant4 tool support, a template file is provided to
# generate the modulefile using the known build settings. Because
# modulefiles are generally only used on installed packages, only
# an Install Tree file is generated.
#
# The resultant modulefile is installed to the share directory, though
# this is not intended to be its final location. System Admins may
# wish to move the file to their local modulefile path
#
macro(_geant4_prepare_modulefile_inputs)
# - Compatibility
if(APPLE)
set(DYNAMIC_LOADER_PATHNAME "DYLD_LIBRARY_PATH")
else()
set(DYNAMIC_LOADER_PATHNAME "LD_LIBRARY_PATH")
endif()
# - Datasets
geant4_get_datasetnames(GEANT4_EXPORTED_DATASETS)
set(G4DATASET_TCLLIST)
list(REMOVE_ITEM GEANT4_EXPORTED_DATASETS "G4ENSDFSTATE")
foreach(_ds ${GEANT4_EXPORTED_DATASETS})
geant4_get_dataset_property(${_ds} ENVVAR ${_ds}_ENVVAR)
geant4_get_dataset_property(${_ds} INSTALL_DIR ${_ds}_PATH)
set(G4DATASET_TCLLIST "${G4DATASET_TCLLIST} ${${_ds}_ENVVAR} ${${_ds}_PATH}")
endforeach()
endmacro()
function(geant4_configure_modulefile)
# - prepare configuration environment
_geant4_prepare_modulefile_inputs()
# - Configure the file
configure_file(
${PROJECT_SOURCE_DIR}/cmake/Templates/geant4-modulefile.in
${PROJECT_BINARY_DIR}/InstallTreeFiles/geant4-${Geant4_VERSION}
@ONLY
)
# - Install it
install(FILES ${PROJECT_BINARY_DIR}/InstallTreeFiles/geant4-${Geant4_VERSION}
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/Geant4-${Geant4_VERSION}
COMPONENT Development
)
endfunction()
+8 -8
View File
@@ -8,41 +8,41 @@
# - NDL
geant4_add_dataset(
NAME G4NDL
VERSION 4.4
VERSION 4.5
FILENAME G4NDL
EXTENSION tar.gz
ENVVAR G4NEUTRONHPDATA
MD5SUM cd8cc1d96aeb9b9ed37189edda26f5ad
MD5SUM fd29c45fe2de432f1f67232707b654c0
)
# - Low energy electromagnetics
geant4_add_dataset(
NAME G4EMLOW
VERSION 6.35
VERSION 6.41
FILENAME G4EMLOW
EXTENSION tar.gz
ENVVAR G4LEDATA
MD5SUM 3345d693b012c80f3e7e4432ae9884a0
MD5SUM b9b2e455d08375ca9cc5201236db6d7d
)
# - Photon evaporation
geant4_add_dataset(
NAME PhotonEvaporation
VERSION 3.0
VERSION 3.1
FILENAME G4PhotonEvaporation
EXTENSION tar.gz
ENVVAR G4LEVELGAMMADATA
MD5SUM f72d6d694f608fe10cc2126a0ac1f2a6
MD5SUM e7870c5ef18ba702e68c22b62233cbb8
)
# - Radioisotopes
geant4_add_dataset(
NAME RadioactiveDecay
VERSION 4.0
VERSION 4.2
FILENAME G4RadioactiveDecay
EXTENSION tar.gz
ENVVAR G4RADIOACTIVEDATA
MD5SUM 44a43b8f62c9f9cd4c3cb31c2b2bb7c3
MD5SUM 2eade8116387ef67d4cd6f14b9cb1512
)
# - Neutron XS
+5 -3
View File
@@ -203,6 +203,7 @@ if(UNIX)
/usr/openwin/include
/usr/openwin/share/include
/opt/graphics/OpenGL/include
/opt/X11/include
)
set(X11_LIB_SEARCH_PATH
@@ -210,6 +211,7 @@ if(UNIX)
/usr/X11R6/lib
/usr/X11R7/lib
/usr/openwin/lib
/opt/X11/lib
)
find_path(X11_Xmu_INCLUDE_PATH X11/Xmu/Xmu.h ${X11_INC_SEARCH_PATH})
@@ -252,17 +254,17 @@ if(UNIX)
set(CMAKE_FIND_FRAMEWORK NEVER)
find_path(OPENGL_X11_INCLUDE_DIR GL/gl.h
PATHS /usr/X11R6/include
PATHS /usr/X11R6/include /opt/X11/include
NO_DEFAULT_PATH
)
find_library(OPENGL_X11_gl_LIBRARY GL
PATHS /usr/X11R6/lib
PATHS /usr/X11R6/lib /opt/X11/lib
NO_DEFAULT_PATH
)
find_library(OPENGL_X11_glu_LIBRARY GLU
PATHS /usr/X11R6/lib
PATHS /usr/X11R6/lib /opt/X11/lib
NO_DEFAULT_PATH
)
+26 -12
View File
@@ -36,6 +36,8 @@ endif()
# OFF by default. Switching on will enable multithreading, adding the
# G4MULTITHREADED definition globally and appending the relevant
# compiler flags to CMAKE_CXX_FLAGS
# Enabling the option allows advanced users to further select the
# thread local storage model if GNU/Clang/Intel compiler is used.
option(GEANT4_BUILD_MULTITHREADED "Enable multithreading in Geant4" OFF)
if(WIN32)
@@ -57,24 +59,27 @@ if(GEANT4_BUILD_MULTITHREADED)
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)
enum_option(GEANT4_BUILD_TLS_MODEL
DOC "Build libraries with Thread Local Storage model"
VALUES ${TLSMODEL_IS_AVAILABLE}
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}")
endif()
# Set Defs/Compiler Flags
add_definitions(-DG4MULTITHREADED)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GEANT4_MULTITHREADED_CXX_FLAGS}")
endif()
geant4_add_feature(GEANT4_BUILD_MULTITHREADED "Build multithread enabled libraries")
# - G4TPMALLOC
# Only usable when Multithreading is enabled and we are not on WIN32
# If it is enabled, add the global definition "G4TPMALLOC"
cmake_dependent_option(GEANT4_BUILD_TPMALLOC "Build multithread optimized malloc library" OFF "GEANT4_BUILD_MULTITHREADED;NOT WIN32" OFF)
if(GEANT4_BUILD_TPMALLOC)
add_definitions(-DG4TPMALLOC)
endif()
mark_as_advanced(GEANT4_BUILD_TPMALLOC)
geant4_add_feature(GEANT4_BUILD_TPMALLOC "Build multithread optimized malloc library")
# - G4_STORE_TRAJECTORY
# ON by default, switching off can improve performance. Needs to be on
# for visualization to work fully. Mark as advanced because most users
@@ -118,6 +123,15 @@ if(CXXSTD_IS_AVAILABLE)
geant4_add_feature(GEANT4_BUILD_CXXSTD "Compiling against C++ Standard '${GEANT4_BUILD_CXXSTD}'")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${${GEANT4_BUILD_CXXSTD}_FLAGS}")
# Get needed defs for selected standard
# NB this needs refactoring because, for example, newer MSVC versions
# will just support c++11, and the selection above isn't needed, nor
# available, so we cannot check it in the if statement below.
# Add the def(s) to flags, because it may be *required*
if(GEANT4_BUILD_CXXSTD MATCHES "c\\+\\+11")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DG4USE_STD11")
endif()
endif()
#-----------------------------------------------------------------------
+25 -14
View File
@@ -100,7 +100,7 @@ MACRO(GEANT4_LIBRARY_TARGET)
# but then remove the archive from the LINK_INTERFACE.
target_link_libraries(${G4LIBTARGET_NAME}
${_archive}
${G4LIBTARGET_GEANT4_LINK_LIBRARIES}
${G4LIBTARGET_GEANT4_LINK_LIBRARIES}
${G4LIBTARGET_LINK_LIBRARIES})
set_target_properties(${G4LIBTARGET_NAME}
@@ -109,15 +109,15 @@ MACRO(GEANT4_LIBRARY_TARGET)
else()
# - We build a Shared library in the usual fashion...
add_library(${G4LIBTARGET_NAME} SHARED ${G4LIBTARGET_SOURCES})
geant4_compile_definitions_config(${G4LIBTARGET_NAME})
geant4_compile_definitions_config(${G4LIBTARGET_NAME})
target_link_libraries(${G4LIBTARGET_NAME}
${G4LIBTARGET_GEANT4_LINK_LIBRARIES}
${G4LIBTARGET_GEANT4_LINK_LIBRARIES}
${G4LIBTARGET_LINK_LIBRARIES})
endif()
# This property is set to prevent concurrent builds of static and
# This property is set to prevent concurrent builds of static and
# shared libs removing each others files.
set_target_properties(${G4LIBTARGET_NAME}
set_target_properties(${G4LIBTARGET_NAME}
PROPERTIES CLEAN_DIRECT_OUTPUT 1)
# Set the INSTALL_NAME_DIR of the library to its final installation
@@ -159,16 +159,26 @@ MACRO(GEANT4_LIBRARY_TARGET)
list(APPEND G4LIBTARGET_GEANT4_LINK_LIBRARIES_STATIC ${_tgt}-static)
endforeach()
target_link_libraries(${G4LIBTARGET_NAME}-static
# If we are building both types of library and builtin clhep etc,
# we want to link shared->shared and static->static.
# Because externals like clhep appear in G4LIBTARGET_LINK_LIBRARIES,
# filter this list to replace shared builtins with their static variant
string(REGEX REPLACE
"(G4clhep|G4expat|G4zlib)(;|$)" "\\1-static\\2"
G4LIBTARGET_LINK_LIBRARIES_STATIC
"${G4LIBTARGET_LINK_LIBRARIES}"
)
target_link_libraries(${G4LIBTARGET_NAME}-static
${G4LIBTARGET_GEANT4_LINK_LIBRARIES_STATIC}
${G4LIBTARGET_LINK_LIBRARIES})
${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...
if(NOT WIN32)
set_target_properties(${G4LIBTARGET_NAME}-static
set_target_properties(${G4LIBTARGET_NAME}-static
PROPERTIES OUTPUT_NAME ${G4LIBTARGET_NAME})
endif()
@@ -279,22 +289,23 @@ MACRO(GEANT4_GLOBAL_LIBRARY_TARGET)
list(APPEND ${G4GLOBLIB_NAME}_BUILDTREE_INCLUDES ${${G4MODULENAME}_INCDIR})
endforeach()
# Filter out duplicates in GLOBAL_DEPENDENCIES and LINK_LIBRARIES
# Filter out duplicates/self in GLOBAL_DEPENDENCIES and LINK_LIBRARIES
if(${G4GLOBLIB_NAME}_GLOBAL_DEPENDENCIES)
list(REMOVE_DUPLICATES ${G4GLOBLIB_NAME}_GLOBAL_DEPENDENCIES)
list(REMOVE_ITEM ${G4GLOBLIB_NAME}_GLOBAL_DEPENDENCIES ${G4GLOBLIB_NAME})
endif()
if(${G4GLOBLIB_NAME}_LINK_LIBRARIES)
list(REMOVE_DUPLICATES ${G4GLOBLIB_NAME}_LINK_LIBRARIES)
endif()
# Now add the library target
GEANT4_LIBRARY_TARGET(NAME ${G4GLOBLIB_NAME}
SOURCES
${${G4GLOBLIB_NAME}_GLOBAL_SOURCES}
GEANT4_LIBRARY_TARGET(NAME ${G4GLOBLIB_NAME}
SOURCES
${${G4GLOBLIB_NAME}_GLOBAL_SOURCES}
${${G4GLOBLIB_NAME}_GLOBAL_HEADERS}
GEANT4_LINK_LIBRARIES
GEANT4_LINK_LIBRARIES
${${G4GLOBLIB_NAME}_GLOBAL_DEPENDENCIES}
LINK_LIBRARIES
LINK_LIBRARIES
${${G4GLOBLIB_NAME}_LINK_LIBRARIES})
# Header install?
+19 -3
View File
@@ -125,6 +125,20 @@ function(__configure_cxxstd_intel)
endforeach()
endfunction()
#-----------------------------------------------------------------------
# function __configure_tls_models()
# Set available thread local storage models. Valid for GNU,
# Clang and Intel compilers.
#
function(__configure_tls_models)
# available models, default first
set(_TLSMODELS initial-exec local-exec global-dynamic local-dynamic)
set(TLSMODEL_IS_AVAILABLE ${_TLSMODELS} PARENT_SCOPE)
foreach(_s ${_TLSMODELS})
set(${_s}_FLAGS "-ftls-model=${_s}" PARENT_SCOPE)
endforeach()
endfunction()
#-----------------------------------------------------------------------
# DEFAULT FLAG SETTING
@@ -133,7 +147,7 @@ endfunction()
# NB: At present, only identifies clang correctly on CMake > 2.8.1
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_FLAGS_INIT "-W -Wall -pedantic -Wno-non-virtual-dtor -Wno-long-long -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -Wno-variadic-macros -Wshadow -pipe")
set(CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
set(CMAKE_CXX_FLAGS_DEBUG_INIT "-g -DG4FPE_DEBUG")
set(CMAKE_CXX_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
set(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
@@ -158,7 +172,8 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
endif()
# - Multithreading
set(GEANT4_MULTITHREADED_CXX_FLAGS "-ftls-model=initial-exec -pthread")
__configure_tls_models()
set(GEANT4_MULTITHREADED_CXX_FLAGS "-pthread")
endif()
@@ -202,7 +217,8 @@ if(CMAKE_CXX_COMPILER MATCHES "icpc.*|icc.*")
__configure_cxxstd_intel()
# - Multithreading
set(GEANT4_MULTITHREADED_CXX_FLAGS "-ftls-model=initial-exec -pthread")
__configure_tls_models()
set(GEANT4_MULTITHREADED_CXX_FLAGS "-pthread")
# Linker flags
set(CMAKE_EXE_LINKER_FLAGS "-i-dynamic -limf")
+32 -7
View File
@@ -13,7 +13,9 @@
# ZLIB - Control use of internal G4zlib, or locate external ZLIB
# GDML - Requires external XercesC
# G3TOG4 - UNIX only
# USOLIDS - Allow use of USolids classes in geometry
# USOLIDS - Allow use of USolids classes in geometry, using
# internal Usolids by default, plus option to use system
# version
#-----------------------------------------------------------------------
# Find required CLHEP package
@@ -145,17 +147,40 @@ if(UNIX)
endif()
#-----------------------------------------------------------------------
# Optional support for use of USolids classes for geometry
# Optional replacement
# - Advanced option only
# - If enabled, require
# 1) Global Compile definition G4GEOM_USE_USOLIDS (also exported)
# 2) Global add of geometry/solids/usolids/include to include path
option(GEANT4_USE_USOLIDS "EXPERIMENTAL: Allow use of USolids geometry classes" OFF)
mark_as_advanced(GEANT4_USE_USOLIDS)
# 2) Use internal USolids by default, otherwise searching for system
# install
option(GEANT4_USE_USOLIDS "EXPERIMENTAL: Replace Geant4 solids with USolids equivalents" OFF)
option(GEANT4_USE_SYSTEM_USOLIDS "Use system USolids library" OFF)
mark_as_advanced(GEANT4_USE_USOLIDS GEANT4_USE_SYSTEM_USOLIDS)
# - G4USolids setup
if(GEANT4_USE_USOLIDS)
add_definitions(-DG4GEOM_USE_USOLIDS)
include_directories(${PROJECT_SOURCE_DIR}/source/geometry/solids/usolids/include)
GEANT4_ADD_FEATURE(GEANT4_USE_USOLIDS "Building support for USolids geometry classes (EXPERIMENTAL)")
endif()
# - Internal or external USolids
if(GEANT4_USE_SYSTEM_USOLIDS)
find_package(USolids REQUIRED)
else()
set(USolids_FOUND TRUE)
set(GEANT4_USE_BUILTIN_USOLIDS TRUE)
set(USOLIDS_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/source/externals/usolids/include)
if(BUILD_SHARED_LIBS)
set(USOLIDS_LIBRARIES G4geomUSolids)
else()
set(USOLIDS_LIBRARIES G4geomUSolids-static)
endif()
# Include dirs here because of the large number of G4 users
# of solids
# Resolve once we use Modern INTERFACE_INCLUDES
include_directories(${USOLIDS_INCLUDE_DIRS})
endif()
GEANT4_ADD_FEATURE(GEANT4_USE_USOLIDS "Replacing Geant4 solids with USolids equivalents (EXPERIMENTAL)")
GEANT4_ADD_FEATURE(GEANT4_USE_SYSTEM_USOLIDS "Using system USolids library")
+7 -2
View File
@@ -20,7 +20,8 @@ endif()
# Message arguments
#
if(CMD)
string(REPLACE "#" ";" _cmd ${CMD})
string(REPLACE "#" ";" _cmd "${CMD}")
string(REPLACE "@" "=" _cmd "${_cmd}")
if(DBG)
set(_cmd gdb --args ${_cmd})
endif()
@@ -53,7 +54,11 @@ endif()
if(TIM)
math(EXPR _timeout "${TIM} - 120")
else()
math(EXPR _timeout "1500 - 120")
if(NOT $ENV{CTEST_TIMEOUT} STREQUAL "")
math(EXPR _timeout "$ENV{CTEST_TIMEOUT} - 120")
else()
math(EXPR _timeout "1500 - 120")
endif()
endif()
if(CWD)
@@ -48,6 +48,7 @@
# configuration.
#
#-----------------------------------------------------------------------
# - Functions and Macros to help configuration of shell scripts.
#-----------------------------------------------------------------------
@@ -339,6 +340,13 @@ macro(_g4tc_configure_tc_variables SHELL_FAMILY SCRIPT_NAME)
set(GEANT4_TC_G4LIB_USE_CLHEP "# USING INTERNAL CLHEP")
endif()
# - EXPAT
if(GEANT4_USE_SYSTEM_EXPAT)
set(GEANT4_TC_G4LIB_USE_EXPAT "# USING SYSTEM EXPAT")
else()
_g4tc_setenv_command(GEANT4_TC_G4LIB_USE_EXPAT ${SHELL_FAMILY} G4LIB_USE_EXPAT 1)
endif()
# - ZLIB...
if(GEANT4_USE_SYSTEM_ZLIB)
set(GEANT4_TC_G4LIB_USE_ZLIB "# USING SYSTEM ZLIB")
@@ -725,3 +733,7 @@ foreach(_shell bourne;cshell)
)
endforeach()
# - TEMP hack to get modulefile support in
include(Geant4ConfigureModulefile)
geant4_configure_modulefile()
+87 -62
View File
@@ -1,62 +1,87 @@
// LibSymbolInfo.h: interface for the CLibSymbolInfo class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_LIBSYMBOLINFO_H__1A7003B4_BA53_11D1_AE46_1CFB51000000__INCLUDED_)
#define AFX_LIBSYMBOLINFO_H__1A7003B4_BA53_11D1_AE46_1CFB51000000__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include <string>
#include <iostream>
#include <stdio.h>
#include <assert.h>
#include <windows.h>
class CLibSymbolInfo
{
public:
CLibSymbolInfo();
virtual ~CLibSymbolInfo();
BOOL DumpSymbols(LPTSTR lpszLibPathName, std::ostream& pFile);
std::string GetLastError() const;
protected:
std::string m_strResultsString;
std::string m_strErrorMsg;
BOOL Dump(LPTSTR lpszLibPathName, std::ostream& pFile);
BOOL IsRegularLibSymbol( PSTR pszSymbolName );
BOOL IsFiltedSymbol( std::string& pszSymbolName );
DWORD ConvertBigEndian(DWORD bigEndian);
};
enum errMMF { errMMF_NoError, errMMF_FileOpen,
errMMF_FileMapping, errMMF_MapView };
class MEMORY_MAPPED_FILE
{
public:
MEMORY_MAPPED_FILE( PSTR pszFileName );
~MEMORY_MAPPED_FILE(void);
PVOID GetBase( void ){ return m_pMemoryMappedFileBase; }
DWORD GetFileSize( void ){ return m_cbFile; }
BOOL IsValid( void ) { return errMMF_NoError == m_errCode; }
errMMF GetErrorType(){ return m_errCode; }
private:
HANDLE m_hFile;
HANDLE m_hFileMapping; // Handle of memory mapped file
PVOID m_pMemoryMappedFileBase;
DWORD m_cbFile;
errMMF m_errCode;
};
typedef MEMORY_MAPPED_FILE* PMEMORY_MAPPED_FILE;
#endif // !defined(AFX_LIBSYMBOLINFO_H__1A7003B4_BA53_11D1_AE46_1CFB51000000__INCLUDED_)
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// LibSymbolInfo.h: interface for the CLibSymbolInfo class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_LIBSYMBOLINFO_H__1A7003B4_BA53_11D1_AE46_1CFB51000000__INCLUDED_)
#define AFX_LIBSYMBOLINFO_H__1A7003B4_BA53_11D1_AE46_1CFB51000000__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include <string>
#include <iostream>
#include <stdio.h>
#include <assert.h>
#include <windows.h>
class CLibSymbolInfo
{
public:
CLibSymbolInfo();
virtual ~CLibSymbolInfo();
BOOL DumpSymbols(LPTSTR lpszLibPathName, std::ostream& pFile);
std::string GetLastError() const;
protected:
std::string m_strResultsString;
std::string m_strErrorMsg;
BOOL Dump(LPTSTR lpszLibPathName, std::ostream& pFile);
BOOL IsRegularLibSymbol( PSTR pszSymbolName );
BOOL IsFiltedSymbol( std::string& pszSymbolName );
DWORD ConvertBigEndian(DWORD bigEndian);
};
enum errMMF { errMMF_NoError, errMMF_FileOpen,
errMMF_FileMapping, errMMF_MapView };
class MEMORY_MAPPED_FILE
{
public:
MEMORY_MAPPED_FILE( PSTR pszFileName );
~MEMORY_MAPPED_FILE(void);
PVOID GetBase( void ){ return m_pMemoryMappedFileBase; }
DWORD GetFileSize( void ){ return m_cbFile; }
BOOL IsValid( void ) { return errMMF_NoError == m_errCode; }
errMMF GetErrorType(){ return m_errCode; }
private:
HANDLE m_hFile;
HANDLE m_hFileMapping; // Handle of memory mapped file
PVOID m_pMemoryMappedFileBase;
DWORD m_cbFile;
errMMF m_errCode;
};
typedef MEMORY_MAPPED_FILE* PMEMORY_MAPPED_FILE;
#endif // !defined(AFX_LIBSYMBOLINFO_H__1A7003B4_BA53_11D1_AE46_1CFB51000000__INCLUDED_)
+73 -15
View File
@@ -11,6 +11,9 @@
# Geant4_CXX_FLAGS_<CONFIG> - Recommended CXX flags for build mode CONFIG.
# Geant4_USE_FILE - path to a CMake module which may be included to
# 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.
#
# 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
@@ -42,11 +45,25 @@
# then the module will issue a FATAL_ERROR if this build of Geant4 does
# not have the requested component(s).
#
# The list of components available generally corresponds to the optional
# extras that Geant4 can be built with and are:
# The components available generally correspond to configurations of
# the Geant4 libraries or optional extras that Geant4 can be built with.
#
# multithreaded (Libraries built with multithreading support)
# Library Configuration
# ---------------------
# static (Static libraries available. Using this component
# when static libraries are available will result in
# Geant4_LIBRARIES being populated with the static
# versions of the Geant4 libraries. It does not
# guarantee the use of static third party libraries.)
# multithreaded (Libraries have multithreading support. Using this
# component will add the compiler definitions needed
# to activate multithread mode to Geant4_DEFINITIONS,
# if the libraries support it.)
#
# usolids (Geant4 solids are replaced with USolids equivalents)
#
# Optional Components
# -------------------
# gdml (GDML support)
# g3tog4 (Geant3 geometry call list reader library)
#
@@ -74,12 +91,13 @@
# argument is set. This is because these options do not depend on specific
# components being available.
#
# You can also query Geant4's use, or otherwise, of its builtin versions
# of CLHEP, ZLIB and Expat after calling find_package via the variables
# You can also query whether the Geant4 found uses the builtin versions
# of CLHEP, ZLIB, Expat and USolids after calling find_package via the variables
#
# Geant4_builtin_clhep_FOUND (TRUE if Geant4 built with internal CLHEP)
# Geant4_builtin_expat_FOUND (TRUE if Geant4 built with internal Expat)
# Geant4_builtin_zlib_FOUND (TRUE if Geant4 built with internal Zlib)
# Geant4_builtin_clhep_FOUND (TRUE if Geant4 built with internal CLHEP)
# Geant4_builtin_expat_FOUND (TRUE if Geant4 built with internal Expat)
# Geant4_builtin_usolids_FOUND (TRUE if Geant4 built with internal USolids)
# Geant4_builtin_zlib_FOUND (TRUE if Geant4 built with internal Zlib)
#
# These are not used via components as they do not, in general, affect
# the use of Geant4 in an application unless you yourself make direct
@@ -91,13 +109,13 @@
# system APIs as required, and you should use these to ensure you compile
# and link against the same API version.
#
# Environment variables for and directory paths to physics datasets
# Environment variables for, and directory paths to, physics datasets
# used by some Geant4 physics processes may be determined from the
# variables
#
# Geant4_DATASETS (List of dataset names known to Geant4)
# Geant4_DATASET_<NAME>_ENVVAR (Name of environment variable used by
# Geant4 to query for path to dataset
# Geant4 to obtain path to dataset
# <NAME>)
# Geant4_DATASET_<NAME>_PATH (Path to dataset <NAME>. NB this may
# point to a non-existent path if Geant4
@@ -141,6 +159,9 @@ get_filename_component(_thisdir "${CMAKE_CURRENT_LIST_FILE}" PATH)
# It's up to the user what to do with these
@GEANT4_COMPILER_FLAG_HINTS@
# - Provide variable indicating C++ Standard we were compiled against
set(Geant4_CXXSTD "@GEANT4_BUILD_CXXSTD@")
#-----------------------------------------------------------------------
# Set the base compile definitions required to use Geant4 if the variable
# does not exist (we do this to ensure multiple calls to find_package
@@ -243,12 +264,22 @@ unset(Geant4_DATASET_DESCRIPTIONS)
set(Geant4_builtin_clhep_FOUND @GEANT4_USE_BUILTIN_CLHEP@)
set(Geant4_builtin_expat_FOUND @GEANT4_USE_BUILTIN_EXPAT@)
set(Geant4_builtin_zlib_FOUND @GEANT4_USE_BUILTIN_ZLIB@)
set(Geant4_builtin_usolids_FOUND @GEANT4_USE_BUILTIN_USOLIDS@)
# - Usolids replacement
set(Geant4_usolids_FOUND @GEANT4_USE_USOLIDS@)
if(Geant4_usolids_FOUND)
list(REMOVE_ITEM Geant4_FIND_COMPONENTS usolids)
endif()
# - Multithreading
set(Geant4_multithreaded_FOUND @GEANT4_BUILD_MULTITHREADED@)
if(Geant4_multithreaded_FOUND)
list(REMOVE_ITEM Geant4_FIND_COMPONENTS multithreaded)
list(APPEND Geant4_DEFINITIONS -DG4MULTITHREADED)
# - Define variable to indicate TLS model used
set(Geant4_TLS_MODEL "@GEANT4_BUILD_TLS_MODEL@")
endif()
# - GDML
@@ -440,19 +471,24 @@ endif()
#-----------------------------------------------------------------------
# Now perform final configuration of libraries...
# We provide FOUND variables for shared and static but for now we don't
# allow users to choose - we prefer shared if available, and fallback to
# static otherwise
#
# We provide FOUND variables for presence of shared and static
# User can supply "static" component to force use of static libraries, if
# available.
set(Geant4_shared_FOUND @BUILD_SHARED_LIBS@)
set(Geant4_static_FOUND @BUILD_STATIC_LIBS@)
# - Default setting : shared if available, static otherwise
if(Geant4_shared_FOUND)
set(_geant4_lib_use_suffix "")
else()
set(_geant4_lib_use_suffix "-static")
endif()
if(Geant4_FIND_REQUIRED_static AND Geant4_static_FOUND)
set(_geant4_lib_use_suffix "-static")
list(REMOVE_ITEM Geant4_FIND_COMPONENTS static)
endif()
# The list of libraries probably should be autogenerated, but we hard code
# for now. We don't have to divide the list of shared libraries, but we
# do so for consistency with the way we'll need to do it for static.
@@ -487,6 +523,28 @@ if(_geant4_use_g3tog4_library)
set(_geant4_g3tog4_library G3toG4${_geant4_lib_use_suffix})
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
set(_geant4_physicslists_library G4physicslists${_geant4_lib_use_suffix})
if(_geant4_lib_use_suffix STREQUAL "-static")
# - Use CMAKE_CXX_COMPILER_ID, which should be reliable enough...
# Though the GNU/Clang/Intel compilers/linkers *should* use identical
# flags,keep their sections separate until behaviour confirmed
#
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set(_geant4_physicslists_library -Wl,--whole-archive G4physicslists${_geant4_lib_use_suffix} -Wl,--no-whole-archive)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(_geant4_physicslists_library -Wl,-force_load G4physicslists${_geant4_lib_use_suffix})
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
set(_geant4_physicslists_library -Wl,--whole-archive G4physicslists${_geant4_lib_use_suffix} -Wl,--no-whole-archive)
else()
# Needs determination of other compiler options.
# NB: MSVC has /OPT:NOREF, but may apply globally...
set(_geant4_physicslists_library G4physicslists${_geant4_lib_use_suffix})
endif()
endif()
# - 'Kernel' libraries
list(APPEND _geant4_internal_libraries
G4vis_management${_geant4_lib_use_suffix}
@@ -497,7 +555,7 @@ list(APPEND _geant4_internal_libraries
G4analysis${_geant4_lib_use_suffix}
G4error_propagation${_geant4_lib_use_suffix}
G4readout${_geant4_lib_use_suffix}
G4physicslists${_geant4_lib_use_suffix}
${_geant4_physicslists_library}
G4run${_geant4_lib_use_suffix}
G4event${_geant4_lib_use_suffix}
G4tracking${_geant4_lib_use_suffix}
+24 -18
View File
@@ -7,21 +7,25 @@
# Geant4 installation.
#
# Inclusion of this file, e.g. via
#
#
# include(${Geant4_USE_FILE})
#
# results in the addition of the Geant4 compile definitions and
# include directories to those of the directory in which this file is
# results in the addition of the Geant4 compile definitions and
# include directories to those of the directory in which this file is
# included.
#
# The recommended Geant4 compiler flags are also added to CMAKE_CXX_FLAGS
# but duplicated flags are NOT removed.
# Header paths are added to include_directories as SYSTEM type directories
#
# Advanced users requiring special sets of flags, or the removal of
# duplicate flags should therefore *not* use this file, preferring the
# The recommended Geant4 compiler flags are also prepended to
# CMAKE_CXX_FLAGS but duplicated flags are NOT removed. This permits
# client of UseGeant4 to override Geant4's recommended flags if required
# and at their own risk.
#
# Advanced users requiring special sets of flags, or the removal of
# duplicate flags should therefore *not* use this file, preferring the
# direct use of the Geant4_XXXX variables set by the Geant4Config file.
#
# The last thing the module does is to optionally include an internal Use
# The last thing the module does is to optionally include an internal Use
# file. This file can contain variables, functions and macros for strict
# internal use in Geant4, such as building and running validation tests.
#
@@ -30,19 +34,21 @@
# We need to set the compile definitions and include directories
#
add_definitions(${Geant4_DEFINITIONS})
include_directories(${Geant4_INCLUDE_DIRS})
include_directories(AFTER SYSTEM ${Geant4_INCLUDE_DIRS})
#-----------------------------------------------------------------------
# Because Geant4 is sensitive to the compiler flags, let's set the base
# set here. This reproduces as far as possible the behaviour of the
# original makefile system.
# Because Geant4 is sensitive to the compiler flags, let's set the base
# set here. This reproduces as far as possible the behaviour of the
# original makefile system. However, we append any existing CMake flags in
# case the user wishes to override these (at their own risk).
# Though this may lead to duplication, that should not affect behaviour.
#
set(CMAKE_CXX_FLAGS "${Geant4_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS_DEBUG "${Geant4_CXX_FLAGS_DEBUG}")
set(CMAKE_CXX_FLAGS_MINSIZEREL "${Geant4_CXX_FLAGS_MINSIZEREL}")
set(CMAKE_CXX_FLAGS_RELEASE "${Geant4_CXX_FLAGS_RELEASE}")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${Geant4_CXX_FLAGS_RELWITHDEBINFO}")
set(CMAKE_EXE_LINKER_FLAGS "${Geant4_EXE_LINKER_FLAGS}")
set(CMAKE_CXX_FLAGS "${Geant4_CXX_FLAGS} ${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS_DEBUG "${Geant4_CXX_FLAGS_DEBUG} ${CMAKE_CXX_FLAGS_DEBUG}")
set(CMAKE_CXX_FLAGS_MINSIZEREL "${Geant4_CXX_FLAGS_MINSIZEREL} ${CMAKE_CXX_FLAGS_MINSIZEREL}")
set(CMAKE_CXX_FLAGS_RELEASE "${Geant4_CXX_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_RELEASE}")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${Geant4_CXX_FLAGS_RELWITHDEBINFO} ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
set(CMAKE_EXE_LINKER_FLAGS "${Geant4_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}")
#-----------------------------------------------------------------------
# Locate ourselves
+1
View File
@@ -136,6 +136,7 @@ function(geant4_add_test test)
endif()
set(_cmd ${_prg} ${ARG_COMMAND})
string(REPLACE ";" "#" _cmd "${_cmd}")
string(REPLACE "=" "@" _cmd "${_cmd}")
endif()
set(_command ${CMAKE_COMMAND} -DTST=${test} -DCMD=${_cmd})
+47 -1
View File
@@ -77,11 +77,22 @@ vis_libs="-lG4Tree \
cflags="@CMAKE_CXX_FLAGS@"
feature_list=""
# - CXX Standard
geant4_cxx_std="@GEANT4_BUILD_CXXSTD@"
# - static libs
have_staticlibs="@G4_BUILTWITH_STATICLIBS@"
feature_list="${feature_list} staticlibs[${have_staticlibs}]"
# No action as yet
# - multithreading
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@"
cflags="${cflags} -DG4MULTITHREADED"
else
geant4_tls_model=""
fi
# - Includes and Libs
@@ -135,6 +146,14 @@ if test "x${have_expat}" = "xyes" ; then
libs="${libs} -lG4expat"
fi
# - ZLIB
have_zlib="@G4_BUILTWITH_ZLIB@"
feature_list="${feature_list} zlib[${have_zlib}]"
if test "x${have_zlib}" = "xyes" ; then
libs="${libs} -lG4zlib"
fi
# - GDML
have_gdml="@G4_BUILTWITH_GDML@"
feature_list="${feature_list} gdml[${have_gdml}]"
@@ -145,10 +164,14 @@ fi
# - USolids
have_usolids="@G4_BUILTWITH_USOLIDS@"
have_internal_usolids="@G4_BUILTWITH_BUILTIN_USOLIDS@"
feature_list="${feature_list} usolids[${have_usolids}]"
if test "x${have_usolids}" = "xyes" ; then
cflags="-DG4GEOM_USE_USOLIDS ${cflags}"
fi
if test "x${have_internal_usolids}" = "xyes" ; then
libs="${libs} -lG4geomUSolids"
fi
# - G3toG4
have_g3tog4="@G4_BUILTWITH_G3TOG4@"
@@ -226,9 +249,13 @@ fi
# Datasets
# - List creation for sh compatibility, see:
# https://wiki.ubuntu.com/DashAsBinSh
# Note however that the guide in the link uses the GNU awk extension
# 'length' to find the number of elements in the array. This will fail
# on other awk implementations. Use standard feature of split function
# returning number of elements.
dataset_url="@GEANT4_DATASETS_URL@"
dataset_timeout="@GEANT4_INSTALL_DATA_TIMEOUT@"
dataset_list=$(awk 'BEGIN { split( "@GEANT4_CONFIG_DATASET_DESCRIPTIONS@", array, ";"); for (i=1;i<=length(array);i++) { print array[i]; } }')
dataset_list=$(awk 'BEGIN { n = split( "@GEANT4_CONFIG_DATASET_DESCRIPTIONS@", array, ";"); for (i=1;i<=n;i++) { print array[i]; } }')
#-----------------------------------------------------------------------
# function print_datasets
@@ -408,6 +435,8 @@ help()
Usage: geant4-config [OPTION...]
--prefix output installation prefix of Geant4
--version output version for Geant4
--cxxstd C++ Standard compiled against
--tls-model Thread Local Storage model used
--libs output all linker flags
--cflags output all preprocessor
and compiler flags
@@ -485,6 +514,14 @@ while test $# -gt 0 ; do
echo ${version}
;;
--cxxstd)
echo ${geant4_cxx_std}
;;
--tls-model)
echo ${geant4_tls_model}
;;
--libs)
echo "-L${libdir}" ${vis_libs} ${libs}
;;
@@ -505,6 +542,9 @@ while test $# -gt 0 ; do
shift
case "$1" in
static)
echo ${have_staticlibs}
;;
multithreading)
echo ${have_multithreading}
;;
@@ -514,12 +554,18 @@ while test $# -gt 0 ; do
expat)
echo ${have_expat}
;;
zlib)
echo ${have_zlib}
;;
gdml)
echo ${have_gdml}
;;
usolids)
echo ${have_usolids}
;;
g3tog4)
echo ${have_g3tog4}
;;
qt)
echo ${have_qt}
;;
+76
View File
@@ -0,0 +1,76 @@
#%Module1.0################################################################
#
# Template module file to configure environment for the Geant4 package.
# As generated by CMake, paths are hardcoded so that you may move this
# modulefile to a location suitable for your use of modules. If you
# prefer to use relative paths (i.e. relative to the location of this
# modulefile), you should edit
# the variables:
#
# geant4_install_prefix
# geant4_install_bindir
# geant4_install_libdir
#
# as required for your filesystem hierarchy.
#
# You may also wish to rename this file to allow use of multiple versions,
# e.g. if you store versioned modulefiles for Geant4 under a directory:
#
# tools/
# +- geant4/
#
# then copy this file to
#
# tools/
# +- geant4/
# +- @Geant4_VERSION@
#
# Provided tools/ is in the MODULEPATH environment variable, you can do
#
# module load geant4/@Geant4_VERSION@
#
# to load this specific version. If you do this, then you should also
# use the module 'conflict' command to prevent loading of multiple
# versions.
###########################################################################
#
# Template paths
# Edit these only if you require Geant4 to be found relative to the
# location of this modulefile
#
set geant4_install_prefix "@CMAKE_INSTALL_PREFIX@"
set geant4_install_bindir "@CMAKE_INSTALL_FULL_BINDIR@"
set geant4_install_libdir "@CMAKE_INSTALL_FULL_LIBDIR@"
#
# Provide help and whatis responses
#
proc ModulesHelp { } {
puts stderr "Configures your environment for the Geant4 toolkit v@Geant4_VERSION@"
puts stderr "This module configures the environment as needed to build Geant4 applications"
puts stderr "using CMake or other build systems via the information provided"
puts stderr "by the geant4-config application."
puts stderr ""
puts stderr "For more informatation on Geant4, see the main webpage at:"
puts stderr ""
puts stderr "http://geant4.cern.ch"
puts stderr ""
}
module-whatis "Geant4 toolkit libraries, v@Geant4_VERSION@"
#
# Core Variables/Paths
#
prepend-path PATH $geant4_install_bindir
prepend-path @DYNAMIC_LOADER_PATHNAME@ $geant4_install_libdir
#
# Resource paths
#
array set G4DATASETS [list @G4DATASET_TCLLIST@]
foreach {key value} [array get G4DATASETS] {
setenv $key $value
}
+11 -3
View File
@@ -41,9 +41,9 @@
@GEANT4_TC_UNSET_COMMAND@ CLHEP_LIB
@GEANT4_TC_UNSET_COMMAND@ CLHEP_LIB_DIR
# - G3ToG4
@GEANT4_TC_UNSET_COMMAND@ G4LIB_BUILD_G3TOG4
@GEANT4_TC_UNSET_COMMAND@ G4LIB_USE_G3TOG4
# - EXPAT options
@GEANT4_TC_UNSET_COMMAND@ G4LIB_BUILD_EXPAT
@GEANT4_TC_UNSET_COMMAND@ G4LIB_USE_EXPAT
# - ZLIB options
@GEANT4_TC_UNSET_COMMAND@ G4LIB_BUILD_ZLIB
@@ -54,6 +54,10 @@
@GEANT4_TC_UNSET_COMMAND@ G4LIB_USE_GDML
@GEANT4_TC_UNSET_COMMAND@ XERCESCROOT
# - G3ToG4
@GEANT4_TC_UNSET_COMMAND@ G4LIB_BUILD_G3TOG4
@GEANT4_TC_UNSET_COMMAND@ G4LIB_USE_G3TOG4
# - UI Build and Use options
# USE options only for applications.
@GEANT4_TC_UNSET_COMMAND@ G4UI_NONE
@@ -154,6 +158,10 @@
@GEANT4_TC_CLHEP_LIB_DIR@
@GEANT4_TC_CLHEP_LIB_PATH_SETUP@
#-----------------------------------------------------------------------
# EXPAT setup
@GEANT4_TC_G4LIB_USE_EXPAT@
#-----------------------------------------------------------------------
# ZLIB Setup
#