-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
116 lines (85 loc) · 3.92 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
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
# NOTE: needs boost, tclap, STXXL, KMC, and sdsl
CXX=g++
CPP_FLAGS=-pipe -m64 -std=c++14 -pedantic-errors -W -Wall -Wextra -Wpointer-arith \
-Wunused -Wwrite-strings #-Wcast-qual #-Werror
CLANG_WARNINGS=-Wbool-conversions -Wshift-overflow -Wliteral-conversion # CLANG ONLY
BOOST_PATH=3rd_party_inst/boost
DEP_PATH=3rd_party_inst
KMC_PATH=/ufrc/boucher/kingdgp/cosmo/cosmo/3rd_party_src/KMC
INC=-isystem $(DEP_PATH)/include -isystem $(BOOST_PATH)/include
LIB=-L$(DEP_PATH)/lib -L./ -L$(BOOST_PATH)/lib
BOOST_FLAGS= -lboost_system -lboost_filesystem
DEP_FLAGS=$(INC) $(LIB) $(BOOST_FLAGS) -isystem $(KMC_PATH) -lsdsl -fopenmp #openmp is needed for logging
DEBUG_FLAGS=-pg -gstabs
NDEBUG_FLAGS=-DNDEBUG
OPT_FLAGS=-O3 -mmmx -msse -msse2 -msse3 -msse4 -msse4.2 -march=core-avx-i -fno-strict-aliasing
NOPT_FLAGS=-O0
# Using Semantic Versioning: http://semver.org/
VERSION=0.7.0
BANNER='Copyright Alex Bowe (c) 2016'
CPP_FLAGS+=-DVERSION=\"$(VERSION)\" -DBANNER=\"$(BANNER)\"
k?=64
# TODO: quantize k
CPP_FLAGS+=-DK_LEN=$(k)
colors?=128
CPP_FLAGS+=-DNUM_COLS=$(colors)
ifeq ($(asm),1)
CPP_FLAGS+=-S -fverbose-asm
endif
ifeq ($(optimise),0)
CPP_FLAGS+=$(NOPT_FLAGS)
else
CPP_FLAGS+=$(OPT_FLAGS)
endif
ifeq ($(debug),1)
CPP_FLAGS+=$(DEBUG_FLAGS)
else
CPP_FLAGS+=$(NDEBUG_FLAGS)
endif
ifeq ($(verbose),1)
CPP_FLAGS+=-DVERBOSE
endif
KMC_OBJS=$(KMC_PATH)/kmc_api/kmc_file.o $(KMC_PATH)/kmc_api/kmer_api.o $(KMC_PATH)/kmc_api/mmer.o
BUILD_REQS=lut.hpp debug.hpp utility.hpp io.hpp sort.hpp kmer.hpp dummies.hpp debruijn_graph.hpp debruijn_graph_shifted.hpp pack-color.hpp cosmo-color-pd.hpp
COLOR_REQS=colored_debruijn_graph.hpp io.hpp debug.hpp
BINARIES= vari_find_paths cosmo-build cosmo-color cosmo-test cosmo-benchmark cosmo-benchmark-varord pack-color cosmo-color-pd cosmo-read-color transpose cosmo-merge
default: all
# Stores last compiled options to know whether we need to recompile when comp variables change
.PHONY: force
compiler_flags: force
@echo $(CPP_FLAGS) | cmp -s - $@ || echo $(CPP_FLAGS) > $@
lut.hpp: make_lut.py
python make_lut.py > lut.hpp
vari_find_paths: vari_find_paths_ext.cpp $(BUILD_REQS) compiler_flags
$(CXX) $(CPP_FLAGS) -o $@ $< $(KMC_OBJS) $(DEP_FLAGS)
vari_rest_kmers: vari_rest_kmers.cpp $(BUILD_REQS) compiler_flags
$(CXX) $(CPP_FLAGS) -o $@ $< $(KMC_OBJS) $(DEP_FLAGS)
seeding_ext : seeding_ext.cpp $(BUILD_REQS)
$(CXX) $(CPP_FLAGS) -o $@ $< io.o $(KMC_OBJS) $(DEP_FLAGS)
cosmo-build: cosmo-build.cpp $(BUILD_REQS) compiler_flags
$(CXX) $(CPP_FLAGS) -o $@ $< $(KMC_OBJS) $(DEP_FLAGS) -lstxxl
#cosmo-color: cosmo-color.cpp $(BUILD_REQS) compiler_flags
# $(CXX) $(CPP_FLAGS) -o $@ $< $(KMC_OBJS) $(DEP_FLAGS)
cosmo-merge: cosmo-merge.cpp $(BUILD_REQS) compiler_flags
$(CXX) $(CPP_FLAGS) -o $@ $< $(KMC_OBJS) $(DEP_FLAGS)
cosmo-color-pd: cosmo-color-pd.cpp $(BUILD_REQS) compiler_flags
$(CXX) $(CPP_FLAGS) -o $@ $< $(KMC_OBJS) $(DEP_FLAGS)
cosmo-read-color: cosmo-read-color.cpp $(BUILD_REQS) compiler_flags
$(CXX) $(CPP_FLAGS) -o $@ $< $(KMC_OBJS) $(DEP_FLAGS)
transpose: transpose.cpp $(BUILD_REQS) compiler_flags
$(CXX) $(CPP_FLAGS) -o $@ $< $(KMC_OBJS) $(DEP_FLAGS)
pack-color: pack-color.cpp $(BUILD_REQS) compiler_flags
$(CXX) $(CPP_FLAGS) -o $@ $< $(KMC_OBJS) $(DEP_FLAGS)
cosmo-benchmark: cosmo-benchmark.cpp $(BUILD_REQS) wt_algorithm.hpp debruijn_hypergraph.hpp
$(CXX) $(CPP_FLAGS) -o $@ $< $(DEP_FLAGS)
cosmo-benchmark-varord: cosmo-benchmark.cpp $(BUILD_REQS) wt_algorithm.hpp debruijn_hypergraph.hpp
$(CXX) $(CPP_FLAGS) -o $@ $< $(DEP_FLAGS) -DVAR_ORDER
#cosmo-test: cosmo-test.cpp catch.hpp $(wildcard *_test.cpp) $(wildcard $(subst _test.cpp,.hpp,$(wildcard *_test.cpp)))
# $(CXX) $(CPP_FLAGS) -o $@ $(filter-out %.hpp,$^) $(DEP_FLAGS) -lstxxl -fopenmp -lsdsl
cosmo-test: debruijn_graph_test.cpp $(BUILD_REQS) bgl_sdb_adapter.hpp multi_bit_vector.hpp compiler_flags
$(CXX) $(CPP_FLAGS) -o $@ $< $(DEP_FLAGS) -lboost_unit_test_framework
test: cosmo-test
./cosmo-test
all: $(BINARIES)
clean:
rm -rf $(BINARIES) *.o *.dSYM