-
Notifications
You must be signed in to change notification settings - Fork 2
/
include.mk
122 lines (102 loc) · 3.81 KB
/
include.mk
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
SHELL = /bin/bash
##
# Users can set CPPFLAGS, CFLAGS, LIBS to reference external packages. These
# can be set in environment of config.local.mk. LDLIBS should not be modified,
# as it is not seen my kyoto configure.
##
# special handling to get C++ ABI right on UCSC Centos 6 servers
ifeq (${CXX_ABI_DEF},)
ifneq ($(wildcard /etc/redhat-release),)
ifeq ($(shell hostname -d), gi.ucsc.edu)
export CXX_ABI_DEF = -D_GLIBCXX_USE_CXX11_ABI=0
endif
endif
endif
#Location of sonLib
BINDIR = ${rootPath}/bin
LIBDIR = ${rootPath}/lib
INCLDIR = ${rootPath}/include
#Modify this variable to set the location of sonLib
sonLibRootDir ?= ${rootPath}/submodules/sonLib
sonLibDir=${sonLibRootDir}/lib
include ${sonLibRootDir}/include.mk
#Turn asserts back on in spite of sonLib
#https://github.com/ComparativeGenomicsToolkit/cactus/issues/235
CFLAGS += -UNDEBUG
ifndef TARGETOS
TARGETOS := $(shell uname -s)
endif
# Hack to include openmp on os x after "brew install lomp
ifeq ($(TARGETOS), Darwin)
CFLAGS+= -Xpreprocessor -fopenmp -lomp
else
CFLAGS+= -fopenmp
endif
# Hack in ARM support
# Toggle on if "arm" is set, or if uname -m returns aarch64
ifeq ($(shell uname -m || true), aarch64)
arm=1
endif
ifeq ($(shell arch || true), aarch64)
arm=1
endif
ifdef arm
# flags to build abpoa
export armv8 = 1
export aarch64 = 1
# flags to include simde abpoa in cactus on ARM
CFLAGS+= -march=armv8-a+simd
else
ifdef CACTUS_LEGACY_ARCH
export sse2 = 1
CFLAGS+= -msse2
else
# flags to build abpoa
export avx2 = 1
# flags to include simde abpoa in cactus on X86
CFLAGS+= -mavx2
endif
endif
# flags needed to include simde abpoa in cactus on any architecture
ifdef CACTUS_LEGACY_ARCH
CFLAGS+= -D__SSE2__ -DUSE_SIMDE -DSIMDE_ENABLE_NATIVE_ALIASES
else
CFLAGS+= -D__AVX2__ -DUSE_SIMDE -DSIMDE_ENABLE_NATIVE_ALIASES
endif
inclDirs = inc submodules/sonLib/C/inc submodules/sonLib/externalTools/cutest
# htslib will be used only if it can be found via pkg-config
# without it, taf won't support bgzipped input (but is otherwise the same)
HAVE_HTSLIB = $(shell pkg-config --exists htslib; echo $$?)
ifeq (${HAVE_HTSLIB},0)
HTSLIB_CFLAGS = $(shell pkg-config htslib --cflags) -DUSE_HTSLIB
ifdef TAF_STATIC
HTSLIB_LIBS = $(shell pkg-config htslib --libs --static) -llzma
else
HTSLIB_LIBS = $(shell pkg-config htslib --libs)
endif
endif
CFLAGS += ${inclDirs:%=-I${rootPath}/%} -I${LIBDIR} -I${rootPath}/include ${HTSLIB_CFLAGS}
CXXFLAGS += ${inclDirs:%=-I${rootPath}/%} -I${LIBDIR} -I${rootPath}/include ${HTSLIB_CFLAGS}
LDLIBS += ${HTSLIB_LIBS}
# libraries can't be added until they are build, so add as to LDLIBS until needed
sonLibLibs = ${sonLibDir}/sonLib.a ${sonLibDir}/cuTest.a
# optional hal support toggled on by setting HALDIR (ex to ../hal)
ifdef HALDIR
LDLIBS += ${HALDIR}/lib/libHalBlockViz.a ${HALDIR}/lib/libHalLiftover.a ${HALDIR}/lib/libHalLod.a ${HALDIR}/lib/libHalMaf.a ${HALDIR}/lib/libHal.a
CFLAGS += -I${HALDIR}/api/inc -I${HALDIR}/blockViz/inc -DUSE_HAL
CXXFLAGS += -I${HALDIR}/api/inc -I${HALDIR}/blockViz/inc -DUSE_HAL
CXX = h5c++
# This bit copied from HAL: todo -- we should probably just use hal's include.mk directly
# add compiler flag and kent paths if udc is enabled
# relies on KENTSRC containing path to top level kent/src dir
# and MACHTYPE being specified.
# This MUST follow PHAST defs, as they both have a gff.h
ifdef ENABLE_UDC
# Find htslib as in kent/src/inc/common.mk:
MACHTYPE = x86_64
CXXFLAGS += -DENABLE_UDC-I${KENTSRC}/inc -I${KENTSRC}/htslib -pthread
LDLIBS += ${KENTSRC}/lib/${MACHTYPE}/jkweb.a ${KENTSRC}/htslib/libhts.a -lcurl -lssl -lcrypto -pthread
endif
endif
# note: the CACTUS_STATIC_LINK_FLAGS below can generally be empty -- it's used by the static builder script only
LDLIBS += ${sonLibLibs} ${LIBS} -L${rootPath}/lib -Wl,-rpath,${rootPath}/lib -lz -lbz2 -lpthread -lm -lstdc++ -lm ${CACTUS_STATIC_LINK_FLAGS}