Skip to content

Commit e58e650

Browse files
committed
Import Geant4 11.3.0.beta source tree
1 parent f7b2387 commit e58e650

File tree

5,232 files changed

+232576
-237520
lines changed

Some content is hidden

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

5,232 files changed

+232576
-237520
lines changed

.gitlab/CODEOWNERS

-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,6 @@
258258
/examples/extended/parallel/MPI/exMPI04/ @ihrivnac
259259
/examples/extended/parallel/TBB/ @jmadsen @ihrivnac
260260
/examples/extended/parallel/ThreadsafeScorers/ @jmadsen @ihrivnac
261-
/examples/extended/parallel/TopC/ @cooperma @ihrivnac
262261

263262
/examples/extended/parameterisations/gflash/ @mverderi @ihrivnac
264263
/examples/extended/parameterisations/Par01/ @mverderi @ihrivnac

CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ project(Geant4
3030
DESCRIPTION "C++ toolkit for simulating the passage of particles through matter"
3131
HOMEPAGE_URL "https://geant4.cern.ch")
3232
set(${PROJECT_NAME}_VERSION_MAJOR 11)
33-
set(${PROJECT_NAME}_VERSION_MINOR 2)
34-
set(${PROJECT_NAME}_VERSION_PATCH 2)
33+
set(${PROJECT_NAME}_VERSION_MINOR 3)
34+
set(${PROJECT_NAME}_VERSION_PATCH 0)
3535
set(${PROJECT_NAME}_VERSION "${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}.${${PROJECT_NAME}_VERSION_PATCH}")
3636

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

ReleaseNotes/Beta4.11.3-1.txt

+740
Large diffs are not rendered by default.

ReleaseNotes/Patch.11.2-1.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ List of fixes included in this public patch since the public release 11.2.0:
4545
+ dna
4646
o G4DNABornAngle: fixed numerical problem; added protection for cosTheta;
4747
use relativistic formula for maximum energy transfer to delta-electrons.
48-
+ loweneegy
48+
+ lowenergy
4949
o G4MicroElecInelasticModel_new: fixed Coverity report for memory leak at
5050
exit. Minor code cleanup.
5151
o G4MicroElecLOPhononModel: minor code cleanup.

cmake/History

+48-10
Original file line numberDiff line numberDiff line change
@@ -6,44 +6,82 @@ It must **not** be used as a substitute for writing good git commit messages!
66

77
-------------------------------------------------------------------------------
88

9-
## 2024-06-07 Ben Morgan (cmake-V11-01-33)
9+
## 2024-06-07 Ben Morgan (cmake-V11-02-18)
10+
- Add optional install of new URRPT data model
11+
- Fixes Issue #217
12+
13+
## 2024-06-04 Ben Morgan (cmake-V11-02-17)
1014
- Do not export HDF5 version to Geant4Config
1115
- Fixes Issue #214
1216

13-
## 2024-05-17 Gunter Folger
17+
## 2024-05-17 Gunter Folger (cmake-V11-02-16)
1418
- Use patched G4NDL 4.7.1 dataset.
1519

16-
## 2024-03-26 Ben Morgan
20+
## 2024-05-17 Ben Morgan (cmake-V11-02-15)
21+
- Add optional install of new NuDEXLib data model
22+
23+
## 2024-05-09 Ben Morgan (cmake-V11-02-14)
24+
- Provide CMake function to assist in linking unit tests to final libraries
25+
given required source code modules.
26+
27+
## 2024-05-08 Ben Morgan (cmake-V11-02-13)
28+
- Remove configuration/setup of TiMemory in Geant4.
29+
30+
## 2024-05-03 Ben Morgan (cmake-V11-02-12)
31+
- Introduce new `FullRelWithDebInfo` build mode.
32+
- Essentially `-O3 -g`, so maximum optimization with debugging symbols
33+
- Intended to help diagnose FPE exceptions on Alma9/gcc13/c++20 and future
34+
proof against similar
35+
- Remove obsolete `Maintainer` build mode that is nothing more than `Debug`
36+
37+
## 2024-04-30 Ben Morgan (cmake-V11-02-11)
38+
- Simplifications to Geant4Config.cmake
39+
- Remove obsolete and never run "whole archive" linking of G4physics_lists
40+
- Replace TOOLSSG vis driver variables that are just synonyms for more
41+
fundamental config options (e.g. GEANT4_USE_QT) with the underlying
42+
variable.
43+
44+
## 2024-03-26 Ben Morgan (cmake-V11-02-10)
1745
- Disable use of FindPythia6 outside of internal Geant4 examples.
1846

