forked from editeodoro/Bbarolo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.in
307 lines (254 loc) · 7.88 KB
/
Makefile.in
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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
FLAGS = -O2 -ftree-vectorize -fPIC -Wuninitialized -std=c++11 @OPENMP_CXXFLAGS@ @CFLAGS@
#-march=native
#FLAGS = -O0 -g -fbounds-check -Wall -Wextra @OPENMP_CXXFLAGS@ @CFLAGS@
#FLAGS = -fast -Wall @OPENMP_CXXFLAGS@ @CFLAGS@
#WCSFLAGS = `pkg-config --cflags --libs wcslib`
OPS = @OP@
CC = @CC@ $(CFLAGS) $(FLAGS)
CXX = @CXX@ $(CFLAGS) $(FLAGS)
LINK= @CXX@ $(CFLAGS) $(FLAGS) -flto
BASE = @BASEDIR@
INSTALLDIR = @prefix@/bin
LIBDIR = @prefix@/lib
INCDIR = @prefix@/include/bbarolo
V = @PACKAGE_VERSION@
EXEC = BBarolo-$(V)
EXEC-STUB = BBarolo
AR = ar cq
LIB = libBBarolo-$(V).a
LIB_LN = libBBarolo.a
RANLIB = ranlib
SHAREDLIB = @SHRLD@
#SHAREDFLAGS = -shared -Wl,-soname,@SHRLIB@
LIBSO = @SHRLIB@
LIBSO_LN = @SHRLN@
INSTALL = @INSTALL@
LN_S = @LN_S@
CFITSIOINC = @CFITSIOINC@
CFITSIOLIB = @CFITSIOLIB@
FFTW3INC = @FFTW3INC@
FFTW3LIB = @FFTW3LIB@
WCSINC = @WCSINC@
WCSLIB = @WCSLIB@
PYINC = @PYTHON_INCLUDE@
PYLIB = @PYTHON_LIBS@
OPT = @GNUPLOT@ @FFTW3@ @HAVEPYTHON@ @HAVEMPI@
ifeq ($(OPS),MACOSX)
OPT += -DMACOSX
endif
#OPT += -DDOUBLE_PRECISION
OTHERLIB = -lm
CINC = -I$(BASE) $(FFTW3INC) $(CFITSIOINC) $(WCSINC) #$(PYINC)
LIBS = $(FFTW3LIB) $(CFITSIOLIB) $(WCSLIB) $(OTHERLIB) #$(PYLIB)
STATICLIBS = @STATICLIBS@ -lcurl -lz
#$(PYLIB)/libpython3.6.a
ARRAYDIR = $(BASE)/Arrays
MAPDIR = $(BASE)/Map
UTILDIR = $(BASE)/Utilities
TASKDIR = $(BASE)/Tasks
PYBBDIR = $(BASE)/../pyBBarolo
OBJDIR = $(BASE)/Build
HEADS = $(ARRAYDIR)/param.hh\
$(ARRAYDIR)/header.hh\
$(ARRAYDIR)/array.hpp\
$(ARRAYDIR)/cube.hh\
$(ARRAYDIR)/image.hh\
$(ARRAYDIR)/stats.hh\
$(ARRAYDIR)/rings.hh\
$(MAPDIR)/voxel.hh\
$(MAPDIR)/scan.hh\
$(MAPDIR)/object2D.hh\
$(MAPDIR)/object3D.hh\
$(MAPDIR)/detection.hh\
$(MAPDIR)/objectgrower.hh\
$(UTILDIR)/gnuplot.hh\
$(UTILDIR)/progressbar.hh\
$(UTILDIR)/lsqfit.hh\
$(UTILDIR)/paramguess.hh\
$(UTILDIR)/conv2D.hh\
$(UTILDIR)/utils.hh\
$(UTILDIR)/converter.hh\
$(UTILDIR)/allocator.hpp\
$(UTILDIR)/optimization.hh\
$(TASKDIR)/galmod.hh\
$(TASKDIR)/ringmodel.hh\
$(TASKDIR)/galfit.hh\
$(TASKDIR)/smooth3D.hh\
$(TASKDIR)/galwind.hh\
$(TASKDIR)/ellprof.hh\
$(TASKDIR)/moment.hh\
$(TASKDIR)/spacepar.hh\
$(TASKDIR)/search.hh\
$(TASKDIR)/rendering3D.hh\
OBJECTS = $(OBJDIR)/bbarolo.o\
$(OBJDIR)/header.o\
$(OBJDIR)/param.o\
$(OBJDIR)/stats.o\
$(OBJDIR)/cube.o\
$(OBJDIR)/search.o\
$(OBJDIR)/image.o\
$(OBJDIR)/object2D.o\
$(OBJDIR)/object3D.o\
$(OBJDIR)/objectgrower.o\
$(OBJDIR)/utils.o\
$(OBJDIR)/conv2D.o\
$(OBJDIR)/smooth3D.o\
$(OBJDIR)/moment.o\
$(OBJDIR)/galmod.o\
$(OBJDIR)/galwind.o\
$(OBJDIR)/galfit.o\
$(OBJDIR)/galfit_min.o\
$(OBJDIR)/galfit_errors.o\
$(OBJDIR)/galfit_out.o\
$(OBJDIR)/slitfit.o\
$(OBJDIR)/spacepar.o\
$(OBJDIR)/ringmodel.o\
$(OBJDIR)/progressbar.o\
$(OBJDIR)/ellprof.o\
$(OBJDIR)/string.o\
$(OBJDIR)/statistics.o\
$(OBJDIR)/interpolation.o\
$(OBJDIR)/converter.o\
$(OBJDIR)/wcsUtils.o\
$(OBJDIR)/fitsUtils.o\
$(OBJDIR)/paramguess.o\
$(OBJDIR)/BB_interface.o\
bbarolo : builddir $(OBJECTS)
$(LINK) -o $(EXEC-STUB) $(OBJECTS) $(LIBS) $(OPT)
$(OBJECTS) : $(HEADS)
%.o: %.cpp
$(CXX) $(OPT) -c $< -o $@ $(CINC)
$(OBJDIR)/%.o: $(BASE)/%.cpp
$(CXX) $(OPT) -c $< -o $@ $(CINC)
$(OBJDIR)/%.o: $(ARRAYDIR)/%.cpp
$(CXX) $(OPT) -c $< -o $@ $(CINC)
$(OBJDIR)/%.o: $(MAPDIR)/%.cpp
$(CXX) $(OPT) -c $< -o $@ $(CINC)
$(OBJDIR)/%.o: $(UTILDIR)/%.cpp
$(CXX) $(OPT) -c $< -o $@ $(CINC)
$(OBJDIR)/%.o: $(TASKDIR)/%.cpp
$(CXX) $(OPT) -c $< -o $@ $(CINC)
.cc.o:
$(CXX) -c $< $(CINC) -o $@ $(OPT)
.c.o:
$(CC) -c $< $(CINC) -o $@ $(OPT)
lib : builddir $(OBJECTS)
$(AR) $(LIB) $(OBJECTS)
$(RANLIB) $(LIB)
$(SHAREDLIB) $(CINC) $(LIBS) -o $(LIBSO) $(OBJECTS)
rm -rf $(LIBSO_LN) $(LIB_LN)
$(LN_S) $(LIBSO) $(LIBSO_LN)
$(LN_S) $(LIB) $(LIB_LN)
# $(CXX) $(SHAREDFLAGS) -o $(LIBSO) $(OBJECTS)
linux : $(OBJECTS)
$(LINK) -o BBarololinux $(OBJECTS) $(LIBS)
install :
$(INSTALL) -d -m 2755 $(INSTALLDIR)
ifneq ("$(wildcard BBarolo)","")
cp $(EXEC-STUB) $(EXEC)
$(RM) $(INSTALLDIR)/$(EXEC-STUB) $(INSTALLDIR)/$(EXEC)
$(INSTALL) -m 755 $(EXEC) $(INSTALLDIR)
$(LN_S) $(INSTALLDIR)/$(EXEC) $(INSTALLDIR)/$(EXEC-STUB)
$(RM) $(EXEC)
else
@echo "BBarolo executable not found: run 'make' before 'make install'"
endif
ifneq ("$(wildcard BBarolo_MPI)","")
$(RM) $(INSTALLDIR)/BBarolo_MPI
$(INSTALL) -m 755 BBarolo_MPI $(INSTALLDIR)
endif
installall : lib install
-test ! -f $(LIB) || $(INSTALL) -d -m 2755 $(LIBDIR)
-test ! -f $(LIB) || $(INSTALL) -m 644 $(LIB) $(LIBDIR)
-test ! -f $(LIB) || cd $(LIBDIR) && $(RM) $(LIB_LN) && $(LN_S) $(LIB) $(LIB_LN)
-test ! -f $(LIBSO) || $(INSTALL) -m 755 $(LIBSO) $(LIBDIR) && \
if [ "@SHRLN@" != "" ] ; then \
cd $(LIBDIR) && $(RM) $(LIBSO_LN) && $(LN_S) $(LIBSO) $(LIBSO_LN); \
fi
$(INSTALL) -d -m 2755 $(INCDIR)
$(INSTALL) -m 644 $(BASE)/*.hh $(INCDIR)
$(INSTALL) -d -m 2755 $(INCDIR)/Arrays
$(INSTALL) -m 644 $(ARRAYDIR)/*.hh $(INCDIR)/Arrays
$(INSTALL) -d -m 2755 $(INCDIR)/Map
$(INSTALL) -m 644 $(MAPDIR)/*.hh $(INCDIR)/Map
$(INSTALL) -d -m 2755 $(INCDIR)/Utilities
$(INSTALL) -m 644 $(UTILDIR)/*.hh $(INCDIR)/Utilities
uninstall :
$(RM) $(INSTALLDIR)/$(EXEC-STUB) $(INSTALLDIR)/$(EXEC) $(INSTALLDIR)/BBarolo_MPI
cd $(LIBDIR) && $(RM) $(LIB) $(LIB_LN) $(LIBSO) $(LIBSO_LN)
$(RM) -r $(INCDIR)
builddir:
mkdir -p $(OBJDIR)
.PHONY: clean
clean : cleanup
rm -rf $(OBJDIR) $(LIB) $(LIBSO) $(LIB_LN) $(LIBSO_LN)
.PHONY: cleanest
cleanest: clean
rm -rf Makefile $(EXEC) $(EXEC-STUB)
.PHONY: cleanup
cleanup:
rm -rf autom4te.cache config.log config.status setup.log
.PHONY: cleangui
cleangui:
cd ./src/GUI && make clean
gui :
cd ./src/GUI && mv BbaroloGUI.pro BbaroloGUI.or && \
cp BbaroloGUI.or BbaroloGUI.pro && \
echo "QMAKE_CC = $(CC) $(OPT) " >> BbaroloGUI.pro &&\
echo "QMAKE_CXX = $(CXX) $(OPT) " >> BbaroloGUI.pro &&\
echo "QMAKE_LINK = $(CXX) $(OPT) " >> BbaroloGUI.pro &&\
echo "QMAKE_LFLAGS -= -stdlib=libc++" >> BbaroloGUI.pro && \
echo "QMAKE_CFLAGS -= -stdlib=libc++" >> BbaroloGUI.pro && \
echo "QMAKE_CXXFLAGS -= -stdlib=libc++" >> BbaroloGUI.pro && \
echo "LIBS += $(LIBS) -static-libgcc -static-libstdc++" >> BbaroloGUI.pro && \
qmake && \
rm BbaroloGUI.pro && mv BbaroloGUI.or BbaroloGUI.pro && \
make
ifeq ($(OPS),MACOSX)
cp BBarolo ./BBaroloGUI.app/Contents/MacOS/
endif
justgui :
cd ./src/GUI && make
ifeq ($(OPS),MACOSX)
cp BBarolo ./BBaroloGUI.app/Contents/MacOS/
endif
all:
make && make gui
static: builddir $(OBJECTS)
$(LINK) -o $(EXEC-STUB) $(OBJECTS) $(STATICLIBS) $(OPT) -static-libgcc -static-libstdc++
guistatic :
rm -rf ./BBaroloGUI.app/Contents/Resources/qt.conf
macdeployqt ./BBaroloGUI.app
$(LINK) -o ./BBaroloGUI.app/Contents/MacOS/BBarolo $(OBJECTS) $(STATICLIBS) -static-libgcc -static-libstdc++
guistaticlinux :
cd ./src/GUI && mv BbaroloGUI.pro BbaroloGUI.or && \
cp BbaroloGUI.or BbaroloGUI.pro && \
echo "LIBS += $(STATICLIBS) -static-libgcc -static-libstdc++ " >> BbaroloGUI.pro && \
echo "QMAKE_FLAGS += $(OPT) $(CINC)" >> BbaroloGUI.pro && \
echo "QMAKE_FLAGS -= -stdlib=libc++" >> BbaroloGUI.pro && \
echo "QMAKE_LFLAGS -= -stdlib=libc++" >> BbaroloGUI.pro && \
echo "QMAKE_CC = $(CC)" >> BbaroloGUI.pro &&\
echo "QMAKE_CXX = $(CXX)" >> BbaroloGUI.pro &&\
echo "QMAKE_LINK = $(CXX)" >> BbaroloGUI.pro &&\
export PATH=/home/edt/Downloads/qt/bin/:$(PATH) &&\
qmake -config release &&\
rm BbaroloGUI.pro && mv BbaroloGUI.or BbaroloGUI.pro && \
make && \
cd ../.. &&\
$(LINK) -o BBarolo $(OBJECTS) $(STATICLIBS) -static-libgcc -static-libstdc++
mpi: lib
mpicxx $(FLAGS) -o BBarolo_MPI $(BASE)/bbarolo_mpi.cpp $(LIB) $(LIBS) $(OPT) $(CINC)
pybb : lib
mv $(LIB) $(PYBBDIR)
mv $(LIB_LN) $(PYBBDIR)
mv $(LIBSO) $(PYBBDIR)
mv $(LIBSO_LN) $(PYBBDIR)
pybbdist :
#python setup.py sdist upload
python setup.py sdist
twine upload --repository-url https://upload.pypi.org/legacy/ dist/*
rm -rf build dist MANIFEST
pybbinst:
python setup.py install
rm -rf build dist MANIFEST
rm -rf pyBBarolo/BBarolo pyBBarolo/libBB*