-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
57 lines (44 loc) · 1.43 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
.PHONY: all
VERSION=2.0
EIGEN_INC=../eigen-git-mirror
BOOST_INC=../boost_1_62_0/boost
BOOST_LIB=/usr/local/lib
SPECTRA_INC=../spectra/include
all: flashpca
static: flashpca_x86-64
OBJ = \
randompca.o \
flashpca.o \
svdwide.o \
svdtall.o \
data.o \
util.o \
plink2_base.o \
pgenlib_internal.o
CXXFLAGS += -I${SPECTRA_INC} -I${BOOST_INC} -I${EIGEN_INC}
UNAME := $(shell uname)
ifeq ($(UNAME), Darwin)
CXXFLAGS += -msse2 -DEIGEN_DONT_PARALLELIZE -std=c++11
BOOST = ${BOOST_LIB}/libboost_program_options.a
else
CXXFLAGS += -march=native -fopenmp -std=c++0x
BOOST = -L${BOOST_LIB} -lboost_program_options
endif
debug: LDFLAGS = $(BOOST)
debug: CXXFLAGS += -O0 -ggdb3 -DVERSION=\"$(VERSION)\"
debug: $(OBJ)
$(CXX) $(CXXFLAGS) -o flashpca $^ $(LDFLAGS)
flashpca: LDFLAGS = $(BOOST)
flashpca: CXXFLAGS += -O3 -DNDEBUG -DVERSION=\"$(VERSION)\" \
-funroll-loops -ftree-vectorize -ffast-math
flashpca: flashpca.o randompca.o data.o util.o svdwide.o svdtall.o plink2_base.o pgenlib_internal.o
$(CXX) $(CXXFLAGS) -o flashpca $^ $(LDFLAGS)
flashpca_x86-64: LDFLAGS = $(BOOST) -Wl,--whole-archive -lpthread -Wl,--no-whole-archive
flashpca_x86-64: CXXFLAGS += -O3 -DNDEBUG -DVERSION=\"$(VERSION)\" \
-funroll-loops -ftree-vectorize -ffast-math -static
flashpca_x86-64: $(OBJ)
$(CXX) $(CXXFLAGS) -o flashpca_x86-64 $^ $(LDFLAGS)
$(OBJ): %.o: %.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@
clean:
rm -f $(OBJ) flashpca flashpca_x86-64