19-
## 2024-04-17 Stephan Hageboeck
47+
## 2024-04-17 Stephan Hageboeck (cmake-V11-02-09)
2048
- Mention the possibility of using cvmfs datasets in the cmake configure warning
2149

22-
## 2024-04-08 Guilherme Amadio
50+
## 2024-04-17 Ben Morgan (cmake-V11-02-08)
51+
- Bump G4EMLOW dataset to v8.6
52+
53+
## 2024-04-08 Guilherme Amadio (cmake-V11-02-07)
2354
- Fix also find_package(SoXt) and find_package(SoWin)
2455

25-
## 2024-04-20 Ben Morgan
56+
## 2024-04-20 Ben Morgan (cmake-V11-02-06)
2657
- Update FindPythia8 module to:
2758
- Apply [GitHub PR 68](https://github.com/Geant4/geant4/pull/68)
2859
- Reduce capability to only that required by py8decayer example
2960
- Emit error if used in project outside Geant4 or py8decayer
3061

31-
## 2024-03-12 Ben Morgan
62+
## 2024-03-12 Ben Morgan (cmake-V11-02-05)
3263
- Update FindPythia6 module to account for lib64
3364
- Applies [GitHub PR 63](https://github.com/Geant4/geant4/pull/63)
3465

35-
## 2024-03-11 Ben Morgan
66+
## 2024-03-11 Ben Morgan (cmake-V11-02-04)
3667
- Fix escaping of regex in geant4_module_check to satisfy latest Python3.
3768

38-
## 2024-01-29 Ben Morgan (cmake-V11-01-32)
69+
## 2024-03-06 Ben Morgan (cmake-V11-02-03)
70+
- Bump G4PARTICLEXS dataset to v4.1
71+
72+
## 2024-01-29 Ben Morgan (cmake-V11-02-02)
3973
- Manually check versions of found SoXX packages to workaround their use of
4074
the `ExactVersionOnly` version checking strategy in find_package. Geant4
4175
only requires a minimum version.
4276

43-
## 2024-01-26 Ben Morgan (cmake-V11-01-31)
77+
## 2024-01-26 Ben Morgan (cmake-V11-02-01)
4478
- Add -F flag for Qt when on macOS and with a framework build of Qt
4579
- Addresses [Bugzilla 2589](https://bugzilla-geant4.kek.jp/show_bug.cgi?id=2589)
4680

81+
## 2024-01-19 Ben Morgan (cmake-V11-02-00)
82+
- Add compiler flags for GCC only to help detect/debug LTO-related problems when
83+
building with CMAKE_INTERPROCEDURAL_OPTIMIZATION.
84+
4785
## 2023-11-28 Ben Morgan (cmake-V11-01-30)
4886
- Bump minimum VecGeom version to 1.2.6
4987

cmake/Modules/G4BuildSettings.cmake

+23-10
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,14 @@ set(CMAKE_CXX_FLAGS_TESTRELEASE "${CMAKE_CXX_FLAGS_TESTRELEASE_INIT}"
101101
mark_as_advanced(CMAKE_CXX_FLAGS_TESTRELEASE)
102102

103103
#.rst:
104-
# - ``Maintainer``:
105-
# For development of the toolkit. It adds debugging, and enables the use
106-
# of library specific debugging via standardized definitions.
104+
# - ``FullRelWithDebInfo``:
105+
# For trial production and extended testing. Maximum optimization
106+
# and debugging symbols
107107
#
108-
set(CMAKE_CXX_FLAGS_MAINTAINER "${CMAKE_CXX_FLAGS_MAINTAINER_INIT}"
109-
CACHE STRING "Flags used by the compiler during Maintainer builds"
108+
set(CMAKE_CXX_FLAGS_FULLRELWITHDEBINFO "${CMAKE_CXX_FLAGS_FULLRELWITHDEBINFO_INIT}"
109+
CACHE STRING "Flags used by the compiler during FullRelWithDebInfo builds"
110110
)
111-
mark_as_advanced(CMAKE_CXX_FLAGS_MAINTAINER)
111+
mark_as_advanced(CMAKE_CXX_FLAGS_FULLRELWITHDEBINFO)
112112

113113
#.rst:
114114
# Compiler flags specific to these build types are set in the cache, and
@@ -117,17 +117,17 @@ mark_as_advanced(CMAKE_CXX_FLAGS_MAINTAINER)
117117
#
118118
if(NOT CMAKE_CONFIGURATION_TYPES)
119119
# Single mode build tools like Make, Ninja,
120-
set(__g4buildmodes "" Release TestRelease MinSizeRel Debug Debug_FPE RelWithDebInfo MinSizeRel Maintainer)
120+
set(__g4buildmodes "" Release TestRelease MinSizeRel Debug Debug_FPE RelWithDebInfo FullRelWithDebInfo)
121121
if(NOT CMAKE_BUILD_TYPE)
122122
# Default to a Release build if nothing else...
123123
set(CMAKE_BUILD_TYPE Release
124-
CACHE STRING "Choose the type of build, options are: None Release TestRelease MinSizeRel Debug Debug_FPE RelWithDebInfo MinSizeRel Maintainer."
124+
CACHE STRING "Choose the type of build, options are: None Release TestRelease MinSizeRel Debug Debug_FPE RelWithDebInfo FullRelWithDebInfo."
125125
FORCE
126126
)
127127
else()
128128
# Force to the cache, but use existing value.
129129
set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}"
130-
CACHE STRING "Choose the type of build, options are: None Release TestRelease MinSizeRel Debug Debug_FPE RelWithDebInfo MinSizeRel Maintainer."
130+
CACHE STRING "Choose the type of build, options are: None Release TestRelease MinSizeRel Debug Debug_FPE RelWithDebInfo FullRelWithDebInfo."
131131
FORCE
132132
)
133133
endif()
@@ -136,7 +136,7 @@ else()
136136
# Multimode tools like VS, Xcode
137137
list(APPEND CMAKE_CONFIGURATION_TYPES Debug_FPE)
138138
list(APPEND CMAKE_CONFIGURATION_TYPES TestRelease)
139-
list(APPEND CMAKE_CONFIGURATION_TYPES Maintainer)
139+
list(APPEND CMAKE_CONFIGURATION_TYPES FullRelWithDebInfo)
140140
list(REMOVE_DUPLICATES CMAKE_CONFIGURATION_TYPES)
141141
set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}"
142142
CACHE STRING "Geant4 configurations for multimode build tools"
@@ -365,6 +365,19 @@ if(GEANT4_BUILD_MULTITHREADED)
365365
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GEANT4_MULTITHREADED_CXX_FLAGS}")
366366
endif()
367367

368+
#-----------------------------------------------------------------------
369+
# Link-time optimization
370+
#-----------------------------------------------------------------------
371+
# If LTO is enabled via CMAKE_INTERPROCEDURAL_OPTIMIZATION, then add
372+
# additional flags to force identify/check ODR violations for GCC only (at present)
373+
# Note that these are _nominally_ enabled by default in GCC with flto, so
374+
# they are added explicitly for the sake of clarity. Also, some are only valid for
375+
# older GCC versions, but they do not break things.
376+
# TODO: Review with experiments what recommended options are here.
377+
if(CMAKE_INTERPROCEDURAL_OPTIMIZATION AND (CMAKE_CXX_COMPILER_ID STREQUAL "GNU"))
378+
string(APPEND CMAKE_CXX_FLAGS " -Wodr -fipa-icf -flto-odr-type-merging")
379+
endif()
380+
368381
#-----------------------------------------------------------------------
369382
# Physics
370383
#-----------------------------------------------------------------------

cmake/Modules/G4DatasetDefinitions.cmake

+33-5
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ geant4_add_dataset(
1818
# - Low energy electromagnetics
1919
geant4_add_dataset(
2020
NAME G4EMLOW
21-
VERSION 8.5
21+
VERSION 8.6
2222
FILENAME G4EMLOW
2323
EXTENSION tar.gz
2424
ENVVAR G4LEDATA
25-
MD5SUM 146d0625d8d39f294056e1618271bc46
25+
MD5SUM 080576674061a0649629649879655bb9
2626
)
2727

2828
# - Photon evaporation
@@ -48,11 +48,11 @@ geant4_add_dataset(
4848
# - Particle XS - replaces Neutron XS
4949
geant4_add_dataset(
5050
NAME G4PARTICLEXS
51-
VERSION 4.0
51+
VERSION 4.1
5252
FILENAME G4PARTICLEXS
5353
EXTENSION tar.gz
5454
ENVVAR G4PARTICLEXSDATA
55-
MD5SUM d82a4d171d50f55864e28b6cd6f433c0
55+
MD5SUM 878252a464ba6b38f085741840f053e6
5656
)
5757

5858
# - PII
@@ -115,7 +115,7 @@ geant4_add_dataset(
115115
ENVVAR G4ENSDFSTATEDATA
116116
MD5SUM 6f18fce8f217e7aaeaa3711be9b2c7bf
117117
)
118-
118+
119119
# - TENDL
120120
option(GEANT4_INSTALL_DATASETS_TENDL "Install optional TENDL dataset" OFF)
121121
mark_as_advanced(GEANT4_INSTALL_DATASETS_TENDL)
@@ -129,6 +129,34 @@ if(GEANT4_INSTALL_DATASETS_TENDL)
129129
ENVVAR G4PARTICLEHPDATA
130130
MD5SUM ab17a1eec5ad4c8fcfafcfbc0de30ed8
131131
)
132+
endif()
133+
134+
# - NuDEX
135+
option(GEANT4_INSTALL_DATASETS_NUDEXLIB "Install optional NuDEXLib dataset" OFF)
136+
mark_as_advanced(GEANT4_INSTALL_DATASETS_NUDEXLIB)
132137

138+
if(GEANT4_INSTALL_DATASETS_NUDEXLIB)
139+
geant4_add_dataset(
140+
NAME G4NUDEXLIB
141+
VERSION 1.0
142+
FILENAME G4NUDEXLIB
143+
EXTENSION tar.gz
144+
ENVVAR G4NUDEXLIBDATA
145+
MD5SUM 09a85f907d2282dbf234d1784f436db3
146+
)
133147
endif()
134148

149+
# - G4URRPT
150+
option(GEANT4_INSTALL_DATASETS_URRPT "Install optional URRPT dataset" OFF)
151+
mark_as_advanced(GEANT4_INSTALL_DATASETS_URRPT)
152+
153+
if(GEANT4_INSTALL_DATASETS_URRPT)
154+
geant4_add_dataset(
155+
NAME G4URRPT
156+
VERSION 1.0
157+
FILENAME G4URRPT
158+
EXTENSION tar.gz
159+
ENVVAR G4URRPTDATA
160+
MD5SUM acc94698e4199455b4fac33c3384ccb4
161+
)
162+
endif()

cmake/Modules/G4DeveloperAPI.cmake

+56
Original file line numberDiff line numberDiff line change
@@ -852,6 +852,59 @@ function(geant4_get_external_categories _result)
852852
set(${_result} ${__tmp} PARENT_SCOPE)
853853
endfunction()
854854

855+
#-----------------------------------------------------------------------
856+
#-----------------------------------------------------------------------
857+
#.rst:
858+
# Test Program Commands
859+
# ^^^^^^^^^^^^^^^^^^^^^
860+
# .. cmake:command:: geant4_test_link_libraries
861+
#
862+
# .. code-block:: cmake
863+
#
864+
# geant4_test_link_libraries(<target>
865+
# [PUBLIC pub1 [pub2 ...]
866+
# [PRIVATE pri1 [pri2 ...]
867+
# [INTERFACE int1 [int2 ...])
868+
function(geant4_test_link_libraries _target)
869+
cmake_parse_arguments(G4TESTLINKLIB
870+
""
871+
""
872+
"PUBLIC;PRIVATE;INTERFACE"
873+
${ARGN}
874+
)
875+
__geant4_assert_no_unparsed_arguments(G4TESTLINKLIB geant4_test_link_libraries)
876+
877+
# Need defined libraries to be able to resolve between static/shared
878+
get_property(__g4definedlibraries GLOBAL PROPERTY GEANT4_DEFINED_CATEGORIES)
879+
880+
foreach(__prop PUBLIC PRIVATE INTERFACE)
881+
__geant4_resolve_link_libraries(G4TESTLINKLIB_${__prop})
882+
if(G4TESTLINKLIB_${__prop})
883+
# Filter list for internal static targets
884+
# NB: This only works assuming that the input target is an executable
885+
# If we introduce test libraries, would need same treatment as for main libraries
886+
if(BUILD_STATIC_LIBS AND NOT BUILD_SHARED_LIBS)
887+
set(_g4linklibs )
888+
foreach(_linklib ${G4TESTLINKLIB_${__prop}})
889+
# If the linklib is a G4Library, change name to "name-static"
890+
list(FIND __g4definedlibraries ${_linklib} _isg4lib)
891+
if(_isg4lib GREATER -1)
892+
list(APPEND _g4linklibs "${_linklib}-static")
893+
else()
894+
list(APPEND _g4linklibs "${_linklib}")
895+
endif()
896+
endforeach()
897+
message(STATUS "${_g4linklibs}")
898+
set(_linklibs ${_g4linklibs})
899+
else()
900+
set(_linklibs ${G4TESTLINKLIB_${__prop}})
901+
endif()
902+
903+
target_link_libraries(${_target} ${__prop} ${_linklibs})
904+
endif()
905+
endforeach()
906+
endfunction()
907+
855908
#-----------------------------------------------------------------------
856909
#-----------------------------------------------------------------------
857910
# Composition Functions
@@ -1184,6 +1237,9 @@ function(__geant4_resolve_link_libraries _list)
11841237
geant4_has_module(__is_module ${__lib})
11851238
if(__is_module)
11861239
geant4_get_module_property(__parent_lib ${__lib} PARENT_TARGET)
1240+
if(NOT __parent_lib)
1241+
message(FATAL_ERROR "Module '${__lib}' has no PARENT_TARGET set")
1242+
endif()
11871243
list(APPEND _resolved_list ${__parent_lib})
11881244
else()
11891245
list(APPEND _resolved_list ${__lib})

cmake/Modules/G4InterfaceOptions.cmake

+9-20
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ if(GEANT4_USE_INVENTOR_QT AND NOT GEANT4_USE_QT)
6464
set(GEANT4_USE_QT ON CACHE BOOL "Build Geant4 with Qt support" FORCE)
6565
message(STATUS "Forcing GEANT4_USE_QT to ON, required by selection of GEANT4_USE_INVENTOR_QT as ON")
6666
endif()
67-
set(GEANT4_USE_TOOLSSG_QT_GLES ${GEANT4_USE_QT})
68-
set(GEANT4_USE_TOOLSSG_QT_ZB ${GEANT4_USE_QT})
6967

7068
# TEMPORARY for 11.2 Beta Development
7169
# Decision still required on whether to allow selection of 5/6 in production
@@ -76,15 +74,15 @@ mark_as_advanced(GEANT4_USE_QT_QT6)
7674
option(GEANT4_USE_VTK "Build Geant4 with VTK visualisation" OFF)
7775
if(GEANT4_USE_VTK)
7876
find_package(VTK 9 REQUIRED COMPONENTS
79-
CommonColor
80-
InteractionStyle
81-
IOExport
82-
IOGeometry
83-
IOLegacy
84-
IOPLY
85-
GUISupportQt
86-
RenderingVolumeOpenGL2
87-
)
77+
CommonColor
78+
InteractionStyle
79+
IOExport
80+
IOGeometry
81+
IOLegacy
82+
IOPLY
83+
GUISupportQt
84+
RenderingVolumeOpenGL2
85+
)
8886
geant4_save_package_variables(VTK VTK_DIR)
8987
endif()
9088
geant4_add_feature(GEANT4_USE_VTK "Using VTK for visualisation")
@@ -100,19 +98,13 @@ if(UNIX)
10098
set(GEANT4_USE_XM ON CACHE BOOL "Build Geant4 with Motif (X11) support" FORCE)
10199
message(STATUS "Forcing GEANT4_USE_XM to ON, required by Inventor driver")
102100
endif()
103-
set(GEANT4_USE_TOOLSSG_XT_GLES ${GEANT4_USE_XM})
104-
set(GEANT4_USE_TOOLSSG_XT_ZB ${GEANT4_USE_XM})
105101
geant4_add_feature(GEANT4_USE_XM "Build Geant4 with Xm Support")
106102

107103
# - OpenGL/X11 Vis Driver
108104
# Selection also enables ToolsSG driver X11 backend
109105
option(GEANT4_USE_OPENGL_X11 "Build Geant4 OpenGL driver with X11 support" OFF)
110-
set(GEANT4_USE_TOOLSSG_X11_GLES ${GEANT4_USE_OPENGL_X11})
111106
geant4_add_feature(GEANT4_USE_OPENGL_X11 "Build Geant4 OpenGL driver with X11 support")
112107

113-
# tools/zb X11 Vis Driver
114-
set(GEANT4_USE_TOOLSSG_X11_ZB ${X11_FOUND})
115-
116108
# RayTracer driver with X11 support
117109
option(GEANT4_USE_RAYTRACER_X11 "Build RayTracer driver with X11 support" OFF)
118110
geant4_add_feature(GEANT4_USE_RAYTRACER_X11 "Build RayTracer driver with X11 support")
@@ -121,10 +113,7 @@ endif()
121113
# Windows only
122114
if(WIN32)
123115
option(GEANT4_USE_OPENGL_WIN32 "Build OpenGL driver with Win32 support" OFF)
124-
set(GEANT4_USE_TOOLSSG_WINDOWS_GLES ${GEANT4_USE_OPENGL_WIN32})
125116
geant4_add_feature(GEANT4_USE_OPENGL_WIN32 "Build OpenGL driver with Win32 support")
126-
127-
set(GEANT4_USE_TOOLSSG_WINDOWS_ZB ON)
128117
endif()
129118

130119
#-----------------------------------------------------------------------

0 commit comments

Comments
 (0)