-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile.main
executable file
·245 lines (188 loc) · 5.81 KB
/
Makefile.main
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
# -*- makefile -*-
#
# $COSMOPMC/Makefile.main
# Main Makefile, containing variables and settings, no rults. To be included
# by Makefiles in subdirectories
# Martin Kilbinger, Karim Benabed 2007-2010
#
# To specify machine- or user-specific settings, e.g. paths to packages,
# 'Makefile.Host' is included below.
#########################
# Compilers and linkers #
#########################
CC = gcc
MPICC = mpicc
LD = gcc
AR = ar
F90 = ifort
# Optimisation and Debugging
#OPTIM = -O2
OPTIM =
# Sometimes debugging does not work with -fPIC
FPIC = -fPIC
DEBUG = -g -DCOMM_DEBUG
# Compiler flags
WARNINGS = -Wunused
#WARNINGS += -Wall -pedantic
# Packages
GSL = /opt/local
FFTW = /usr/local
# Shared or static linking
# (Shared does not work at the moment)
DOSHARED = 0
#############################
# Flags to include packages #
#############################
# PMC library extern?
PMCLIB_EXT = 1
# CAMB+WMAP likelihood extern?
CMB_EXT = 0
#####################
# Basic directories #
#####################
TOOLS = $(COSMOPMC)/tools
WRAPPERS = $(COSMOPMC)/wrappers
ifeq ($(PMCLIB_EXT),1)
# $(PMCLIB) is set in Makefile.host
PMC = $(PMCLIB)
LIB_PMC = -Wl,-rpath,$(PMC)/lib -L$(PMC)/lib
INC_PMC = -I$(PMC)/include -I$(PMC)/include/pmctools -I$(PMC)/include/pmclib
else
PMC = $(COSMOPMC)/pmclib
LIB_PMC = -L$(PMC)
INC_PMC = -I$(PMC)/include -I$(TOOLS)/include
endif
DEMO = $(COSMOPMC)/Demo
EXEC = $(COSMOPMC)/exec
####################################################################
# Additional directories for cosmology and likelihood calculations #
####################################################################
# Add directory of new module here
# NEWMODULE = $(COSMOPMC)/newmodule
##############################
# CMB section: WMAP and camb #
##############################
# With or without WMAP?
DOWMAP = 1
# WMAP3, WMAP5 or WMAP7
NYR = 7
# Intel math kernel libraries, needed by WMAP likelihood
LIBLAPACK = -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lguide -lpthread
# F90 flags for CAMB
LIBF90 = -lifcore -limf -lsvml -lirc
FLIBPATH = /opt/intel/Compiler/11.1/080/lib/intel64
FFLAGS_CMB = -openmp -O2 -vec_report0
ifeq ($(F90), "ifort")
FFLAGS_CMB += -fpp
endif
#-openmp -O2 -ip -W0 -WB -fpp2 -vec_report0
# OpenMP flags for CAMB
OPENMP = -openmp
###############################################################
### The following includes may overwrite some of the above ###
### defined variables. ###
###############################################################
# Platform-specific flags
# Supported so far: Linus, Darwin (Mac OS X), AIX(?)
ifeq ("$(shell uname)", "Darwin")
ARCH = MacOSX
LIBLAPACK = -lmkl_lapack -lguide -lpthread
LIBLAPACK += -framework vecLib
LAPACKDIR = /opt/intel/Compiler/11.1/080/mkl/lib/em64t
GUIDEDIR = /opt/intel/Compiler/11.1/080/lib
FLIBPATH = /usr/lib
#CFITSIODIR = /usr/lib
#IFCOREDIR = /usr/lib
FFTW = /opt/local/
endif
###############################################################
### Host-specific Makefile to set paths, compilers, etc. ###
### Edit by hand or use './configure.py'. ###
###############################################################
-include $(COSMOPMC)/Makefile.host
###############################################################
### Change this section only if you know what you're doing! ###
###############################################################
# Library extensions
EXT_STATIC = a
ifeq ($(ARCH),MacOSX)
EXT_DYN = dylib
XSHARED = -dynamiclib -single_module
else
EXT_DYN = so
XSHARED = -shared
endif
ifeq ($(DOSHARED),1)
EXT = $(EXT_DYN)
SHARED = $(XSHARED)
else
# Static
EXT = a
SHARED =
endif
# Omission flags, to be passed on to the preprocessor. Excludes some packages
# More flags for WMAP
WMAPFLAGS = -DOPTIMIZE
FFLAGS = $(WMAPFLAGS) $(FPIC) $(OPENMP) -ip -O2 -Vaxlib -W0 -WB -fpp2
#############
# Libraries #
#############
LIBWRAP = libwr.$(EXT)
LIBERROR = liberrorio.$(EXT)
LIBMVDENS = libmvdens.$(EXT)
ifeq ($(PMCLIB_EXT),1)
LIBPMC = libpmc.$(EXT_DYN)
LIBPMC_MPI = libpmc_mpi.$(EXT_DYN)
else
LIBPMC = libpmc.$(EXT)
LIBPMC_MPI = libpmc_mpi.$(EXT)
endif
LIBPARAM = libparam.$(EXT)
LIBCMBBAO = libcmbbao.$(EXT)
LIBLENSING = liblensing.$(EXT)
LIBNOFZ = libnofz.$(EXT)
LIBSNIA = libsn1a.$(EXT)
LIBWMAP = libwmap$(NYR).$(EXT) libwmap$(NYR)_wrap.$(EXT)
LIBHALO = libhalomodel.$(EXT)
LIBCOYOTE = libcoyote.$(EXT)
#LIBBIAS = libbias.$(EXT)
# Add library of new module here:
# LIBNEWMODULE = libnewmodule.$(EXT)
###########################################
# Combined cosmo include and linker flags #
###########################################
# Add paths for new module here:
# IINCDIRS += -I$(NEWMODULE)/include
# LLIBDIRS += -L$(NEWMODULE)
# LLIBS += -lnewmodule
ifeq ($(DOWMAP),1)
IINCDIRS += -I$(CMB)
LLIBDIRS += -L$(MY_WMAP)
endif
IINCDIRS += -I$(NICAEA)/include
LLIBDIRS += -L$(NICAEA)/lib
LLIBS += -lnicaea
# Topo
ifdef TOPO
LLIBDIRS += -L$(TOPO)
LLIBS += -ltopo -lgfortran
endif
# Targets in exec
EXEC_TARGETS = cosmo_mcmc cosmo_pmc max_post go_fishing meanvar_sample histograms_sample meanvar_mixmvdens \
add_pmc_proposal cl_one_sided importance_sample getHODModel sample_GalCorr add_deduced_halomodel \
add_deduced_cosebis
ifeq ($(DOWMAP),1)
EXEC_TARGETS += sample_cmb
endif
ifdef TOPO
EXEC_TARGETS += topolike_test
endif
# Avoid some common 'icc' compiler warnings
ifeq ($(CC),icc)
WARNINGS += -wd981 -wd869 -wd188 -wd47
else
ARCHFLAGS += -std=gnu9x
endif
###############################################################
STATUS = "DEVEL"
###############################################################