-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile_main
106 lines (71 loc) · 2.85 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
#Files containing evolution equations initial power spectrum module
EQUATIONS ?= equations_ppf
POWERSPECTRUM ?= power_tilt
REIONIZATION ?= reionization
RECOMBINATION ?= recfast_axion
BISPECTRUM ?= SeparableBispectrum
#Module doing non-linear scaling
NONLINEAR ?= halofit_ppf
#Driver program
DRIVER ?= inidriver_axion.F90
#DRIVER ?= sigma8.f90
#DRIVER ?= tester.f90
CAMBLIB = libcamb_$(RECOMBINATION).a
#Shouldn't need to change anything else...
F90FLAGS = $(FFLAGS)
#-L$(MKLROOT)/lib/intel64 -lmkl_blas95_ilp64 -lmkl_lapack95_ilp64 -lmkl_scalapack_ilp64 -lmkl_intel_ilp64 -lmkl_core -lmkl_intel_thread -lmkl_blacs_ilp64 -lmkl_blacs_intelmpi_ilp64 -lmkl_vml_mc
#-lpthread -lm
# -lmkl_blas95_ilp64 -lmkl_blas95_ilp64 -lmkl_lapack95_ilp64 -lmkl_scalapack_ilp64 -lmkl_intel_ilp64 -lmkl_core -lmkl_vml_mc -lmkl_intel_thread
# -L$(MKLROOT)/lib/intel64/libmkl_blas95_ilp64 -L$(MKLROOT)/lib/intel64/libmkl_lapack95_ilp64 -L$(MKLROOT)/lib/intel64 -lmkl_scalapack_ilp64 -lmkl_intel_ilp64 -lmkl_core -lmkl_intel_thread -lmkl_blacs_intelmpi_ilp64 -L$(MKLROOT)/lib/intel64/libmkl_mc
HEALPIXLD = -L$(HEALPIXDIR)/lib -lhealpix -L$(FITSDIR) -l$(FITSLIB)
CAMBOBJ = constants.o utils.o $(EXTCAMBFILES) subroutines.o inifile.o $(POWERSPECTRUM).o $(RECOMBINATION).o \
$(REIONIZATION).o modules.o bessels.o $(EQUATIONS).o $(NONLINEAR).o lensing.o $(BISPECTRUM).o cmbmain.o camb.o axion_background.o
#F90CRLINK ?= -lstdc++
## CosmoRec
ifeq ($(RECOMBINATION),cosmorec)
COSMOREC_PATH ?=../CosmoRec/
GSL_LINK ?=-lgsl -lgslcblas
camb: libCosmoRec.a
$(CAMBLIB): libCosmoRec.a
F90CRLINK += -L$(COSMOREC_PATH) -lCosmoRec $(GSL_LINK)
endif
ifeq ($(RECOMBINATION),hyrec)
HYREC_PATH ?= ../HyRec/
camb: libhyrec.a
$(CAMBLIB): libhyrec.a
F90CRLINK += -L$(HYREC_PATH) -lhyrec
endif
default: camb
all: camb $(CAMBLIB)
subroutines.o: constants.o utils.o
$(POWERSPECTRUM).o: subroutines.o inifile.o
$(RECOMBINATION).o: subroutines.o inifile.o
$(REIONIZATION).o: constants.o inifile.o
modules.o: $(REIONIZATION).o $(POWERSPECTRUM).o $(RECOMBINATION).o
bessels.o: modules.o
$(EQUATIONS).o: bessels.o
$(NONLINEAR).o: modules.o
lensing.o: bessels.o
$(BISPECTRUM).o: lensing.o modules.o
cmbmain.o: lensing.o $(NONLINEAR).o $(EQUATIONS).o $(BISPECTRUM).o
camb.o: cmbmain.o
Matrix_utils.o: utils.o
camb: $(CAMBOBJ) $(DRIVER)
$(F90C) $(F90FLAGS) $(CAMBOBJ) $(DRIVER) $(F90CRLINK) -o $@
$(CAMBLIB): $(CAMBOBJ)
ar -r $@ $(CAMBOBJ)
camb_fits: writefits.f90 $(CAMBOBJ) $(DRIVER)
$(F90C) $(F90FLAGS) -I$(HEALPIXDIR)/include $(CAMBOBJ) writefits.f90 $(DRIVER) $(HEALPIXLD) -DWRITE_FITS -o $@
%.o: %.f90
$(F90C) $(F90FLAGS) -c $*.f90
%.o: %.F90
$(F90C) $(F90FLAGS) -c $*.F90
clean:
-rm -f *.o *.a *.d core *.mod
## CosmoRec make parts
cleanCR:
cd $(COSMOREC_PATH); make tidy;
libCosmoRec.a:
cd $(COSMOREC_PATH); make lib;
libhyrec.a:
cd $(HYREC_PATH); make libhyrec.a;