This repository was archived by the owner on Oct 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·107 lines (102 loc) · 2.62 KB
/
install.sh
File metadata and controls
executable file
·107 lines (102 loc) · 2.62 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
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
#!/bin/bash
accept_eula=''
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
print_usage() {
printf "Usage: $0 [ -a Accept EULA ]"
}
while getopts 'as' flag; do
case "${flag}" in
a) accept_eula='y' ;;
*) print_usage
exit 1 ;;
esac
done
read_eula() {
if [[ -z $accept_eula ]];
then
echo "In order to install this package, you have to accept the EULA"
echo "Please use PgDown and PgUp to read the EULA, then press q"
read -p "Now please press ENTER " -r
less EULA
read -p "Do you accept this EULA (y/n)? " -r
accept_eula=$REPLY
fi
}
if [ `which lsb_release 2>/dev/null` ] && [ `lsb_release -i | cut -f2` == 'Ubuntu' ]
then
read_eula
if [[ $accept_eula =~ ^[Yy]$ ]]
then
apt-get update
apt-get -y install python3-pip
pip3 install --upgrade numpy
pip3 install onnx==1.8.1
# Protobuf
ldconfig -p | grep libprotobuf.so.17 >/dev/null
if [ $? -eq 0 ]; then
echo "protobuf is installed, skipping protobuf installation"
else
echo "Installing protobuf 3.6.1 from source"
cd /tmp
wget https://github.com/google/protobuf/releases/download/v3.6.1/protobuf-all-3.6.1.tar.gz
tar xf protobuf-all-3.6.1.tar.gz
cd protobuf-3.6.1
./configure
make -j4
make install
fi
ldconfig
echo 'Installation finished'
fi
elif [ -f /etc/redhat-release ] && [ `cut -d ' ' -f1 /etc/redhat-release` == 'CentOS' ] && \
[ `cut -d ' ' -f4 /etc/redhat-release | cut -d . -f1 -` == '7' ]
then
read_eula
if [[ $accept_eula =~ ^[Yy]$ ]]
then
if [ -f /etc/ld.so.conf.d/local.conf ]; then
if ! grep -q /usr/local/bin /etc/ld.so.conf.d/local.conf; then
echo /usr/local/lib >>/etc/ld.so.conf.d/local.conf
fi
else
echo /usr/local/lib >/etc/ld.so.conf.d/local.conf
fi
yum install unzip
if ! [ -x "$(command -v python3)" ]; then
echo "Installing Python3 from source"
yum install yum-utils
yum-builddep python
cd /tmp
curl -LO https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tar.xz
tar xf Python-3.6.5.tar.xz
cd Python-3.6.5
./configure
make
make install
fi
ldconfig -p | grep libprotobuf.so.17 >/dev/null
if [ $? -eq 0 ]; then
echo "protobuf is installed, skipping protobuf installation"
else
echo "Installing protobuf 3.6.1 from source"
cd /tmp
curl -LO https://github.com/google/protobuf/releases/download/v3.6.1/protobuf-all-3.6.1.tar.gz
tar xf protobuf-all-3.6.1.tar.gz
cd protobuf-3.6.1
./configure
make
make install
ldconfig
fi
ldconfig
pip3 install --upgrade numpy
pip3 install onnx==1.8.1
echo 'Installation finished'
fi
else
echo 'This installer works only for Ubuntu and CentOS 7.x, sorry'
exit
fi