-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
49 lines (41 loc) · 2.01 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
## MAKEFILE FOR RascalC. This compiles the grid_covariance.cpp file into the ./cov exececutable.
CC = gcc
CFLAGS = -g -O3 -Wall -MMD
CXXFLAGS = -O3 -Wall -MMD -DOPENMP -DLEGENDRE_MIX -DJACKKNIFE -DPRINTPERCENTS
#-DOPENMP # use this to run multi-threaded with OPENMP
#-DPERIODIC # use this to enable periodic behavior
#-DLEGENDRE # use this to compute 2PCF covariances in Legendre bins (original mode, corresponding to direct accumulation into multipoles from pair counts)
#-DLEGENDRE_MIX # also compute 2PCF covariances in Legendre bins, but in other, "mixed" mode, corresponding to projection of s,µ bins into multipoles
# without either of the two Legendre flags above, the covariance is computed in s,µ bins
#-DJACKKNIFE # use this to compute (r,mu)-space 2PCF covariances and jackknife covariances. Incompatible with -DLEGENDRE but works with -DLEGENDRE_MIX
#-DTHREE_PCF # use this to compute 3PCF autocovariances
#-DPRINTPERCENTS # use this to print percentage of progress in each loop. This can be a lot of output
# Known OS-specific choices
ifeq ($(shell uname -s),Darwin)
# Here we use LLVM compiler to load the Mac OpenMP. Tested after installation commands:
# brew install llvm
# brew install libomp
# This may need to be modified with a different installation
ifndef HOMEBREW_PREFIX
HOMEBREW_PREFIX = /usr/local
endif
CXX = ${HOMEBREW_PREFIX}/opt/llvm/bin/clang++ -std=c++0x -fopenmp -ffast-math $(shell pkg-config --cflags gsl)
LD = ${HOMEBREW_PREFIX}/opt/llvm/bin/clang++
LFLAGS = $(shell pkg-config --libs gsl) -fopenmp -lomp
else
# default (Linux) case
CXX = g++ -fopenmp -lgomp -std=c++0x -ffast-math $(shell pkg-config --cflags gsl)
LD = g++
LFLAGS = -L/usr/local/lib -L/usr/lib/x86_64-linux-gnu $(shell pkg-config --libs gsl) -lgomp
endif
AUNTIE = cov
AOBJS = grid_covariance.o ./cubature/hcubature.o ./ransampl/ransampl.o
ADEPS = ${AOBJS:.o=.d}
.PHONY: main clean
main: $(AUNTIE)
$(AUNTIE): $(AOBJS) Makefile
$(LD) $(AOBJS) $(LFLAGS) -o $(AUNTIE)
clean:
rm -f $(AUNTIE) $(AOBJS) ${ADEPS}
$(AOBJS): Makefile
-include ${ADEPS}