Skip to content

Commit

Permalink
Import Geant4 11.3.0.beta source tree
Browse files Browse the repository at this point in the history
  • Loading branch information
gcosmo committed Jun 28, 2024
1 parent f7b2387 commit e58e650
Show file tree
Hide file tree
Showing 5,232 changed files with 232,576 additions and 237,520 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 0 additions & 1 deletion .gitlab/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@
/examples/extended/parallel/MPI/exMPI04/ @ihrivnac
/examples/extended/parallel/TBB/ @jmadsen @ihrivnac
/examples/extended/parallel/ThreadsafeScorers/ @jmadsen @ihrivnac
/examples/extended/parallel/TopC/ @cooperma @ihrivnac

/examples/extended/parameterisations/gflash/ @mverderi @ihrivnac
/examples/extended/parameterisations/Par01/ @mverderi @ihrivnac
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ project(Geant4
DESCRIPTION "C++ toolkit for simulating the passage of particles through matter"
HOMEPAGE_URL "https://geant4.cern.ch")
set(${PROJECT_NAME}_VERSION_MAJOR 11)
set(${PROJECT_NAME}_VERSION_MINOR 2)
set(${PROJECT_NAME}_VERSION_PATCH 2)
set(${PROJECT_NAME}_VERSION_MINOR 3)
set(${PROJECT_NAME}_VERSION_PATCH 0)
set(${PROJECT_NAME}_VERSION "${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}.${${PROJECT_NAME}_VERSION_PATCH}")

# - Prepend our own CMake Modules to the search path
Expand Down
740 changes: 740 additions & 0 deletions ReleaseNotes/Beta4.11.3-1.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ReleaseNotes/Patch.11.2-1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ List of fixes included in this public patch since the public release 11.2.0:
+ dna
o G4DNABornAngle: fixed numerical problem; added protection for cosTheta;
use relativistic formula for maximum energy transfer to delta-electrons.
+ loweneegy
+ lowenergy
o G4MicroElecInelasticModel_new: fixed Coverity report for memory leak at
exit. Minor code cleanup.
o G4MicroElecLOPhononModel: minor code cleanup.
Expand Down
58 changes: 48 additions & 10 deletions cmake/History
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,82 @@ It must **not** be used as a substitute for writing good git commit messages!

-------------------------------------------------------------------------------

## 2024-06-07 Ben Morgan (cmake-V11-01-33)
## 2024-06-07 Ben Morgan (cmake-V11-02-18)
- Add optional install of new URRPT data model
- Fixes Issue #217

## 2024-06-04 Ben Morgan (cmake-V11-02-17)
- Do not export HDF5 version to Geant4Config
- Fixes Issue #214

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

## 2024-03-26 Ben Morgan
## 2024-05-17 Ben Morgan (cmake-V11-02-15)
- Add optional install of new NuDEXLib data model

## 2024-05-09 Ben Morgan (cmake-V11-02-14)
- Provide CMake function to assist in linking unit tests to final libraries
given required source code modules.

## 2024-05-08 Ben Morgan (cmake-V11-02-13)
- Remove configuration/setup of TiMemory in Geant4.

## 2024-05-03 Ben Morgan (cmake-V11-02-12)
- Introduce new `FullRelWithDebInfo` build mode.
- Essentially `-O3 -g`, so maximum optimization with debugging symbols
- Intended to help diagnose FPE exceptions on Alma9/gcc13/c++20 and future
proof against similar
- Remove obsolete `Maintainer` build mode that is nothing more than `Debug`

## 2024-04-30 Ben Morgan (cmake-V11-02-11)
- Simplifications to Geant4Config.cmake
- Remove obsolete and never run "whole archive" linking of G4physics_lists
- Replace TOOLSSG vis driver variables that are just synonyms for more
fundamental config options (e.g. GEANT4_USE_QT) with the underlying
variable.

## 2024-03-26 Ben Morgan (cmake-V11-02-10)
- Disable use of FindPythia6 outside of internal Geant4 examples.

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

## 2024-04-08 Guilherme Amadio
## 2024-04-17 Ben Morgan (cmake-V11-02-08)
- Bump G4EMLOW dataset to v8.6

