Skip to content

Commit

Permalink
Import Geant4 11.3.0 source tree
Browse files Browse the repository at this point in the history
  • Loading branch information
gcosmo committed Dec 6, 2024
1 parent e58e650 commit 32390e8
Show file tree
Hide file tree
Showing 1,984 changed files with 93,976 additions and 79,259 deletions.
9 changes: 5 additions & 4 deletions ReleaseNotes/Beta4.11.3-1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,11 @@ List of features and fixes included in this Beta release since 11.2.p02:
o Minor cleanup in QSS classes.
+ management:
o Added new capability to run voxel optimisation in threads in MT mode.
Parallelises only over volumes. The user must currently call
G4GeometryManager::RequestParallelOptimisation(optimise, verbose) to
use it. Set 'verbose=true' to obtain statistics on the volumes with
biggest contribution to memory size and CPU time for voxelisation.
Parallelises only over volumes. The user can call the method
RequestParallelOptimisation(optimise, verbose) from G4GeometryManager
to turn it on/off. Set 'verbose=true' to obtain statistics on the
volumes with biggest contribution to memory size and CPU time for
voxelisation.
New method BuildOptimisationsParallel() can be called by
G4WorkerRunManager to initialise. New method ReportVoxelInfo() to
write out for verification. Checked with simple and complex/large
Expand Down
2,424 changes: 2,424 additions & 0 deletions ReleaseNotes/ReleaseNotes.11.3.html

Large diffs are not rendered by default.

55 changes: 55 additions & 0 deletions cmake/History
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,61 @@ It must **not** be used as a substitute for writing good git commit messages!

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

## 2024-11-25 Ben Morgan (cmake-V11-02-30)
- Bump RadioactiveDecay dataset version to 6.1.2
- Fixes Issue #237

## 2024-11-19 Ben Morgan (cmake-V11-02-29)
- Bump RadioactiveDecay dataset version to 6.1.1

## 2024-11-08 Ben Morgan (cmake-V11-02-28)
- Bump dataset versions:
- PhotonEvaporation 6.1
- RadioactiveDecay 6.1
- Fixes Issue 234

## 2024-10-30 Ben Morgan (cmake-V11-02-27)
- Ensure sanitizer flags are forwarded to the linker when using Xcode, and all
linker flags are forwarded to builds of tests done by geant4_add_test.
- Fixes Issue #227

## 2024-10-02 Ben Morgan (cmake-V11-02-26)
- Bump URRPT dataset version to 1.1
- Fixes Issue #228

## 2024-09-25 Ben Morgan (cmake-V11-02-25)
- Default GEANT4_INSTALL_PACKAGE_CACHE to OFF
- This file is highly unstable on macOS and SPack installs, and causes more problems
for most users than it solves.

## 2024-09-24 Ben Morgan (cmake-V11-02-24)
- Support running example build-and-run tests in Xcode
- Part of Issue #227

## 2024-09-23 Gunter Folger (cmake-V11-02-23)
- Bump dataset version:
- RadioactiveDecay 6.0.1
- Fixes Issue #226

## 2024-09-19 Ben Morgan (cmake-V11-02-22)
- Bump dataset versions:
- G4ENSDFSTATE 3.0
- PhotonEvaporation 6.0
- RadioactiveDecay 6.0
- Fixes Issue #224

## 2024-08-28 Ben Morgan (cmake-V11-02-21)
- Bump G4EMLOW dataset version to 8.6.1

## 2024-08-27 Ben Morgan (cmake-V11-02-20)
- Add new G4CHANNELING dataset to support channeling physics processes/models.

## 2024-06-24 Ben Morgan (cmake-V11-02-19)
- Simplify CMake/CTest functions and settings
- Move geant4_add_test function to dedicated module, retiring "UseGeant4_internal"
file
- Reduce oversetting of Geant4_DIR variable for use by tests

