Statistics
| Revision:

root / src / Makefile @ 5

History | View | Annotate | Download (9.4 kB)

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
      Calc_zmat.f90 \
236
      Calc_zmat_frag.f90 \
237
      Calc_zmat_constr_frag.f90 \
238
      Decomp_frag.f90 \
239
      Calc_mixed_frag.f90 \
240
      Calc_baker.f90 \
241
      Calc_Xprim.f90 \
242
      Calc_baker_allGeomF.f90 \
243
      ConvertZmat_cart.f90  \
244
      ConvertBakerInternal_cart.f90  \
245
      ConvertZmat_cart_3.f90  \
246
      Die.f90 \
247
      Warning.f90 \
248
      WriteList.f90 \
249
      SearchInput.f90 \
250
      CleanString.f90 \
251
      InString.f90 \
252
      Egrad.f90  \
253
      EgradPath.f90 \
254
      egrad_gaussian.f90 \
255
      egrad_mopac.f90 \
256
      egrad_siesta.f90 \
257
      egrad_ext.f90 \
258
      egrad_test.f90 \
259
      egrad_test_2D.f90 \
260
      egrad_vasp.f90 \
261
      egrad_turbomole.f90 \
262
      egrad_chamfre.f90 \
263
      egrad_LEPS.f90 \
264
      CalcHess.f90 \
265
      Hupdate_all.f90 \
266
      Hupdate_MS.f90 \
267
      Hupdate_Bofill.f90 \
268
      Hinvup_BFGS.f90 \
269
      Hinvup_DFP.f90 \
270
      CalcTangent.f90 \
271
      Step_RFO_all.f90 \
272
      Step_GEDIIS.f90  \
273
      Step_GEDIIS_All.f90 \
274
      Energy_GEDIIS.f90 \
275
      Step_DIIS_all.f90 \
276
      Extrapol_int.f90 \
277
      Extrapol_baker.f90 \
278
      Extrapol_mixed.f90 \
279
      Extrapol_cart.f90 \
280
      IntCoord_der.f90 \
281
      Step_DIIS.f90 \
282
      Step_GDIIS_Simple_Err.f90  \
283
      minv.f90 \
284
      Space.f90 \
285
      Space_GEDIIS.f90 \
286
      Space_GEDIIS_all.f90 \
287
      Space_all.f90 \
288
      freemv.f90 \
289
      Mat_util.f90 \
290
      refsor.f90 \
291
      Ginvse.f90
292

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

    
331
MAIN= $(SRC:.f90=.o)
332
TOOLS= $(SRC0:.f90=.o)
333

    
334
MOD = VarTypes.mod \
335
      Path_module.mod \
336
      Io_module.mod  \
337
      m_mrgrnk.mod
338
      
339
MODo = $(MOD:.mod=.o)
340
MODSRC = $(MOD:.mod=.f90)
341

    
342
OBJ = ${MAIN} ${TOOLS}
343

    
344
EXAMPLES = Path.valid  parameter.dat
345

    
346

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

    
357
OBJLAPACK=$(SRCLAPACKD:.f=.o) \
358
        $(SRCLAPACKU:.f=.o)
359

    
360
OBJBLAS=$(SRCBLAS:.f=.o)
361

    
362
all: path utils
363

    
364
install: 
365
	mkdir -p ${PWD}/../exe
366
	ln -s ${PWD}/Path.exe ../exe/.
367
	ln -s ${PWD}/../utils/xyz2scan ../exe/.
368
	ln -s ${PWD}/../utils/xyz2path ../exe/.
369

    
370
path: ${MODo} ${OBJ} 
371
	${LINK} -o Path.exe ${OBJ} ${MODo} ${LIBMATH} 
372
	@echo ""
373
	@echo "Path.exe has been created."
374

    
375
path_noL: ${MODo} ${OBJ} lapack blas
376
	${LINK} -o Path.exe ${OBJ} ${MODo}  ./lapack/lapack.a ./blas/blas.a
377
	@echo ""
378
	@echo "Path.exe has been created."
379

    
380
util: utils
381
utils:  xyz2scan xyz2path
382
	@echo ""
383
	@echo "Utilities have been created."
384
	@echo "Make sure that they are in your PATH environment"
385

    
386
xyz2scan: ../utils/Xyz2Scan.f90
387
	${F90} -o ../utils/xyz2scan ../utils/Xyz2Scan.f90
388

    
389
xyz2path: ../utils/Xyz2Path.f90 ../utils/Xyz2Path.param 
390
	${F90} -o ../utils/xyz2path ../utils/Xyz2Path.f90
391

    
392
tgz:  ${SRC0} ${SRC} Makefile ${EXAMPLES} ${MODSRC} ${SRCLAPACKD} ${SRCLAPACKU} ${SRCBLAS} 
393
	tar -cvf OpenPath_${Version}.tar ${SRC0} ${SRC} Makefile ${EXAMPLES} ${MODSRC}
394
	gzip OpenPath_${Version}.tar 
395
	mv  OpenPath_${Version}.tar.gz OpenPath_${Version}.tgz
396
	@echo "OpenPath_${Version}.tgz  has been created."
397

    
398
lapack: ${OBJLAPACK} 
399
	ar rcs ./lapack/lapack.a ${OBJLAPACK}
400

    
401
blas: ${OBJBLAS}
402
	ar rcs ./blas/blas.a ${OBJBLAS}
403

    
404
clean:
405
	rm -f *~ "#"* *.s ${OBJ} *.mod  ${MODo} ${OBJLAPACK} ${OBJBLAS}  
406

    
407
veryclean: clean
408
	rm -f Path.exe ./lapack/lapack.a  ./blas/blas.a ../utils/xyz2scan ../utils/xyz2path
409

    
410
%.o : %.mod
411

    
412
%.o: %.f90 ${MOD}
413
	${F90} -c $*.f90 
414

    
415
%.o: %.f
416
	${F90} -o $@ -c $<
417

    
418
%.exe: %.f90
419
	${F90} -o $*.exe $*.f90
420
	chmod u+x  $*.exe
421

    
422
%.mod: %.f90
423
	${F90} -c $*.f90