-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall_openvino_dependencies_custom.sh
executable file
·256 lines (244 loc) · 7.36 KB
/
install_openvino_dependencies_custom.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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
#!/bin/bash
# Copyright (c) 2018 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -e
if [ $EUID -ne 0 ]; then
echo "ERROR: this script must be run as root to install 3rd party packages." >&2
echo "Please try again with \"sudo -E $0\", or as root." >&2
exit 1
fi
params=$@
yes_or_no_ffmpeg() {
if [ "$params" == "-y" ]; then
return 0
fi
while true; do
read -p "Add third-party RPM Fusion repository and install FFmpeg package (y/n): " yn
case $yn in
[Yy]*) return 0 ;;
[Nn]*) return 1 ;;
esac
done
}
yes_or_no_gst_bad_ugly() {
if [ "$params" == "-y" ]; then
return 0
fi
while true; do
read -p "Add third-party RPM Epel, Nux, Fusion, Forensics repositories and install dependencies for GStreamer Bad & Ugly Plugins (y/n): " yn
case $yn in
[Yy]*) return 0 ;;
[Nn]*) return 1 ;;
esac
done
}
if [ -f /etc/lsb-release ]; then
# Ubuntu
echo
echo "This script installs the following OpenVINO 3rd-party dependencies:"
echo " 1. GTK+, FFmpeg and GStreamer libraries used by OpenCV"
echo " 2. libusb library required for Myriad plugin for Inference Engine"
echo " 3. build dependencies for OpenVINO samples"
echo " 4. build dependencies for GStreamer Plugins"
echo
PKGS=(
libusb-1.0-0-dev
libdrm-dev
libgstreamer1.0-0
gstreamer1.0-plugins-base
gstreamer1.0-plugins-good
gstreamer1.0-plugins-bad
ffmpeg
libjpeg-dev
libtiff-dev
libavcodec-dev
libavformat-dev
libswscale-dev
libv4l-dev
libx264-dev
libtbb2
libtbb-dev
libpng-dev
)
system_ver=$(cat /etc/lsb-release | grep -i "DISTRIB_RELEASE" | cut -d "=" -f2)
if [ "$system_ver" = "16.04" ]; then
PKGS+=( libgtk2.0-0 )
else
PKGS+=( libglib2.0-0
libudev1
)
fi
apt update
apt install -y ${PKGS[@]}
else
# CentOS
echo
echo "This script installs the following OpenVINO 3rd-party dependencies:"
echo " 1. GTK+ and GStreamer libraries used by OpenCV"
echo " 2. libusb library required for Myriad plugin for Inference Engine"
echo " 3. Python 3.6 for Model Optimizer"
echo " 4. gcc 4.8.5 and other build dependencies for OpenVINO samples"
echo " 5. build dependencies for GStreamer Plugins"
echo
PKGS=(
libusbx-devel
gtk2
gstreamer1
gstreamer1-plugins-good
gstreamer1-plugins-bad-free
gcc
gcc-c++
make
glibc-static
glibc
libstdc++-static
libstdc++
libstdc++
libgcc
cmake
python36
python36-pip
glib2-devel
flex
bison
gmp
gsl
gobject-introspection
libcap
libcap
gettext
libXrandr
libX11
iso-codes
mesa-libEGL
mesa-libGLES
mesa-libGL
libgudev1
libtheora
cdparanoia
pango
mesa-libgbm
alsa-lib
libjpeg-turbo
libvisual
libXv
opus
libvorbis
patch
bzip2
libv4l
flac
gdk-pixbuf2
libdv
mpg123
libraw1394
libavc1394
libiec61883
pulseaudio-libs
libsoup
speex
wavpack
boost-regex-1.53.0
)
yum install -y ${PKGS[@]}
# Thirdparty repositories for installing GStreamer Bad & Ugly Plugins dependencies.
if yes_or_no_gst_bad_ugly; then
GST_BAD_UGLY_PKGS=(
bluez-libs
libusb
libass
libbs2b
libchromaprint
lcms2
libssh2
libdc1394
libXext
libssh
libdca
faac
fdk-aac
flite
fluidsynth
game-music-emu
gsm
nettle
kate
liblrdf
libde265
mjpegtools
libmms
libmodplug
libmpcdec
neon
openal-soft
OpenEXR
openjpeg2
openni
libdvdnav
librtmp
librsvg2
sbc
libsndfile
soundtouch
spandsp
libsrtp
zvbi
vo-amrwbenc
webrtc-audio-processing
wildmidi
zbar
libnice
libxkbcommon
libmpeg2
libcdio
opencore-amr
libva
python36-gobject
python3-devel
)
yum install -y epel-release
rpm -Uvh https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm
RPMFUSION_IS_INSTALLED=1
yum install -y https://forensics.cert.org/cert-forensics-tools-release-el7.rpm
yum install -y ${GST_BAD_UGLY_PKGS[@]}
else
echo "Dependencies for GStreamer Ugly & Bad plugins installation skipped."
echo
fi
echo
echo "Intel(R) Distribution of OpenVINO(TM) toolkit can use FFmpeg for processing video streams with OpenCV. Please select your preferred method for installing FFmpeg:"
echo
echo "Option 1: Allow installer script to add a third party repository, RPM Fusion (https://rpmfusion.org/), which contains FFmpeg. FFmpeg rpm package will be installed from this repository. "
echo "WARNING: This repository is NOT PROVIDED OR SUPPORTED by Intel or CentOS. Neither Intel nor CentOS has control over this repository. Terms governing your use of FFmpeg can be found here: https://www.ffmpeg.org/legal.html "
echo "Once added, this repository will be enabled on your operating system and can thus receive updates to all packages installed from it. "
echo
echo "Consider the following ways to prevent unintended 'updates' from this third party repository from over-writing some core part of CentOS:"
echo "a) Only enable these archives from time to time, and generally leave them disabled. See: man yum"
echo "b) Use the exclude= and includepkgs= options on a per sub-archive basis, in the matching .conf file found in /etc/yum.repos.d/ See: man yum.conf"
echo "c) The yum Priorities plug-in can prevent a 3rd party repository from replacing base packages, or prevent base/updates from replacing a 3rd party package."
echo
echo "Option 2: Skip FFmpeg installation."
echo
if yes_or_no_ffmpeg; then
if [[ -z $RPMFUSION_IS_INSTALLED ]]; then
yum install -y epel-release
rpm -Uvh https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm
fi
yum install -y ffmpeg
else
echo "FFmpeg installation skipped. You may build FFmpeg from sources as described here: https://trac.ffmpeg.org/wiki/CompilationGuide/Centos"
echo
fi
exit
fi