-
Notifications
You must be signed in to change notification settings - Fork 2
/
install_dependencies.sh
160 lines (138 loc) · 3.59 KB
/
install_dependencies.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
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
#!/bin/bash
set -e
init_submodules () {
cd ../.. # ReadServer/
git submodule init
git submodule update
}
if [ ! -d libs ]
then
mkdir libs # create ReadServer/libs/
cd libs
mkdir include
mkdir lib
mkdir bin
mkdir share
cd ..
fi
# ReadServer repository
REP_DIR=`pwd`
cd libs # ReadServer/libs/
LIB_DIR=`pwd`
cd ../submodules/bamtools # ReadServer/submodules/bamtools
BAMTOOLS_DIR=`pwd`
cd ../ # ReadServer/submodules/
#
# bamtools bfc cppzmq google-sparsehash libconfig libzmq mongoose protobuf rocksdb sga
#
cd bamtools # ReadServer/submodules/bamtools
if [ ! -d src ]
then
init_submodules
cd submodules/bamtools # ReadServer/submodules/bamtools
fi
if [ ! -d build ]
then
mkdir build
fi
cd build # ReadServer/submodules/bamtools/build
cmake .. && make
cd ../.. # ReadServer/submodules
cd bfc # ReadServer/submodules/bfc
if [ ! -d tex ]
then
init_submodules
cd submodules/bfc # ReadServer/submodules/bfc
fi
make
cd .. # ReadServer/submodules
cd cppzmq # ReadServer/submodules/cppzmq
if [ ! -e "README" ]
then
init_submodules
cd submodules/cppzmq # ReadServer/submodules/cppzmq
fi
cp zmq.hpp ../../libs/include/
cd .. # ReadServer/submodules
cd google-sparsehash # ReadServer/submodules/google-sparsehash
if [ ! -d src ]
then
init_submodules
cd submodules/google-sparsehash # ReadServer/submodules/google-sparsehash
fi
./configure --prefix=$LIB_DIR && make && make install
cd .. # ReadServer/submodules
cd libconfig # ReadServer/submodules/libconfig
if [ ! -d lib ]
then
init_submodules
cd submodules/libconfig # ReadServer/submodules/libconfig
fi
aclocal
automake --add-missing
./configure --prefix=$LIB_DIR && make && make install
cd .. # ReadServer/submodules
cd libzmq # ReadServer/submodules/libzmq
if [ ! -d src ]
then
init_submodules
cd submodules/libzmq # ReadServer/submodules/libzmq
fi
./autogen.sh
./configure --prefix=$LIB_DIR && make && make install
cd .. # ReadServer/submodules
cd mongoose # ReadServer/submodules/mongoose
if [ ! -e "mongoose.h" ]
then
init_submodules
cd submodules/mongoose # ReadServer/submodules/mongoose
fi
git checkout readserver
cd .. # ReadServer/submodules
cd protobuf # ReadServer/submodules/protobuf
if [ ! -d src ]
then
init_submodules
cd submodules/protobuf # ReadServer/submodules/protobuf
fi
./autogen.sh
./configure --prefix=$LIB_DIR && make && make install
cd .. # ReadServer/submodules
cd snappy # ReadServer/submodules/snappy
if [ ! -e "snappy.h" ]
then
init_submodules
cd submodules/snappy # ReadServer/submodules/snappy
fi
./autogen.sh
./configure --prefix=$LIB_DIR && make && make install
cd .. # ReadServer/submodules
cd rocksdb # ReadServer/submodules/rocksdb
if [ ! -d db ]
then
init_submodules
cd submodules/rocksdb # ReadServer/submodules/rocksdb
fi
make static_lib
mv librocksdb.a ../../libs/lib
make shared_lib
mv librocksdb.so* ../../libs/lib
cd .. # ReadServer/submodules
cd sga # ReadServer/submodules/sga
if [ ! -d src ]
then
init_submodules
cd submodules/sga # ReadServer/submodules/sga
fi
cd src
./autogen.sh
./configure --prefix=$LIB_DIR --with-sparsehash=$LIB_DIR --with-bamtools=$BAMTOOLS_DIR
make && make install
cd ../.. # ReadServer/submodules
cd ${REP_DIR}
cd src/service # ReadServer/src/service
../../submodules/protobuf/src/protoc ./readserver.proto --cpp_out=.
cd ../.. # ReadServer/
cd ${REP_DIR}
cat demo/build_bwt.sh | awk -v r_path=${REP_DIR} 'BEGIN{}{gsub(/INST_SRC_DIR="<path>"/,"INST_SRC_DIR=\"REPLACE_PATH\"",$0);gsub(/REPLACE_PATH/,r_path,$0);print $0}END{}' > demo/build_bwt.sh.tmp
mv demo/build_bwt.sh.tmp demo/build_bwt.sh