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