## 2024-04-08 Guilherme Amadio (cmake-V11-02-07)
- Fix also find_package(SoXt) and find_package(SoWin)

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

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

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

## 2024-01-29 Ben Morgan (cmake-V11-01-32)
## 2024-03-06 Ben Morgan (cmake-V11-02-03)
- Bump G4PARTICLEXS dataset to v4.1

## 2024-01-29 Ben Morgan (cmake-V11-02-02)
- Manually check versions of found SoXX packages to workaround their use of
the `ExactVersionOnly` version checking strategy in find_package. Geant4
only requires a minimum version.

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

## 2024-01-19 Ben Morgan (cmake-V11-02-00)
- Add compiler flags for GCC only to help detect/debug LTO-related problems when
building with CMAKE_INTERPROCEDURAL_OPTIMIZATION.

## 2023-11-28 Ben Morgan (cmake-V11-01-30)
- Bump minimum VecGeom version to 1.2.6

Expand Down
33 changes: 23 additions & 10 deletions cmake/Modules/G4BuildSettings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,14 @@ set(CMAKE_CXX_FLAGS_TESTRELEASE "${CMAKE_CXX_FLAGS_TESTRELEASE_INIT}"
mark_as_advanced(CMAKE_CXX_FLAGS_TESTRELEASE)

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

#.rst:
# Compiler flags specific to these build types are set in the cache, and
Expand All @@ -117,17 +117,17 @@ mark_as_advanced(CMAKE_CXX_FLAGS_MAINTAINER)
#
if(NOT CMAKE_CONFIGURATION_TYPES)
# Single mode build tools like Make, Ninja,
set(__g4buildmodes "" Release TestRelease MinSizeRel Debug Debug_FPE RelWithDebInfo MinSizeRel Maintainer)
set(__g4buildmodes "" Release TestRelease MinSizeRel Debug Debug_FPE RelWithDebInfo FullRelWithDebInfo)
if(NOT CMAKE_BUILD_TYPE)
# Default to a Release build if nothing else...
set(CMAKE_BUILD_TYPE Release
CACHE STRING "Choose the type of build, options are: None Release TestRelease MinSizeRel Debug Debug_FPE RelWithDebInfo MinSizeRel Maintainer."
CACHE STRING "Choose the type of build, options are: None Release TestRelease MinSizeRel Debug Debug_FPE RelWithDebInfo FullRelWithDebInfo."
FORCE
)
else()
# Force to the cache, but use existing value.
set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}"
CACHE STRING "Choose the type of build, options are: None Release TestRelease MinSizeRel Debug Debug_FPE RelWithDebInfo MinSizeRel Maintainer."
CACHE STRING "Choose the type of build, options are: None Release TestRelease MinSizeRel Debug Debug_FPE RelWithDebInfo FullRelWithDebInfo."
FORCE
)
endif()
Expand All @@ -136,7 +136,7 @@ else()
# Multimode tools like VS, Xcode
list(APPEND CMAKE_CONFIGURATION_TYPES Debug_FPE)
list(APPEND CMAKE_CONFIGURATION_TYPES TestRelease)
list(APPEND CMAKE_CONFIGURATION_TYPES Maintainer)
list(APPEND CMAKE_CONFIGURATION_TYPES FullRelWithDebInfo)
list(REMOVE_DUPLICATES CMAKE_CONFIGURATION_TYPES)
set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}"
CACHE STRING "Geant4 configurations for multimode build tools"
Expand Down Expand Up @@ -365,6 +365,19 @@ if(GEANT4_BUILD_MULTITHREADED)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GEANT4_MULTITHREADED_CXX_FLAGS}")
endif()

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

