Skip to content

Commit

Permalink
Import Geant4 10.1.3 source tree
Browse files Browse the repository at this point in the history
  • Loading branch information
gcosmo committed Jun 10, 2016
1 parent 2c587f9 commit d2db8fb
Show file tree
Hide file tree
Showing 240 changed files with 21,121 additions and 4,726 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 90844 2015-06-10 10:03:56Z gcosmo $
# $Id: CMakeLists.txt 95323 2016-02-04 15:12:37Z gcosmo $
#

#------------------------------------------------------------------------------
Expand Down Expand Up @@ -72,10 +72,10 @@ set(CMAKE_MODULE_PATH
# See the documentation in each of these modules for further details.
#
# - Versioning. We do this here for now
set(${PROJECT_NAME}_VERSION "10.1.2")
set(${PROJECT_NAME}_VERSION "10.1.3")
set(${PROJECT_NAME}_VERSION_MAJOR "10")
set(${PROJECT_NAME}_VERSION_MINOR "1")
set(${PROJECT_NAME}_VERSION_PATCH "2")
set(${PROJECT_NAME}_VERSION_PATCH "3")

# - Provide dependent options as these are needed for some Geant4 features
include(CMakeDependentOption)
Expand Down
201 changes: 201 additions & 0 deletions ReleaseNotes/Patch4.10.1-3.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@

Geant4 10.1 - patch-03 Release Notes
------------------------------------

5 February 2016

List of fixes included in this public patch since the public release 10.1.p02:

o Configuration:
-------------
+ CMake:
o Updated Apple Clang detection to work on Xcode-7.
o Always use libc++ with Apple Clang so that std-supporting library is
used for C++11 mode on older Mac systems where libstdc++ is the default.
o Updated std-flag setting rules.
+ GNUMake:
o Updated X11 settings in MacOS platform.
o Added settings for C++ standards in platform specific scripts.

o Analysis:
--------
+ Fixed G4Analysis::Tokenize() which was failing when processsing a string
containing opening double quota without a closing one.
+ Fixed handling ntuples created in MT mode on master thread
This fixes the problem reported in hypernews (#459) and the problem
of deleting non-empty Root file containing only ntuples.

o Geometry:
--------
+ divisions:
o Fix for use of rotation matrix in G4VDivisionParameterisation in
MT-mode; use thread-local pointer for rotation matrix as member of the
class G4VDivisionParameterisation and set it to suto-delete.
Removed unnecessary thread-local verbose flag.
Addressing problem reports #1743 and #1758.
o Set as unsupported divisions of polycone and polyhedra in MT-mode.
+ magneticfield:
o Added check in G4ChordFinder against number of iterations in
FindNextChord(), to identify potential cases of lack of convergence.
o Better diagnostics text in case of errors in G4FieldTrack and
G4UniformMagField.
o Added explanation comment in G4MagHelicalSteper.
+ navigation:
o G4MultiLevelLocator::EstimateIntersectionPoint(): fix for logic error
in keeping consistent candidate intersection. Copes with case that a
candidate intersection is not found in the next segment (typically in
the 'second half' part).
Ensure that splitting of step (new level/depth) advances the required
length, used when adding a new level/depth.
Revised condition of 'while' loop which ensures that a new candidate
intersection exists. Corrected the resetting of 'first_section' flag.
Replaced fatal error for exceeding max steps with warning and signal
'looping' for too many steps; G4PropagatorInField detects this
condition, and identifies it as a 'Looping Particle' which is then
flagged; the calling class (Transportation, PathFinder) is expected
to stop the tracking of this particle after a few of these steps.
Addressing issue seen by ALICE (non-finishing of step due to poor
advances).
o G4VIntersectionLocator: added new logging methods & revised interfaces.
o G4NavigationLogger: added method to report issue with normal that
is the result of applying a rotation.
o G4NormalNavigation, G4VoxelNavigation: added check of rotated exit
normal.
o Relaxed condition for zero or almost-zero steps in G4ReplicaNavigation
and G4Navigator, to allow for faster progression in case of stuck tracks
in 3D scoring meshes. Addressing old problem report #1432.
o Fix in G4ReplicaNavigation::ComputeStep() for correct setting of copyNo
for particle entering. Fixes issue of negative copyNo observed in nested
replica setups. Addressing problem report #1634.
o Moved check for overlaps in G4Navigator::ComputeStep() within G4VERBOSE.
Addressing problem report #1811.
+ solids/Boolean:
o Checked for potential never-ending loops. Replaced while-do loop with
bounded for-loop in G4IntersectionSolid::DistanceToIn(p,v).
Also addressing problem report #1821.
+ solids/CSG:
o Introduced check in G4Sphere::DistanceToIn(p,v) for concave Theta and
point located on the origin. Also make proper use of radial tolerance in
DistanceToOut(p,v).
o Fixed Coverity defect in G4CutTubs::GetMaxMinZ().
+ solids/specific:
o Added specialised implementation for GetCubicVolume() in
G4TessellatedSolid. Added debug printouts withing G4SPECSDEBUG for
DistanceToIn/Out(p,v) to identify potential wrong responses.
o Removed redundant condition in G4Polyhedra and G4polycone
SetOriginalParameters() method.
o Minor code cleanup in G4SurfaceVoxelizer.
o Checked for potential never-ending loops.
+ volumes:
o Enabled paramerisation by solid type in G4GeometryWorkspace in MT-mode.
Assumes solids being parameterised are declared thread-local in the
user's parameterisation class and allocated just once.

o Global:
------
+ Tune radial tolerance to same value as for Cartesian tolerance in
G4GeometryTolerance.
+ Corrected conditions for proper treatment of gcc-5 in tls.hh and
G4Threading.hh.
+ Removed unused and buggy operator=(const G4String&) in G4SubString.
Added string length check in G4String::operator==().
Added missing 'inline' specification to functions in G4String.
+ Force use of G4MT wrappers for Intel-icc compiler for random numbers.
+ Updated date and version for 10.1.p03.

o Materials:
---------
+ G4NistElementBuilder: fixed typo in printout.
Addressing problem report #1786.

o Parameterisations:
-----------------
+ gflash: fix for Zeff wrongly computed as ( W1*Z2 ) + ( W2*Z1 ), with Z1
and Z2 swapped. Addressing problem report #1719.

o Particles:
---------
+ Fixed wrong argument order CreateIon(A,Z,LL,0.0) in G4IonTable to
CreateIon(Z,A,LL,0.0).
+ Fixed setting of mass in decay parent particle.
Addressing problem report #1820.

o Persistency:
-----------
+ GDML:
o Use relaxed precision constant for matrix to angle formula evaluation
in G4GDMLWriteDefine, to allow for proper treatment of singularities.
Fixes issues of misplaced volumes in exported geometries of complex
detectors.
o Rectify rotation matrices in reading and writing GDML files to reduce
spurious roundoff errors in stored values.

o Physics Lists
-------------
+ constructors/limiters:
o G4ParallelWorldPhysics: fixed process order index for
G4ParallelWorldProcess to 9900 to make sure it is registered
prior to G4OpBoundaryProcess.

o Processes - Electromagnetic:
---------------------------
+ xrays:
o G4VTransitionRadiation, G4VXTRenergyLoss: fixed process sub-type.

o Processes - Generic:
-------------------
+ scoring:
o G4ParallelWorldProcess: fixed processType from 'fParameterized'
to 'fParallel' and set processSubType to 491.
o Fixed Coverity defects.

o Processes - Hadronic:
--------------------
+ cross_sections:
o G4NeutronInelasticXS, G4NeutronCaptureXS: fixed isotope cross-sections
including retrieve, data management, isotope x-section and isotope
selection. Fixed Coverity defects.
+ models/cascade:
o G4CascadeCoalescence: added explicit inclusion of
G4InuclElementaryParticle header to address compiler error from Cray
(as reported in Configuration Hypernews Forum #1764).
+ models/coherent_elastic:
o G4DiffuseElastic: bug-fix in BuildAngleTable() to improve the angle
bin accuracy at high energies.
+ models/im_r_matrix:
o Fixed compiler warning in clang-3.6.

o Run:
---
+ G4PhysicsListHelper: add entry for G4ParallelWorldProcess.
+ G4RunManager, G4WorkerRunManager: fixed process order index of
G4ParallelWorldProcess to 9900 to make sure it is registered
prior to G4OpBoundaryProcess.

o Tracking:
--------
+ G4SteppingManager: fix to properly set 'OriginTouchableHandle' for the
primary track. Addressing problem report #1773.

o Examples:
--------
+ Updated reference outputs.
+ basic/B4:
o Restored the third parameter in G4UIsession construction, which was
lost when moving G4UIExecutive at the beginning of main().
Addressing problem report #1802.

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

Technical Notes
---------------

o This patch should be applied on top of release 10.1, 10.1.p01 or 10.1.p02.
o Technical notes distributed for release 10.1 are also applicable and
valid for this patch.

The code and rebuilt binary libraries for release 10.1.p03 are available
through our "Download" Web page.

Please refer to the Geant4 User Documentation for further information about
using Geant4.
16 changes: 16 additions & 0 deletions cmake/History
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,22 @@ add this in the documentation for the changed file as [BUGFIX #BUGNUMBER].

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

6th October 2015 - Ben Morgan (cmake-V10-00-43, 42)
- Modules/Geant4MakeRules_cxx.cmake: Update AppleClang detection to
for Xcode 7 and match to CMake 3's AppleClang rules. Provide
CXXSTD_IS_AVAILABLE for MSVC 19 so that appropriate standard selection
preprocessor symbols are defined.

27th July 2015 - Ben Morgan
- Modules/Geant4MakeRules_cxx.cmake : Always use libc++ with Apple
Clang so that std-supporting library is used for C++11 mode on
older Mac systems where libstdc++ is the default.

23rd July 2015 - Ben Morgan
- Modules/Geant4MakeRules_cxx.cmake : To permit transition to C++11
update std-flag setting rules to only allow C++11 builds with compiler
versions that are know to support the features in current use.

8th June 2015 - Ben Morgan (cmake-V10-00-41)
- Templates/Geant4Config.cmake.in : Always re-find Qt5 via find_package
if Geant4 was configured with Qt5 support. Qt5 libraries are in
Expand Down
12 changes: 12 additions & 0 deletions cmake/Modules/Geant4LibraryBuildOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,18 @@ if(CXXSTD_IS_AVAILABLE)
if(GEANT4_BUILD_CXXSTD MATCHES "c\\+\\+11")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DG4USE_STD11")
endif()
if(GEANT4_BUILD_CXXSTD MATCHES "c\\+\\+14")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DG4USE_STD11")
endif()
if(GEANT4_BUILD_CXXSTD MATCHES "c\\+\\+1y")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DG4USE_STD11")
endif()
if(GEANT4_BUILD_CXXSTD MATCHES "c\\+\\+1z")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DG4USE_STD11")
endif()
if(GEANT4_BUILD_CXXSTD MATCHES "c\\+\\+17")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DG4USE_STD11")
endif()
endif()

#-----------------------------------------------------------------------
Expand Down
102 changes: 76 additions & 26 deletions cmake/Modules/Geant4MakeRules_cxx.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,17 @@ function(__configure_cxxstd_gnu)
OUTPUT_STRIP_TRAILING_WHITESPACE
)

if(_gnucxx_version VERSION_LESS 4.3)
# Set allowed flags based, temporarily, on KNOWN abilities of compiler
# rather than what flags it supports (e.g. GCC 4.7 claims -std=c++11
# works, but it does not support inheriting constructors...)
if(_gnucxx_version VERSION_LESS 4.8)
set(_CXXSTDS "c++98")
elseif(_gnucxx_version VERSION_LESS 4.7)
set(_CXXSTDS "c++98" "c++0x")
elseif(_gnucxx_version VERSION_LESS 4.9)
set(_CXXSTDS "c++98" "c++0x" "c++11")
set(_CXXSTDS "c++98" "c++11")
elseif(_gnucxx_version VERSION_LESS 5.3)
set(_CXXSTDS "c++98" "c++11" "c++1y")
else()
set(_CXXSTDS "c++98" "c++0x" "c++11" "c++1y")
set(_CXXSTDS "c++98" "c++11" "c++14" "c++1z")
endif()

set(CXXSTD_IS_AVAILABLE ${_CXXSTDS} PARENT_SCOPE)
Expand All @@ -75,33 +78,71 @@ function(__configure_cxxstd_clang)
ERROR_STRIP_TRAILING_WHITESPACE
)
string(REGEX REPLACE ".*clang version ([0-9]\\.[0-9]+).*" "\\1" _clangcxx_version ${_clangcxx_dumpedversion})
# Apple Clang 4.2 no longer reports clang version but LLVM version
# Moreover, this is Apple versioning, not LLVM upstream
# If this is the case, the previous regex will not do anything.
# Check to see if we have "Apple LLVM version" in the output,
# and if so extract the original LLVM version which should appear as
# "based on LLVM X.Ysvn". The "svn" extension means the development
# version of LLVM X.Y, not a release, so it may not provide all features
# present in the X.Y release.
if(APPLE AND "${_clangcxx_version}" MATCHES ".*Apple LLVM version.*")
string(REGEX REPLACE ".*based on LLVM ([0-9](\\.[0-9])+)svn.*" "\\1" _clangcxx_version ${_clangcxx_version})
endif()
message(STATUS "Clang version : ${_clangcxx_version}")

if(_clangcxx_version VERSION_LESS 2.9)
set(_CXXSTDS "c++98")
elseif(_clangcxx_version VERSION_LESS 3.3)
set(_CXXSTDS "c++98" "c++0x" "c++11")
elseif(_clangcxx_version VERSION_LESS 3.5)
set(_CXXSTDS "c++98" "c++0x" "c++11" "c++1y")
# Set allowed flags based, temporarily, on KNOWN abilities of compiler
# rather than what flags it supports (e.g. Clang 3.4 claims -std=c++11
# works, but it does not support <type_traits>...)

# Apple Clang Versioning works slightly differently...
# We follow CMake conventions, allowing minimal changes for
# CMake 3's 'AppleClang' convention
if(APPLE AND "${_clangcxx_version}" MATCHES ".*Apple (LLVM|clang) version.*")
# Apple LLVM version
string(REGEX
REPLACE ".*Apple (LLVM|clang) version ([0-9](\\.[0-9])+) .*" "\\2"
APPLE_LLVM_VERSION_STR
"${_clangcxx_version}"
)
# Apple build version
string(REGEX REPLACE ".*[\\(/]clang\\-([0-9\\.]+)\\).*" "\\1"
APPLE_BUILD_VERSION_STR
"${_clangcxx_version}"
)
string(REPLACE "." ""
APPLE_BUILD_VERSION_STR
"${APPLE_BUILD_VERSION_STR}"
)

# Format should be XXX.YY.ZZ, but 'YY' often appears as single digit,
# so pad if length < 7 chars
string(LENGTH ${APPLE_BUILD_VERSION_STR} ABVS_LENGTH)
if(ABVS_LENGTH LESS 7)
string(SUBSTRING "${APPLE_BUILD_VERSION_STR}" 0 3 APPLE_BUILD_VERSION_MAJOR)
string(SUBSTRING "${APPLE_BUILD_VERSION_STR}" 3 -1 APPLE_BUILD_VERSION_REMAINDER)
set(APPLE_BUILD_VERSION_STR "${APPLE_BUILD_VERSION_MAJOR}0${APPLE_BUILD_VERSION_REMAINDER}")
endif()

set(__appleclang_version "${APPLE_LLVM_VERSION_STR}.${APPLE_BUILD_VERSION_STR}")

# Handle AppleClang versions
if(__appleclang_version VERSION_LESS 5.1)
set(_CXXSTDS "c++98")
elseif(__appleclang_version VERSION_LESS 6.1)
set(_CXXSTDS "c++98" "c++11" "c++1y")
else()
# As Apple's exact clang version is unclear, only use c++14 when
# the 3.6svn version started to be used.
set(_CXXSTDS "c++98" "c++11" "c++14")
endif()

# Apple Clang requires use of libc++ for full C++11 support.
# From OS X 10.9, libc++ is the default, but set it explicitly so
# that 10.8 can be supported.
set(_CXXSTDLIBFLAGS "-stdlib=libc++")
else()
# Be cautious for now and only use c++1y rather than c++14
set(_CXXSTDS "c++98" "c++0x" "c++11" "c++1y")
# Otherwise, have out-the-box clang
if(_clangcxx_version VERSION_LESS 3.4)
set(_CXXSTDS "c++98")
elseif(_clangcxx_version VERSION_LESS 3.5)
set(_CXXSTDS "c++98" "c++11" "c++1y")
else()
set(_CXXSTDS "c++98" "c++11" "c++14")
endif()
endif()

set(CXXSTD_IS_AVAILABLE ${_CXXSTDS} PARENT_SCOPE)
foreach(_s ${_CXXSTDS})
set(${_s}_FLAGS "-std=${_s}" PARENT_SCOPE)
set(${_s}_FLAGS "-std=${_s} ${_CXXSTDLIBFLAGS}" PARENT_SCOPE)
endforeach()
endfunction()

Expand Down Expand Up @@ -205,6 +246,15 @@ if(MSVC)
set(CMAKE_CXX_FLAGS_TESTRELEASE_INIT "-MDd -Zi -G4DEBUG_VERBOSE")
set(CMAKE_CXX_FLAGS_MAINTAINER_INIT "-MDd -Zi")

# C++ Standard modes - don't have flags, but is needed to set compile
# defs
# NB: Visual Studio 14 2015 => MSVC 19.X, and this is CMake's compiler
# version
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0)
set(CXXSTD_IS_AVAILABLE "c++98")
else()
set(CXXSTD_IS_AVAILABLE "c++98" "c++11")
endif()
# We may also have to set linker flags....
endif()

Expand Down
Loading

0 comments on commit d2db8fb

Please sign in to comment.