Skip to content

Commit 1251ac7

Browse files
committed
Import Geant4 10.0.1 source tree
1 parent 286caac commit 1251ac7

File tree

401 files changed

+132509
-258064
lines changed

Some content is hidden

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

401 files changed

+132509
-258064
lines changed

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# 21st September 2010 Ben Morgan
55
#
6-
# $Id: CMakeLists.txt 78013 2013-12-02 12:51:57Z gcosmo $
6+
# $Id: CMakeLists.txt 79108 2014-02-17 09:54:05Z gcosmo $
77
#
88

99
#------------------------------------------------------------------------------
@@ -51,10 +51,10 @@ set(CMAKE_MODULE_PATH
5151
# See the documentation in each of these modules for further details.
5252
#
5353
# - Versioning. We do this here for now
54-
set(${PROJECT_NAME}_VERSION "10.0.0")
54+
set(${PROJECT_NAME}_VERSION "10.0.1")
5555
set(${PROJECT_NAME}_VERSION_MAJOR "10")
5656
set(${PROJECT_NAME}_VERSION_MINOR "0")
57-
set(${PROJECT_NAME}_VERSION_PATCH "0")
57+
set(${PROJECT_NAME}_VERSION_PATCH "1")
5858

5959
# - Provide dependent options as these are needed for some Geant4 features
6060
include(CMakeDependentOption)

ReleaseNotes/Patch4.10.0-1.txt

Lines changed: 340 additions & 0 deletions
Large diffs are not rendered by default.

cmake/History

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,42 @@ add this in the documentation for the changed file as [BUGFIX #BUGNUMBER].
3030
* Reverse chronological order (last date on top), please *
3131

3232
----------------------------------------------------------
33+
34+
18th February 2014 - Ben Morgan (cmake-V09-06-46)
35+
- Modules/Geant4ConfigureConfigScript.cmake : Export use of builtin
36+
zlib or otherwise to geant4-config (Bugfix #1572).
37+
- Template/geant4-config.in : Add builtin zlib to list of features,
38+
adding G4zlib to list of libraries when used (Bugfix #1572).
39+
- Template/geant4-config.in : Replace use of GNU awk extension 'length'
40+
for determining number of datasets. Use return value of split function
41+
to get length of array. Problem reported on Hypernews:
42+
http://hypernews.slac.stanford.edu/HyperNews/geant4/get/installconfig/1614.html
43+
44+
17th February 2014 - Ben Morgan
45+
- Templates/geant4make-skeleton.in : Add variables for
46+
G4LIB_{BUILD,USE}_EXPAT as for ZLIB. Fixes Bug #1567
47+
- Modules/Geant4ToolchainBackwardCompatibility.cmake : Export
48+
G4LIB_{BUILD,USE}_EXPAT based on value of GEANT4_USE_SYSTEM_EXPAT.
49+
Fixes Bug #1567.
50+
51+
21st January 2014 - Jonathan Madsen
52+
- Updated Modules/Geant4InterfaceOptions.cmake to include /opt/X11
53+
paths that are now the standard places for X11 and OpenGL on Mac OSX
54+
as of Mavericks (OS X 10.9). Without these paths configuring CMake with
55+
GEANT4_USE_OPENGL_X11=ON fails
56+
57+
18th December 2013 - Gunter Folger
58+
- Modules/Geant4TestDriver.cmake: CTEST_TEST_TIMEOUT is empty, or
59+
its setting is not visible.
60+
Directly using environment variable CTEST_TIMEOUT finally works.
61+
62+
16th December 2013 - Gunter Folger
63+
- Modules/Geant4TestDriver.cmake: fix typo introduced in previous tag
64+
65+
16th December 2013 - Gunter Folger
66+
- Modules/Geant4TestDriver.cmake: use CTEST_TEST_TIMEOUT if set to set
67+
default timeout
68+
3369
28th November 2013 - Ben Morgan (cmake-V09-06-45)
3470
- Modules/Geant4CTest.cmake : Remove G4ENSDFSTATE dataset from list
3571
exported to the testing environment, as it should not be used by

cmake/Modules/Geant4ConfigureConfigScript.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,13 @@ if(NOT GEANT4_BUILD_GRANULAR_LIBS AND UNIX)
9898
set(G4_BUILTWITH_EXPAT "yes")
9999
endif()
100100

101+
# - ZLIB
102+
if(GEANT4_USE_SYSTEM_ZLIB)
103+
set(G4_BUILTWITH_ZLIB "no")
104+
else()
105+
set(G4_BUILTWITH_ZLIB "yes")
106+
endif()
107+
101108
# - GDML
102109
if(GEANT4_USE_GDML)
103110
set(G4_BUILTWITH_GDML "yes")

cmake/Modules/Geant4InterfaceOptions.cmake

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,13 +203,15 @@ if(UNIX)
203203
/usr/openwin/include
204204
/usr/openwin/share/include
205205
/opt/graphics/OpenGL/include
206+
/opt/X11/include
206207
)
207208

208209
set(X11_LIB_SEARCH_PATH
209210
/usr/pkg/xorg/lib
210211
/usr/X11R6/lib
211212
/usr/X11R7/lib
212213
/usr/openwin/lib
214+
/opt/X11/lib
213215
)
214216

215217
find_path(X11_Xmu_INCLUDE_PATH X11/Xmu/Xmu.h ${X11_INC_SEARCH_PATH})
@@ -252,17 +254,17 @@ if(UNIX)
252254
set(CMAKE_FIND_FRAMEWORK NEVER)
253255

254256
find_path(OPENGL_X11_INCLUDE_DIR GL/gl.h
255-
PATHS /usr/X11R6/include
257+
PATHS /usr/X11R6/include /opt/X11/include
256258
NO_DEFAULT_PATH
257259
)
258260

259261
find_library(OPENGL_X11_gl_LIBRARY GL
260-
PATHS /usr/X11R6/lib
262+
PATHS /usr/X11R6/lib /opt/X11/lib
261263
NO_DEFAULT_PATH
262264
)
263265

264266
find_library(OPENGL_X11_glu_LIBRARY GLU
265-
PATHS /usr/X11R6/lib
267+
PATHS /usr/X11R6/lib /opt/X11/lib
266268
NO_DEFAULT_PATH
267269
)
268270

cmake/Modules/Geant4TestDriver.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ endif()
5353
if(TIM)
5454
math(EXPR _timeout "${TIM} - 120")
5555
else()
56-
math(EXPR _timeout "1500 - 120")
56+
if(NOT $ENV{CTEST_TIMEOUT} STREQUAL "")
57+
math(EXPR _timeout "$ENV{CTEST_TIMEOUT} - 120")
58+
else()
59+
math(EXPR _timeout "1500 - 120")
60+
endif()
5761
endif()
5862

5963
if(CWD)

cmake/Modules/Geant4ToolchainBackwardCompatibility.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,13 @@ macro(_g4tc_configure_tc_variables SHELL_FAMILY SCRIPT_NAME)
339339
set(GEANT4_TC_G4LIB_USE_CLHEP "# USING INTERNAL CLHEP")
340340
endif()
341341

342+
# - EXPAT
343+
if(GEANT4_USE_SYSTEM_EXPAT)
344+
set(GEANT4_TC_G4LIB_USE_EXPAT "# USING SYSTEM EXPAT")
345+
else()
346+
_g4tc_setenv_command(GEANT4_TC_G4LIB_USE_EXPAT ${SHELL_FAMILY} G4LIB_USE_EXPAT 1)
347+
endif()
348+
342349
# - ZLIB...
343350
if(GEANT4_USE_SYSTEM_ZLIB)
344351
set(GEANT4_TC_G4LIB_USE_ZLIB "# USING SYSTEM ZLIB")

cmake/Templates/geant4-config.in

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,14 @@ if test "x${have_expat}" = "xyes" ; then
135135
libs="${libs} -lG4expat"
136136
fi
137137

138+
# - ZLIB
139+
have_zlib="@G4_BUILTWITH_ZLIB@"
140+
feature_list="${feature_list} zlib[${have_zlib}]"
141+
142+
if test "x${have_zlib}" = "xyes" ; then
143+
libs="${libs} -lG4zlib"
144+
fi
145+
138146
# - GDML
139147
have_gdml="@G4_BUILTWITH_GDML@"
140148
feature_list="${feature_list} gdml[${have_gdml}]"
@@ -226,9 +234,13 @@ fi
226234
# Datasets
227235
# - List creation for sh compatibility, see:
228236
# https://wiki.ubuntu.com/DashAsBinSh
237+
# Note however that the guide in the link uses the GNU awk extension
238+
# 'length' to find the number of elements in the array. This will fail
239+
# on other awk implementations. Use standard feature of split function
240+
# returning number of elements.
229241
dataset_url="@GEANT4_DATASETS_URL@"
230242
dataset_timeout="@GEANT4_INSTALL_DATA_TIMEOUT@"
231-
dataset_list=$(awk 'BEGIN { split( "@GEANT4_CONFIG_DATASET_DESCRIPTIONS@", array, ";"); for (i=1;i<=length(array);i++) { print array[i]; } }')
243+
dataset_list=$(awk 'BEGIN { n = split( "@GEANT4_CONFIG_DATASET_DESCRIPTIONS@", array, ";"); for (i=1;i<=n;i++) { print array[i]; } }')
232244

233245
#-----------------------------------------------------------------------
234246
# function print_datasets

cmake/Templates/geant4make-skeleton.in

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@
4141
@GEANT4_TC_UNSET_COMMAND@ CLHEP_LIB
4242
@GEANT4_TC_UNSET_COMMAND@ CLHEP_LIB_DIR
4343

44-
# - G3ToG4
45-
@GEANT4_TC_UNSET_COMMAND@ G4LIB_BUILD_G3TOG4
46-
@GEANT4_TC_UNSET_COMMAND@ G4LIB_USE_G3TOG4
44+
# - EXPAT options
45+
@GEANT4_TC_UNSET_COMMAND@ G4LIB_BUILD_EXPAT
46+
@GEANT4_TC_UNSET_COMMAND@ G4LIB_USE_EXPAT
4747

4848
# - ZLIB options
4949
@GEANT4_TC_UNSET_COMMAND@ G4LIB_BUILD_ZLIB
@@ -54,6 +54,10 @@
5454
@GEANT4_TC_UNSET_COMMAND@ G4LIB_USE_GDML
5555
@GEANT4_TC_UNSET_COMMAND@ XERCESCROOT
5656

57+
# - G3ToG4
58+
@GEANT4_TC_UNSET_COMMAND@ G4LIB_BUILD_G3TOG4
59+
@GEANT4_TC_UNSET_COMMAND@ G4LIB_USE_G3TOG4
60+
5761
# - UI Build and Use options
5862
# USE options only for applications.
5963
@GEANT4_TC_UNSET_COMMAND@ G4UI_NONE
@@ -154,6 +158,10 @@
154158
@GEANT4_TC_CLHEP_LIB_DIR@
155159
@GEANT4_TC_CLHEP_LIB_PATH_SETUP@
156160

161+
#-----------------------------------------------------------------------
162+
# EXPAT setup
163+
@GEANT4_TC_G4LIB_USE_EXPAT@
164+
157165
#-----------------------------------------------------------------------
158166
# ZLIB Setup
159167
#

config/History

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
svn log $Id: History 77473 2013-11-25 09:32:54Z gcosmo $
1+
svn log $Id: History 79120 2014-02-18 14:50:37Z gcosmo $
22
-------------------------------------------------------------------
33

44
=========================================================
@@ -16,6 +16,12 @@ committal in the CVS repository !
1616
* Reverse chronological order (last date on top), please *
1717
----------------------------------------------------------
1818

19+
17th January 2014 Gabriele Cosmo (config-V09-06-18)
20+
- Fixed setting of -fPIC also for Darwin targets.
21+
22+
13th January 2014 Gabriele Cosmo
23+
- Fixed setting of -fPIC in MT-mode for Linux-g++ and Linux-icc.
24+
1925
25th November 2013 Gabriele Cosmo (config-V09-06-17)
2026
- Corrected settings for Linux-g++ and Linux-icc in the use of -fPIC in
2127
multi-threaded mode.

config/sys/Darwin-clang.gmk

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
# Original author: Gabriele Cosmo - CERN
66
#
77
ifeq ($(G4SYSTEM),Darwin-clang)
8-
CXX := clang
8+
CXX := clang++
99
CXXFLAGS := -Wall -Wno-non-virtual-dtor -Wno-long-long
10-
CXXFLAGS += -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -pipe
11-
CXXFLAGS += -Wno-variadic-macros -Wshadow
10+
CXXFLAGS += -Wwrite-strings -Wpointer-arith -Woverloaded-virtual
11+
CXXFLAGS += -Wno-variadic-macros -Wshadow -pipe
1212
ifdef G4MULTITHREADED
1313
CXXFLAGS += -ftls-model=initial-exec -pthread
1414
endif
@@ -33,6 +33,12 @@ ifeq ($(G4SYSTEM),Darwin-clang)
3333
FCFLAGS += -O2 -g
3434
CCFLAGS += -O2 -g
3535
endif
36+
ifdef G4LIB_BUILD_SHARED
37+
CXXFLAGS += -fPIC
38+
FCFLAGS += -fPIC
39+
CCFLAGS += -fPIC
40+
endif
41+
G4RUNPATHOPTION := -Wl,-rpath
3642
FC := gfortran
3743
FCFLAGS += -fno-automatic -fno-backslash -fno-second-underscore
3844
LDFLAGS += -bind_at_load
@@ -151,13 +157,13 @@ ifeq ($(G4SYSTEM),Darwin-clang)
151157
define build-granular-shared-lib
152158
@libdir=`(cd $(@D);/bin/pwd)`; \
153159
cd $(G4TMPDIR); \
154-
$(CXX) -dynamiclib -single_module -undefined dynamic_lookup \
160+
$(CXX) -dynamiclib -single_module -undefined dynamic_lookup \
155161
-o $$libdir/$(@F) $(INTYLIBS) *.o
156162
endef
157163
define build-global-shared-lib
158164
@libdir=`(cd $(@D);/bin/pwd)`; \
159165
cd $(G4TMP)/$(G4SYSTEM); \
160-
$(CXX) -dynamiclib -single_module -undefined dynamic_lookup \
166+
$(CXX) -dynamiclib -single_module -undefined dynamic_lookup \
161167
-o $$libdir/$(@F) $(INTYLIBS) $(foreach dir,$(SUBLIBS),$(dir)/*.o);
162168
endef
163169

config/sys/Darwin-g++.gmk

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ ifeq ($(G4SYSTEM),Darwin-g++)
1111
CXX := g++
1212
CXXFLAGS := -Wall -Wno-non-virtual-dtor -Wno-long-long
1313
# CXXFLAGS += -Wunused-parameter -Winline -Wunreachable-code
14-
CXXFLAGS += -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -pipe
15-
CXXFLAGS += -Wno-variadic-macros -Wshadow
14+
CXXFLAGS += -Wwrite-strings -Wpointer-arith -Woverloaded-virtual
15+
CXXFLAGS += -Wno-variadic-macros -Wshadow -pipe
1616
# CXXFLAGS += -stdlib=libstdc++
1717
ifdef G4OPTIMISE
1818
CXXFLAGS += -O2
@@ -35,6 +35,11 @@ ifeq ($(G4SYSTEM),Darwin-g++)
3535
FCFLAGS += -O2 -g
3636
CCFLAGS += -O2 -g
3737
endif
38+
ifdef G4LIB_BUILD_SHARED
39+
CXXFLAGS += -fPIC
40+
FCFLAGS += -fPIC
41+
CCFLAGS += -fPIC
42+
endif
3843
FC := gfortran
3944
FCFLAGS += -fno-automatic -fno-backslash -fno-second-underscore
4045
LDFLAGS += -bind_at_load
@@ -162,13 +167,13 @@ ifeq ($(G4SYSTEM),Darwin-g++)
162167
define build-granular-shared-lib
163168
@libdir=`(cd $(@D);/bin/pwd)`; \
164169
cd $(G4TMPDIR); \
165-
$(CXX) -dynamiclib -single_module -undefined dynamic_lookup \
170+
$(CXX) -dynamiclib -single_module -undefined dynamic_lookup \
166171
-o $$libdir/$(@F) $(INTYLIBS) *.o
167172
endef
168173
define build-global-shared-lib
169174
@libdir=`(cd $(@D);/bin/pwd)`; \
170175
cd $(G4TMP)/$(G4SYSTEM); \
171-
$(CXX) -dynamiclib -single_module -undefined dynamic_lookup \
176+
$(CXX) -dynamiclib -single_module -undefined dynamic_lookup \
172177
-o $$libdir/$(@F) $(INTYLIBS) $(foreach dir,$(SUBLIBS),$(dir)/*.o);
173178
endef
174179

config/sys/Linux-g++.gmk

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,9 @@ ifeq ($(G4SYSTEM),Linux-g++)
4040
CCFLAGS += -O2 -g
4141
endif
4242
ifdef G4LIB_BUILD_SHARED
43-
ifndef G4MULTITHREADED
44-
CXXFLAGS += -fPIC
45-
FCFLAGS += -fPIC
46-
CCFLAGS += -fPIC
47-
endif
43+
CXXFLAGS += -fPIC
44+
FCFLAGS += -fPIC
45+
CCFLAGS += -fPIC
4846
endif
4947
G4RUNPATHOPTION := -Wl,-rpath
5048
CC := gcc

config/sys/Linux-icc.gmk

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@ ifeq ($(G4SYSTEM),Linux-icc)
2424
CCFLAGS += -pg
2525
endif
2626
ifdef G4LIB_BUILD_SHARED
27-
ifndef G4MULTITHREADED
28-
CXXFLAGS += -fPIC
29-
FCFLAGS += -fPIC
30-
CCFLAGS += -fPIC
31-
endif
27+
CXXFLAGS += -fPIC
28+
FCFLAGS += -fPIC
29+
CCFLAGS += -fPIC
3230
LDFLAGS += -i-dynamic
3331
endif
3432
G4RUNPATHOPTION := -Wl,-rpath -Wl,

examples/advanced/ChargeExchangeMC/CMakeLists.txt

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,21 @@ if(CEXMC_USE_CUSTOM_FILTER)
7676
add_definitions(-DCEXMC_DEBUG_CF)
7777
endif()
7878

79+
# if CEXMC_USE_QGSP_BERT is 'yes' then QGSP_BERT will be used as basic physics,
80+
# otherwise - FTFP_BERT or QGSP_BIC_EMY
81+
option(CEXMC_USE_QGSP_BERT
82+
"Build ${name} with QGSP_BERT physics list
83+
(default physics list is FTFP_BERT)" OFF)
84+
if(CEXMC_USE_QGSP_BERT)
85+
add_definitions(-DCEXMC_USE_QGSP_BERT)
86+
endif()
87+
7988
# if CEXMC_USE_QGSP_BIC_EMY is 'yes' then QGSP_BIC_EMY will be used as basic
80-
# physics, otherwise - QGSP_BERT
81-
option(CEXMC_USE_QGSP_BIC_EMY
89+
# physics, otherwise - FTFP_BERT or QGSP_BERT
90+
cmake_dependent_option(CEXMC_USE_QGSP_BIC_EMY
8291
"Build ${name} with QGSP_BIC_EMY physics list
83-
(default physics list is QGSP_BERT)" OFF)
92+
(default physics list is FTFP_BERT)" OFF
93+
"NOT CEXMC_USE_QGSP_BERT" OFF)
8494
if(CEXMC_USE_QGSP_BIC_EMY)
8595
add_definitions(-DCEXMC_USE_QGSP_BIC_EMY)
8696
endif()
@@ -156,10 +166,15 @@ if(CEXMC_USE_GENBOD)
156166
endif()
157167
endif()
158168

169+
# all classes in this project have same member names as their formal constructor
170+
# parameters, so -Wno-shadow option is mandatory to prevent multiple warnings!
171+
add_definitions(-Wno-shadow)
159172

160173
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include ${Geant4_INCLUDE_DIR})
161174
file(GLOB sources ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cc)
162175

163-
add_executable(${name} EXCLUDE_FROM_ALL ${name}.cc ${sources})
176+
add_executable(${name} ${name}.cc ${sources})
164177
target_link_libraries(${name} ${Geant4_LIBRARIES} ${EXTRA_LIBRARIES})
165178

179+
install(TARGETS ${name} DESTINATION bin)
180+

0 commit comments

Comments
 (0)