-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprepare.sh
executable file
·115 lines (105 loc) · 2.66 KB
/
prepare.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
#!/bin/bash
# Script for downloading additional third-party libs
#
# This file is part of PhrasIt.
#
# PhrasIt is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# PhrasIt is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with PhrasIt. If not, see <http://www.gnu.org/licenses/>.
#
# Printout error message.
#
logError() {
echo -e "\033[91m[ERROR]\033[0m $@ " 1>&2;
}
#
# Printout info message.
#
logInfo() {
echo -e "\033[92m[INFO ]\033[0m $@"
}
leveldb() {
if [ -d "leveldb" ]; then
logInfo "leveldb already installed locally"
return
fi
logInfo "leveldb download and compiling"
git clone https://github.com/google/leveldb.git
cd leveldb
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build .
cd ..
cd ..
logInfo "leveldb done."
}
cpplint() {
if [ -f "cpplint.py" ]; then
logInfo "cpplint.py already installed locally"
return
fi
logInfo "cpplint.py download"
wget "https://raw.githubusercontent.com/google/styleguide/gh-pages/cpplint/cpplint.py"
}
boost() {
if [ -d "boost" ]; then
logInfo "boost is already installed locally"
return
fi
logInfo "boost download"
wget -c "https://dl.bintray.com/boostorg/release/1.68.0/source/boost_1_68_0.tar.bz2"
tar -jxvf "boost_1_68_0.tar.bz2"
mv "boost_1_68_0" "boost"
cd boost
mkdir build
./bootstrap.sh --prefix=./build
./b2 install
cd ..
}
cereal() {
if [ -d "cereal" ]; then
logInfo "cereal already installed locally"
return
fi
wget "https://github.com/USCiLab/cereal/archive/v1.1.2.tar.gz"
mv "v1.1.2.tar.gz" "cereal_v1.1.2.tar.gz"
tar -zxvf "cereal_v1.1.2.tar.gz"
mv "cereal-1.1.2" "cereal"
}
cxxopts() {
if [ -d "cxxopts" ]; then
logInfo "cxxopts already installed locally"
return
fi
git clone "https://github.com/jarro2783/cxxopts.git"
}
cpphttplib() {
if [ -d "cpp-httplib" ]; then
logInfo "cpp-httplib already installed locally"
return
fi
git clone https://github.com/yhirose/cpp-httplib.git
}
mkdir -p libs
cd libs
leveldb
boost
#cppnetlib
cpphttplib
cereal
cxxopts
cd ..
mkdir -p tools
cd tools
cpplint
cd ..