Statistiques
| Révision :

root / src / Makefile @ 7

Historique | Voir | Annoter | Télécharger (9,16 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=arqg
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  -fbounds-check -pedantic -std=gnu 
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
#F90=${COMP}   -g -check all  -traceback
140
F77=${F90}
141
#F90=${COMP}  
142
LINK=${COMP} -lguide -lpthread   -L/usr/lib/ \
143
  -L/opt/intel/Compiler/11.1/064/mkl/lib/64  \
144
  -Wl,--start-group -lmkl_intel_lp64 -lmkl_sequential \
145
           -lmkl_core -Wl,--end-group -lpthread 
146
FreeF=-FR
147
endif
148

    
149
ifeq ($(Machine),arqg)
150
# Flags for arq GFortran
151
COMP=gfortran -fbacktrace -fbounds-check -pedantic -std=gnu
152
F90=${COMP}  
153
F77=${F90}
154
#F90=${COMP}  
155
LINK=${COMP}  -L/usr/lib/   -llapack -lblas
156
FreeF=-ffree-form
157
endif
158

    
159
ifeq ($(Machine),psmn)
160
# Flags for PSMN PathScale
161
COMP=/softs/pathscale/bin/pathf90
162
F90=${COMP}
163
LINK=${COMP}   -L/usr/lib/
164
FreeF=-FR
165
endif
166

    
167
ifeq ($(Machine),psmnI)
168
# Flags for PSMN Ifort v12
169
COMP=ifort
170
F90=${COMP}   -g -check all -traceback
171
F77=${F90}
172
#F90=${COMP}  
173
LINK=${COMP}    -L/softs/intel/v12.0.084/mkl/lib/intel64  \
174
  -L/softs/intel/v12.0.084/lib/intel64  -L/usr/lib \
175
  -Wl,--start-group -lmkl_intel_lp64 -lmkl_sequential \
176
           -lmkl_core -Wl,--end-group
177
FreeF=-FR
178
endif
179

    
180

    
181
ifeq ($(Machine),psmnI11)
182
# Flags for PSMN Ifort v11
183
COMP=ifort
184
F90=${COMP}   -g -check all -traceback
185
F77=${F90}
186
#F90=${COMP}  
187
LINK=${COMP} -lguide -lpthread   -L/usr/lib/ \
188
  -L/softs/intel/v11.1.069/mkl/lib/em64t  \
189
  -Wl,--start-group -lmkl_intel_lp64 -lmkl_sequential \
190
           -lmkl_core -Wl,--end-group -lpthread
191
FreeF=-FR
192
endif
193

    
194

    
195
ifeq ($(Machine),duo)
196
# Flags for DUO Ifort
197
COMP=/opt/intel/fc/9.1.037/bin/ifort
198
#F90=${COMP}   -g -check all
199
F90=${COMP}  
200
LINK=${COMP} -Vaxlib   -L/usr/lib/  -L/opt/intel/mkl/8.1/lib/32/ -lguide -lpthread  -lmkl_lapack64 -lmkl
201
FreeF=-FR
202
endif
203

    
204
ifeq ($(Machine),commander)
205
# Flags for Commander Ifort
206
COMP=/opt/intel/fc/9.0/bin/ifort
207
#F90=${COMP}   -g -check all
208
F90=${COMP}
209
LINK=${COMP} -Vaxlib   -L/usr/lib/  -L/opt/intel/mkl/8.1/lib/32/ -lguide -lpthread -lmkl_lapack -lmkl_ia32  -lmkl
210
FreeF=-FR
211
endif
212

    
213
Version=1.0
214

    
215

    
216
###############################################################
217
#
218
# Help Makefile 
219
# voir: http://gl.developpez.com/tutoriel/outil/makefile/
220
#
221
###############################################################
222
# $@  	Le nom de la cible
223
# $< 	Le nom de la première dépendance
224
# $^ 	La liste des dépendances
225
# $? 	La liste des dépendances plus récentes que la cible
226
# $* 	Le nom du fichier sans suffixe
227

    
228
SRC=  Path.f90 \
229
      PathCreate.f90 \
230
      Read_geom.f90 \
231
      Calc_zmat.f90 \
232
      Calc_zmat_frag.f90 \
233
      Calc_zmat_constr_frag.f90 \
234
      Decomp_frag.f90 \
235
      Calc_mixed_frag.f90 \
236
      Calc_baker.f90 \
237
      Calc_Xprim.f90 \
238
      Calc_baker_allGeomF.f90 \
239
      ConvertZmat_cart.f90  \
240
      ConvertBakerInternal_cart.f90  \
241
      ConvertZmat_cart_3.f90  \
242
      Egrad.f90  \
243
      Egrad_baker.f90 \
244
      EgradPath.f90 \
245
      egrad_gaussian.f90 \
246
      egrad_mopac.f90 \
247
      egrad_ext.f90 \
248
      egrad_test.f90 \
249
      egrad_vasp.f90 \
250
      egrad_turbomole.f90 \
251
      egrad_chamfre.f90 \
252
      CalcHess.f90 \
253
      Hupdate_all.f90 \
254
      Hupdate_MS.f90 \
255
      Hupdate_Bofill.f90 \
256
      Hinvup_BFGS.f90 \
257
      Hinvup_DFP.f90 \
258
      CalcTangent.f90 \
259
      Step_RFO_all.f90 \
260
      Step_GEDIIS.f90  \
261
      Step_GEDIIS_All.f90 \
262
      Energy_GEDIIS.f90 \
263
      Step_DIIS_all.f90 \
264
      Extrapol_int.f90 \
265
      Extrapol_baker.f90 \
266
      Extrapol_mixed.f90 \
267
      Extrapol_cart.f90 \
268
      IntCoord_der.f90 \
269
      Step_DIIS.f90 \
270
      Step_GDIIS_Simple_Err.f90  \
271
      minv.f90 \
272
      Space.f90 \
273
      Space_GEDIIS.f90 \
274
      Space_GEDIIS_all.f90 \
275
      Space_all.f90 \
276
      freemv.f90 \
277
      Mat_util.f90 \
278
      refsor.f90 \
279
      Ginvse.f90
280

    
281
SRC0= ConvertNumAt.f90 \
282
      CheckPeriodicBound.f90 \
283
      Check_step.f90 \
284
      TestCart.f90 \
285
      Opt_Geom.f90 \
286
      PrintGeom.f90 \
287
      PrintGeomVasp.f90 \
288
      test_zmat.f90 \
289
      Annul.f90 \
290
      addligne.f90 \
291
      Splin1D.f90 \
292
      bib_oper.f90 \
293
      VectorPer.f90 \
294
      ZmatBuild.f90 \
295
      CalcCnct.f90 \
296
      ConvXyzZmat.f90 \
297
      ConvXyzMixed.f90 \
298
      Add2indzmat.f90 \
299
      CalcRmsd.f90\
300
      AlignPartial.f90 \
301
      Rotation_matrix.f90 \
302
      valid.f90  \
303
      upcase.f90\
304
      CalcBMat_int.f90 \
305
      CalcBMat_mixed.f90 \
306
      ConvGrad_Cart2Int.f90 \
307
      Int2cart.f90 \
308
      Mixed2cart.f90 \
309
      Write_path.f90  \
310
      Write_vasp.f90  \
311
      Std_ori.f90 \
312
      Tensor.f90 \
313
      cmshft.f90 \
314
      sinangle.f90 \
315
      Header.f90 \
316
      gaussj.f90  \
317
      Expand.f90
318

    
319
MAIN= $(SRC:.f90=.o)
320
TOOLS= $(SRC0:.f90=.o)
321

    
322
MOD = VarTypes.mod \
323
      Path_module.mod \
324
      Io_module.mod  \
325
      m_mrgrnk.mod
326
      
327
MODo = $(MOD:.mod=.o)
328
MODSRC = $(MOD:.mod=.f90)
329

    
330
OBJ = ${MAIN} ${TOOLS}
331

    
332
EXAMPLES = Path.valid  parameter.dat
333

    
334

    
335
###############################################################
336
#
337
# For now, we also give Lapack and Blas source files in case
338
# the libraries are not found by the user
339
#
340
###############################################################
341
SRCLAPACKD=$(wildcard ./lapack/double/*.f )
342
SRCLAPACKU=$(wildcard ./lapack/util/*.f )
343
SRCBLAS=$(wildcard ./blas/*.f )
344

    
345
OBJLAPACK=$(SCRLAPACKD:.f=.o) \
346
        $(SCRLAPACKU:.f=.o)
347

    
348
OBJBLAS=$(SRCBLAS:.f=.o)
349

    
350
all: path utils
351

    
352
install: 
353
	mkdir -p ${PWD}/../exe
354
	ln -s ${PWD}/Path.exe ../exe/.
355
	ln -s ${PWD}/../utils/xyz2scan ../exe/.
356
	ln -s ${PWD}/../utils/xyz2path ../exe/.
357

    
358
path: ${MODo} ${OBJ} 
359
	${LINK} -o Path.exe ${OBJ} ${MODo} 
360
	@echo ""
361
	@echo "Path.exe has been created."
362

    
363
path_noL: ${MODo} ${OBJ} lapack blas
364
	${LINK} -o Path.exe ${OBJ} ${MODo}  ./lapack/lapack.a ./blas/blas.a
365
	@echo ""
366
	@echo "Path.exe has been created."
367

    
368
util: utils
369
utils:  xyz2scan xyz2path
370
	@echo ""
371
	@echo "Utilities have been created."
372
	@echo "Make sure that they are in your PATH environment"
373

    
374
xyz2scan: ../utils/Xyz2Scan.f90
375
	${F90} -o ../utils/xyz2scan ../utils/Xyz2Scan.f90
376

    
377
xyz2path: ../utils/Xyz2Path.f90 ../utils/Xyz2Path.param 
378
	${F90} -o ../utils/xyz2path ../utils/Xyz2Path.f90
379

    
380
tgz:  ${SRC0} ${SRC} Makefile ${EXAMPLES} ${MODSRC} ${SRCLAPACKD} ${SRCLAPACKU} ${SRCBLAS} 
381
	tar -cvf OpenPath_${Version}.tar ${SRC0} ${SRC} Makefile ${EXAMPLES} ${MODSRC}
382
	gzip OpenPath_${Version}.tar 
383
	mv  OpenPath_${Version}.tar.gz OpenPath_${Version}.tgz
384
	@echo "OpenPath_${Version}.tgz  has been created."
385

    
386
lapack: ${OBJLAPACK} 
387
	ar rcs ./lapack/lapack.a ${OBJLAPACK}
388

    
389
blas: ${OBJBLAS}
390
	ar rcs ./blas/blas.a ${OBJBLAS}
391

    
392
clean:
393
	rm -f *~ "#"* *.s ${OBJ} ${MOD}  ${MODo} ${OBJLAPACK} ${OBJBLAS}  
394

    
395
veryclean: clean
396
	rm -f Path.exe ./lapack/lapack.a  ./blas/blas.a ../utils/xyz2scan ../utils/xyz2path
397

    
398
%.o : %.mod
399

    
400
%.o: %.f90 ${MOD}
401
	${F90} -c $*.f90 
402

    
403
%.o: %.f
404
	${F90} -o $@ -c $<
405

    
406
%.exe: %.f90
407
	${F90} -o $*.exe $*.f90
408
	chmod u+x  $*.exe
409

    
410
%.mod: %.f90
411
	${F90} -c $*.f90