-
Notifications
You must be signed in to change notification settings - Fork 10
/
makefile
118 lines (87 loc) · 4.81 KB
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
goal: duo
tarball:
tar cfz duo$(PLAT).tar.gz makefile *.f90
checkin:
ci -l Makefile *.f90
#FPATH =
EXE = j-duo-0902.x
FOR = ifort # Fortran compiler
# Lorenzo Lodi ---- meaning of some flags used by the Intel fortran compiler
# see (e.g.) file:https:///opt/intel/composer_xe_2011_sp1.8.273/Documentation/en_US/compiler_f/main_for/index.htm
# -O0 removes compiler optimization of the code. Code is slower in execution but compilation is much faster.
# -fltconsistency disables some optimisations which may lead to very small numerical roundoff errors
# -stand f95 gives warnings if non-Fortran95-compliant features are used
# -stand f03 gives warnings if non-Fortran03-compliant features are used
# -check all enables the following run-time checks:
# arg_temp_created => Determines whether checking occurs for actual arguments before routine calls.
# bounds => checks if accessing an out-of-bounds array element (e.g., x(0) when x is defined as x(1:NMAX)
# format => mismatch in the output format, e.g. write(*,'(F10.5)') i , and i is an integer
# output_conversion => output error, e.g. the number won't fit in the given spaces
# pointer => checks for disassociated/uninitialized pointers
# uninit => checks for uninitialized variables
# -warn all enables the following compile-time diagnostic checks:
# alignments => data that is not naturally aligned
# declarations => undeclared names
# errors => warnings are changed to errors
# general => various things
# ignore_loc => %LOC is stripped from an actual argument. (?)
# interfaces => compiler checks the interfaces
# stderrors => Fortran standard violations are changed to errors.
# truncated_source => source exceeds the maximum column width
# uncalled => statement function is never called
# unused => declared variables that are never used.
# usage => questionable programming practices.
# -traceback ***GOLDEN OPTION*** when a run-time error occurs it'll tell you the line in the source code responsible
# -fp-stack-check stops the program immediately when a NaN (Not-a-numeber) error occurs
# Other options:
# -O3 most agressive general optimization setting
# -ip enables additional interprocedural optimizations
# -g generate full debugging information in the object file
# -C compile only (=make .o files), but do not link .o files to produce executable
# -prof-value-profiling=all All value profile types are enabled and value profiling is performed.
#FFLAGS = -O0 -fpe0 -fltconsistency -stand f03 -check all -warn all -traceback -fp-stack-check # debugging options
FFLAGS = -O3 -ip -openmp
# FFLAGS = -C -check bounds -g -gen-interfaces -warn interfaces -check arg_temp_created -prof-value-profiling=all -warn all
#FFLAGS = -O0 # no optimization -- fast compilation
#FFLAGS = -C
#ARPACK = ~/libraries/ARPACK/libarpack_omp_64.a
LAPACK = -mkl=parallel
#LAPACK = -mkl=parallel -static
LIB = $(LAPACK)
###############################################################################
OBJ = grids.o accuracy.o lapack.o timer.o input.o diatom.o refinement.o functions.o symmetry.o dipole.o header_info.o atomic_and_nuclear_data.o
#compilation_details.o
duo: $(OBJ) duo.o
$(FOR) -o $(EXE) $(OBJ) $(FFLAGS) duo.o $(LIB)
duo.o: duo.f90 $(OBJ)
$(FOR) -c duo.f90 $(FFLAGS)
grids.o: grids.f90 accuracy.o input.o
$(FOR) -c grids.f90 $(FFLAGS)
diatom.o: diatom.f90 accuracy.o input.o lapack.o functions.o symmetry.o atomic_and_nuclear_data.o
$(FOR) -c diatom.f90 $(FFLAGS)
refinement.o: refinement.f90 accuracy.o input.o lapack.o diatom.o
$(FOR) -c refinement.f90 $(FFLAGS)
functions.o: functions.f90 accuracy.o input.o lapack.o
$(FOR) -c functions.f90 $(FFLAGS)
dipole.o: dipole.f90 accuracy.o input.o lapack.o diatom.o
$(FOR) -c dipole.f90 $(FFLAGS)
accuracy.o: accuracy.f90
$(FOR) -c accuracy.f90 $(FFLAGS)
symmetry.o: symmetry.f90
$(FOR) -c symmetry.f90 $(FFLAGS)
lapack.o: lapack.f90 accuracy.o timer.o
$(FOR) -c lapack.f90 $(FFLAGS)
timer.o: timer.f90
$(FOR) -c timer.f90 $(FFLAGS)
input.o: input.f90
$(FOR) -c input.f90 $(FFLAGS)
#compilation_details.o: compilation_details.f90
# $(FOR) -c compilation_details.f90 $(FFLAGS)
header_info.o: header_info.f90 accuracy.o
$(FOR) -c header_info.f90 $(FFLAGS)
atomic_and_nuclear_data.o: atomic_and_nuclear_data.f90
$(FOR) -c atomic_and_nuclear_data.f90 $(FFLAGS)
clean:
rm -f $(OBJ) *.mod *__genmod.f90 duo.o duo_test_0*
test: test_duo.f90
$(FOR) $(FFLAGS) test_duo.f90 -o duo_test.exe