-
Notifications
You must be signed in to change notification settings - Fork 26
/
Makefile
192 lines (150 loc) · 5.97 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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
COMPILER = mpicxx
EXE = piccante.exe
MAINFILE = main-piccante.cpp
FILES = grid.cpp \
structures.cpp \
current.cpp \
em_field.cpp \
particle_species.cpp \
output_manager.cpp \
utilities.cpp \
jsonparser.cpp
SRC_FOLDER = src
OBJ_FOLDER = obj
SRC = $(addprefix $(SRC_FOLDER)/, $(FILES))
OBJ = $(addprefix $(OBJ_FOLDER)/, $(addsuffix .o, $(basename $(FILES))))
#OBJDEV = $(addprefix $(OBJ_FOLDER)/, $(addsuffix .o, $(basename $(MAINFILE_DEV))))
ifneq (,$(findstring devel,$(config)))
MAINFILE = main-devel.cpp
endif
MAIN = $(addprefix $(SRC_FOLDER)/, $(MAINFILE))
MAINO = $(addprefix $(OBJ_FOLDER)/, $(addsuffix .o, $(basename $(MAINFILE))))
OBJ += $(addprefix $(OBJ_FOLDER)/, $(addsuffix .o, $(basename $(MAINFILE))))
LIB = -ljsoncpp
RPATH =
OPT = -O3 -std=c++11
BOOST_LIB = $(SRC_FOLDER)
BOOST_INC = $(SRC_FOLDER)
HDF5_INC = $(SRC_FOLDER)
HDF5_LIB = $(SRC_FOLDER)
JSONCPP_INC = /usr/include/jsoncpp
all: dirtree print-MAINFILE $(EXE)
dirtree:
mkdir -p $(OBJ_FOLDER)
print-% :
$(info $* : $($*)) @true
pippo:
@echo "$(MAINFILE)"
boost: OPT += -DUSE_BOOST
boost: LIB = -lboost_filesystem -lboost_system
boost: all
nocpp11: boost
nocpp11: OPT = -O3 -DNO_CXX11 -lboost_random
nocpp11: all
cnaf: boost
cnaf: BOOST_LIB = /shared/software/BOOST/boost_1_56_0/lib
cnaf: BOOST_INC = /shared/software/BOOST/boost_1_56_0/include
cnaf: all
cnaf-intel: boost
cnaf-intel: COMPILER = mpiicpc
cnaf-intel: OPT += -axSSE4.2,AVX -ipo
cnaf-intel: OPT_REPORT += -vec-report -opt-report 3
cnaf-intel: BOOST_LIB = /shared/software/BOOST/boost_1_56_0/lib
cnaf-intel: BOOST_INC = /shared/software/BOOST/boost_1_56_0/include
cnaf-intel: all
cnaf-phi: COMPILER = mpiicpc
cnaf-phi: OPT = -O3 -std=c++11 -mmic
cnaf-phi: RPATH = -Wl,-rpath=/shared/software/compilers/intel/compilers_and_libraries_2016.0.109/linux/compiler/lib/intel64_lin_mic
cnaf-phi: all
brew:
@echo ' '
@echo '"brew" is deprecated: use "make boost" instead'
@echo 'if it fails, check Makefile and adapt the rule "brewold"'
@echo ' '
brewold: boost
brewold: BOOST_LIB = /usr/local/Cellar/boost/1.63.0/lib
brewold: BOOST_INC = /usr/local/Cellar/boost/1.63.0/include
brewold: all
hdf5: boost
hdf5: OPT += -DUSE_HDF5
hdf5: HDF5_INC = /usr/lib/hdf5-1.8.12/hdf5/include
hdf5: HDF5_LIB = /usr/lib/hdf5-1.8.12/hdf5/lib
hdf5: LIB += -lhdf5
hdf5: all
warn: OPT += -Wall -Winline -Wextra
warn: all
debug: OPT = -O0 -g -std=c++11 -Wall
debug: all
profiling: OPT += -g -pg
profiling: all
scalasca: COMPILER = scalasca -instrument mpicxx
scalasca: OPT += -g
scalasca: all
sse2-vec: OPT += -ftree-vectorize -msse2 -ftree-vectorizer-verbose=5
sse2-vec: all
marconi: boost
marconi: OPT += -xCORE-AVX2 -ipo
marconi: BOOST_LIB = /cineca/prod/opt/libraries/boost/1.61.0/intelmpi--5.1--binary/lib
marconi: BOOST_INC = /cineca/prod/opt/libraries/boost/1.61.0/intelmpi--5.1--binary/include
marconi: all
marconi-knl: boost
marconi-knl: OPT += -axMIC-AVX512
marconi-knl: BOOST_LIB = /cineca/prod/opt/libraries/boost/1.61.0/intelmpi--2017--binary/lib
marconi-knl: BOOST_INC = /cineca/prod/opt/libraries/boost/1.61.0/intelmpi--2017--binary/include
marconi-knl: all
galileo: boost
galileo: OPT += -xCORE-AVX2 -ipo
galileo: BOOST_INC = /cineca/prod/libraries/boost/1.57.0/intel--cs-xe-2015--binary/include
galileo: BOOST_LIB = /cineca/prod/libraries/boost/1.57.0/intel--cs-xe-2015--binary/lib
galileo: all
galileo-phi: COMPILER = mpiicpc
galileo-phi: OPT = -O3 -std=c++11 -mmic
galileo-phi: all
fermi: COMPILER = mpixlcxx
fermi: LIB = -lboost_filesystem -lboost_system -lboost_random
fermi: BOOST_LIB = /cineca/prod/libraries/boost/1.51.0/bgq-xl--1.0/lib/
fermi: BOOST_INC = /cineca/prod/libraries/boost/1.51.0/bgq-xl--1.0/include/
fermi: all
fermi-perf: fermi
fermi-perf: OPT = -DUSE_BOOST -DNO_CXX11 -qstrict -O5 -qipa=partition=large -qarch=qp -qtune=qp -qmaxmem=-1
#fermi-perf: OPT = -DUSE_BOOST -DNO_CXX11 -qipa=level=2 -qipa=partition=large -O5 -qstrict -qinline -qhot -qlibmpi -qarch=qp -qtune=qp -qmaxmem=-1
#fermi-perf: OPT = -DUSE_BOOST -DNO_CXX11 -O5 -qstrict -qinline -qhot -qlibmpi -qarch=qp -qtune=qp -qmaxmem=-1
fermi-perf: all
fermi-scalasca: fermi
fermi-scalasca: COMPILER = scalasca -instrument mpixlcxx
fermi-scalasca: OPT = -DUSE_BOOST -DNO_CXX11
fermi-scalasca: EXE = piccante.scalasca
fermi-scalasca: all
fermi-debug: fermi
fermi-debug: OPT = -DUSE_BOOST -DNO_CXX11 -g -qfullpath -qcheck -qflttrap -qinitauto=FF -qkeepparm
fermi-debug: EXE = piccante.debug
fermi-debug: all
fermi-debug-ipa: fermi
fermi-debug-ipa: OPT = -DUSE_BOOST -DNO_CXX11 -qipa=partition=large -qarch=qp -qtune=qp -qmaxmem=-1 -g -qfullpath -qcheck -qflttrap -qinitauto=FF
fermi-debug-ipa: EXE = piccante.debug
fermi-debug-ipa: all
juqueen: nocpp11
juqueen: COMPILER = mpixlcxx
juqueen: OPT = -DUSE_BOOST -DNO_CXX11 -qstrict -O5 -qipa=partition=large -qarch=qp -qtune=qp -qmaxmem=-1
juqueen: LIB = -lboost_system-1_47 -lboost_filesystem-1_47 -lboost_random-1_47
juqueen: BOOST_LIB = /bgsys/local/boost/1.47.0/lib
juqueen: BOOST_INC = /bgsys/local/boost/1.47.0
juqueen: all
$(EXE): $(OBJ)
$(COMPILER) $(OPT) -L$(BOOST_LIB) -L$(HDF5_LIB) $(RPATH) -o $(EXE) $(OBJ) $(LIB)
$(OBJ_FOLDER)/%.o: $(SRC_FOLDER)/%.cpp $(SRC_FOLDER)/%.h $(SRC_FOLDER)/preproc_defs.h
$(COMPILER) $(OPT) -I$(BOOST_INC) -I$(HDF5_INC) -I$(JSONCPP_INC) -c -o $@ $<
#$(addprefix $(OBJ_FOLDER)/, $(addsuffix .o, $(basename $(MAINFILE)))) : $(SRC_FOLDER)/$(MAINFILE) $(SRC_FOLDER)/preproc_defs.h
# $(COMPILER) $(OPT) -I$(BOOST_INC) -I$(HDF5_INC) -I$(JSONCPP_INC) -c -o $(addprefix $(OBJ_FOLDER)/, $(addsuffix .o, $(basename $(MAINFILE)))) $(SRC_FOLDER)/$(MAINFILE)
$(MAINO) : $(MAIN) $(SRC_FOLDER)/preproc_defs.h
$(COMPILER) $(OPT) -I$(BOOST_INC) -I$(HDF5_INC) -I$(JSONCPP_INC) -c -o $(MAINO) $(MAIN)
clean:
rm -f $(OBJ) $(OBJDEV) *~
cleanall:
rm -f $(OBJ) $(OBJDEV) $(EXE) $(EXE).debug *~
help:
@echo 'Usage: make config=OPTIONS'
@echo ' OPTIONS is a string composed of one or more of:'
@echo ' devel : to compile using main-devel.cpp instead of default'
@echo ' examples:'
@echo ' make config=devel'