#-----------------------------------------------------------------------
# Physics
#-----------------------------------------------------------------------
Expand Down
38 changes: 33 additions & 5 deletions cmake/Modules/G4DatasetDefinitions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ geant4_add_dataset(
# - Low energy electromagnetics
geant4_add_dataset(
NAME G4EMLOW
VERSION 8.5
VERSION 8.6
FILENAME G4EMLOW
EXTENSION tar.gz
ENVVAR G4LEDATA
MD5SUM 146d0625d8d39f294056e1618271bc46
MD5SUM 080576674061a0649629649879655bb9
)

# - Photon evaporation
Expand All @@ -48,11 +48,11 @@ geant4_add_dataset(
# - Particle XS - replaces Neutron XS
geant4_add_dataset(
NAME G4PARTICLEXS
VERSION 4.0
VERSION 4.1
FILENAME G4PARTICLEXS
EXTENSION tar.gz
ENVVAR G4PARTICLEXSDATA
MD5SUM d82a4d171d50f55864e28b6cd6f433c0
MD5SUM 878252a464ba6b38f085741840f053e6
)

# - PII
Expand Down Expand Up @@ -115,7 +115,7 @@ geant4_add_dataset(
ENVVAR G4ENSDFSTATEDATA
MD5SUM 6f18fce8f217e7aaeaa3711be9b2c7bf
)

# - TENDL
option(GEANT4_INSTALL_DATASETS_TENDL "Install optional TENDL dataset" OFF)
mark_as_advanced(GEANT4_INSTALL_DATASETS_TENDL)
Expand All @@ -129,6 +129,34 @@ if(GEANT4_INSTALL_DATASETS_TENDL)
ENVVAR G4PARTICLEHPDATA
MD5SUM ab17a1eec5ad4c8fcfafcfbc0de30ed8
)
endif()

# - NuDEX
option(GEANT4_INSTALL_DATASETS_NUDEXLIB "Install optional NuDEXLib dataset" OFF)
mark_as_advanced(GEANT4_INSTALL_DATASETS_NUDEXLIB)

if(GEANT4_INSTALL_DATASETS_NUDEXLIB)
geant4_add_dataset(
NAME G4NUDEXLIB
VERSION 1.0
FILENAME G4NUDEXLIB
EXTENSION tar.gz
ENVVAR G4NUDEXLIBDATA
MD5SUM 09a85f907d2282dbf234d1784f436db3
)
endif()

# - G4URRPT
option(GEANT4_INSTALL_DATASETS_URRPT "Install optional URRPT dataset" OFF)
mark_as_advanced(GEANT4_INSTALL_DATASETS_URRPT)

if(GEANT4_INSTALL_DATASETS_URRPT)
geant4_add_dataset(
NAME G4URRPT
VERSION 1.0
FILENAME G4URRPT
EXTENSION tar.gz
ENVVAR G4URRPTDATA
MD5SUM acc94698e4199455b4fac33c3384ccb4
)
endif()
56 changes: 56 additions & 0 deletions cmake/Modules/G4DeveloperAPI.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,59 @@ function(geant4_get_external_categories _result)
set(${_result} ${__tmp} PARENT_SCOPE)
endfunction()

#-----------------------------------------------------------------------
#-----------------------------------------------------------------------
#.rst:
# Test Program Commands
# ^^^^^^^^^^^^^^^^^^^^^
# .. cmake:command:: geant4_test_link_libraries
#
# .. code-block:: cmake
#
# geant4_test_link_libraries(<target>
# [PUBLIC pub1 [pub2 ...]
# [PRIVATE pri1 [pri2 ...]
# [INTERFACE int1 [int2 ...])
function(geant4_test_link_libraries _target)
cmake_parse_arguments(G4TESTLINKLIB
""
""
"PUBLIC;PRIVATE;INTERFACE"
${ARGN}
)
__geant4_assert_no_unparsed_arguments(G4TESTLINKLIB geant4_test_link_libraries)

# Need defined libraries to be able to resolve between static/shared
get_property(__g4definedlibraries GLOBAL PROPERTY GEANT4_DEFINED_CATEGORIES)

foreach(__prop PUBLIC PRIVATE INTERFACE)
__geant4_resolve_link_libraries(G4TESTLINKLIB_${__prop})
if(G4TESTLINKLIB_${__prop})
# Filter list for internal static targets
# NB: This only works assuming that the input target is an executable
# If we introduce test libraries, would need same treatment as for main libraries
if(BUILD_STATIC_LIBS AND NOT BUILD_SHARED_LIBS)
set(_g4linklibs )
foreach(_linklib ${G4TESTLINKLIB_${__prop}})
# If the linklib is a G4Library, change name to "name-static"
list(FIND __g4definedlibraries ${_linklib} _isg4lib)
if(_isg4lib GREATER -1)
list(APPEND _g4linklibs "${_linklib}-static")
else()
list(APPEND _g4linklibs "${_linklib}")
endif()
endforeach()
message(STATUS "${_g4linklibs}")
set(_linklibs ${_g4linklibs})
else()
set(_linklibs ${G4TESTLINKLIB_${__prop}})
endif()

target_link_libraries(${_target} ${__prop} ${_linklibs})
endif()
endforeach()
endfunction()

#-----------------------------------------------------------------------
#-----------------------------------------------------------------------
# Composition Functions
Expand Down Expand Up @@ -1184,6 +1237,9 @@ function(__geant4_resolve_link_libraries _list)
geant4_has_module(__is_module ${__lib})
if(__is_module)
geant4_get_module_property(__parent_lib ${__lib} PARENT_TARGET)
if(NOT __parent_lib)
message(FATAL_ERROR "Module '${__lib}' has no PARENT_TARGET set")
endif()
list(APPEND _resolved_list ${__parent_lib})
else()
list(APPEND _resolved_list ${__lib})
Expand Down
29 changes: 9 additions & 20 deletions cmake/Modules/G4InterfaceOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ if(GEANT4_USE_INVENTOR_QT AND NOT GEANT4_USE_QT)
set(GEANT4_USE_QT ON CACHE BOOL "Build Geant4 with Qt support" FORCE)
message(STATUS "Forcing GEANT4_USE_QT to ON, required by selection of GEANT4_USE_INVENTOR_QT as ON")
endif()
set(GEANT4_USE_TOOLSSG_QT_GLES ${GEANT4_USE_QT})
set(GEANT4_USE_TOOLSSG_QT_ZB ${GEANT4_USE_QT})

# TEMPORARY for 11.2 Beta Development
# Decision still required on whether to allow selection of 5/6 in production
Expand All @@ -76,15 +74,15 @@ mark_as_advanced(GEANT4_USE_QT_QT6)
option(GEANT4_USE_VTK "Build Geant4 with VTK visualisation" OFF)
if(GEANT4_USE_VTK)
find_package(VTK 9 REQUIRED COMPONENTS
CommonColor
InteractionStyle
IOExport
IOGeometry
IOLegacy
IOPLY
GUISupportQt
RenderingVolumeOpenGL2
)
CommonColor
InteractionStyle
IOExport
IOGeometry
IOLegacy
IOPLY
GUISupportQt
RenderingVolumeOpenGL2
)
geant4_save_package_variables(VTK VTK_DIR)
endif()
geant4_add_feature(GEANT4_USE_VTK "Using VTK for visualisation")
Expand All @@ -100,19 +98,13 @@ if(UNIX)
set(GEANT4_USE_XM ON CACHE BOOL "Build Geant4 with Motif (X11) support" FORCE)
message(STATUS "Forcing GEANT4_USE_XM to ON, required by Inventor driver")
endif()
set(GEANT4_USE_TOOLSSG_XT_GLES ${GEANT4_USE_XM})
set(GEANT4_USE_TOOLSSG_XT_ZB ${GEANT4_USE_XM})
geant4_add_feature(GEANT4_USE_XM "Build Geant4 with Xm Support")

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

# tools/zb X11 Vis Driver
set(GEANT4_USE_TOOLSSG_X11_ZB ${X11_FOUND})

# RayTracer driver with X11 support
option(GEANT4_USE_RAYTRACER_X11 "Build RayTracer driver with X11 support" OFF)
geant4_add_feature(GEANT4_USE_RAYTRACER_X11 "Build RayTracer driver with X11 support")
Expand All @@ -121,10 +113,7 @@ endif()
# Windows only
if(WIN32)
option(GEANT4_USE_OPENGL_WIN32 "Build OpenGL driver with Win32 support" OFF)
set(GEANT4_USE_TOOLSSG_WINDOWS_GLES ${GEANT4_USE_OPENGL_WIN32})
geant4_add_feature(GEANT4_USE_OPENGL_WIN32 "Build OpenGL driver with Win32 support")

set(GEANT4_USE_TOOLSSG_WINDOWS_ZB ON)
endif()

#-----------------------------------------------------------------------
Expand Down
Loading

0 comments on commit e58e650

Please sign in to comment.