-
Notifications
You must be signed in to change notification settings - Fork 9
/
build_no_container_hbb.sh
executable file
·92 lines (77 loc) · 2.5 KB
/
build_no_container_hbb.sh
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
#!/usr/bin/env bash
set -ex
#yum install cmake -yy
working_dir=$(dirname $0)
pushd $working_dir
#clear symlink main lib dirs
rm -rf zlib htslib libBigWig libdeflate build-release-temp
export PATH=/opt/rh/devtoolset-8/root/usr/bin:$PATH
export CFLAGS="-g -O2 -fvisibility=hidden -DCURL_STATICLIB -fPIC"
export CPPFLAGS="-g -O2 -fvisibility=hidden -I/hbb_shlib/include"
export LDFLAGS="-L/hbb_shlib/lib -static-libstdc++"
export SHLIB_LDFLAGS="-static-libstdc++"
export STATICLIB_CFLAGS="-g -O2 -fvisibility=hidden -fPIC"
export STATICLIB_CPPFLAGS="-g -O2 -fvisibility=hidden -I/hbb_shlib/include"
build_type=$1
bc=`perl -e '$bt="'$build_type'"; if($bt=~/static/i) { print "megadepth_static"; } else { print "megadepth"; }'`
if [[ "$bc" == "megadepth_static" ]]; then
ln -fs CMakeLists.txt.static CMakeLists.txt
else
ln -fs CMakeLists.txt.statlib CMakeLists.txt
fi
#dont need our own zlib, since it's already statically compiled in HBB
if [[ ! -s libdeflate_hbb ]] ; then
./get_libdeflate.sh
mv libdeflate libdeflate_hbb
fi
ln -fs libdeflate_hbb libdeflate
if [[ ! -s htslib_hbb ]] ; then
export CPPFLAGS="$CPPFLAGS -I../libdeflate"
#for staticlly linking libcurl
export LDFLAGS="-static-libstdc++ -L/hbb_shlib/lib -L../libdeflate"
export LIBS="-lm -ldl -lssl -lcrypto -lz -ldeflate -lrt -pthread"
./get_htslib.sh linux hbb
export CPPFLAGS="-g -O2 -fvisibility=hidden -I/hbb_shlib/include"
export LDFLAGS="-L/hbb_shlib/lib -static-libstdc++"
export LIBS=
#reset env vars
mv htslib htslib_hbb
fi
ln -fs htslib_hbb htslib
if [[ ! -s libBigWig_hbb ]] ; then
./get_libBigWig.sh
pushd libBigWig
export CFLAGS="-O2 -I/hbb_shlib/include -DCURL_STATICLIB -fPIC"
make clean
make -f Makefile.fpic lib-static
popd
mv libBigWig libBigWig_hbb
fi
ln -fs libBigWig_hbb libBigWig
export CFLAGS="-g -O2 -fvisibility=hidden -I/hbb_shlib/include -DCURL_STATICLIB -fPIC"
export LDFLAGS="-L/hbb_shlib/lib -static-libstdc++"
set -x
export LD_LIBRARY_PATH=./htslib:./libBigWig:$LD_LIBRARY_PATH
DR=build-release-temp
mkdir -p ${DR}
pushd ${DR}
cmake -DCMAKE_BUILD_TYPE=Release ..
make ${bc}
popd
cp ${DR}/${bc} ./
#ln -fs ./$bc megadepth
./megadepth --version
rm -rf ${DR}
mv megadepth megadepth.full
strip -s megadepth.full -o megadepth
DR=build-debug-temp
mkdir -p ${DR}
pushd ${DR}
cmake -DCMAKE_BUILD_TYPE=Debug ..
make ${bc}
popd
cp ${DR}/${bc} ./${bc}_hbb_debug
#ln -fs ./${bc}_debug megadepth_debug
./megadepth_hbb_debug --version
rm -rf ${DR}
ln -fs ./megadepth_hbb_debug mddebug