## 2024-06-07 Ben Morgan (cmake-V11-02-18)
- Add optional install of new URRPT data model
- Fixes Issue #217
Expand Down
9 changes: 8 additions & 1 deletion cmake/Modules/G4BuildSettings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,14 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|.*Clang")
# Add flags - longer term, make compile/link options
# frame pointer flag to get more meaningful stack traces
# May need others for better/reliable output
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer -fsanitize=${GEANT4_BUILD_SANITIZER}")
set(__geant4_sanitizer_flags "-fno-omit-frame-pointer -fsanitize=${GEANT4_BUILD_SANITIZER}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${__geant4_sanitizer_flags}")
# Xcode does not forward CXX_FLAGS to the linker, and sanitizer link flags need propagating to final
# link steps
if(CMAKE_GENERATOR MATCHES Xcode)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${__geant4_sanitizer_flags}")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${__geant4_sanitizer_flags}")
endif()

geant4_add_feature(GEANT4_BUILD_SANITIZER "Compiling/linking with sanitizer '${GEANT4_BUILD_SANITIZER}'")
endif()
Expand Down
18 changes: 9 additions & 9 deletions cmake/Modules/G4CTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,15 @@ if(GEANT4_ENABLE_TESTING)
# - Core CTest
enable_testing()
include(CTest)
include(G4TestAPI)

# - Geant4_DIR is needed to locate GeantConfig.cmake file required
# by tests and examples
set(Geant4_DIR ${PROJECT_BINARY_DIR} CACHE PATH "Current build directory")
# for tests and examples that are built as direct subprojects
# (as opposed to "build-and-test" type situations)
set(Geant4_DIR ${PROJECT_BINARY_DIR})

# - Base URL for test reference files
set(GEANT4_TEST_REFERENCES_URL "http://cern.ch/geant4-data/stt/references/")

# - Add datasets to testing environment
geant4_get_datasetnames(_dslist)
Expand All @@ -27,18 +32,13 @@ if(GEANT4_ENABLE_TESTING)
list(APPEND GEANT4_TEST_ENVIRONMENT ${_dsenvvar}=${_dspath})
endforeach()

# - Add base URL for test reference files
set(GEANT4_TEST_REFERENCES_URL "http://cern.ch/geant4-data/stt/references/" CACHE
STRING "base URL for test reference files")
mark_as_advanced(GEANT4_TEST_REFERENCES_URL)

# - Add TOOLS_FONT_PATH if freetype enabled
# - Add TOOLS_FONT_PATH to testing environment if required
if(GEANT4_USE_FREETYPE)
list(APPEND GEANT4_TEST_ENVIRONMENT TOOLS_FONT_PATH=${PROJECT_SOURCE_DIR}/source/externals/g4tools/fonts)
endif()

# - Configure 'G4RunManagerFactory::CreateRunManager(G4RunManagerType::Default)'
# to use TBB
# to use TBB if required
if(GEANT4_BUILD_MULTITHREADED AND GEANT4_USE_TBB)
list(APPEND GEANT4_TEST_ENVIRONMENT G4RUN_MANAGER_TYPE=TBB)
endif()
Expand Down
11 changes: 3 additions & 8 deletions cmake/Modules/G4ConfigureCMakeHelpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,6 @@ configure_file(
COPYONLY
)

configure_file(
${PROJECT_SOURCE_DIR}/cmake/Templates/UseGeant4_internal.cmake
${PROJECT_BINARY_DIR}/UseGeant4_internal.cmake
COPYONLY
)

#-----------------------------------------------------------------------
# - Generate Install Tree Configuration Files
#-----------------------------------------------------------------------
Expand Down Expand Up @@ -272,8 +266,9 @@ install(FILES
COMPONENT Development
)

