Import Geant4 7.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 11:11:55 +02:00
parent e083ffb441
commit 516dbf1a58
5914 changed files with 202605 additions and 71141 deletions
+36 -3
View File
@@ -41,9 +41,11 @@ ifeq ($(G4SYSTEM),Darwin-g++)
ECHO := /bin/echo -n
SHEXT := dylib
X11FLAGS := -I/usr/include/X11/extensions -I/usr/include/X11
X11LIBS := -L/usr/X11R6/lib -lXmu -lXt -lXext -lX11 -lSM -lICE
X11LIBS := -L/usr/X11R6/lib -lXmu -lXt -lXext -lX11 -lXi -lSM -lICE
XMFLAGS := -I/sw/include
# XMFLAGS := -I/usr/X11R6/include ##### some installations.
XMLIBS := -L/sw/lib -lXm -lXpm
# XMLIBS := -L/usr/X11R6/lib -lXm -lXpm ##### some installations.
DLDLIBS := -ldl
ifndef OGLHOME
OGLHOME := /usr/X11R6
@@ -54,14 +56,38 @@ ifeq ($(G4SYSTEM),Darwin-g++)
ifndef OGLLIBS
OGLLIBS := -L$(OGLHOME)/lib -lGLU -lGL
endif
#
# There are two ways to build shared libs (.dylib) on MacOSX.
# Up to now the "flat_namespace" option had been used ; but
# due to the fact that Apple promotes now the "two_level_namespace"
# way of doing, we had tried to build the shared libs in this way.
# But it appears that for the moment this option induces
# unresolved early crashes at runtim. These crashes are
# probably due to a problem in the sequence of execution
# of constructor of static objects that are now heavily
# used in Geant4.
# Waiting a solution to that, we put the "flat_namespace"
# way of doing as the default to build the .dylib (knowing
# that it is anyway not a long term solution).
# G.Barrand (16/07/2004)
#
#### G4_MACOSX_TWO_LEVEL_NAMESPACE = 1
ifdef G4_MACOSX_TWO_LEVEL_NAMESPACE
define build-granular-shared-lib
@libdir=`(cd $(@D);/bin/pwd)`; \
cd $(G4TMPDIR); \
g++ -dynamiclib -twolevel_namespace -undefined error -dynamic \
g++ -dynamiclib -twolevel_namespace -undefined define_a_way -dynamic \
-single_module -o $$libdir/$(@F) *.o -L$(G4LIB)/$(G4SYSTEM) \
$(patsubst lib%,-l%,$(patsubst %.lib,%,$(GLOBLIBS))) \
-L$(CLHEP_LIB_DIR) -l$(CLHEP_LIB) $(INTYLIBS)
endef
else
define build-granular-shared-lib
@libdir=`(cd $(@D);/bin/pwd)`; \
cd $(G4TMPDIR); \
g++ -dynamiclib -flat_namespace -undefined suppress -dynamic -single_module -o $$libdir/$(@F) $(INTYLIBS) *.o
endef
endif
ifdef G4_MACOSX_TWO_LEVEL_NAMESPACE
define build-global-shared-lib
@libdir=`(cd $(@D);/bin/pwd)`; \
cd $(G4TMP)/$(G4SYSTEM); \
@@ -71,5 +97,12 @@ ifeq ($(G4SYSTEM),Darwin-g++)
$(patsubst lib%,-l%,$(patsubst %.lib,%,$(GLOBLIBS))) \
-L$(CLHEP_LIB_DIR) -l$(CLHEP_LIB) $(INTYLIBS);
endef
else
define build-global-shared-lib
@libdir=`(cd $(@D);/bin/pwd)`; \
cd $(G4TMP)/$(G4SYSTEM); \
g++ -dynamiclib -flat_namespace -undefined suppress -dynamic -single_module -o $$libdir/$(@F) $(INTYLIBS) $(foreach dir,$(SUBLIBS),$(dir)/*.o);
endef
endif
endif
-1
View File
@@ -12,7 +12,6 @@ ifeq ($(G4SYSTEM),SUN-CC)
CCFLAGS := -g
endif
endif
CXXFLAGS += -features=no%anachronisms -mt -lpthread
ifdef G4LIB_BUILD_SHARED
CXXFLAGS += -KPIC
FCFLAGS += -KPIC
+27 -3
View File
@@ -1,5 +1,5 @@
#
# ------ WIN32/VC ------ Visual-C++ 6.0 SP5
# ------ WIN32/VC ------ Visual-C++ 7 .NET
#
ifeq ($(G4SYSTEM),WIN32-VC)
CXX := CL
@@ -12,9 +12,9 @@ ifeq ($(G4SYSTEM),WIN32-VC)
endif
CXXFLAGS += -MD -GR -GX -Zm200 -nologo -DWIN32
CXXFLAGS += -D_CONSOLE -D_WIN32 -DOS
CPPFLAGS += -DWIN32
CPPFLAGS += -DWIN32 -DXPNET
LDFLAGS += -FORCE /NODEFAULTLIB:MSVCRT.dll
SHEXT := dll
AR := LIB
ECHO := echo -e
@@ -30,6 +30,30 @@ ifeq ($(G4SYSTEM),WIN32-VC)
UI32LIBS := gdi32.lib user32.lib
endif
#
# Building DLLs (G.Barrand)
# -------------
# The commands below allow to build DLLs from the archive libraries.
# From a libG4xxx.a, it will extract the symbols with :
# DOS> dumpbin /symbols libG4xxx.a > G4xxx.dumpbin
# After that it will produce a G4xxx.def using the 'win32def' program.
# The G4xxx.def file will contain the list of symbols that are "exported"
# or made public for using the DLLs.
# The source win32def.c is in the geant4/config directory. The binary is
# built during the library installation process, and will be placed in
# $G4LIB/G4SYSTEM.
# If can also be built as follows :
# DOS> cl.exe /Fowin32def.exe win32def.c
# Then, to use it :
# DOS> win32def G4xxx < G4xxx.dumpbin > G4xxx.def
# Libraries libG4xxx.lib can also be built with :
# DOS> lib /def:G4xxx.def /out:libG4xxx.lib
# It also produces a libG4xxx.exp used to build the DLL.
# The DLL can be built with :
# DOS> link /dll /out:G4xxx.dll libG4xxx.exp libG4xxx.a <dependencies>
# Note that a DLL must be fully linked. You should NOT have undefined
# symbols as output of the link command.
#
define build-granular-shared-lib
@libdir=`(cd $(@D);/bin/pwd)`;\
cd $(G4TMP)/$(G4SYSTEM);\
-103
View File
@@ -1,103 +0,0 @@
#
# ------ WIN32/VC ------ Visual-C++ 7 .NET
#
ifeq ($(G4SYSTEM),WIN32-VC7)
CXX := CL
ifdef G4OPTIMISE
CXXFLAGS += -Ox
else
ifdef G4DEBUG
CXXFLAGS += -Od -Zi -Fd$(G4LIBDIR)/lib$(name)
endif
endif
CXXFLAGS += -MD -GR -GX -Zm200 -nologo -DWIN32
CXXFLAGS += -D_CONSOLE -D_WIN32 -DOS
CPPFLAGS += -DWIN32 -DXPNET
LDFLAGS += -FORCE /NODEFAULTLIB:MSVCRT.dll
SHEXT := dll
AR := LIB
ECHO := echo -e
FC := g77
# FCLIBS := -lf2c
ifndef OGLFLAGS
OGLFLAGS :=
endif
ifndef OGLLIBS
OGLLIBS := glu32.lib opengl32.lib
endif
ifndef UI32LIBS
UI32LIBS := gdi32.lib user32.lib
endif
#
# Building DLLs (G.Barrand)
# -------------
# The commands below allow to build DLLs from the archive libraries.
# From a libG4xxx.a, it will extract the symbols with :
# DOS> dumpbin /symbols libG4xxx.a > G4xxx.dumpbin
# After that it will produce a G4xxx.def using the 'win32def' program.
# The G4xxx.def file will contain the list of symbols that are "exported"
# or made public for using the DLLs.
# The source win32def.c is in the geant4/config directory. The binary is
# built during the library installation process, and will be placed in
# $G4LIB/G4SYSTEM.
# If can also be built as follows :
# DOS> cl.exe /Fowin32def.exe win32def.c
# Then, to use it :
# DOS> win32def G4xxx < G4xxx.dumpbin > G4xxx.def
# Libraries libG4xxx.lib can also be built with :
# DOS> lib /def:G4xxx.def /out:libG4xxx.lib
# It also produces a libG4xxx.exp used to build the DLL.
# The DLL can be built with :
# DOS> link /dll /out:G4xxx.dll libG4xxx.exp libG4xxx.a <dependencies>
# Note that a DLL must be fully linked. You should NOT have undefined
# symbols as output of the link command.
#
define build-granular-shared-lib
@libdir=`(cd $(@D);/bin/pwd)`;\
cd $(G4TMP)/$(G4SYSTEM);\
echo "Building $(name).dumpbin file ...";\
$(RM) $(name).dumpbin;\
dumpbin /symbols $(G4LIBDIR)/lib$(name).a > $(name).dumpbin;\
echo "Building $(name).def file ...";\
$(RM) $(name).def;\
$(G4LIB)/$(G4SYSTEM)/win32def.exe $(name) < $(name).dumpbin > $(name).def;\
$(RM) $(name).dumpbin;\
echo "Building lib$(name).exp and lib$(name).lib file ...";\
$(RM) $(G4LIBDIR)/lib$(name).exp;\
$(RM) $(G4LIBDIR)/lib$(name).lib;\
lib.exe /nologo /machine:ix86 /def:$(name).def \
/out:$(G4LIBDIR)/lib$(name).lib;\
$(RM) $(G4LIBDIR)/$(name).dll;\
echo "Building $(name).dll file ...";\
link.exe /nologo /dll /out:$(G4LIBDIR)/$(name).dll \
$(G4LIBDIR)/lib$(name).exp $(G4LIBDIR)/lib$(name).a \
/libpath:$(G4LIBDIR) $(GLOBLIBS) \
$(LIB_PATH)$(CLHEP_LIB_DIR) $(CLHEP_LIB) \
$(INTYLIBS) $(ANALYSISLIBS) $(UI32LIBS)
endef
define build-global-shared-lib
@libdir=`(cd $(@D);/bin/pwd)`;\
cd $(G4TMP)/$(G4SYSTEM);\
echo "Building $(name).dumpbin file ...";\
$(RM) $(name).dumpbin;\
dumpbin /symbols $(G4LIBDIR)/lib$(name).a > $(name).dumpbin;\
echo "Building $(name).def file ...";\
$(RM) $(name).def;\
$(G4LIB)/$(G4SYSTEM)/win32def.exe $(name) < $(name).dumpbin > $(name).def;\
$(RM) $(name).dumpbin;\
echo "Building lib$(name).exp and lib$(name).lib ...";\
$(RM) $(G4LIBDIR)/lib$(name).exp;\
$(RM) $(G4LIBDIR)/lib$(name).lib;\
lib.exe /nologo /machine:ix86 /def:$(name).def \
/out:$(G4LIBDIR)/lib$(name).lib;\
$(RM) $(G4LIBDIR)/$(name).dll;\
echo "Building $(name).dll ...";\
link.exe /nologo /dll /out:$(G4LIBDIR)/$(name).dll \
$(G4LIBDIR)/lib$(name).exp $(G4LIBDIR)/lib$(name).a \
/libpath:$(G4LIBDIR) $(GLOBLIBS) \
$(LIB_PATH)$(CLHEP_LIB_DIR) $(CLHEP_LIB) \
$(INTYLIBS) $(ANALYSISLIBS) $(UI32LIBS)
endef
endif