-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·139 lines (109 loc) · 3.91 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#TO BE CHANGED BY USER:
#$ DRIVER NAME without .f90 extension
#$ COMPILER: supported compilers are ifort, gnu >v4.7 or use mpif90
#$ PLATFORM: supported platform are intel, gnu
#$ EXECUTABLE TARGET DIRECTORY (default is $HOME/.bin)
EXE=
FC=mpif90
PLAT=gnu
DIREXE=$(HOME)/.bin
# LIBRARIES TO BE INCLUDED
#$ LIB_ED: either use *edlat* or *dmft_ed* (until we fix the naming conventions)
#$ LIB_SS: specify slave spins library if any
#$ LIB_TB: specify custom tight-binding library if any
LIB_ED=dmft_ed
LIB_SS=slave_spins
#LIB_TB=honeytools
#NO NEED TO CHANGE DOWN HERE, only expert mode.
#########################################################################
ifdef LIB_ED
GLOB_INC+=$(shell pkg-config --cflags ${LIB_ED})
GLOB_LIB+=$(shell pkg-config --libs ${LIB_ED})
endif
ifdef LIB_SS
GLOB_INC+=$(shell pkg-config --cflags ${LIB_SS})
GLOB_LIB+=$(shell pkg-config --libs ${LIB_SS})
endif
ifdef LIB_TB
GLOB_INC+=$(shell pkg-config --cflags ${LIB_TB})
GLOB_LIB+=$(shell pkg-config --libs ${LIB_TB})
endif
GLOB_INC+=$(shell pkg-config --cflags dmft_tools scifor)
GLOB_LIB+=$(shell pkg-config --libs dmft_tools scifor)
ifeq ($(PLAT),intel)
FFLAG=-O3 -ftz
DFLAG=-p -O0 -g
AFLAG=-p -O0 -g -fpe0 -warn -warn errors -debug extended -traceback -check all,noarg_temp_created
FPPSERIAL =-fpp -D_
FPPMPI =-fpp -D_
endif
ifeq ($(PLAT),gnu)
FFLAG = -O3 -ffast-math -march=native -funroll-loops -ffree-line-length-none
DFLAG = -w -O0 -p -g -fimplicit-none -Wsurprising -Waliasing -fwhole-file -fcheck=all -pedantic -fbacktrace -ffree-line-length-none
AFLAG = -w -O0 -p -g -fbacktrace -fwhole-file -fcheck=all -fbounds-check -fsanitize=address -fdebug-aux-vars -Wall -Waliasing -Wsurprising -Wampersand -Warray-bounds -Wc-binding-type -Wcharacter-truncation -Wconversion -Wdo-subscript -Wfunction-elimination -Wimplicit-interface -Wimplicit-procedure -Wintrinsic-shadow -Wintrinsics-std -Wno-align-commons -Wno-overwrite-recursive -Wno-tabs -Wreal-q-constant -Wunderflow -Wunused-parameter -Wrealloc-lhs -Wrealloc-lhs-all -Wfrontend-loop-interchange -Wtarget-lifetime
FPPSERIAL =-cpp -D_
FPPMPI =-cpp -D_MPI
endif
##$ REVISION SOFTWARE VARIABLES
REV=$(shell git rev-parse HEAD)
REV=$(shell git rev-parse HEAD)
VER = 'character(len=41),parameter :: revision = "$(REV)"' > revision.inc
##$ Extends the implicit support of the Makefile to .f90 files
.SUFFIXES: .f90
define colorecho
@tput setaf $2
@tput bold
@echo $1
@tput sgr0
endef
all: FLAG:=${FFLAG} ${FPPMPI}
all:
@echo ""
$(call colorecho,"compiling $(EXE).f90 ", 6)
@echo ""
$(FC) $(FLAG) $(EXE).f90 -o $(DIREXE)/$(EXE) ${GLOB_INC} ${GLOB_LIB}
@echo "Done"
$(call colorecho,"created $(EXE) in $(DIREXE)", 1)
debug: FLAG:=${DFLAG} ${FPPMPI}
debug:
@echo ""
$(call colorecho,"compiling $(EXE).f90 ", 6)
@echo ""
$(FC) $(FLAG) $(EXE).f90 -o $(DIREXE)/$(EXE) ${GLOB_INC} ${GLOB_LIB}
@echo "Done"
$(call colorecho,"created $(EXE) in $(DIREXE)", 1)
aggressive: FLAG:=${AFLAG} ${FPPMPI}
aggressive:
@echo ""
$(call colorecho,"compiling $(EXE).f90 ", 6)
@echo ""
$(FC) $(FLAG) $(EXE).f90 -o $(DIREXE)/$(EXE) ${GLOB_INC} ${GLOB_LIB}
@echo "Done"
$(call colorecho,"created $(EXE) in $(DIREXE)", 1)
serial: FLAG:=${FFLAG} ${FPPSERIAL}
serial:
@echo ""
$(call colorecho,"compiling $(EXE).f90 ", 6)
@echo ""
$(FC) $(FLAG) $(EXE).f90 -o $(DIREXE)/$(EXE) ${GLOB_INC} ${GLOB_LIB}
@echo "Done"
$(call colorecho,"created $(EXEC) in $(DIREXE)", 1)
serial_testing: FLAG:=${TFLAG} ${FPPSERIAL}
serial_testing:
@echo ""
$(call colorecho,"compiling $(EXE).f90 ", 6)
@echo ""
$(FC) $(FLAG) $(EXE).f90 -o $(DIREXE)/$(EXE) ${GLOB_INC} ${GLOB_LIB}
@echo "Done"
serial_debug: FLAG:=${DFLAG} ${FPPSERIAL}
serial_debug:
@echo ""
$(call colorecho,"compiling $(EXE).f90 ", 6)
@echo ""
$(FC) $(FLAG) $(EXE).f90 -o $(DIREXE)/$(EXE) ${GLOB_INC} ${GLOB_LIB}
@echo "Done"
clean:
@echo "Cleaning:"
@rm -f *.mod *.o *~
@rm -fv $(DIREXE)/$(EXE)
#########################################################################