Statistiques
| Révision :

root / src / Makefile @ 8

Historique | Voir | Annoter | Télécharger (9,12 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  -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 -Wall
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
      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
      Hinvup_DFP.f90 \
257
      CalcTangent.f90 \
258
      Step_RFO_all.f90 \
259
      Step_GEDIIS.f90  \
260
      Step_GEDIIS_All.f90 \
261
      Energy_GEDIIS.f90 \
262
      Step_DIIS_all.f90 \
263
      Extrapol_int.f90 \
264
      Extrapol_baker.f90 \
265
      Extrapol_mixed.f90 \
266
      Extrapol_cart.f90 \
267
      IntCoord_der.f90 \
268
      Step_DIIS.f90 \
269
      Step_GDIIS_Simple_Err.f90  \
270
      minv.f90 \
271
      Space.f90 \
272
      Space_GEDIIS.f90 \
273
      Space_GEDIIS_all.f90 \
274
      Space_all.f90 \
275
      freemv.f90 \
276
      Mat_util.f90 \
277
      refsor.f90 \
278
      Ginvse.f90
279

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

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

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

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

    
331
EXAMPLES = Path.valid  parameter.dat
332

    
333

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

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

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

    
349
all: path utils
350

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

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

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

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

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

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

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

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

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

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

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

    
397
%.o : %.mod
398

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

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

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

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