forked from microsoft/onnxruntime
-
Notifications
You must be signed in to change notification settings - Fork 1
/
install_server_deps.sh
executable file
·78 lines (69 loc) · 2.37 KB
/
install_server_deps.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
#!/bin/bash
set -e
SYS_LONG_BIT=$(getconf LONG_BIT)
apt-get update && apt-get install -y --no-install-recommends libre2-dev
rm -rf /var/lib/apt/lists/*
if [ $SYS_LONG_BIT = "64" ]; then
echo "Installing Go"
mkdir -p /tmp/go
cd /tmp/go
wget https://dl.google.com/go/go1.12.6.linux-amd64.tar.gz
tar -C /usr/local -vzxf /tmp/go/go1.12.6.linux-amd64.tar.gz
echo "Installing CMAKE"
aria2c https://github.com/Kitware/CMake/releases/download/v3.18.1/cmake-3.18.1-Linux-x86_64.tar.gz
tar -zxf cmake-3.18.1-Linux-x86_64.tar.gz --strip=1 -C /usr
echo "Installing onnxruntime"
aria2c https://github.com/microsoft/onnxruntime/releases/download/v1.4.0/onnxruntime-linux-x64-1.4.0.tgz
tar -zxf onnxruntime-linux-x64-1.4.0.tgz --strip=1
cp -r include/* /usr/include
cp -r lib/* /usr/lib
ldconfig /usr/lib
fi
echo "Installing googletest from source"
cd /tmp
git clone https://github.com/google/googletest.git
cd googletest
git checkout release-1.10.0
mkdir b
cd b
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_POSITION_INDEPENDENT_CODE=ON
make -j$(getconf _NPROCESSORS_ONLN)
make install
cd /tmp
rm -rf /tmp/googletest
echo "Installing protobuf from source"
git clone https://github.com/protocolbuffers/protobuf.git
cd protobuf
git checkout v3.11.2
mkdir b
cd b
cmake ../cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_POSITION_INDEPENDENT_CODE=ON -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Debug
make -j$(getconf _NPROCESSORS_ONLN)
make install
cd ..
mkdir b2
cd b2
cmake ../cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_POSITION_INDEPENDENT_CODE=ON -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release
make -j$(getconf _NPROCESSORS_ONLN)
make install
cd /tmp
rm -rf /tmp/protobuf
echo "Installing grpc"
git clone -b v1.26.0 https://github.com/grpc/grpc
cd grpc
git submodule update --init
mkdir -p "third_party/cares/cares/cmake/build"
pushd "third_party/cares/cares/cmake/build"
cmake -DCMAKE_BUILD_TYPE=Release ../..
make -j$(getconf _NPROCESSORS_ONLN) install
popd
mkdir -p cmake/build
cd cmake/build
cmake ../.. -DCMAKE_BUILD_TYPE=Release -DgRPC_CARES_PROVIDER=package \
-DgRPC_PROTOBUF_PROVIDER=package \
-DgRPC_SSL_PROVIDER=package \
-DgRPC_ZLIB_PROVIDER=package
make -j$(getconf _NPROCESSORS_ONLN)
make install
cd /tmp
rm -rf /tmp/grpc