root / src / Makefile @ 2
Historique | Voir | Annoter | Télécharger (8,97 ko)
1 |
################### Makefile for Path ############ |
---|---|
2 |
# (C) PFL 2008 |
3 |
################################################# |
4 |
# Change the value of Machine before compiling |
5 |
# You might also have to edit the location of |
6 |
# some libraries (like mkl for ifort) |
7 |
|
8 |
Machine=gfortran |
9 |
|
10 |
########################################### |
11 |
# # |
12 |
########### Main supported compilers ## |
13 |
# # |
14 |
########################################### |
15 |
ifeq ($(Machine),ifort) |
16 |
# Flags for Ifort |
17 |
COMP=/opt/intel/fc/9.1.036/bin/ifort |
18 |
F90=${COMP} |
19 |
LINK=${COMP} -Vaxlib -L/usr/lib/ -L/opt/intel/mkl/8.1/lib/32/ -lguide -lpthread -lmkl_lapack -lmkl_ia32 -lmkl |
20 |
FreeF=-FR |
21 |
endif |
22 |
|
23 |
ifeq ($(Machine),g95) |
24 |
# Flags for g95 |
25 |
COMP=g95 -g -save-temps -Wall -fbounds-check |
26 |
#COMP=g95 -fbounds-check -g -ftrace=full -ftrace=frame -save-temps |
27 |
F90=${COMP} |
28 |
F77=${COMP} |
29 |
LINK=${COMP} -L/usr/lib/ -llapack -lblas |
30 |
FreeF=-ffree-form |
31 |
endif |
32 |
|
33 |
ifeq ($(Machine),gfortran) |
34 |
# Flags for gfortran |
35 |
COMP=gfortran -g -Wall -fbounds-check |
36 |
#COMP=g95 -fbounds-check -g -ftrace=full -ftrace=frame -save-temps |
37 |
F90=${COMP} |
38 |
F77=${COMP} |
39 |
LINK=${COMP} -L/usr/lib/ -llapack -lblas |
40 |
FreeF=-ffree-form |
41 |
endif |
42 |
|
43 |
|
44 |
ifeq ($(Machine),pgf) |
45 |
# Flags for PGF |
46 |
COMP=pgf90 |
47 |
FLAGS= -mp -fast -Kieee -fastsse -tpp7 -Mipa=fast |
48 |
F90=$(COMP) -c $(FLAGS) |
49 |
LINK=pgf90 $(FLAGS) -L/usr/local/pgi/linux86/6.2/lib -llapack -lblas -lpthread |
50 |
FreeF=-Mfree |
51 |
endif |
52 |
|
53 |
ifeq ($(Machine),pathscale) |
54 |
# Flags for PathScale |
55 |
COMP=/softs/pathscale/bin/pathf90 |
56 |
F90=${COMP} |
57 |
LINK=${COMP} -L/usr/lib/ -llapack -lblas |
58 |
FreeF=-FR |
59 |
endif |
60 |
|
61 |
ifeq ($(Machine),xlf) |
62 |
# Flags for Xlf |
63 |
COMP=xlf |
64 |
F90=${COMP} |
65 |
LINK=${COMP} -L/usr/lib/ -llapack -lblas |
66 |
FreeF=-qfree |
67 |
endif |
68 |
|
69 |
############################################ |
70 |
# |
71 |
# national center |
72 |
# |
73 |
############################################ |
74 |
# |
75 |
#### IDRIS |
76 |
# |
77 |
ifeq ($(Machine),vargas) |
78 |
# Flags for Xlf |
79 |
COMP=xlf |
80 |
F90=${COMP} |
81 |
F77=${COMP} |
82 |
LINK=${COMP} -L/usr/lib/ |
83 |
FreeF=-qfree |
84 |
endif |
85 |
|
86 |
ifeq ($(Machine),idris) |
87 |
# Flags for Xlf |
88 |
COMP=xlf |
89 |
F90=${COMP} |
90 |
F77=${COMP} |
91 |
LINK=${COMP} -L/usr/lib/ |
92 |
FreeF=-qfree |
93 |
endif |
94 |
# |
95 |
#### CINES |
96 |
# |
97 |
|
98 |
ifeq ($(Machine),jade) |
99 |
# Flags for Ifort |
100 |
COMP=ifort |
101 |
F90=${COMP} |
102 |
F77=${COMP} |
103 |
LINK=${COMP} -lguide -lpthread |
104 |
FreeF=-FR |
105 |
endif |
106 |
|
107 |
ifeq ($(Machine),zeus) |
108 |
# Flags for Xlf |
109 |
COMP=xlf |
110 |
F90=${COMP} |
111 |
F77=${COMP} |
112 |
LINK=${COMP} -L/usr/lib/ |
113 |
FreeF=-qfree |
114 |
endif |
115 |
|
116 |
|
117 |
############################################ |
118 |
# |
119 |
# local machines at the ENS Lyon |
120 |
# |
121 |
############################################ |
122 |
|
123 |
ifeq ($(Machine),arq) |
124 |
# Flags for arq Ifort |
125 |
COMP=ifort |
126 |
F90=${COMP} -g -check all -traceback |
127 |
F77=${F90} |
128 |
#F90=${COMP} |
129 |
LINK=${COMP} -lguide -lpthread |
130 |
FreeF=-FR |
131 |
endif |
132 |
|
133 |
|
134 |
|
135 |
ifeq ($(Machine),arqP) |
136 |
# Flags for arq Ifort |
137 |
COMP=ifort |
138 |
F90=${COMP} -g -check bounds -check format -check uninit -traceback |
139 |
F77=${F90} |
140 |
#F90=${COMP} |
141 |
LINK=${COMP} -lguide -lpthread -L/usr/lib/ \ |
142 |
-L/opt/intel/Compiler/11.1/064/mkl/lib/64 \ |
143 |
-Wl,--start-group -lmkl_intel_lp64 -lmkl_sequential \ |
144 |
-lmkl_core -Wl,--end-group -lpthread |
145 |
FreeF=-FR |
146 |
endif |
147 |
|
148 |
ifeq ($(Machine),arqg) |
149 |
# Flags for arq GFortran |
150 |
COMP=gfortran |
151 |
F90=${COMP} |
152 |
F77=${F90} |
153 |
#F90=${COMP} |
154 |
LINK=${COMP} -L/usr/lib/ -llapack -lblas |
155 |
FreeF=-ffree-form |
156 |
endif |
157 |
|
158 |
ifeq ($(Machine),psmn) |
159 |
# Flags for PSMN PathScale |
160 |
COMP=/softs/pathscale/bin/pathf90 |
161 |
F90=${COMP} |
162 |
LINK=${COMP} -L/usr/lib/ |
163 |
FreeF=-FR |
164 |
endif |
165 |
|
166 |
ifeq ($(Machine),psmnI) |
167 |
# Flags for PSMN Ifort v12 |
168 |
COMP=ifort |
169 |
F90=${COMP} -g -check all -traceback |
170 |
F77=${F90} |
171 |
#F90=${COMP} |
172 |
LINK=${COMP} -L/softs/intel/v12.0.084/mkl/lib/intel64 \ |
173 |
-L/softs/intel/v12.0.084/lib/intel64 -L/usr/lib \ |
174 |
-Wl,--start-group -lmkl_intel_lp64 -lmkl_sequential \ |
175 |
-lmkl_core -Wl,--end-group |
176 |
FreeF=-FR |
177 |
endif |
178 |
|
179 |
|
180 |
ifeq ($(Machine),psmnI11) |
181 |
# Flags for PSMN Ifort v11 |
182 |
COMP=ifort |
183 |
F90=${COMP} -g -check all -traceback |
184 |
F77=${F90} |
185 |
#F90=${COMP} |
186 |
LINK=${COMP} -lguide -lpthread -L/usr/lib/ \ |
187 |
-L/softs/intel/v11.1.069/mkl/lib/em64t \ |
188 |
-Wl,--start-group -lmkl_intel_lp64 -lmkl_sequential \ |
189 |
-lmkl_core -Wl,--end-group -lpthread |
190 |
FreeF=-FR |
191 |
endif |
192 |
|
193 |
|
194 |
ifeq ($(Machine),duo) |
195 |
# Flags for DUO Ifort |
196 |
COMP=/opt/intel/fc/9.1.037/bin/ifort |
197 |
#F90=${COMP} -g -check all |
198 |
F90=${COMP} |
199 |
LINK=${COMP} -Vaxlib -L/usr/lib/ -L/opt/intel/mkl/8.1/lib/32/ -lguide -lpthread -lmkl_lapack64 -lmkl |
200 |
FreeF=-FR |
201 |
endif |
202 |
|
203 |
ifeq ($(Machine),commander) |
204 |
# Flags for Commander Ifort |
205 |
COMP=/opt/intel/fc/9.0/bin/ifort |
206 |
#F90=${COMP} -g -check all |
207 |
F90=${COMP} |
208 |
LINK=${COMP} -Vaxlib -L/usr/lib/ -L/opt/intel/mkl/8.1/lib/32/ -lguide -lpthread -lmkl_lapack -lmkl_ia32 -lmkl |
209 |
FreeF=-FR |
210 |
endif |
211 |
|
212 |
Version=1.0 |
213 |
|
214 |
|
215 |
############################################################### |
216 |
# |
217 |
# Help Makefile |
218 |
# voir: http://gl.developpez.com/tutoriel/outil/makefile/ |
219 |
# |
220 |
############################################################### |
221 |
# $@ Le nom de la cible |
222 |
# $< Le nom de la première dépendance |
223 |
# $^ La liste des dépendances |
224 |
# $? La liste des dépendances plus récentes que la cible |
225 |
# $* Le nom du fichier sans suffixe |
226 |
|
227 |
SRC= Path.f90 \ |
228 |
PathCreate.f90 \ |
229 |
Read_geom.f90 \ |
230 |
Calc_zmat.f90 \ |
231 |
Calc_zmat_frag.f90 \ |
232 |
Calc_zmat_constr_frag.f90 \ |
233 |
Decomp_frag.f90 \ |
234 |
Calc_mixed_frag.f90 \ |
235 |
Calc_baker.f90 \ |
236 |
Calc_Xprim.f90 \ |
237 |
Calc_baker_allGeomF.f90 \ |
238 |
ConvertZmat_cart.f90 \ |
239 |
ConvertBakerInternal_cart.f90 \ |
240 |
ConvertZmat_cart_3.f90 \ |
241 |
Egrad.f90 \ |
242 |
Egrad_baker.f90 \ |
243 |
EgradPath.f90 \ |
244 |
egrad_gaussian.f90 \ |
245 |
egrad_mopac.f90 \ |
246 |
egrad_ext.f90 \ |
247 |
egrad_test.f90 \ |
248 |
egrad_vasp.f90 \ |
249 |
egrad_turbomole.f90 \ |
250 |
egrad_chamfre.f90 \ |
251 |
CalcHess.f90 \ |
252 |
Hupdate_all.f90 \ |
253 |
Hupdate_MS.f90 \ |
254 |
Hupdate_Bofill.f90 \ |
255 |
Hinvup_BFGS.f90 \ |
256 |
CalcTangent.f90 \ |
257 |
Step_RFO_all.f90 \ |
258 |
Step_GEDIIS.f90 \ |
259 |
Step_GEDIIS_All.f90 \ |
260 |
Energy_GEDIIS.f90 \ |
261 |
Step_DIIS_all.f90 \ |
262 |
Extrapol_int.f90 \ |
263 |
Extrapol_baker.f90 \ |
264 |
Extrapol_mixed.f90 \ |
265 |
Extrapol_cart.f90 \ |
266 |
IntCoord_der.f90 \ |
267 |
Step_DIIS.f90 \ |
268 |
Step_GDIIS_Simple_Err.f90 \ |
269 |
minv.f90 \ |
270 |
Space.f90 \ |
271 |
Space_GEDIIS.f90 \ |
272 |
Space_GEDIIS_all.f90 \ |
273 |
Space_all.f90 \ |
274 |
freemv.f90 \ |
275 |
Mat_util.f90 \ |
276 |
refsor.f90 \ |
277 |
Ginvse.f90 |
278 |
|
279 |
SRC0= ConvertNumAt.f90 \ |
280 |
CheckPeriodicBound.f90 \ |
281 |
Check_step.f90 \ |
282 |
TestCart.f90 \ |
283 |
Opt_Geom.f90 \ |
284 |
PrintGeom.f90 \ |
285 |
PrintGeomVasp.f90 \ |
286 |
test_zmat.f90 \ |
287 |
Annul.f90 \ |
288 |
addligne.f90 \ |
289 |
Splin1D.f90 \ |
290 |
bib_oper.f90 \ |
291 |
VectorPer.f90 \ |
292 |
ZmatBuild.f90 \ |
293 |
CalcCnct.f90 \ |
294 |
ConvXyzZmat.f90 \ |
295 |
ConvXyzMixed.f90 \ |
296 |
Add2indzmat.f90 \ |
297 |
CalcRmsd.f90\ |
298 |
AlignPartial.f90 \ |
299 |
Rotation_matrix.f90 \ |
300 |
valid.f90 \ |
301 |
upcase.f90\ |
302 |
CalcBMat_int.f90 \ |
303 |
CalcBMat_mixed.f90 \ |
304 |
ConvGrad_Cart2Int.f90 \ |
305 |
Int2cart.f90 \ |
306 |
Mixed2cart.f90 \ |
307 |
Write_path.f90 \ |
308 |
Write_vasp.f90 \ |
309 |
Std_ori.f90 \ |
310 |
Tensor.f90 \ |
311 |
cmshft.f90 \ |
312 |
sinangle.f90 \ |
313 |
Header.f90 \ |
314 |
gaussj.f90 \ |
315 |
Expand.f90 |
316 |
|
317 |
MAIN= $(SRC:.f90=.o) |
318 |
TOOLS= $(SRC0:.f90=.o) |
319 |
|
320 |
MOD = VarTypes.mod \ |
321 |
Path_module.mod \ |
322 |
Io_module.mod \ |
323 |
m_mrgrnk.mod |
324 |
|
325 |
MODo = $(MOD:.mod=.o) |
326 |
MODSRC = $(MOD:.mod=.f90) |
327 |
|
328 |
OBJ = ${MAIN} ${TOOLS} |
329 |
|
330 |
EXAMPLES = Path.valid parameter.dat |
331 |
|
332 |
|
333 |
############################################################### |
334 |
# |
335 |
# For now, we also give Lapack and Blas source files in case |
336 |
# the libraries are not found by the user |
337 |
# |
338 |
############################################################### |
339 |
SRCLAPACKD=$(wildcard ./lapack/double/*.f ) |
340 |
SRCLAPACKU=$(wildcard ./lapack/util/*.f ) |
341 |
SRCBLAS=$(wildcard ./blas/*.f ) |
342 |
|
343 |
OBJLAPACK=$(SCRLAPACKD:.f=.o) \ |
344 |
$(SCRLAPACKU:.f=.o) |
345 |
|
346 |
OBJBLAS=$(SRCBLAS:.f=.o) |
347 |
|
348 |
all: path utils |
349 |
|
350 |
install: |
351 |
mkdir ${PWD}/../exe |
352 |
ln -s ${PWD}/Path.exe ../exe/. |
353 |
ln -s ${PWD}/../utils/xyz2scan ../exe/. |
354 |
ln -s ${PWD}/../utils/xyz2path ../exe/. |
355 |
|
356 |
path: ${MODo} ${OBJ} |
357 |
${LINK} -o Path.exe ${OBJ} ${MODo} |
358 |
@echo "" |
359 |
@echo "Path.exe has been created." |
360 |
|
361 |
path_noL: ${MODo} ${OBJ} lapack blas |
362 |
${LINK} -o Path.exe ${OBJ} ${MODo} ./lapack/lapack.a ./blas/blas.a |
363 |
@echo "" |
364 |
@echo "Path.exe has been created." |
365 |
|
366 |
util: utils |
367 |
utils: xyz2scan xyz2path |
368 |
@echo "" |
369 |
@echo "Utilities have been created." |
370 |
@echo "Make sure that they are in your PATH environment" |
371 |
|
372 |
xyz2scan: ../utils/Xyz2Scan.f |
373 |
${F90} -o ../utils/xyz2scan ../utils/Xyz2Scan.f |
374 |
|
375 |
xyz2path: ../utils/Xyz2Path.f ../utils/Xyz2Path.param |
376 |
${F90} -o ../utils/xyz2path ../utils/Xyz2Path.f |
377 |
|
378 |
tgz: ${SRC0} ${SRC} Makefile ${EXAMPLES} ${MODSRC} ${SRCLAPACKD} ${SRCLAPACKU} ${SRCBLAS} |
379 |
tar -cvf Path_${Version}.tar ${SRC0} ${SRC} Makefile ${EXAMPLES} ${MODSRC} |
380 |
gzip Path_${Version}.tar |
381 |
mv Path_${Version}.tar.gz Path_${Version}.tgz |
382 |
@echo "Path_${Version}.tgz has been created." |
383 |
|
384 |
lapack: ${OBJLAPACK} |
385 |
ar rcs ./lapack/lapack.a ${OBJLAPACK} |
386 |
|
387 |
blas: ${OBJBLAS} |
388 |
ar rcs ./blas/blas.a ${OBJBLAS} |
389 |
|
390 |
clean: |
391 |
rm *~ "#"* *.s ${OBJ} ${MOD} ${MODo} ${OBJLAPACK} ${OBJBLAS} |
392 |
|
393 |
veryclean: clean |
394 |
rm Path.exe ./lapack/lapack.a ./blas/blas.a |
395 |
|
396 |
%.o : %.mod |
397 |
|
398 |
%.o: %.f90 ${MOD} |
399 |
${F90} -c $*.f90 |
400 |
|
401 |
%.o: %.f |
402 |
${F90} -o $@ -c $< |
403 |
|
404 |
%.exe: %.f90 |
405 |
${F90} -o $*.exe $*.f90 |
406 |
chmod u+x $*.exe |
407 |
|
408 |
%.mod: %.f90 |
409 |
${F90} -c $*.f90 |