forked from EiffL/Angpow4CCL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
215 lines (170 loc) · 4.34 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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
ifndef MACH
MACH := $(shell uname)
endif
ifeq ($(MACH), Linux)
#==== Linux system
# choose compiler
include Linux_g++_make.inc
# include Linux_icpc_make.inc
#if unusal loction specify below (here is for nersc)
# FFTWLIB = -L$(FFTW_DIR)
# FFTWINC = -I$(FFTW_INC)
else
#==== Darwin system
# for clang needs OpenMP support tesed with clang 3.9
# include Darwin_clang_make.inc
include Darwin_g++_omp_make.inc
FFTWDIR = /opt/local
FFTWLIB = -L$(FFTWDIR)/lib
FFTWINC = -I$(FFTWDIR)/include
endif
# ==== Profiling ====
PROFIL=
ifdef PROFILING
PROFIL = -DPROFILING
endif
FFTWLIBN = $(FFTWLIB) -lfftw3 -lfftw3_threads
#FFTWLIBN = -L$(FFTWLIB) -lfftw3 -lfftw3_omp
OBJ = ./Objs/
EXE = ./bin/
INC = ./inc/
INCEXT = $(INC)Angpow/
SRC = ./src/
LIB = ./lib/
BOOSTDIR = $(INC)
BOOSTINC = -I$(BOOSTDIR)
CPPFLAGS += $(PROFIL) $(BOOSTINC) $(FFTWINC)
LDFLAGS += $(FFTWLIBN) -lm
# Define our target list
.PHONY: default
default: makedir lib angpow angcor magnification
.PHONY: all
all : makedir lib angpow
.PHONY: tidy
tidy :
find . -name "*~" | xargs -I {} rm {}
.PHONY: clean
clean :
rm -rf ./$(OBJ)/* ./$(EXE)/* ./$(LIB)/*
.PHONY: makedir
makedir :
@mkdir -p $(OBJ)
@mkdir -p $(EXE)
@mkdir -p $(LIB)
#C++ common Objects
CXXOBJ = $(OBJ)walltimer.o \
$(OBJ)walltime_c.o \
$(OBJ)angpow_bessel.o \
$(OBJ)angpow_chebyshevInt.o \
$(OBJ)angpow_radint.o \
$(OBJ)angpow_kinteg.o \
$(OBJ)angpow_pk2cl.o \
$(OBJ)angpow_tools.o \
$(OBJ)angpow_clbase.o \
$(OBJ)angpow_powspec.o \
$(OBJ)angpow_parameters.o \
$(OBJ)angpow_cosmo.o \
$(OBJ)angpow_ccl.o \
$(OBJ)angpow_ctheta.o
#$(OBJ)angpow_growth.o
CXXSHOBJ = walltimer.o \
walltime_c.o \
angpow_bessel.o \
angpow_chebyshevInt.o \
angpow_radint.o \
angpow_kinteg.o \
angpow_pk2cl.o \
angpow_tools.o \
angpow_clbase.o \
angpow_powspec.o \
angpow_parameters.o \
angpow_cosmo.o \
angpow_ccl.o \
angpow_ctheta.o \
angpow_growth.o
#C++ common Headers
CXXHDR = $(INCEXT)walltimer.h \
$(INCEXT)walltime_c.h \
$(INCEXT)angpow_quadinteg.h \
$(INCEXT)angpow_numbers.h \
$(INCEXT)angpow_exceptions.h \
$(INCEXT)angpow_func.h \
$(INCEXT)angpow_bessel.h \
$(INCEXT)angpow_fft.h \
$(INCEXT)angpow_chebyshevInt.h\
$(INCEXT)angpow_integrand_base.h \
$(INCEXT)angpow_integrand.h \
$(INCEXT)angpow_powspec_base.h \
$(INCEXT)angpow_powspec.h \
$(INCEXT)angpow_radial.h \
$(INCEXT)angpow_radial_base.h \
$(INCEXT)angpow_radint.h \
$(INCEXT)angpow_kinteg.h \
$(INCEXT)angpow_utils.h \
$(INCEXT)angpow_cosmo_base.h \
$(INCEXT)angpow_cosmo.h \
$(INCEXT)angpow_pk2cl.h \
$(INCEXT)angpow_tools.h \
$(INCEXT)angpow_parameters.h \
$(INCEXT)angpow_clbase.h \
$(INCEXT)angpow_ccl_private.h \
$(INCEXT)angpow_ctheta.h
#$(INCEXT)angpow_growth_base.h \
#$(INCEXT)angpow_growth.h
#$(INCEXT)angpow_filter_base.h \
#$(INCEXT)angpow_filter.h
#$(INCEXT)angpow_limber.h \
#C++ rule for compiling
$(OBJ)%.o: $(SRC)%.cc $(CXXHDR)
echo "compile... $@"
$(CXXCOMPILE) -I$(INC) -c $< -o $@
######################
.PHONY: sharelib
sharelib : $(CXXOBJ)
echo "make shared library..."
cd $(OBJ); \
$(CMDSHLCXX) -o ../$(LIB)libangpow.$(SLEXT) $(CXXSHOBJ) $(LDFLAGS)
.PHONY: lib
lib : $(LIB)libangpow.a
$(LIB)libangpow.a : $(CXXOBJ)
$(AR) $(ARFLAGS) $@ $^
###############
.PHONY: angpow
angpow: $(EXE)angpow
echo '---- angpow made'
$(OBJ)angpow.o: angpow.cc $(CXXHDR)
echo "compile... $@"
$(CXXCOMPILE) -I$(INC) -c $< -o $@
$(EXE)angpow : $(OBJ)angpow.o $(LIB)libangpow.a
echo "Link..."
$(CXXLINK) -o $@ $(OBJ)angpow.o -L$(LIB) -langpow $(LDFLAGS)
###############
.PHONY: angcor
angcor: $(EXE)angcor
echo '---- angcor made'
$(OBJ)angcor.o: angcor.cc $(CXXHDR)
echo "compile... $@"
$(CXXCOMPILE) -I$(INC) -c $< -o $@
$(EXE)angcor : $(OBJ)angcor.o $(LIB)libangpow.a
echo "Link..."
$(CXXLINK) -o $@ $(OBJ)angcor.o -L$(LIB) -langpow $(LDFLAGS)
###############
.PHONY: magnification
magnification: $(EXE)magnification
echo '---- magnification made'
$(OBJ)magnification.o: magnification.cc $(CXXHDR)
echo "compile... $@"
$(CXXCOMPILE) -I$(INC) -c $< -o $@
$(EXE)magnification : $(OBJ)magnification.o $(LIB)libangpow.a
echo "Link..."
$(CXXLINK) -o $@ $(OBJ)magnification.o -L$(LIB) -langpow $(LDFLAGS)
###############
.PHONY: debug
debug:
echo "Test with bench1 init file"
$(EXE)angpow angpow_bench1.ini
###############
.PHONY: fullcheck
fullcheck:
echo "Test with the whole set of init files"
./verif.sh