Skip to content

Commit

Permalink
Import Geant4 10.5.0.beta source tree
Browse files Browse the repository at this point in the history
  • Loading branch information
gcosmo committed Jun 29, 2018
1 parent fe81a77 commit 6aa23be
Show file tree
Hide file tree
Showing 1,581 changed files with 114,929 additions and 74,399 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# 21st September 2010 Ben Morgan
#
# $Id: CMakeLists.txt 110078 2018-05-15 10:04:54Z gcosmo $
# $Id: CMakeLists.txt 110849 2018-06-20 06:36:08Z gcosmo $
#

#-----------------------------------------------------------------------
Expand Down Expand Up @@ -37,8 +37,8 @@ set(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX
# the same form.
project(Geant4)
set(${PROJECT_NAME}_VERSION_MAJOR 10)
set(${PROJECT_NAME}_VERSION_MINOR 4)
set(${PROJECT_NAME}_VERSION_PATCH 2)
set(${PROJECT_NAME}_VERSION_MINOR 5)
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
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
The Geant4 Collaboration:
http://geant4.cern.ch/collaboration/members.shtml
http://cern.ch/geant4/collaboration/members
1 change: 0 additions & 1 deletion README.md

This file was deleted.

952 changes: 952 additions & 0 deletions ReleaseNotes/Beta4.10.5-1.txt

Large diffs are not rendered by default.

64 changes: 58 additions & 6 deletions cmake/History
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,77 @@ add this in the documentation for the changed file as [BUGFIX #BUGNUMBER].

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

23rd May 2018 - Gunter Folger (cmake-V10-03-54)
19th June 2018 - Gunter Folger (cmake-V10-04-14)
- Templates/geant4_validate_sources.cmake.in, revert addition of .c and .h
Skip checking sources for zlib
(.c and .h match far too many other files)
- Switch to G4EMLOW7.4

14th June 2018 - Gunter Folger (cmake-V10-04-13)
- Templates/geant4_validate_sources.cmake.in: add C sources and headers

8th June 2018 - Ben Morgan (cmake-V10-04-12)
- Add "auto" dummy Thread Local Storage model
Per request from CERN, when "auto" is used,
no explicit compiler flag to select the TLS model is
set. Record this in Geant4Config.cmake and geant4-config
as unset/empty variables.

6th Jun 2018 - Jonathan Madsen (cmake-V10-04-11)
- Addition of TiMemory as an optional package

23rd May 2018 - Ben Morgan (cmake-V10-04-10)
- Remove CMake warning about building MT DLLs on Windows, as
these are now supported.

23rd May 2018 - Gunter Folger (cmake-V10-04-09)
- Update Geant4DatasetDefinitions to use G4RealSurface 2.1.1
patched version bringing back data lost in 2.1

26th February 2018 - Ben Morgan (cmake-V10-03-53, 52)
14st May 2018 - Gunter Folger (cmake-V10-04-08)
- Update Geant4DatasetDefinitions to use G4NEUTRONXS 2.0

21st March 2018 - Ben Morgan (cmake-V10-04-07)
- G4BuildSettings.cmake: Allow Windows MT builds to use DLLs, but warn.

26th February 2018 - Ben Morgan (cmake-V10-04-06)
- Geant4InstallData.cmake, Geant4CTest.cmake: Update URL for downloads
to "cern.ch/geant4-data" as the correct alias to new EOS area, seperate
from main website. Superceeds cmake-V10-03-51.
from main website.

26th February 2018 - Ben Morgan (cmake-V10-03-51)
26th February 2018 - Ben Morgan (cmake-V10-04-05)
- Geant4InstallData.cmake, Geant4CTest.cmake: Update URL for downloads
to "cern.ch/geant4" as the correct alias.

26th February 2018 - Ben Morgan (cmake-V10-03-50)
26th February 2018 - Ben Morgan (cmake-V10-04-04)
- G4BuildSettings.cmake: Add 17/c++17 to C++ standards against which
Geant4 can be compiled. Will require a minimum CMake version of
3.8 to enable, but this is not checked.

8th December 2017 - Ben Morgan
20th February 2018 - Ben Morgan (cmake-V10-04-03)
- Initial configuration support for MT on Windows
- Modules/G4BuildSettings.cmake: Remove restrictions and warnings on enabling
MT on Windows. Add restriction on building MT DLLs, emitting a fatal error
if this combination is selcted, and report needed settings to enable
static MT libraries.

18th January 2018 - Ben Morgan (cmake-V10-04-02)
- Support use of WINDOWS_EXPORT_ALL_SYMBOLS for DLL builds with cmake >=3.4
retaining old capability for CMake 3.3.
- Modules/G4WindowsDLLSupport.cmake: New module to hold old DLL support.
Create old `genwindef` support program, moved from G4BuildSettings.
Implement `__geant4_add_dll_old` macro which expands to the pre cmake 3.4
use of `genwindef` to export symbols and create DLL.
- Modules/G4DeveloperAPI_OLD.cmake: Include G4WindowsDLLSupport module, and
use functionality to create DLL when CMake is <3.4. Otherwise, use
new WINDOWS_EXPORT_ALL_SYMBOLS property when building a shared library.

11th January 2018 - Gabriele Cosmo (cmake-V10-04-01)
- Modules/Geant4OptionalComponents.cmake: add TESSELLATEDSOLID flag to enable
wrapping of G4TessellatedSolid in GEANT4_USOLIDS_SHAPES.
Coworks with tag geom-specific-V10-04-03.

8th December 2017 - Ben Morgan (cmake-V10-04-00)
- Templates/UseGeant4_internal.cmake: When running test driver directly,
make it run in WORKING_DIRECTORY if this is supplied.

Expand Down
48 changes: 12 additions & 36 deletions cmake/Modules/G4BuildSettings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,9 @@ set(GEANT4_CXXSTD_FLAGS "${CMAKE_CXX${GEANT4_BUILD_CXXSTD}_STANDARD_COMPILE_OPTI
# - ``GEANT4_BUILD_MULTITHREADED`` (Default: ``OFF``)
#
# If set to ``ON``, compile Geant4 with support for multithreading.
# At present, this is only supported on Unix platforms.
# On Win32, this option requires use of static libraries only
#
option(GEANT4_BUILD_MULTITHREADED "Enable multithreading in Geant4" OFF)

if(WIN32)
mark_as_advanced(GEANT4_BUILD_MULTITHREADED)
endif()

geant4_add_feature(GEANT4_BUILD_MULTITHREADED "Build multithread enabled libraries")

#.rst:
Expand All @@ -233,8 +228,10 @@ geant4_add_feature(GEANT4_BUILD_MULTITHREADED "Build multithread enabled librari
# If ``GEANT4_BUILD_MULTITHREADED`` is ``ON`` and a GNU/Clang/Intel
# compiler is being used, then this option may be used to choose the
# Thread Local Storage model. A default of ``initial-exec`` is used
# to provide optimize performance for applications directly linking
# to the Geant4 libraries
# to provide optimal performance for applications directly linking
# to the Geant4 libraries. The dummy ``auto`` model may be selected
# to leave model selection to the compiler, with no additional flag(s)
# passed to the compiler.
#
if(GEANT4_BUILD_MULTITHREADED)
# - Need Thread Local Storage support (POSIX)
Expand All @@ -245,12 +242,6 @@ if(GEANT4_BUILD_MULTITHREADED)
endif()
endif()

# - Emit warning on Windows - message will format oddly on CMake prior
# to 2.8, but still print
if(WIN32)
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)
Expand All @@ -260,9 +251,14 @@ if(GEANT4_BUILD_MULTITHREADED)
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}")
if(GEANT4_BUILD_TLS_MODEL STREQUAL "auto")
geant4_add_feature(GEANT4_BUILD_TLS_MODEL "Building without explicit TLS model")
else()
geant4_add_feature(GEANT4_BUILD_TLS_MODEL "Building with TLS model '${GEANT4_BUILD_TLS_MODEL}'")
endif()

set(GEANT4_MULTITHREADED_CXX_FLAGS "${GEANT4_MULTITHREADED_CXX_FLAGS} ${${GEANT4_BUILD_TLS_MODEL}_TLSMODEL_FLAGS}")
endif()

# Set Defs/Compiler Flags
Expand Down Expand Up @@ -349,8 +345,6 @@ endif()
# Library Mode and Link Options
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#

#.rst:
# - ``BUILD_SHARED_LIBS`` (Default: ``ON``)
#
# - Build shared libraries (`.so` on Unix, `.dylib` on macOS, `.dll/.lib` on Windows)
Expand Down Expand Up @@ -378,24 +372,6 @@ if(GEANT4_BUILD_GRANULAR_LIBS)
message(FATAL_ERROR " Granular libraries are no longer supported!")
endif()

# On WIN32, we need to build the genwindef application to create export
# def files for building DLLs.
# We only use it as a helper application at the moment so we exclude it from
# the ALL target.
# TODO: We could move this section into the Geant4MacroLibraryTargets.cmake
# if it can be protected so that the genwindef target wouldn't be defined
# more than once... Put it here for now...
# TODO: Investigate use of CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS from CMake 3.4
# and/or other forms of symbol visibility
if(WIN32)
# Assume the sources are co-located
get_filename_component(_genwindef_src_dir ${CMAKE_CURRENT_LIST_FILE} PATH)
add_executable(genwindef EXCLUDE_FROM_ALL
${_genwindef_src_dir}/genwindef/genwindef.cpp
${_genwindef_src_dir}/genwindef/LibSymbolInfo.h
${_genwindef_src_dir}/genwindef/LibSymbolInfo.cpp)
endif()

#------------------------------------------------------------------------
#.rst:
# Build Output Directories
Expand Down
63 changes: 13 additions & 50 deletions cmake/Modules/G4DeveloperAPI_OLD.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ endif()

# - Needed CMake modules
include(CMakeParseArguments)
include(G4WindowsDLLSupport)

#-----------------------------------------------------------------------
#.rst:
Expand Down Expand Up @@ -246,60 +247,23 @@ macro(geant4_library_target)

if(BUILD_SHARED_LIBS)
# Add the shared library target and link its dependencies
# WIN32 first
if(WIN32)
# We have to generate the def export file from an archive library.
# This is a temporary separate from a real archive library, and
# even though it's static, we need to mark that it will have
# DLL symbols via the G4LIB_BUILD_DLL macro
add_library(_${G4LIBTARGET_NAME}-archive STATIC EXCLUDE_FROM_ALL ${G4LIBTARGET_SOURCES})
set(_archive _${G4LIBTARGET_NAME}-archive)
target_compile_features(${_archive} PUBLIC ${GEANT4_TARGET_COMPILE_FEATURES})
target_compile_definitions(${_archive} PUBLIC -DG4LIB_BUILD_DLL)

# - Add the config specific compile definitions
geant4_compile_definitions_config(${_archive})

# - Create the .def file for this library
# Use generator expressions to get path to per-mode lib and
# older CMAKE_CFG_INTDIR variable to set name of per-mode def
# file (Needed as generator expressions cannot be used in argument
# to OUTPUT...
add_custom_command(OUTPUT _${G4LIBTARGET_NAME}-${CMAKE_CFG_INTDIR}.def
COMMAND genwindef -o _${G4LIBTARGET_NAME}-${CMAKE_CFG_INTDIR}.def -l ${G4LIBTARGET_NAME} $<TARGET_FILE:${_archive}>
DEPENDS ${_archive} genwindef)

# - Now we can build the DLL
# We create it from a dummy empty C++ file plus the def file.
# Also set the public compile definition on it so that clients
# will set correct macro automatically.
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/_${G4LIBTARGET_NAME}.cpp
"// empty _${G4LIBTARGET_NAME}.cpp\n")

add_library(${G4LIBTARGET_NAME} SHARED _${G4LIBTARGET_NAME}.cpp
_${G4LIBTARGET_NAME}-${CMAKE_CFG_INTDIR}.def)
target_compile_definitions(${G4LIBTARGET_NAME} PUBLIC -DG4LIB_BUILD_DLL)
target_compile_features(${G4LIBTARGET_NAME} PUBLIC ${GEANT4_TARGET_COMPILE_FEATURES})

# - Link the DLL.
# We link it to the archive, and the supplied libraries,
# but then remove the archive from the LINK_INTERFACE.
target_link_libraries(${G4LIBTARGET_NAME}
${_archive}
${G4LIBTARGET_GEANT4_LINK_LIBRARIES}
${G4LIBTARGET_LINK_LIBRARIES})

set_target_properties(${G4LIBTARGET_NAME}
PROPERTIES INTERFACE_LINK_LIBRARIES "${G4LIBTARGET_GEANT4_LINK_LIBRARIES};${G4LIBTARGET_LINK_LIBRARIES}")

# WIN32/CMake<3.4 workaround
if(WIN32 AND (CMAKE_VERSION VERSION_LESS 3.4))
__geant4_add_dll_old(${ARGV})
else()
# - We build a Shared library in the usual fashion...
# - Common shared lib commands
add_library(${G4LIBTARGET_NAME} SHARED ${G4LIBTARGET_SOURCES})
geant4_compile_definitions_config(${G4LIBTARGET_NAME})
target_compile_features(${G4LIBTARGET_NAME} PUBLIC ${GEANT4_TARGET_COMPILE_FEATURES})
target_link_libraries(${G4LIBTARGET_NAME}
${G4LIBTARGET_GEANT4_LINK_LIBRARIES}
${G4LIBTARGET_LINK_LIBRARIES})
# DLL support, portable to all platforms
# G4LIB_BUILD_DLL is public as despite the name it indicates the shared/archive mode
# and clients must apply it when linking to the shared libs. The global
# category handles the exact import/export statements
target_compile_definitions(${G4LIBTARGET_NAME} PUBLIC G4LIB_BUILD_DLL)
set_target_properties(${G4LIBTARGET_NAME} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)
endif()

# This property is set to prevent concurrent builds of static and
Expand Down Expand Up @@ -365,9 +329,8 @@ macro(geant4_library_target)
${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...
# On WIN32 we *retain* the -static postfix to avoid name clashes
# with the DLL import lib.
if(NOT WIN32)
set_target_properties(${G4LIBTARGET_NAME}-static
PROPERTIES OUTPUT_NAME ${G4LIBTARGET_NAME})
Expand Down
Loading

0 comments on commit 6aa23be

Please sign in to comment.