forked from damonge/CoLoRe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile-gcc
148 lines (129 loc) · 3.67 KB
/
Makefile-gcc
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
########## User-definable stuff ##########
#
###Compiler and compilation options
COMP_SER = cc
COMP_MPI = cc
OPTIONS = -Wall -O3 -std=c99
#
### Behavioural flags
#Use double precision integer (enable in general)
DEFINEFLAGS += -D_LONGIDS
#Use normalized bias model
#DEFINEFLAGS += -D_BIAS_MODEL_2
#Use linear bias model
#DEFINEFLAGS += -D_BIAS_MODEL_3
#Generate debug help. Only useful for development
DEFINEFLAGS += -D_DEBUG
#Use double precision floating point? Set to "yes" or "no"
USE_SINGLE_PRECISION = yes
#Add random perturbations to kappa from redshifts outside the box
ADD_EXTRA_KAPPA = yes
#Compile with HDF5 capability? Set to "yes" or "no"
USE_HDF5 = yes
#Use OMP parallelization? Set to "yes" or "no"
USE_OMP = yes
#Use MPI parallelization? Set to "yes" or "no"
USE_MPI = no
#
###Path to libraries and headers
###If two or more of the dependencies reside in the same paths, only
###one instance is necessary.
#GSL
GSL_INC = -I/usr/include/gsl
GSL_LIB = -L/usr/lib/x86_64-linux-gnu
#FFTW
FFTW_INC =
FFTW_LIB =
#cfitsio
FITS_INC =
FITS_LIB =
#cfitsio
HDF5_INC =-I/usr/include/hdf5/serial
HDF5_LIB =-L/usr/lib/x86_64-linux-gnu/hdf5/serial/
#libconfig
CONF_INC =
CONF_LIB =
#healpix
HPIX_INC =-I/home/plaszczy/lib/Healpix_3.31/include
HPIX_LIB =-L/home/plaszczy/lib/Healpix_3.31/lib
#libsharp
SHT_INC =-I/home/plaszczy/lib/Healpix_3.31/src/cxx/optimized_gcc/include
SHT_LIB =-L/home/plaszczy/lib/Healpix_3.31/src/cxx/optimized_gcc/lib
#
########## End of user-definable ##########
USE_FITS = yes
DEFINEFLAGS += -DHAVE_INLINE -DGSL_RANGE_CHECK_OFF
ifeq ($(strip $(USE_OMP)),yes)
OPTIONS += -fopenmp
DEFINEFLAGS += -D_HAVE_OMP
endif #OMP
ifeq ($(strip $(USE_MPI)),yes)
DEFINEFLAGS += -D_HAVE_MPI
COMP_PAR = $(COMP_MPI)
else #MPI
COMP_PAR = $(COMP_SER)
endif #MPI
ifeq ($(strip $(USE_SINGLE_PRECISION)),yes)
DEFINEFLAGS += -D_SPREC
ifeq ($(strip $(USE_OMP)),yes)
LIB_FFTW += -lfftw3f_omp
endif #OMP
ifeq ($(strip $(USE_MPI)),yes)
LIB_FFTW += -lfftw3f_mpi
endif #MPI
LIB_FFTW += -lfftw3f
else #SINGLE_PRECISION
ifeq ($(strip $(USE_OMP)),yes)
LIB_FFTW += -lfftw3_omp
endif #OMP
ifeq ($(strip $(USE_MPI)),yes)
LIB_FFTW += -lfftw3_mpi
endif #MPI
endif #SINGLE_PRECISION
LIB_FFTW += -lfftw3
# for fftlog
LIB_FFTW += -lfftw3
OPTIONS += $(DEFINEFLAGS)
INC_ALL = -I./src $(GSL_INC) $(FFTW_INC) $(FITS_INC) $(HDF5_INC) $(CONF_INC) $(SHT_INC) $(HPIX_INC)
LIB_ALL = $(GSL_LIB) $(FFTW_LIB) $(FITS_LIB) $(HDF5_LIB) $(CONF_LIB) $(SHT_LIB) $(HPIX_LIB) -lconfig -lgsl -lgslcblas $(LIB_FFTW) -lcfitsio -lchealpix
ifeq ($(strip $(ADD_EXTRA_KAPPA)),yes)
DEFINEFLAGS += -D_ADD_EXTRA_KAPPA -D_WITH_SHT
LIB_ALL += -lsharp -lfftpack -lc_utils
endif #EXTRA_KAPPA
ifeq ($(strip $(USE_HDF5)),yes)
DEFINEFLAGS += -D_HAVE_HDF5
LIB_ALL += -lhdf5 -lhdf5_hl -lz
endif #HDF5
ifeq ($(strip $(USE_FITS)),yes)
DEFINEFLAGS += -D_HAVE_FITS
#LIB_ALL += -lcfitsio
endif #FITS
LIB_ALL += -lm
COMMONO = src/common.o
COSMOMADO = src/cosmo_mad.o
COSMOO = src/cosmo.o
FOURIERO = src/fourier.o
DENSO = src/density.o
SRCSO = src/srcs.o
IMAPO = src/imap.o
KAPPAO = src/kappa.o
ISWO = src/isw.o
IOO = src/io.o
HPIXO = src/healpix_extra.o
BEAMO = src/beaming.o
PREDICTO = src/predictions.o
FFTLOGO = src/fftlog.o
MAIN = src/main.c
OFILES = $(COMMONO) $(COSMOMADO) $(COSMOO) $(FOURIERO) $(DENSO) $(BEAMO) $(IOO) $(HPIXO) $(SRCSO) $(IMAPO) $(KAPPAO) $(ISWO) $(FFTLOGO) $(PREDICTO)
#OFILES = $(COMMONO) $(COSMOMADO) $(COSMOO) $(FOURIERO) $(DENSO) $(LCO) $(IOO) $(HPIXO) $(PIXO) $(PREDICTO) $(FFTLOGO)
EXEC = CoLoRe
default : $(EXEC)
%.o : %.c
$(COMP_CC) $(OPTIONS) $(INC_ALL) -c $< -o $@
$(OFILES) : COMP_CC := $(COMP_PAR)
$(EXEC) : $(OFILES)
$(COMP_PAR) $(OPTIONS) $(INC_ALL) $(OFILES) $(MAIN) -o $(EXEC) $(LIB_ALL)
clean :
rm -f src/*.o
cleaner :
rm -f *~ src/*.o src/*~ $(EXEC)