Import Geant4 6.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 10:49:58 +02:00
parent 96686e0c8f
commit 1d812b78b1
4545 changed files with 24433 additions and 175005 deletions
+29 -2
View File
@@ -1,5 +1,5 @@
$Id: History,v 1.231 2003/11/18 09:08:10 gcosmo Exp $
$Name: geant4-06-00 $
$Id: History,v 1.238 2004/02/24 09:49:45 gcosmo Exp $
$Name: geant4-06-01 $
-------------------------------------------------------------------
=========================================================
@@ -17,6 +17,33 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
24th February 2004 Gabriele Cosmo (config-V06-00-03)
- Fixed link rpath definition in Linux-icc.gmk.
11th February 2004 Gabriele Cosmo (config-V06-00-02)
- Added configuration file Linux-icc.gmk for Intel/icc compiler
on Linux systems.
10th February 2004 Guy Barrand
- WIN32-VC7.gmk: added material to build shared libs for Windows (DLLs).
- Added program win32def.c to help building DLLs, built from
source/GNUmakefile through a specialised target and placed in
$G4LIB/$G4SYSTEM.
- source/materials/GNUmakefile: modified to provide an example of macro
GLOBLIBS used by the DLL builder in order to have global lib dependencies.
9th February 2004 Gunter Folger (config-V06-00-01)
- architecture.gmk:
o Protect OGLFLAGS against containing -I/usr/include; this may cause
wrong includes to be picked up.
26th January 2004 Guy Barrand (config-V06-00-00)
- Darwin-g++.gmk:
o Use "g++" as a default compiler (in order to take the MacOSX
default compiler).
o Corrected procedure for building .dylib shared libs.
Previous default Linux commands do not work on MacOSX.
18th November 2003 Gabriele Cosmo (config-V05-02-05)
- Updated binmake.gmk to include new hadronics modules.
Coworks with "ghad-V05-02-00" and HEAD of processes/GNUmakefile.
+10 -1
View File
@@ -1,4 +1,4 @@
# $Id: architecture.gmk,v 1.90 2003/10/17 10:17:11 gbarrand Exp $
# $Id: architecture.gmk,v 1.91 2004/02/09 15:22:49 gunter Exp $
# ------------------------------------------------------------------------
# GEANT 4 - Architecture configuration script for GNU Make
#
@@ -260,6 +260,15 @@ GREP := grep
#
include $(G4INSTALL)/config/sys/$(G4SYSTEM).gmk
# make certain that OGLFLAGS does NOT contain -I/usr/include
# caused by OGLHOME being /usr, as e.g. on Linux
#
ifdef OGLFLAGS
OGLFLAGS:= $(filter-out -I/usr/include,$(OGLFLAGS))
OGLFLAGS:= $(filter-out -I/usr//include,$(OGLFLAGS))
endif
# If there is no cbrt() function...
#
ifdef G4_NO_CBRT
+15 -12
View File
@@ -3,15 +3,19 @@
#
# MacOS 10.1 GNU-gcc 2.92.2
# MacOS 10.2 there is g++2 and g++3, choose consistently one,
# like g++2 which is 2.95.2
# use echo -n (there is not the echo -e option of Linux)
# like g++2 which is 2.95.2, g++3 for 3.X.
# MacOS 10.3 use default MacOS-X compiler (g++) as the default.
# Have commands to build the .dylib (MacOS-X shared libs)
#
# Helmut Burkhardt - CERN
# Use echo -n (there is not the 'echo -e' option of Linux)
#
# Author: Helmut Burkhardt - CERN
#
ifeq ($(G4SYSTEM),Darwin-g++)
# choice of GNU compilers:
CXX := g++2
# CXX := g++3
# choice of compiler (take, as default, the MacOS default) :
# CXX := g++2
# CXX := g++3
CXX := g++
CXXFLAGS := -Wall -ansi -pedantic -pipe
# optionally add verbose flag
# CXXFLAGS += -v
@@ -36,12 +40,12 @@ ifeq ($(G4SYSTEM),Darwin-g++)
FCFLAGS += -fPIC
CCFLAGS += -fPIC
endif
G4RUNPATHOPTION := -Wl,-rpath
# G4RUNPATHOPTION := -Wl,-rpath
FC := g77
FCFLAGS += -fno-automatic -fno-backslash -fno-second-underscore
FCLIBS := -lg2c -lnsl
ECHO := /bin/echo -n
SHEXT := so
SHEXT := dylib
X11FLAGS := -I/usr/include/X11/extensions -I/usr/include/X11
X11LIBS := -L/usr/X11R6/lib -lXmu -lXt -lXext -lX11 -lSM -lICE
XMFLAGS := -I/usr/X11R6/include
@@ -60,13 +64,12 @@ ifeq ($(G4SYSTEM),Darwin-g++)
define build-granular-shared-lib
@libdir=`(cd $(@D);/bin/pwd)`; \
cd $(G4TMPDIR); \
$(CXX) -Wl,-soname,$(@F) -shared -o $$libdir/$(@F) *.o
g++ -dynamiclib -flat_namespace -undefined suppress -o $$libdir/$(@F) $(INTYLIBS) *.o
endef
define build-global-shared-lib
@libdir=`(cd $(@D);/bin/pwd)`; \
libdir=`(cd $(@D);/bin/pwd)`; \
cd $(G4TMP)/$(G4SYSTEM); \
$(CXX) -Wl,-soname,$(@F) -shared -o $$libdir/$(@F) \
$(foreach dir,$(SUBLIBS),$(dir)/*.o);
g++ -dynamiclib -flat_namespace -undefined suppress -o $$libdir/$(@F) $(INTYLIBS) $(foreach dir,$(SUBLIBS),$(dir)/*.o);
endef
endif
+60
View File
@@ -0,0 +1,60 @@
#
# ------ GNU/LINUX ------ !!! not supported !!!
# Intel icc 8.0
ifeq ($(G4SYSTEM),Linux-icc)
CXX := icc
CXXFLAGS := -ansi -mp -no-gcc -w1
ifdef G4OPTIMISE
CXXFLAGS += -O
FCFLAGS := -O
CCFLAGS := -O
else
ifdef G4DEBUG
CXXFLAGS += -g
FCFLAGS := -g
CCFLAGS := -g
endif
endif
ifdef G4PROFILE
CXXFLAGS += -qp
FCFLAGS += -qp
CCFLAGS += -pg
endif
ifdef G4LIB_BUILD_SHARED
CXXFLAGS += -fPIC
FCFLAGS += -fPIC
CCFLAGS += -fPIC
endif
G4RUNPATHOPTION := -Xlinker -rpath
CC := gcc
FC := g77
FCFLAGS += -fno-automatic -fno-backslash -fno-second-underscore
FCLIBS := -lg2c -lnsl
AR := xiar r
ECHO := /bin/echo -e
SHEXT := so
X11FLAGS := -I/usr/include/X11/extensions -I/usr/include/X11
X11LIBS := -L/usr/X11R6/lib -lXmu -lXt -lXext -lX11 -lSM -lICE
XMFLAGS := -I/usr/X11R6/include
XMLIBS := -lXm -lXpm
DLDLIBS := -ldl
ifndef OGLFLAGS
OGLFLAGS := -I$(OGLHOME)/include
endif
ifndef OGLLIBS
OGLLIBS := -L$(OGLHOME)/lib -lGLU -lGL
endif
OIVFLAGS += -I$(OIHOME)/include
define build-granular-shared-lib
@libdir=`(cd $(@D);/bin/pwd)`; \
cd $(G4TMPDIR); \
$(CXX) -Wl,-soname,$(@F) -shared -o $$libdir/$(@F) $(INTYLIBS) *.o
endef
define build-global-shared-lib
@libdir=`(cd $(@D);/bin/pwd)`; \
cd $(G4TMP)/$(G4SYSTEM); \
$(CXX) -Wl,-soname,$(@F) -shared -o $$libdir/$(@F) $(INTYLIBS) \
$(foreach dir,$(SUBLIBS),$(dir)/*.o);
endef
endif
+56 -3
View File
@@ -15,6 +15,7 @@ ifeq ($(G4SYSTEM),WIN32-VC7)
CPPFLAGS += -DWIN32 -DXPNET
LDFLAGS += -FORCE /NODEFAULTLIB:MSVCRT.dll
SHEXT := dll
AR := LIB
ECHO := echo -e
FC := g77
@@ -29,11 +30,63 @@ ifeq ($(G4SYSTEM),WIN32-VC7)
UI32LIBS := gdi32.lib user32.lib
endif
#
# Building DLLs (from G.Barrand)
# -------------
# The below commands permit 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 config/sys. 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
@echo "Shared Libraries not supported on $(G4SYSTEM)
@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;\
$(G4LIBDIR)/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)
endef
define build-global-shared-lib
@echo "Shared Libraries not supported on $(G4SYSTEM)
@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;\
$(G4LIBDIR)/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)
endef
endif
+170
View File
@@ -0,0 +1,170 @@
/* $Id: win32def.c,v 1.2 2004/02/09 16:44:45 gcosmo Exp $ */
/* +---------------------- Copyright notice -------------------------------+ */
/* | Copyright (C) 1995, Guy Barrand, LAL Orsay, (barrand@lal.in2p3.fr) | */
/* | Permission to use, copy, modify, and distribute this software | */
/* | and its documentation for any purpose and without fee is hereby | */
/* | granted, provided that the above copyright notice appear in all | */
/* | copies and that both that copyright notice and this permission | */
/* | notice appear in supporting documentation. This software is | */
/* | provided "as is" without express or implied warranty. | */
/* +---------------------- Copyright notice -------------------------------+ */
/*
This program is a tool to build .def file
used by lib.exe to build the DLL on Windows.
It takes the output of a "dumpbin" over an
archive library and produces the .def file for
this library. For example :
DOS> dumpbin /out:tmp /symbols MyLib.arc
DOS> win32def.exe MyLib < tmp > MyLib.def
Note that win32def is a standalone program that
can be easily reconstructed with :
DOS> cl /Fowin32def.exe win32def.c
*/
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
char** GetWords (char*,char*,int*);
/*****************************************************************************/
int main (
int aArgn
,char** aArgs
)
/*****************************************************************************/
{
#define MAX_STRING 2048
char buffer[MAX_STRING+1];
int length;
/*EXETYPE WINDOWS\n\ */
printf("\
LIBRARY %s\n\
EXPORTS\n",aArgs[1]);
while(1){
if(fgets(buffer,MAX_STRING,stdin)==NULL) return EXIT_FAILURE;
/*
On some system (NT) editors when saving binary files
put \r\n at place of \n ; we then look for \r\n.
*/
length = strlen(buffer);
if( (length>=2) && (buffer[length-2]=='\r') && (buffer[length-1]=='\n') ) {
buffer[length-2] = '\0';
length--;
length--;
} else if((length>=1) && (buffer[length-1]=='\n')) {
buffer[length-1] = '\0';
length--;
}
if(strstr(buffer,"SECT")==NULL) continue;
if(strstr(buffer,"??_")!=NULL) continue;
if(strstr(buffer,"External")==NULL) continue;
{
char** words;
int wordn;
words = GetWords (buffer," ",&wordn);
if(wordn>=8) {
int iword = 7;
if(strcmp(words[4],"()")==0) {
iword = 7;
} else if(strcmp(words[4],"External")==0) {
iword = 6;
}
if(words[iword][0]=='_') {
if(iword==6) {
printf(" %s\tDATA\n",words[iword]+1);
} else {
printf(" %s\n",words[iword]+1);
}
} else {
if(iword==6) {
printf(" %s\tDATA\n",words[iword]);
} else {
printf(" %s\n",words[iword]);
}
}
}
{int count;
for(count=0;count<wordn;count++) if(words[count]) free(words[count]);
if(words) free(words);}
}
/*printf("%s\n",buffer);*/
}
return EXIT_SUCCESS;
}
/*****************************************************************************/
char** GetWords (
char* a_string
,char* a_limiter
,int* a_number
)
/***************************************************************************/
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
{
#define STRDUP(str) ((str) != NULL ? (strcpy((char*)malloc((unsigned)strlen(str) + 1), str)) : (char*)NULL)
#define STRDEL(str) {if((str)!=NULL) {free(str);str=NULL;}}
int count;
char* string;
char* token;
int iline;
char** list = NULL;
int nline = 0;
/*.........................................................................*/
if(a_number!=NULL) *a_number = 0;
if( (a_string==NULL) || (*a_string=='\0') ) return NULL;
if(a_limiter==NULL) return NULL;
string = STRDUP(a_string);
if(string==NULL) return NULL;
nline = 16;
list = (char**)malloc(nline*sizeof(char*));
if(list==NULL) return NULL;
iline = 0;
token = string;
while(1) {
char* pos;
pos = strstr (token,a_limiter);
if(pos!=NULL) {
*pos = '\0';
if(*token!='\0') {
if(iline>=nline) {
nline +=16;
list = (char**)realloc(list,nline*sizeof(char*));
if(list==NULL) return NULL;
}
list[iline] = token;
iline++;
}
token = pos + strlen(a_limiter);
} else { /*last word*/
if(*token!='\0') {
if(iline>=nline) {
nline += 16;
list = (char**)realloc(list,nline*sizeof(char*));
if(list==NULL) return NULL;
}
list[iline] = token;
iline++;
}
break;
}
}
for(count=0;count<iline;count++) list[count] = STRDUP(list[count]);
STRDEL(string);
if(iline==0) {
if(list) free(list);
if(a_number!=NULL) *a_number = 0;
return NULL;
} else {
if(a_number!=NULL) *a_number = iline;
return list;
}
}