-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
118 lines (86 loc) · 2.37 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
#Makefile
DEBUGENABLE=0
DPENABLE=1
METISENABLE=0
PARDISOENABLE=1
SPAINVENABLE=1
VERBOSE=0
FC = gfortran
#FC = ifort
#ifort
ifeq ($(FC), ifort)
FFLAGS=-O3 -fpp -heap-arrays -qopenmp -parallel -qopt-matmul -qopt-report=5
FFLAGS+=-I${MKLROOT}/include -I${MKLROOT}/include/intel64/lp64 -L${MKLROOT}/lib/intel64
FLIBS += -liomp5 -lmkl_blas95_lp64 -lmkl_lapack95_lp64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core
FLIBS += -lpthread -lm -ldl
ifeq ($(DEBUGENABLE), 1)
FFLAGS += -g -check all -traceback -debug extended -debug inline-debug-info -check noarg_temp_created -warn all
endif
endif
#gfortan
ifeq ($(FC), gfortran)
FFLAGS=-O3 -cpp -fopenmp -fall-intrinsics
FFLAGS+=-I${MKLROOT}/include -I${MKLROOT}/include/intel64/lp64 -L${MKLROOT}/lib/intel64
FLIBS += -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_gf_lp64.a ${MKLROOT}/lib/intel64/libmkl_gnu_thread.a ${MKLROOT}/lib/intel64/libmkl_core.a -Wl,--end-group -lgomp
FLIBS += -lpthread -lm -ldl
ifeq ($(DEBUGENABLE), 1)
FFLAGS += -g -Wall -fcheck=all -fbacktrace -std=f2008
endif
endif
#ifx
ifeq ($(FC), ifx)
FFLAGS=-O3 -fpp -heap-arrays -qopenmp -parallel -qopt-matmul -qopt-report=5
FFLAGS+=-I${MKLROOT}/include -I${MKLROOT}/include/intel64/lp64 -L${MKLROOT}/lib/intel64
FLIBS += -liomp5 -lmkl_blas95_lp64 -lmkl_lapack95_lp64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core
FLIBS += -lpthread -lm -ldl
ifeq ($(DEBUGENABLE), 1)
FFLAGS += -g -check all -traceback -debug extended -debug inline-debug-info -check noarg_temp_created -warn all
endif
endif
ifeq ($(METISENABLE), 1)
LIBMETISROOT=~/metis-5.1.0
LIBMETIS=$(LIBMETISROOT)/build/Linux-x86_64/libmetis
FLIBS += $(LIBMETIS)/libmetis.a
METIS = 1
else
METIS = 0
endif
ifeq ($(DPENABLE),0)
DP=0
else
DP=1
endif
ifeq ($(PARDISOENABLE),1)
PARDISO=1
else
PARDISO=0
endif
ifeq ($(SPAINVENABLE),1)
SPAINV=1
else
SPAINV=0
endif
FFLAGS += -D_DP=$(DP) -D_METIS=$(METIS) -D_PARDISO=$(PARDISO) -D_SPAINV=$(SPAINV) -D_VERBOSE=$(VERBOSE)
FYPPFLAGS =
export FC
export FFLAGS
export FLIBS
export FYPPFLAGS
export METISENABLE
export PARDISOENABLE
export SPAINVENABLE
.PHONY: all clean examples lib test
all: lib
$(MAKE) --directory=test
examples:
$(MAKE) --directory=examples
lib:
$(MAKE) --directory=src -j
test: all
$(MAKE) --directory=test test
@echo
@echo "All tests passed."
clean:
$(MAKE) clean --directory=src
$(MAKE) clean --directory=examples
$(MAKE) clean --directory=test