Import Geant4 5.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 16:57:27 +02:00
parent 330b82b769
commit 37fff30d2e
5733 changed files with 263867 additions and 74574 deletions
+53 -116
View File
@@ -1,4 +1,4 @@
# $Id: binmake.gmk,v 1.76 2002/06/13 11:08:08 jwellisc Exp $
# $Id: binmake.gmk,v 1.85 2002/12/04 14:44:23 gcosmo Exp $
# ----------------------------------------------------------
# Script defining rules and paths for making binaries.
# First implementation: Gabriele Cosmo, 25/06/1998.
@@ -10,6 +10,11 @@ endif
G4LIBDIR := $(G4LIB)/$(G4SYSTEM)
# Define variable checking for existence of centrally installed headers.
# If check will be true, avoid explicit definition of paths to INCFLAGS.
#
G4INCLUDE_EXEC := $(shell [ -r $(G4INCLUDE)/globals.hh ] && echo 1)
include $(G4INSTALL)/config/G4UI_USE.gmk
include $(G4INSTALL)/config/G4VIS_USE.gmk
include $(G4INSTALL)/config/interactivity.gmk
@@ -27,18 +32,6 @@ ifndef SHAREDLIBS
SHAREDLIBS := $(shell test -f $(G4LIB)/$(G4SYSTEM)/libG4globman.$(SHEXT) && echo yes)
endif
# Define variable checking for existence of centrally installed headers,
# and global compound libraries installed (in future, the mechanism will
# be extended to the granular libraries as well. The liblist application
# must be re-engineered for that).
# If check will be true, avoid explicit definition of paths to INCFLAGS.
#
ifndef GLOBALLIBS
G4INCLUDE_EXEC := 0
else
G4INCLUDE_EXEC := $(shell [ -r $(G4INCLUDE)/globals.hh ] && echo 1)
endif
ifndef INCFLAGS
ifeq ($(G4INCLUDE_EXEC),1)
INCFLAGS := -I$(G4INCLUDE)
@@ -59,7 +52,6 @@ ifndef INCFLAGS
-I$(G4BASE)/particles/hadrons/mesons/include \
-I$(G4BASE)/particles/shortlived/include \
-I$(G4BASE)/processes/management/include \
-I$(G4BASE)/processes/general/include \
-I$(G4BASE)/processes/decay/include \
-I$(G4BASE)/processes/optical/include \
-I$(G4BASE)/processes/transportation/include \
@@ -76,6 +68,7 @@ ifndef INCFLAGS
-I$(G4BASE)/processes/hadronic/cross_sections/include \
-I$(G4BASE)/processes/hadronic/models/cascade/evaporation/include \
-I$(G4BASE)/processes/hadronic/models/cascade/utils/include \
-I$(G4BASE)/processes/hadronic/models/cascade/cascade/include \
-I$(G4BASE)/processes/hadronic/models/coherent_elastic/include \
-I$(G4BASE)/processes/hadronic/models/chiral_inv_phase_space/body/include \
-I$(G4BASE)/processes/hadronic/models/chiral_inv_phase_space/interface/include \
@@ -88,6 +81,7 @@ ifndef INCFLAGS
-I$(G4BASE)/processes/hadronic/models/generator/quark_gluon_string/include \
-I$(G4BASE)/processes/hadronic/models/generator/string_common/include \
-I$(G4BASE)/processes/hadronic/models/generator/string_fragmentation/include \
-I$(G4BASE)/processes/hadronic/models/generator/scattering/include \
-I$(G4BASE)/processes/hadronic/models/generator/util/include \
-I$(G4BASE)/processes/hadronic/models/high_energy/include \
-I$(G4BASE)/processes/hadronic/models/low_energy/include \
@@ -112,34 +106,17 @@ ifndef INCFLAGS
-I$(G4BASE)/digits+hits/detector/include \
-I$(G4BASE)/digits+hits/hits/include \
-I$(G4BASE)/digits+hits/digits/include \
-I$(G4BASE)/persistency/include \
-I$(G4BASE)/readout/include \
-I$(G4BASE)/event/include \
-I$(G4BASE)/graphics_reps/include \
-I$(G4BASE)/intercoms/include \
-I$(G4BASE)/g3tog4/include
-I$(G4BASE)/intercoms/include
ifdef G4USE_G3TOG4
INCFLAGS += -I$(G4BASE)/g3tog4/include
endif
endif
endif
ifdef G4ODBMS
ifneq ($(G4INCLUDE_EXEC),1)
INCFLAGS += \
-I$(G4BASE)/persistency/global/include \
-I$(G4BASE)/persistency/digits+hits/hits/include \
-I$(G4BASE)/persistency/digits+hits/digits/include \
-I$(G4BASE)/persistency/events/include \
-I$(G4BASE)/persistency/geometry/global/include \
-I$(G4BASE)/persistency/geometry/solids/CSG/include \
-I$(G4BASE)/persistency/geometry/solids/Boolean/include \
-I$(G4BASE)/persistency/geometry/solids/specific/include \
-I$(G4BASE)/persistency/geometry/management/include \
-I$(G4BASE)/persistency/management/include \
-I$(G4SCHEMA_INCLUDE)
endif
INCFLAGS += -I$(OBJY_DIR)/include \
-I$(HEP_ODBMS_DIR)/include \
-DHep_HAS_BUILDIN_BOOL_CONSTANTS
endif
CPPFLAGS += $(INCFLAGS)
LDFLAGS += -L$(G4LIBDIR)
@@ -179,19 +156,15 @@ LDLIBS1 += $(EXTRALIBS)
# VISLIBS and UILIBS are now handled by the granular library script...
#
ifdef GLOBALLIBS
LDLIBS1 += $(VISLIBS) $(UILIBS)
endif
LDLIBS1 += $(VISLIBS) $(UILIBS) -lG4persistency
ifdef GLOBALLIBS
ifdef G4ODBMS
LDLIBS1 += -lG4persistency
ifdef G4USE_G3TOG4
LDLIBS1 += -lG3toG4
endif
LDLIBS2 := -lG4readout \
-lG4run \
-lG4event \
-lG3toG4 \
-lG4tracking \
-lG4parmodels \
-lG4processes \
@@ -204,9 +177,18 @@ ifdef GLOBALLIBS
-lG4intercoms \
-lG4global
else
# The next line specifically should read LDLIBS2 = , not LDLIBS2 :=, so
# that it is not expanded until the directory G4TMPDIR is created.
LDLIBS2 = $(shell \
# The next lines specifically should read LDLIBS2 = , not LDLIBS2 :=, so
# that it is not expanded until the directory G4TMPDIR is created.
ifeq ($(G4INCLUDE_EXEC),1)
LDLIBS2 = $(shell \
G4TMP=$(G4TMP); export G4TMP; \
if [ \( -f $(G4LIB)/$(G4SYSTEM)/liblist \
-a -f $(G4LIB)/$(G4SYSTEM)/libname.map \) ]; then \
$(G4LIB)/$(G4SYSTEM)/liblist \
-m $(G4LIB)/$(G4SYSTEM) \
< $(G4LIB)/$(G4SYSTEM)/libname.map; fi)
else
LDLIBS2 = $(shell \
G4TMP=$(G4TMP); export G4TMP; \
if [ \( -f $(G4LIB)/$(G4SYSTEM)/liblist \
-a -f $(G4LIB)/$(G4SYSTEM)/libname.map \) ]; then \
@@ -217,6 +199,7 @@ else
# expanded too soon. Hence extra libraries must have a different name...
# Extra libraries to resolve remaining circular dependencies...
# LDLIBS2EXTRA =
endif
endif
# LDLIBS3 contains the first set of low level libraries...
@@ -229,19 +212,6 @@ endif # ifndef USER_DEFINED_LDLIBS
# LDLIBS4 contains the next set of low level libraries which historically
# (why?) the user is not supposed to be able to define...
#
ifdef G4ODBMS
LDFLAGS += -L$(OBJY_DIR)/lib \
-L$(HEP_ODBMS_DIR)/lib
# Note: $(G4ODBMS_LIBS) should be placed
# _before_ -l$(CLHEP_LIB)
LDLIBS4 += $(G4ODBMS_LIBS)
endif
ifdef G4USE_OSPACE
LDLIBS4 += $(OSPACELIBS)
endif
LDLIBS4 += $(LOADLIBS)
# Finally assemble libraries...
@@ -273,16 +243,7 @@ dependencies := $(patsubst %.cc,$(G4TMPDIR)/exe/%.d,$(sources))
LINK_DEPENDENCIES := $(G4TMPDIR)/exe/obj.last $(EXTRA_LINK_DEPENDENCIES)
ifndef G4ODBMS
.PHONY: bin clean clean_bin debug
else
.PHONY: bin clean clean_bin debug cleandb newboot newfd
endif
#
# Target "bin" requires dependency files when G4ODBMS=1.
# gmake must be recursively called with MAKE_DFILES=1.
#
# Make $(G4TARGET) executable.
@@ -338,20 +299,37 @@ else
-c $(OUT_OBJ)$(G4TMPDIR)/exe/$(G4TARGET).o $(G4TARGET).cc
endif
ifdef G4ODBMS
GPPFLAGS := "-MM"
else
GPPFLAGS := "-M"
endif
GPPFLAGS := "-M"
# Make the $(G4TARGET).d file and include it.
# The ideas for this come from the GNU Make Manual, Section 4.12,
# Generating Prerequisites Automatically. The g++ compiler has an
# option -M or -MM to write to standard output a list of dependencies
# based on the #include statements. The "sed" adds the dependency
# file itself as a second target. The result is a mini-makefile which
# specifies the .o and .d files as targets which depend on all the
# files found through the #include statements. This file is then
# included, causing GNU Make to honour these dependencies.
# The "set -e" causes the shell to exit with an error when the "g++"
# fails (otherwise it would only notice the last command in the
# pipeline, namely "sed"). GNU Make notices the error and exits
# sooner than it otherwise would (still not as soon as I expect,
# though!). Even then, an empty file is made, so "[ -s $@ ] || rm -f
# $@" removes it ([ -s filename ] gives zero exit code only if file
# exists and has a size greater than zero). This avoids making
# corrupt .d files which would play havoc with your next build.
$(G4TMPDIR)/exe/$(G4TARGET).d: $(G4TARGET).cc
@if [ ! -d $(G4TMP)/$(G4SYSTEM) ] ; then mkdir $(G4TMP)/$(G4SYSTEM) ;fi
@if [ ! -d $(G4TMPDIR) ] ; then mkdir $(G4TMPDIR) ;fi
@if [ ! -d $(G4TMPDIR)/exe ] ; then mkdir $(G4TMPDIR)/exe ;fi
@echo Making dependency for file $<...
@($(ECHO) $(G4TMPDIR)/exe/\\c ; \
g++ $(GPPFLAGS) $(CPPFLAGS) $< ) | sed 's!$(G4TMPDIR)/exe/$*.o!& $@!' >$@
@set -e;\
g++ $(GPPFLAGS) $(CPPFLAGS) $< |\
sed 's!$(G4TARGET)\.o!$(G4TMPDIR)/exe/& $@!' >$@;\
[ -s $@ ] || rm -f $@
ifneq ($(dependencies),)
-include $(dependencies)
endif
@@ -370,44 +348,3 @@ clean_bin:
@echo Removing application $(G4TARGET) ...
@rm -f ./core
@rm -f $(G4BINDIR)/$(G4TARGET)
############################+ targets for G4ODBMS +############################
ifdef G4ODBMS
cleandb: clean newboot
$(G4EXAMPLE_BOOT):
@echo Copying schema file to $(G4EXAMPLE_BOOT) for FDID $(G4EXAMPLE_FDID)
@rm -f $(G4EXAMPLE_BOOT_DIR)/$(name)
@rm -f $(G4EXAMPLE_BOOT_DIR)/$(name).FDDB
@rm -f $(G4EXAMPLE_BOOT_DIR)/*.$(name).DB
@$(HEP_ODBMS_DIR)/etc/getdb $(G4SCHEMA_DIR)/G4SCHEMA \
$(G4EXAMPLE_BOOT) $(G4SCHEMA_FDID)
newboot:
@echo Copying schema file to $(G4EXAMPLE_BOOT) for FDID $(G4EXAMPLE_FDID)
@rm -f $(G4EXAMPLE_BOOT_DIR)/$(name)
@rm -f $(G4EXAMPLE_BOOT_DIR)/$(name).FDDB
@rm -f $(G4EXAMPLE_BOOT_DIR)/*.$(name).DB
@$(HEP_ODBMS_DIR)/etc/getdb $(G4SCHEMA_DIR)/G4SCHEMA \
$(G4EXAMPLE_BOOT) $(G4SCHEMA_FDID)
$(G4EXAMPLE_FD):
@echo Creating new runtime federated database $(G4EXAMPLE_BOOT) for FDID $(G4EXAMPLE_FDID)
@rm -f $(G4EXAMPLE_FD_DIR)/$(name)
@rm -f $(G4EXAMPLE_FD_DIR)/$(name).FDDB
@rm -f $(G4EXAMPLE_FD_DIR)/*.$(name).DB
@$(HEP_ODBMS_DIR)/etc/getdb $(G4EXAMPLE_BOOT) \
$(G4EXAMPLE_FD) $(G4EXAMPLE_FDID)
newfd:
@echo Creating new runtime federated database $(G4EXAMPLE_BOOT) for FDID $(G4EXAMPLE_FDID)
@rm -f $(G4EXAMPLE_FD_DIR)/$(name)
@rm -f $(G4EXAMPLE_FD_DIR)/$(name).FDDB
@rm -f $(G4EXAMPLE_FD_DIR)/*.$(name).DB
@$(HEP_ODBMS_DIR)/etc/getdb $(G4EXAMPLE_BOOT) \
$(G4EXAMPLE_FD) $(G4EXAMPLE_FDID)
endif
############################- targets for G4ODBMS -############################