# Install the package settings file if required (always for now)
option(GEANT4_INSTALL_PACKAGE_CACHE "Install file recording build-time locations of required packages" ON)
# Install the package settings file if required
# Default to OFF because it's a hand-holding solution that hinders more than helps.
option(GEANT4_INSTALL_PACKAGE_CACHE "Install file recording build-time locations of required packages" OFF)
mark_as_advanced(GEANT4_INSTALL_PACKAGE_CACHE)
if(GEANT4_INSTALL_PACKAGE_CACHE)
install(FILES ${PROJECT_BINARY_DIR}/Geant4PackageCache.cmake
Expand Down
30 changes: 20 additions & 10 deletions cmake/Modules/G4DatasetDefinitions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,31 @@ geant4_add_dataset(
# - Low energy electromagnetics
geant4_add_dataset(
NAME G4EMLOW
VERSION 8.6
VERSION 8.6.1
FILENAME G4EMLOW
EXTENSION tar.gz
ENVVAR G4LEDATA
MD5SUM 080576674061a0649629649879655bb9
MD5SUM 9db67a37acc3eae9b0ffdace41a23b74
)

# - Photon evaporation
geant4_add_dataset(
NAME PhotonEvaporation
VERSION 5.7
VERSION 6.1
FILENAME G4PhotonEvaporation
EXTENSION tar.gz
ENVVAR G4LEVELGAMMADATA
MD5SUM 81ff27deb23af4aa225423e6b3a06b39
MD5SUM 92d68b937cdad0fd49892a66878863de
)

# - Radioisotopes
geant4_add_dataset(
NAME RadioactiveDecay
VERSION 5.6
VERSION 6.1.2
FILENAME G4RadioactiveDecay
EXTENSION tar.gz
ENVVAR G4RADIOACTIVEDATA
MD5SUM acc1dbeb87b6b708b2874ced729a3a8f
MD5SUM 20d494f73d4bddabd7fab5c06a58895c
)

# - Particle XS - replaces Neutron XS
Expand Down Expand Up @@ -109,11 +109,21 @@ geant4_add_dataset(
# - ENSDFSTATE
geant4_add_dataset(
NAME G4ENSDFSTATE
VERSION 2.3
VERSION 3.0
FILENAME G4ENSDFSTATE
EXTENSION tar.gz
ENVVAR G4ENSDFSTATEDATA
MD5SUM 6f18fce8f217e7aaeaa3711be9b2c7bf
MD5SUM c500728534ce3e9fb2fefa0112eb3a74
)

# - Channeling
geant4_add_dataset(
NAME G4CHANNELING
VERSION 1.0
FILENAME G4CHANNELING
EXTENSION tar.gz
ENVVAR G4CHANNELINGDATA
MD5SUM b2f692ec7109418c6354ea1ecbc62da7
)

# - TENDL
Expand Down Expand Up @@ -153,10 +163,10 @@ mark_as_advanced(GEANT4_INSTALL_DATASETS_URRPT)
if(GEANT4_INSTALL_DATASETS_URRPT)
geant4_add_dataset(
NAME G4URRPT
VERSION 1.0
VERSION 1.1
FILENAME G4URRPT
EXTENSION tar.gz
ENVVAR G4URRPTDATA
MD5SUM acc94698e4199455b4fac33c3384ccb4
MD5SUM ec9a2acb0745c8bfb6365ca3434bd3b8
)
endif()
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
# - Internal Use file for Geant4
# This file is designed for inclusion by the UseGeant4.cmake file, but
# only in the build tree. It contains functions and macros that are only
# intended to help in building the Geant4 tests.
#
# IT SHOULD NOT BE INSTALLED!

#-----------------------------------------------------------------------
# Special internal functions for building tests.
#-----------------------------------------------------------------------
Expand All @@ -23,11 +16,6 @@
# [LABELS label1 label2 ...])
#
function(geant4_add_test test)
if(NOT CMAKE_PROJECT_NAME STREQUAL Geant4)
message(WARNING "geant4_add_test is only for internal Geant4 usage, test '${test}' is disabled")
return()
endif()

cmake_parse_arguments(ARG
"DEBUG"
"TIMEOUT;BUILD;OUTPUT;ERROR;SOURCE_DIR;BINARY_DIR;PROJECT;PASSREGEX;FAILREGEX;WORKING_DIRECTORY"
Expand All @@ -38,19 +26,31 @@ function(geant4_add_test test)
set(_cfg $<CONFIGURATION>/)
endif()

# ARG_BUILD is treated as "zero or one"
# zero arg: build everything
# one arg: just that target
if(ARG_BUILD OR "BUILD" IN_LIST ARG_KEYWORDS_MISSING_VALUES)
set(_is_build_test TRUE)
endif()

# COMMAND AND BUILD: split test
# - In this case, we have to create a -build and a -run test with the latter depending on the former
# NOT COMMAND AND BUILD: pure build
# COMMAND AND NOT BUILD: pure test
if(ARG_COMMAND AND ARG_BUILD)
if(ARG_COMMAND AND _is_build_test)
set(_is_split_test TRUE)
endif()

# Supplying a PROJECT argument is now a deprecation warning and will be removed
if(ARG_PROJECT)
message(WARNING "Test '${test}' uses the deprecated 'PROJECT' argument to 'geant4_add_test'. This argument is obsolete")
endif()

#- Handle COMMAND argument
list(LENGTH ARG_COMMAND _len)
if(_len LESS 1)
if(NOT ARG_BUILD)
message(FATAL_ERROR "GEANT4_ADD_TEST: command is mandatory (without build)")
if(NOT _is_build_test)
message(FATAL_ERROR "geant4_add_test: COMMAND argument is mandatory when BUILD argument is not supplied")
endif()
else()
list(GET ARG_COMMAND 0 _prg)
Expand Down Expand Up @@ -125,20 +125,13 @@ function(geant4_add_test test)
set(_command ${_command} -P ${_driver})

#- Now we can actually add the test
if(ARG_BUILD)
if(_is_build_test)
if(NOT ARG_SOURCE_DIR)
set(ARG_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
endif()
if(NOT ARG_BINARY_DIR)
set(ARG_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
endif()
if(NOT ARG_PROJECT)
if(NOT PROJECT_NAME STREQUAL "Geant4")
set(ARG_PROJECT ${PROJECT_NAME})
else()
set(ARG_PROJECT ${ARG_BUILD})
endif()
endif()

set(__build_test_name "${test}")
set(__run_test_name "")
Expand All @@ -148,15 +141,18 @@ function(geant4_add_test test)
set(__run_test_name "${test}")
endif()

if(ARG_BUILD)
set(__build_argument --build-target ${ARG_BUILD})
endif()

# Build part of the test
# Again, note that we scope Geant4_DIR to Geant4_BINARY_DIR so we don't accidentally pickup
# local or higher scopes
add_test(NAME ${__build_test_name} COMMAND ${CMAKE_CTEST_COMMAND}
--build-and-test ${ARG_SOURCE_DIR} ${ARG_BINARY_DIR}
--build-generator ${CMAKE_GENERATOR}
--build-makeprogram ${CMAKE_MAKE_PROGRAM}
--build-target ${ARG_BUILD}
--build-project ${ARG_PROJECT}
${__build_argument}
--build-config $<CONFIGURATION>
--build-noclean
--build-options
Expand All @@ -175,9 +171,11 @@ function(geant4_add_test test)
-DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE}
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO=${CMAKE_CXX_FLAGS_RELWITHDEBINFO}
-DCMAKE_CXX_FLAGS_FULLRELWITHDEBINFO=${CMAKE_CXX_FLAGS_FULLRELWITHDEBINFO}
-DCMAKE_EXE_LINKER_FLAGS=${CMAKE_EXE_LINKER_FLAGS}
-DCMAKE_SHARED_LINKER_FLAGS=${CMAKE_SHARED_LINKER_FLAGS}
-DCMAKE_STATIC_LINKER_FLAGS=${CMAKE_STATIC_LINKER_FLAGS}
-DCMAKE_DISABLE_FIND_PACKAGE_ROOT=$<BOOL:${CMAKE_DISABLE_FIND_PACKAGE_ROOT}>
)
set_property(TEST ${__build_test_name} PROPERTY ENVIRONMENT Geant4_DIR=${Geant4_BINARY_DIR})

# Build part of the test should have additional regex, and *must* have same labels
if(ARG_FAILREGEX)
Expand Down
8 changes: 1 addition & 7 deletions cmake/Templates/UseGeant4.cmake
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
# - Use file for Geant4
#
# Optional inclusion of internal Use file. This file can contain
# variables, functions and macros for strict internal use in Geant4,
# such as building and running validation tests.
#
include(${CMAKE_CURRENT_LIST_DIR}/UseGeant4_internal.cmake OPTIONAL)

# Add Module directory so that examples can use internal "FindXXX"
# modules. Appended to minimize any conflict with consumer project
# settings
# DEPRECATED: Only needed by certain examples
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/Modules)
Loading

0 comments on commit 32390e8

Please sign in to comment.