forked from baidu/unit-dmkit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeps.sh
More file actions
66 lines (59 loc) · 1.35 KB
/
deps.sh
File metadata and controls
66 lines (59 loc) · 1.35 KB
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
#!/usr/bin/env bash
cd "$(dirname "$0")"
JOBS=8
OS=$1
case "$OS" in
mac)
;;
ubuntu)
;;
centos)
;;
none)
;;
*)
echo "Usage: $0 [ubuntu|mac|centos|none]"
exit 1
esac
if [ $OS = mac ]; then
echo "Installing dependencies for MacOS..."
brew install openssl git gnu-getopt gflags protobuf leveldb cmake openssl
elif [ $OS = ubuntu ]; then
echo "Installing dependencies for Ubuntu..."
sudo apt-get install -y git \
g++ \
make \
libssl-dev \
coreutils \
libgflags-dev \
libprotobuf-dev \
libprotoc-dev \
protobuf-compiler \
libleveldb-dev \
libsnappy-dev \
libcurl4-openssl-dev \
libgoogle-perftools-dev
elif [ $OS = centos ]; then
echo "Installing dependencies for CentOS..."
sudo yum install -y epel-release
sudo yum install -y git gcc-c++ make openssl-devel libcurl-devel
sudo yum install -y gflags-devel protobuf-devel protobuf-compiler leveldb-devel gperftools-devel
else
echo "Skipping dependencies installation..."
fi
if [ ! -e brpc ]; then
echo "Cloning brpc..."
git clone https://github.com/brpc/brpc.git
fi
cd brpc
git checkout master
git pull
git checkout 2ae7f04ce513c6aee27545df49d5439a98ae3a3f
#build brpc
echo "Building brpc..."
rm -rf _build
mkdir -p _build
cd _build
cmake ..
make -j$JOBS
cd ../../