Statistiques
| Révision :

root / src / Makefile @ 7

Historique | Voir | Annoter | Télécharger (9,47 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 arq Ifort
17
COMP=ifort
18
#F90=${COMP}   -g -check bounds  -check format -check uninit  -traceback
19
F90=${COMP}   -g  -traceback
20
F77=${F90}
21
#F90=${COMP}  
22
LIBMATH=  -L/opt/intel/Compiler/11.1/064/mkl/lib/64  \
23
    -Wl,--start-group -lmkl_intel_lp64 -lmkl_sequential \
24
    -lmkl_core -Wl,--end-group 
25
LINK=${COMP} -lguide -lpthread   -L/usr/lib/ 
26
FreeF=-FR
27
endif
28

    
29

    
30
ifeq ($(Machine),g95)
31
# Flags for g95 
32
COMP=g95 -g   -Wall -fbounds-check
33
#COMP=g95  -fbounds-check -g -ftrace=full -ftrace=frame  -save-temps
34
F90=${COMP}
35
F77=${COMP}
36
LIBMATH= -llapack -lblas
37
LINK=${COMP}   -L/usr/lib/
38
FreeF=-ffree-form
39
endif
40

    
41
ifeq ($(Machine),gfortran)
42
# Flags for gfortran
43
COMP=gfortran  -pedantic -std=gnu 
44
#COMP=g95  -fbounds-check -g -ftrace=full -ftrace=frame  -save-temps
45
F90=${COMP}
46
F77=${COMP}
47
LIBMATH= -llapack -lblas
48
LINK=${COMP}   -L/usr/lib/
49
FreeF=-ffree-form
50
endif
51

    
52

    
53
ifeq ($(Machine),pgf)
54
# Flags for PGF
55
COMP=pgf90
56
FLAGS= -mp  -fast -Kieee -fastsse  -tpp7 -Mipa=fast
57
F90=$(COMP)  -c  $(FLAGS)
58
LIBMATH= -llapack -lblas
59
LINK=${COMP} $(FLAGS)  -L/usr/local/pgi/linux86/6.2/lib  -lpthread 
60
FreeF=-Mfree
61
endif
62

    
63
ifeq ($(Machine),pathscale)
64
# Flags for PathScale
65
COMP=/softs/pathscale/bin/pathf90
66
F90=${COMP}
67
LIBMATH= -llapack -lblas
68
LINK=${COMP}   -L/usr/lib/ 
69
FreeF=-FR
70
endif
71

    
72
ifeq ($(Machine),xlf)
73
# Flags for Xlf
74
COMP=xlf
75
F90=${COMP}
76
LIBMATH= -llapack -lblas
77
LINK=${COMP}   -L/usr/lib/ 
78
FreeF=-qfree
79
endif
80

    
81
############################################
82
#
83
# national center
84
#
85
############################################
86
#
87
#### IDRIS
88
#
89
ifeq ($(Machine),vargas)
90
# Flags for Xlf
91
COMP=xlf
92
F90=${COMP}
93
F77=${COMP}
94
LINK=${COMP}   -L/usr/lib/
95
FreeF=-qfree
96
endif
97

    
98
ifeq ($(Machine),idris)
99
# Flags for Xlf
100
COMP=xlf
101
F90=${COMP}
102
F77=${COMP}
103
LINK=${COMP}   -L/usr/lib/
104
FreeF=-qfree
105
endif
106
#
107
#### CINES
108
#
109

    
110
ifeq ($(Machine),jade)
111
# Flags for Ifort
112
COMP=ifort
113
F90=${COMP}
114
F77=${COMP}
115
LIBMATH=  -Wl,--start-group -lmkl_intel_lp64 -lmkl_sequential \
116
           -lmkl_core -Wl,--end-group
117
LINK=${COMP}  -lguide -lpthread 
118
FreeF=-FR
119
endif
120

    
121
ifeq ($(Machine),zeus)
122
# Flags for Xlf
123
COMP=xlf
124
F90=${COMP}
125
F77=${COMP}
126
LINK=${COMP}   -L/usr/lib/
127
FreeF=-qfree
128
endif
129

    
130

    
131
############################################
132
#
133
# local machines at the ENS Lyon
134
#
135
############################################
136

    
137
ifeq ($(Machine),arq)
138
# Flags for arq Ifort
139
COMP=ifort
140
F90=${COMP}   -g -check all -traceback
141
F77=${F90}
142
#F90=${COMP}  
143
LINK=${COMP} -lguide -lpthread 
144
FreeF=-FR
145
endif
146

    
147

    
148

    
149
ifeq ($(Machine),arqP)
150
# Flags for arq Ifort
151
COMP=ifort
152
#F90=${COMP}   -g -check bounds  -check format -check uninit  -traceback
153
F90=${COMP}   -g -check all  -traceback
154
F77=${F90}
155
#F90=${COMP}  
156
LIBMATH= -L/opt/intel/Compiler/11.1/064/mkl/lib/64  \
157
  -Wl,--start-group -lmkl_intel_lp64 -lmkl_sequential \
158
           -lmkl_core -Wl,--end-group
159
LINK=${COMP} -lguide -lpthread   -L/usr/lib/
160
FreeF=-FR
161
endif
162

    
163
ifeq ($(Machine),arqg)
164
# Flags for arq GFortran
165
COMP=gfortran -g -fbacktrace -fbounds-check -Wall -Wextra
166
F90=${COMP}  
167
F77=${F90}
168
#F90=${COMP}  
169
F90=${COMP}
170
LIBMATH= -llapack -lblas
171
LINK=${COMP}  -L/usr/lib/  
172
FreeF=-ffree-form
173
endif
174

    
175
ifeq ($(Machine),psmn)
176
# Flags for PSMN PathScale
177
COMP=/softs/pathscale/bin/pathf90
178
F90=${COMP}
179
LINK=${COMP}   -L/usr/lib/
180
FreeF=-FR
181
endif
182

    
183
ifeq ($(Machine),psmnI)
184
# Flags for PSMN Ifort v12
185
COMP=ifort
186
F90=${COMP}   -g -check all -traceback
187
F77=${F90}
188
#F90=${COMP}  
189
LIBMATH=    -L/softs/intel/v12.0.084/mkl/lib/intel64  \
190
 -L/softs/intel/v12.0.084/lib/intel64  -L/usr/lib \
191
  -Wl,--start-group -lmkl_intel_lp64 -lmkl_sequential \
192
           -lmkl_core -Wl,--end-group
193
LINK=${COMP}
194
FreeF=-FR
195
endif
196

    
197

    
198
ifeq ($(Machine),psmnI11)
199
# Flags for PSMN Ifort v11
200
COMP=ifort
201
F90=${COMP}   -g -check all -traceback
202
F77=${F90}
203
#F90=${COMP}  
204
LIBMATH=   -L/softs/intel/v11.1.069/mkl/lib/em64t  \
205
  -Wl,--start-group -lmkl_intel_lp64 -lmkl_sequential \
206
           -lmkl_core -Wl,--end-group 
207
LINK=${COMP} -lguide -lpthread   -L/usr/lib/
208
FreeF=-FR
209
endif
210

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

    
223
SRC=  Path.f90 \
224
      PathCreate.f90 \
225
      Read_geom.f90 \
226
      ReadGeom_cart.f90 \
227
      ReadGeom_vasp.f90 \
228
      ReadGeom_turbomole.f90 \
229
      ReadGeom_siesta.f90 \
230
      ReadInput.f90 \
231
      ReadInput_gaussian.f90 \
232
      ReadInput_vasp.f90 \
233
      ReadInput_mopac.f90 \
234
      ReadInput_siesta.f90 \
235
      ReadAnaList.f90 \
236
      PrintAnaList.f90 \
237
      AnaPath.f90 \
238
      AnalyzeGeom.f90 \
239
      Calc_zmat.f90 \
240
      Calc_zmat_frag.f90 \
241
      Calc_zmat_constr_frag.f90 \
242
      Decomp_frag.f90 \
243
      Calc_mixed_frag.f90 \
244
      Calc_baker.f90 \
245
      Calc_Xprim.f90 \
246
      Calc_baker_allGeomF.f90 \
247
      ConvertZmat_cart.f90  \
248
      ConvertBakerInternal_cart.f90  \
249
      ConvertZmat_cart_3.f90  \
250
      Die.f90 \
251
      Warning.f90 \
252
      WriteList.f90 \
253
      SearchInput.f90 \
254
      CleanString.f90 \
255
      InString.f90 \
256
      Egrad.f90  \
257
      EgradPath.f90 \
258
      egrad_gaussian.f90 \
259
      egrad_mopac.f90 \
260
      egrad_siesta.f90 \
261
      egrad_ext.f90 \
262
      egrad_test.f90 \
263
      egrad_test_2D.f90 \
264
      egrad_vasp.f90 \
265
      egrad_turbomole.f90 \
266
      egrad_chamfre.f90 \
267
      egrad_LEPS.f90 \
268
      CalcHess.f90 \
269
      Hupdate_all.f90 \
270
      Hupdate_MS.f90 \
271
      Hupdate_Bofill.f90 \
272
      Hinvup_BFGS.f90 \
273
      Hinvup_DFP.f90 \
274
      CalcTangent.f90 \
275
      Step_RFO_all.f90 \
276
      Step_GEDIIS.f90  \
277
      Step_GEDIIS_All.f90 \
278
      Energy_GEDIIS.f90 \
279
      Step_DIIS_all.f90 \
280
      Extrapol_int.f90 \
281
      Extrapol_baker.f90 \
282
      Extrapol_mixed.f90 \
283
      Extrapol_cart.f90 \
284
      IntCoord_der.f90 \
285
      Step_DIIS.f90 \
286
      Step_GDIIS_Simple_Err.f90  \
287
      minv.f90 \
288
      Space.f90 \
289
      Space_GEDIIS.f90 \
290
      Space_GEDIIS_all.f90 \
291
      Space_all.f90 \
292
      freemv.f90 \
293
      Mat_util.f90 \
294
      refsor.f90 \
295
      Ginvse.f90
296

    
297
SRC0= ConvertNumAt.f90 \
298
      CheckPeriodicBound.f90 \
299
      Check_step.f90 \
300
      TestCart.f90 \
301
      Opt_Geom.f90 \
302
      PrintGeom.f90 \
303
      PrintGeomVasp.f90 \
304
      test_zmat.f90 \
305
      Annul.f90 \
306
      addligne.f90 \
307
      Splin1D.f90 \
308
      bib_oper.f90 \
309
      VectorPer.f90 \
310
      ZmatBuild.f90 \
311
      CalcCnct.f90 \
312
      ConvXyzZmat.f90 \
313
      ConvXyzMixed.f90 \
314
      Add2indzmat.f90 \
315
      CalcRmsd.f90\
316
      AlignPartial.f90 \
317
      Rotation_matrix.f90 \
318
      valid.f90  \
319
      upcase.f90\
320
      CalcBMat_int.f90 \
321
      CalcBMat_mixed.f90 \
322
      ConvGrad_Cart2Int.f90 \
323
      Int2cart.f90 \
324
      Mixed2cart.f90 \
325
      Write_path.f90  \
326
      Write_vasp.f90  \
327
      Std_ori.f90 \
328
      Tensor.f90 \
329
      cmshft.f90 \
330
      sinangle.f90 \
331
      Header.f90 \
332
      gaussj.f90  \
333
      Expand.f90
334

    
335
MAIN= $(SRC:.f90=.o)
336
TOOLS= $(SRC0:.f90=.o)
337

    
338
MOD = VarTypes.mod \
339
      Path_module.mod \
340
      Io_module.mod  \
341
      m_mrgrnk.mod
342
      
343
MODo = $(MOD:.mod=.o)
344
MODSRC = $(MOD:.mod=.f90)
345

    
346
OBJ = ${MAIN} ${TOOLS}
347

    
348
EXAMPLES = Path.valid  parameter.dat
349

    
350

    
351
###############################################################
352
#
353
# For now, we also give Lapack and Blas source files in case
354
# the libraries are not found by the user
355
#
356
###############################################################
357
SRCLAPACKD=$(wildcard ./lapack/double/*.f )
358
SRCLAPACKU=$(wildcard ./lapack/util/*.f )
359
SRCBLAS=$(wildcard ./blas/*.f )
360

    
361
OBJLAPACK=$(SRCLAPACKD:.f=.o) \
362
        $(SRCLAPACKU:.f=.o)
363

    
364
OBJBLAS=$(SRCBLAS:.f=.o)
365

    
366
all: path utils
367

    
368
install: 
369
	mkdir -p ${PWD}/../exe
370
	ln -s ${PWD}/Path.exe ../exe/.
371
	ln -s ${PWD}/../utils/xyz2scan ../exe/.
372
	ln -s ${PWD}/../utils/xyz2path ../exe/.
373

    
374
path: ${MODo} ${OBJ} 
375
	${LINK} -o Path.exe ${OBJ} ${MODo} ${LIBMATH} 
376
	@echo ""
377
	@echo "Path.exe has been created."
378

    
379
path_noL: ${MODo} ${OBJ} lapack blas
380
	${LINK} -o Path.exe ${OBJ} ${MODo}  ./lapack/lapack.a ./blas/blas.a
381
	@echo ""
382
	@echo "Path.exe has been created."
383

    
384
util: utils
385
utils:  xyz2scan xyz2path
386
	@echo ""
387
	@echo "Utilities have been created."
388
	@echo "Make sure that they are in your PATH environment"
389

    
390
xyz2scan: ../utils/Xyz2Scan.f90
391
	${F90} -o ../utils/xyz2scan ../utils/Xyz2Scan.f90
392

    
393
xyz2path: ../utils/Xyz2Path.f90 ../utils/Xyz2Path.param 
394
	${F90} -o ../utils/xyz2path ../utils/Xyz2Path.f90
395

    
396
tgz:  ${SRC0} ${SRC} Makefile ${EXAMPLES} ${MODSRC} ${SRCLAPACKD} ${SRCLAPACKU} ${SRCBLAS} 
397
	tar -cvf OpenPath_${Version}.tar ${SRC0} ${SRC} Makefile ${EXAMPLES} ${MODSRC}
398
	gzip OpenPath_${Version}.tar 
399
	mv  OpenPath_${Version}.tar.gz OpenPath_${Version}.tgz
400
	@echo "OpenPath_${Version}.tgz  has been created."
401

    
402
lapack: ${OBJLAPACK} 
403
	ar rcs ./lapack/lapack.a ${OBJLAPACK}
404

    
405
blas: ${OBJBLAS}
406
	ar rcs ./blas/blas.a ${OBJBLAS}
407

    
408
clean:
409
	rm -f *~ "#"* *.s ${OBJ} *.mod  ${MODo} ${OBJLAPACK} ${OBJBLAS}  
410

    
411
veryclean: clean
412
	rm -f Path.exe ./lapack/lapack.a  ./blas/blas.a ../utils/xyz2scan ../utils/xyz2path
413

    
414
%.o : %.mod
415

    
416
%.o: %.f90 ${MOD}
417
	${F90} -c $*.f90 
418

    
419
%.o: %.f
420
	${F90} -o $@ -c $<
421

    
422
%.exe: %.f90
423
	${F90} -o $*.exe $*.f90
424
	chmod u+x  $*.exe
425

    
426
%.mod: %.f90
427
	${F90} -c $*.f90