Upgrade to Geant4 version 3.0 (I.Hrivnacova)
[u/mrichter/AliRoot.git] / conf / Geant4.gmk
CommitLineData
a4c95ff7 1# $Id$
2
3################### Geant4 specific definitions ################################
4
5# include $(G4INSTALL)/config/architecture.gmk
6
7# Alice options flags
8ifdef AG4_VISUALIZE
9 CPPFLAGS += -DALICE_VISUALIZE
10endif
11
12ifdef AG4_STACKING
13 CPPFLAGS += -DALICE_STACKING
14endif
15
16ifdef AG4_NOPHYSICS
17 CPPFLAGS += -DALICE_EMPTY_PHYSICS_LIST
18endif
19
20#
21# C++ compilation flags
22#
23
24ifeq ($(ALICE_TARGET),Linux)
25
26# Redefinition of -Wall option
27# in order to exclude warnings from G4
28# excluded for Geant4: -Wswitch -Wunused
29
30 CXXOPTS := $(filter-out -Wall,$(CXXOPTS))
31 CXXOPTS += -Wimplicit-int -Wimplicit-function-declaration\
32 -Wimplicit -Wmain -Wreturn-type -Wcomment \
0eb27f7c 33 -Wtrigraphs -Wformat -Wchar-subscripts \
a4c95ff7 34 -Wparentheses
0eb27f7c 35 CXXOPTS := $(patsubst -O%,-O% -Wuninitialized,$(CXXOPTS))
a4c95ff7 36endif
0eb27f7c 37
38ifeq ($(ALICE_TARGET),HP-UX.aCC)
39
40# Adding options:
41# +Onolimit - excludes warnings from G4
42# +DAportable - necessary (if not set, run time error from object space)
43
44 CXXOPTS := $(patsubst -O%,-O% +Onolimit,$(CXXOPTS))
45 CXXOPTS := $(patsubst +O%,+O% +Onolimit,$(CXXOPTS))
46 CXXOPTS += +DAportable
47endif
a4c95ff7 48
4f78512d 49ifeq ($(ALICE_TARGET),OSF1)
50
51 CXXOPTS := $(filter-out -nostdnew,$(CXXOPTS))
52 CXXOPTS := $(filter-out -nortti,$(CXXOPTS))
53 CXXOPTS += -ieee -timplicit_local
54 ifndef G4NO_STD_NAMESPACE
55 G4USE_STD_NAMESPACE := yes
56 CXXOPTS += -std strict_ansi
57 endif
58
59endif
60
a4c95ff7 61#
62# Geant4 include paths
63#
64
65include $(G4INSTALL)/config/G4UI_USE.gmk
66include $(G4INSTALL)/config/G4VIS_USE.gmk
67include $(G4INSTALL)/config/interactivity.gmk
68ifndef INCFLAGS
69 INCFLAGS := \
70 -I$(G4BASE)/global/management/include \
71 -I$(G4BASE)/global/HEPRandom/include \
72 -I$(G4BASE)/global/HEPGeometry/include \
73 -I$(G4BASE)/global/HEPNumerics/include \
74 -I$(G4BASE)/run/include \
75 -I$(G4BASE)/materials/include \
76 -I$(G4BASE)/particles/management/include \
77 -I$(G4BASE)/particles/bosons/include \
78 -I$(G4BASE)/particles/leptons/include \
79 -I$(G4BASE)/particles/hadrons/barions/include \
80 -I$(G4BASE)/particles/hadrons/ions/include \
81 -I$(G4BASE)/particles/hadrons/mesons/include \
82 -I$(G4BASE)/particles/shortlived/include \
83 -I$(G4BASE)/processes/management/include \
84 -I$(G4BASE)/processes/general/include \
85 -I$(G4BASE)/processes/decay/include \
86 -I$(G4BASE)/processes/optical/include \
87 -I$(G4BASE)/processes/transportation/include \
88 -I$(G4BASE)/processes/parameterisation/include \
89 -I$(G4BASE)/processes/electromagnetic/standard/include \
90 -I$(G4BASE)/processes/electromagnetic/muons/include \
91 -I$(G4BASE)/processes/electromagnetic/utils/include \
92 -I$(G4BASE)/processes/electromagnetic/xrays/include \
93 -I$(G4BASE)/processes/electromagnetic/lowenergy/include \
94 -I$(G4BASE)/processes/hadronic/management/include \
95 -I$(G4BASE)/processes/hadronic/processes/include \
96 -I$(G4BASE)/processes/hadronic/util/include \
97 -I$(G4BASE)/processes/hadronic/cross_sections/include \
98 -I$(G4BASE)/processes/hadronic/models/generator/de_excitation/include \
99 -I$(G4BASE)/processes/hadronic/models/generator/diffractive_string/include \
100 -I$(G4BASE)/processes/hadronic/models/generator/high_energy/include \
101 -I$(G4BASE)/processes/hadronic/models/generator/kinetic_model/include \
102 -I$(G4BASE)/processes/hadronic/models/generator/management/include \
103 -I$(G4BASE)/processes/hadronic/models/generator/pre_equilibrium/include \
104 -I$(G4BASE)/processes/hadronic/models/generator/quark_gluon_string/include \
105 -I$(G4BASE)/processes/hadronic/models/generator/string_common/include \
106 -I$(G4BASE)/processes/hadronic/models/generator/string_fragmentation/include \
107 -I$(G4BASE)/processes/hadronic/models/generator/util/include \
108 -I$(G4BASE)/processes/hadronic/models/high_energy/include \
109 -I$(G4BASE)/processes/hadronic/models/low_energy/include \
110 -I$(G4BASE)/processes/hadronic/models/neutron_hp/include \
111 -I$(G4BASE)/processes/hadronic/models/isotope_production/include \
112 -I$(G4BASE)/processes/hadronic/stopping/include \
113 -I$(G4BASE)/geometry/management/include \
114 -I$(G4BASE)/geometry/solids/CSG/include \
115 -I$(G4BASE)/geometry/solids/specific/include \
116 -I$(G4BASE)/geometry/solids/BREPS/include \
117 -I$(G4BASE)/geometry/solids/Boolean/include \
118 -I$(G4BASE)/geometry/solids/STEP/include \
119 -I$(G4BASE)/geometry/solids/STEPinterface/include \
120 -I$(G4BASE)/geometry/volumes/include \
121 -I$(G4BASE)/geometry/magneticfield/include \
122 -I$(G4BASE)/track/include \
123 -I$(G4BASE)/tracking/include \
124 -I$(G4BASE)/digits+hits/detector/include \
125 -I$(G4BASE)/digits+hits/hits/include \
126 -I$(G4BASE)/digits+hits/digits/include \
127 -I$(G4BASE)/readout/include \
128 -I$(G4BASE)/event/include \
129 -I$(G4BASE)/graphics_reps/include \
130 -I$(G4BASE)/intercoms/include \
131 -I$(G4BASE)/g3tog4/include
132
133endif
134CPPFLAGS += $(INCFLAGS)
135
136#
137# Geant4 libraries
138#
139
140ifdef NEED_G4_LIBS
141
142G4TMPDIR := $(G4TMP)/$(G4SYSTEM)/$(G4TARGET)
143G4LIBDIR := $(G4LIB)/$(G4SYSTEM)
c51d764e 144LDFLAGS += -L$(G4LIBDIR) -L$(CLHEP_LIB_DIR)
a4c95ff7 145
146ifdef LDLIBS
147 USER_DEFINED_LDLIBS := 1
148endif
149
150# Because of the script for granular libraries which replaces part of LDLIBS
151# and because of the way user defined LDLIBS was augmented historically I
152# have split LDLIBS into 4 parts...
153#
154
155ifndef USER_DEFINED_LDLIBS
156
157# LDLIBS1 contains the very high level libraries...
158#
159ifdef G4EXLIB
160 LDLIBS1 := -l$(G4TARGET)
161endif
162 LDLIBS1 += $(EXTRALIBS)
163 LDLIBS1 += $(VISLIBS) $(UILIBS)
164
165# test if global libraries are present
166GLOBALLIBS := $(shell test -f $(G4LIBDIR)/libG4global.$(SL) && echo yes)
167
168ifdef GLOBALLIBS
169 LDLIBS2 := \
170 -lG4readout \
171 -lG4run \
172 -lG4event \
173 -lG4tracking \
174 -lG4processes \
175 -lG4particles \
176 -lG4digits+hits \
177 -lG4track \
178 -lG4materials \
179 -lG4geometry \
180 -lG4geometry \
181 -lG4graphics_reps \
182 -lG4intercoms \
183 -lG4global
184else
185 DUMMY := $(shell \
186 if [ ! \( -f $(G4INSTALL)/lib/$(G4SYSTEM)/list \) ]; then \
187 $(G4INSTALL)/lib/$(G4SYSTEM)/liblist \
188 -d $(G4INSTALL)/tmp/$(G4SYSTEM) \
189 < $(G4INSTALL)/lib/$(G4SYSTEM)/libname.map \
190 > $(G4INSTALL)/lib/$(G4SYSTEM)/list; fi )
191# Extra libraries to resolve remaining circular dependencies...
192 LDLIBS2 := $(shell cat $(G4INSTALL)/lib/$(G4SYSTEM)/list)
0eb27f7c 193# LDLIBS2 += -lG4xrays -lG4optical -lG4muons
a4c95ff7 194endif
195
196# Warning: do not add to LDLIBS2 with += becuase this causes it to be
197# expanded too soon. Hence extra libraries must have a different name...
198# Extra libraries to resolve remaining circular dependencies...
199# LDLIBS2EXTRA =
200
201# LDLIBS3 contains the first set of low level libraries...
202#
203 LDLIBS3 += $(INTYLIBS)
204
205endif # ifndef USER_DEFINED_LDLIBS
206
207# LDLIBS4 contains the next set of low level libraries which historically
208# (why?) the user is not supposed to be able to define...
209#
210ifdef G4USE_OSPACE
211 LDLIBS4 += $(OSPACELIBS)
212endif
213
214 LDLIBS4 += $(LOADLIBS)
215
216# Finally assemble libraries...
217#
218ifdef USER_DEFINED_LDLIBS
219 LDLIBS_PREFINAL := $(LDLIBS)
220else
0eb27f7c 221 LDLIBS_PREFINAL = $(LDLIBS1) -lG3toG4 $(LDLIBS2) $(LDLIBS2EXTRA) $(LDLIBS3)
a4c95ff7 222endif
223 LDLIBS_PREFINAL += $(LDLIBS4)
224
225LDLIBS = $(LDLIBS_PREFINAL)
226
0eb27f7c 227G4LDLIBS = $(LDLIBS)
a4c95ff7 228
229endif #ifdef NEED_G4_LIBS
230