Skip to content

Commit 2d174b7

Browse files
committed
Import Geant4 10.6.2 source tree
1 parent b14d739 commit 2d174b7

File tree

448 files changed

+23209
-30946
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

448 files changed

+23209
-30946
lines changed

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ set(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX
3232
project(Geant4)
3333
set(${PROJECT_NAME}_VERSION_MAJOR 10)
3434
set(${PROJECT_NAME}_VERSION_MINOR 6)
35-
set(${PROJECT_NAME}_VERSION_PATCH 1)
35+
set(${PROJECT_NAME}_VERSION_PATCH 2)
3636
set(${PROJECT_NAME}_VERSION "${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}.${${PROJECT_NAME}_VERSION_PATCH}")
3737

3838
# - Prepend our own CMake Modules to the search path

ReleaseNotes/Patch4.10.6-2.txt

+124
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
2+
Geant4 10.6 - patch-02 Release Notes
3+
------------------------------------
4+
5+
29 May 2020
6+
7+
List of fixes included in this public patch since the public release 10.6.p01:
8+
9+
o Configuration:
10+
-------------
11+
+ CMake:
12+
o Added activation of build of G4Py through GEANT4_USE_PYTHON flag.
13+
Requires Boost.Python (only 1.72 tested so far) using Python 3 or
14+
newer (only 3.7 tested).
15+
Verify that MT builds use 'global-dynamic' TLS mode to allow Python
16+
module loading of dynamic libraries.
17+
o Fix to avoid configuration of applications failure due to variables
18+
having empty values, and consequently no "type" argument. Only store
19+
values in the package cache if they are set and have a valid value.
20+
o Use full path to datasets if GEANT4_INSTALL_DATADIR is an absolute path.
21+
Customize CMAKE_INSTALL_DATADIR in a single location.
22+
o Suppress warnings about icc libraries not existing for Intel icc-19.
23+
24+
o Environments:
25+
------------
26+
+ G4Py: integrated build, test, and install of geant4py with core Geant4
27+
CMake build system.
28+
29+
o Geometry:
30+
--------
31+
+ solids/specific:
32+
o Fixed mismatch in signature of constructors for the G4UExtrudedSolid
33+
wrapper.
34+
35+
o Global:
36+
------
37+
+ G4UnitsTable: added inheriting constructors for std::vector.
38+
Addressing problem report #2232.
39+
+ Updated date and version for 10.6.p02.
40+
41+
o Intercoms:
42+
---------
43+
+ Accept null string as an alias value. Addessing problem report #2208.
44+
45+
o Physics Lists
46+
-------------
47+
+ constructors/limiters
48+
o G4GenericBiasingPhysics: added missing code for parallel geometries
49+
for all neutral and charged particles.
50+
51+
o Processes - Electromagnetic:
52+
---------------------------
53+
+ utils:
54+
o G4LossTableBuilder: fixed typo. Addressing problem report #2230.
55+
56+
o Processes - Hadronic:
57+
--------------------
58+
+ models/de_excitation:
59+
o G4DeexPrecoParameters: set default time limit to 1 microsecond
60+
for isomer production (now, in all cases, isomers with half-life time
61+
above 1 microsecond are produced, whereas before this happened
62+
only when Radioactive Decay was activated, else only above 1000 sec).
63+
Addressing problem report #2226.
64+
+ models/lend:
65+
o New class G4LENDGammaModel to sample GND gamma-nuclear reactions.
66+
New class G4LENDGammaCrossSection to sample GND gamma-nuclear reactions.
67+
Added documentation to MCGIDI_outputChannel.
68+
Rewritten G4LENDInelastic to take care of large baryon number
69+
violations. Addressing problem report #2174.
70+
+ models/particle_hp:
71+
o In G4ParticleHPInelasticBaseFS, use QI[0]-QI[it] for excitation and
72+
added particle definition protection to 'iLevel' calculation.
73+
Addressing problem report #1838.
74+
o Correction in G4ParticleHPInelasticBaseFS and
75+
G4ParticleHPInelasticCompFS. Removed deletion of 'theReactionXsec'
76+
in G4ParticleHPPhotonDist() destructor as memory allocation does
77+
not take place in this class. Addressing problem report #1824.
78+
o In G4ParticleHPThermalScattering::create_E_isoAng_from_energy(),
79+
added fatal exception for case when pointers panEPM_T_EL or panEPM_T_EH
80+
are null; fixing Coverity reports.
81+
o Corrected copy constructor in G4ParticleHPDataPoint.
82+
+ models/parton_string/hadronization:
83+
o G4QGSMFragmentation, G4LundStringFragmentation: fixed Coverity defects
84+
warnings; if fragmentation at low energy is not possible, always return
85+
flag "false"; use nullptr.
86+
+ models/radioactive_decay:
87+
o G4RadioactiveDecayBase, G4RadioactiveDecay, G4Radioactivation:
88+
use G4VERBOSE consistently; in G4Radioactivation, fixed forgotten
89+
change of verbosity from 0 to 1.
90+
91+
o Examples:
92+
--------
93+
+ advanced/ChargeExchangeMC
94+
o Fixed compilation error on main().
95+
o Fixed CMake build script for dependence on Qt libraries.
96+
+ basic/B2
97+
o Updated READMEs and added a comment in B2PrimaryGeneratorAction
98+
that starting a primary particle on the world boundary requires
99+
shooting in a direction towards inside the world.
100+
+ extended/biasing/ReverseMC01
101+
o RMC01AnalysisManager: use double for computation of mean and RMS;
102+
added protection for sqrt() argument, to avoid a problem due to
103+
precision loss in arithmetic computations.
104+
+ extended/exoticphysics/monopole
105+
o G4MonopolePhysics: minor code clean-up for thread safety
106+
o Do not instantiate VisManager in the batch mode in main();
107+
fixed some typos.
108+
o G4MonopoleTransportation: removed check if monopole is opticalphoton
109+
or not as no longer necessary.
110+
111+
----------------------------------------------------------------------------
112+
113+
Technical Notes
114+
---------------
115+
116+
o This patch should be applied on top of release 10.6 or 10.6.p01.
117+
o Technical notes distributed for release 10.6 are also applicable and
118+
valid for this patch.
119+
120+
The code and rebuilt binary libraries for release 10.6.p02 are available
121+
through the Geant4 "Download" Web page.
122+
123+
Please refer to the Geant4 User Documentation for further information about
124+
using Geant4.

cmake/History

+18
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,24 @@ add this in the documentation for the changed file as [BUGFIX #BUGNUMBER].
2929
* Reverse chronological order (last date on top), please *
3030

3131
----------------------------------------------------------
32+
21st April 2020 - Ben Morgan (cmake-V10-05-39)
33+
- BUGFIX: Only store variables in Geant4PackageCache if they have
34+
a value.
35+
36+
6th April 2020 - Ben Morgan (cmake-V10-05-38)
37+
- Activate build of geant4py when GEANT4_USE_PYTHON is set
38+
Check that MT builds use global-dynamic TLS to allow Python
39+
module loading of the Geant4 dynamic libraries.
40+
41+
3rd April 2020 - Guilherme Amadio (cmake-V10-05-37)
42+
- Use full path to datasets if GEANT4_INSTALL_DATADIR is an absolute path
43+
44+
2nd April 2020 - Guilherme Amadio (cmake-V10-05-36)
45+
- Customize CMAKE_INSTALL_DATADIR in a single location
46+
47+
18th March 2020 - Gunter Folger (cmake-V10-05-35)
48+
- In Modules/G4CPack.cmake suppress warnings about icc libraries not existing
49+
for Intel icc version 19.
3250

3351
14th February 2020 - Ben Morgan (cmake-V10-05-34)
3452
- No longer create gnumake symlinks on Windows

cmake/Modules/G4CMakeMain.cmake

+19-12
Original file line numberDiff line numberDiff line change
@@ -63,29 +63,37 @@ include(Geant4OptionalComponents)
6363
# there are many complex options to handle.
6464
include(Geant4InterfaceOptions)
6565

66-
# - Provide options to enable wrapping of Geant4 by other languages
67-
include(Geant4Wrapping)
66+
# - Installation of optional read-only architecture independent data files.
67+
include(Geant4InstallData)
68+
69+
# - Include testing up front so both source and environments can use it if required
70+
include(Geant4CTest)
71+
6872

6973
#-----------------------------------------------------------------------
7074
# Add the source and environments subdirectories
7175
# source : Process all the Geant4 core targets
7276
# environments : Process optional wrappings of Geant4 (NOTYETIMPLEMENTED)
7377
add_subdirectory(source)
74-
#add_subdirectory(environments)
78+
79+
option(GEANT4_USE_PYTHON "Build Python bindings for Geant4" OFF)
80+
if(GEANT4_USE_PYTHON)
81+
# We can only build g4py with MT geant4 if TLS is global-dynamic (or auto?)
82+
if(GEANT4_BUILD_MULTITHREADED AND (NOT GEANT4_BUILD_TLS_MODEL MATCHES "global-dynamic"))
83+
message(FATAL_ERROR "Geant4Py only supports 'global-dynamic' thread local storage
84+
'${GEANT4_BUILD_TLS_MODEL}' selected by GEANT4_BUILD_TLS_MODEL option
85+
")
86+
endif()
87+
88+
add_subdirectory(environments/g4py)
89+
endif()
7590

7691
#-----------------------------------------------------------------------
7792
# - Perform all post build tasks
7893
# At the CMake level, this simply means that we must know about targets
7994
# and other properties processed in source and environments trees before
8095
# these tasks can be performed.
8196
#
82-
# - Installation of optional read-only architecture independent data files.
83-
# E.g. Examples, data libraries, documentation.
84-
# Done before toolchain generation because it may affect what we have to do
85-
# there!
86-
#
87-
include(Geant4InstallData)
88-
8997
# - Generate any Use/Config/Support files here once everything else has
9098
# been processed e.g. "UseGeant4.cmake", "Geant4Config.cmake", library
9199
# dependencies etc.
@@ -101,7 +109,6 @@ include(G4ConfigureCMakeHelpers)
101109
#-----------------------------------------------------------------------
102110
# - Testing configuration.
103111
# Done here, as projects under 'tests' require Geant4Config.
104-
include(Geant4CTest)
105112
if(GEANT4_ENABLE_TESTING)
106113
add_subdirectory(tests)
107114
if(EXISTS ${CMAKE_SOURCE_DIR}/benchmarks)
@@ -121,7 +128,7 @@ mark_as_advanced(GEANT4_INSTALL_EXAMPLES)
121128

122129
if(GEANT4_INSTALL_EXAMPLES)
123130
install(DIRECTORY examples
124-
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/Geant4-${Geant4_VERSION}
131+
DESTINATION ${CMAKE_INSTALL_DATADIR}
125132
COMPONENT Examples
126133
PATTERN "CVS" EXCLUDE
127134
PATTERN ".svn" EXCLUDE

cmake/Modules/G4CMakeSettings.cmake

+10
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,16 @@ add_custom_target(validate_sources
116116
#.rst:
117117
# General Installation Settings
118118
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
119+
#
120+
# Geant4 custom defaults
121+
122+
set(CMAKE_INSTALL_DATAROOTDIR "share" CACHE PATH
123+
"Read-only architecture-independent data root (share)")
124+
125+
set(CMAKE_INSTALL_DATADIR
126+
"${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}-${${PROJECT_NAME}_VERSION}" CACHE PATH
127+
"Read-only architecture-independent data (DATAROOTDIR/${PROJECT_NAME}-${${PROJECT_NAME}_VERSION})")
128+
119129
#
120130
# CMake's builtin `GNUInstallDirs` module is used to set and provide variables
121131
# for the destinations to which for executables, libraries and other files

cmake/Modules/G4CMakeUtilities.cmake

+6-3
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,12 @@ function(geant4_save_package_variables _title)
195195
get_property(__exported_vars GLOBAL PROPERTY GEANT4_EXPORT_PACKAGE_${_title}_VARIABLES)
196196
foreach(__varname ${ARGN})
197197
if(NOT (${__varname} IN_LIST __exported_vars))
198-
# TODO: Also check that the save variable is in the cache...
199-
# if(CACHE ...) only available from 3.14
200-
set_property(GLOBAL APPEND PROPERTY GEANT4_EXPORT_PACKAGE_${_title}_VARIABLES ${__varname})
198+
# Some variables might be empty on certain systems. Only save those with a value
199+
if(${__varname})
200+
# TODO: Also check that the save variable is in the cache...
201+
# if(CACHE ...) only available from 3.14
202+
set_property(GLOBAL APPEND PROPERTY GEANT4_EXPORT_PACKAGE_${_title}_VARIABLES ${__varname})
203+
endif()
201204
endif()
202205
endforeach()
203206
endfunction()

cmake/Modules/G4ConfigureGNUMakeHelpers.cmake

+20-16
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ _g4tc_configure_build_tree_scripts(geant4make)
729729
# +- CMAKE_INSTALL_PREFIX
730730
# +- LIBDIR/Geant4-VERSION (G4LIB)
731731
# +- INCLUDEDIR/Geant4 (G4INCLUDE)
732-
# +- DATAROOTDIR/Geant4-VERSION/
732+
# +- DATADIR/
733733
# +- geant4make (THIS IS G4INSTALL!)
734734
# +- geant4make.(c)sh
735735
# +- config/
@@ -742,23 +742,23 @@ set(G4INSTALL "\"\$geant4make_root\"")
742742
# - Include dir
743743
file(RELATIVE_PATH
744744
G4MAKE_TO_INCLUDEDIR
745-
${CMAKE_INSTALL_FULL_DATAROOTDIR}/Geant4-${Geant4_VERSION}/geant4make
745+
${CMAKE_INSTALL_FULL_DATADIR}/geant4make
746746
${CMAKE_INSTALL_FULL_INCLUDEDIR}/${PROJECT_NAME}
747747
)
748748
set(G4INCLUDE "\"`cd \$geant4make_root/${G4MAKE_TO_INCLUDEDIR} > /dev/null \; pwd`\"")
749749

750750
# - Bin dir
751751
file(RELATIVE_PATH
752752
G4MAKE_TO_BINDIR
753-
${CMAKE_INSTALL_FULL_DATAROOTDIR}/Geant4-${Geant4_VERSION}/geant4make
753+
${CMAKE_INSTALL_FULL_DATADIR}/geant4make
754754
${CMAKE_INSTALL_FULL_BINDIR}
755755
)
756756
set(G4BIN_DIR "\"`cd \$geant4make_root/${G4MAKE_TO_BINDIR} > /dev/null \; pwd`\"")
757757

758758
# - Lib dir
759759
file(RELATIVE_PATH
760760
G4MAKE_TO_LIBDIR
761-
${CMAKE_INSTALL_FULL_DATAROOTDIR}/Geant4-${Geant4_VERSION}/geant4make
761+
${CMAKE_INSTALL_FULL_DATADIR}/geant4make
762762
${CMAKE_INSTALL_FULL_LIBDIR}
763763
)
764764
set(G4LIB "\"`cd \$geant4make_root/${G4MAKE_TO_LIBDIR}/Geant4-${Geant4_VERSION} > /dev/null \; pwd`\"")
@@ -775,7 +775,7 @@ foreach(_ds ${GEANT4_EXPORTED_DATASETS})
775775

776776
file(RELATIVE_PATH
777777
G4MAKE_TO_DATADIR
778-
${CMAKE_INSTALL_FULL_DATAROOTDIR}/Geant4-${Geant4_VERSION}/geant4make
778+
${CMAKE_INSTALL_FULL_DATADIR}/geant4make
779779
${${_ds}_PATH}
780780
)
781781
set(${_ds}_PATH "\"`cd \$geant4make_root/${G4MAKE_TO_DATADIR} > /dev/null \; pwd`\"")
@@ -788,7 +788,7 @@ set(TOOLS_FONT_PATH "\"`cd \$geant4make_root/../fonts > /dev/null ; pwd`\"")
788788
_g4tc_configure_install_tree_scripts(
789789
${CMAKE_BINARY_DIR}/InstallTreeFiles
790790
geant4make
791-
${CMAKE_INSTALL_DATAROOTDIR}/Geant4-${Geant4_VERSION}/geant4make
791+
${CMAKE_INSTALL_DATADIR}/geant4make
792792
)
793793

794794

@@ -797,7 +797,7 @@ _g4tc_configure_install_tree_scripts(
797797
# softlink to the G4SYSTEM directory.
798798
#
799799
install(DIRECTORY config
800-
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/Geant4-${Geant4_VERSION}/geant4make
800+
DESTINATION ${CMAKE_INSTALL_DATADIR}/geant4make
801801
COMPONENT Development
802802
FILES_MATCHING PATTERN "*.gmk"
803803
PATTERN "CVS" EXCLUDE
@@ -835,21 +835,25 @@ foreach(_ds ${GEANT4_EXPORTED_DATASETS})
835835
geant4_get_dataset_property(${_ds} ENVVAR ${_ds}_ENVVAR)
836836
geant4_get_dataset_property(${_ds} INSTALL_DIR ${_ds}_PATH)
837837

838-
file(RELATIVE_PATH
839-
G4ENV_BINDIR_TO_DATADIR
840-
${CMAKE_INSTALL_FULL_BINDIR}
841-
${${_ds}_PATH}
842-
)
843-
set(${_ds}_PATH "\"`cd \$geant4_envbindir/${G4ENV_BINDIR_TO_DATADIR} > /dev/null \; pwd`\"")
838+
if(NOT IS_ABSOLUTE ${${_ds}_PATH})
839+
file(RELATIVE_PATH
840+
G4ENV_BINDIR_TO_DATADIR
841+
${CMAKE_INSTALL_FULL_BINDIR}
842+
${${_ds}_PATH}
843+
)
844+
set(${_ds}_PATH "\"`cd \$geant4_envbindir/${G4ENV_BINDIR_TO_DATADIR} > /dev/null \; pwd`\"")
845+
else()
846+
set(${_ds}_PATH "\"${${_ds}_PATH}\"")
847+
endif()
844848
endforeach()
845849

846850
# - Fonts
847851
file(RELATIVE_PATH
848-
G4ENV_BINDIR_TO_DATAROOTDIR
852+
G4ENV_BINDIR_TO_DATADIR
849853
"${CMAKE_INSTALL_FULL_BINDIR}"
850-
"${CMAKE_INSTALL_FULL_DATAROOTDIR}/Geant4-${Geant4_VERSION}"
854+
"${CMAKE_INSTALL_FULL_DATADIR}"
851855
)
852-
set(TOOLS_FONT_PATH "\"`cd \$geant4_envbindir/${G4ENV_BINDIR_TO_DATAROOTDIR}/fonts > /dev/null ; pwd`\"")
856+
set(TOOLS_FONT_PATH "\"`cd \$geant4_envbindir/${G4ENV_BINDIR_TO_DATADIR}/fonts > /dev/null ; pwd`\"")
853857

854858

855859
# - Configure for each shell

cmake/Modules/Geant4CPackBase.cmake

+5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
#-----------------------------------------------------------------------
77
# Package up needed system libraries - only for WIN32?
88
#
9+
# for Intel icc suppress warnings about icc libraries not existing for 19.
10+
if(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
11+
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS True)
12+
endif()
13+
914
include(InstallRequiredSystemLibraries)
1015

1116
#-----------------------------------------------------------------------

cmake/Modules/Geant4InstallData.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ set(GEANT4_DATASETS_URL "https://cern.ch/geant4-data/datasets")
105105
set(GEANT4_BUILD_FULL_DATADIR ${PROJECT_BINARY_DIR}/data)
106106

107107
# Where to install data in the install tree (a Default)
108-
set(GEANT4_INSTALL_DATADIR_DEFAULT "${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}-${${PROJECT_NAME}_VERSION}/data")
108+
set(GEANT4_INSTALL_DATADIR_DEFAULT "${CMAKE_INSTALL_DATADIR}/data")
109109

110110
# File containing dataset list
111111
set(GEANT4_DATASETS_DEFINITIONS "Geant4DatasetDefinitions")
@@ -596,7 +596,7 @@ endfunction()
596596
# Choose Physics Data Install Dir
597597
# This follows the pattern for interface and setting as in GNUInstallDirs
598598
if(NOT GEANT4_INSTALL_DATADIR)
599-
set(GEANT4_INSTALL_DATADIR "" CACHE PATH "read-only architecture independent Geant4 physics data (DATAROOTDIR/${GEANT4_INSTALL_DATADIR_DEFAULT}")
599+
set(GEANT4_INSTALL_DATADIR "" CACHE PATH "read-only architecture independent Geant4 physics data (DATADIR/data")
600600
set(GEANT4_INSTALL_DATADIR "${GEANT4_INSTALL_DATADIR_DEFAULT}")
601601
endif()
602602

0 commit comments

Comments
 (0)