forked from ROCm/MIVisionX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMIVisionX-setup.py
440 lines (429 loc) · 23.3 KB
/
MIVisionX-setup.py
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
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
# Copyright (c) 2018 - 2020 Advanced Micro Devices, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
import os
import sys
import argparse
__author__ = "Kiriti Nagesh Gowda"
__copyright__ = "Copyright 2018 - 2020, AMD Radeon MIVisionX setup"
__license__ = "MIT"
__version__ = "1.8.4"
__maintainer__ = "Kiriti Nagesh Gowda"
__email__ = "[email protected]"
__status__ = "Shipping"
if sys.version_info[0] < 3:
import commands
else:
import subprocess
# Import arguments
parser = argparse.ArgumentParser()
parser.add_argument('--directory', type=str, default='~/mivisionx-deps',
help='Setup home directory - optional (default:~/)')
parser.add_argument('--installer', type=str, default='apt-get',
help='Linux system installer - optional (default:apt-get) [options: Ubuntu - apt-get; CentOS - yum]')
parser.add_argument('--opencv', type=str, default='3.4.0',
help='OpenCV Version - optional (default:3.4.0)')
parser.add_argument('--miopen', type=str, default='2.5.0',
help='MIOpen Version - optional (default:2.5.0)')
parser.add_argument('--miopengemm', type=str, default='1.1.5',
help='MIOpenGEMM Version - optional (default:1.1.5)')
parser.add_argument('--protobuf', type=str, default='3.12.0',
help='ProtoBuf Version - optional (default:3.12.0)')
parser.add_argument('--rpp', type=str, default='0.5',
help='RPP Version - optional (default:0.5)')
parser.add_argument('--ffmpeg', type=str, default='no',
help='FFMPEG Installation - optional (default:no) [options:yes/no]')
parser.add_argument('--neural_net', type=str, default='yes',
help='MIVisionX Neural Net Dependency Install - optional (default:yes) [options:yes/no]')
parser.add_argument('--rali', type=str, default='yes',
help='MIVisionX RALI Dependency Install - optional (default:yes) [options:yes/no]')
parser.add_argument('--reinstall', type=str, default='no',
help='Remove previous setup and reinstall - optional (default:no) [options:yes/no]')
args = parser.parse_args()
setupDir = args.directory
linuxSystemInstall = args.installer
opencvVersion = args.opencv
MIOpenVersion = args.miopen
MIOpenGEMMVersion = args.miopengemm
ProtoBufVersion = args.protobuf
rppVersion = args.rpp
ffmpegInstall = args.ffmpeg
neuralNetInstall = args.neural_net
raliInstall = args.rali
reinstall = args.reinstall
# sudo requirement check
sudoLocation = ''
userName = ''
if sys.version_info[0] < 3:
status, sudoLocation = commands.getstatusoutput("which sudo")
if sudoLocation != '/usr/bin/sudo':
status, userName = commands.getstatusoutput("whoami")
else:
status, sudoLocation = subprocess.getstatusoutput("which sudo")
if sudoLocation != '/usr/bin/sudo':
status, userName = subprocess.getstatusoutput("whoami")
# Setup Directory for Deps
if setupDir == '~/mivisionx-deps':
setupDir_deps = setupDir
else:
setupDir_deps = setupDir+'/mivisionx-deps'
# setup directory
deps_dir = os.path.expanduser(setupDir_deps)
# setup for CentOS or Ubuntu
linuxSystemInstall_check = '--nogpgcheck'
linuxCMake = 'cmake3'
linuxFlag = ''
if linuxSystemInstall == '' or linuxSystemInstall == 'apt-get':
linuxSystemInstall = 'apt-get'
linuxSystemInstall_check = '--allow-unauthenticated'
linuxCMake = 'cmake'
linuxFlag = '-S'
if userName == 'root':
os.system('apt -y update')
os.system('apt -y install sudo')
else:
if userName == 'root':
os.system('yum -y update')
os.system('yum -y install sudo')
os.system('sudo -v')
os.system('sudo yum -y update')
os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y ' +
linuxSystemInstall_check+' install cmake3 boost boost-thread boost-devel')
os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y ' +
linuxSystemInstall_check+' install openssl-devel hg autoconf automake')
# Delete previous install
if(os.path.exists(deps_dir) and reinstall == 'yes'):
os.system('sudo -v')
os.system('sudo rm -rf '+deps_dir)
# MIVisionX setup
if(os.path.exists(deps_dir)):
# opencv
os.system('sudo -v')
os.system('(cd '+deps_dir+'/build/OpenCV; sudo ' +
linuxFlag+' make install -j8)')
if raliInstall == 'yes' or neuralNetInstall == 'yes':
# half.hpp
os.system('sudo -v')
os.system(
'(cd '+deps_dir+'; sudo cp half-files/include/half.hpp /usr/local/include/ )')
if neuralNetInstall == 'yes':
# rocm-cmake
os.system('sudo -v')
os.system('(cd '+deps_dir+'/build/rocm-cmake; sudo ' +
linuxFlag+' make install -j8)')
# MIOpenGEMM
os.system('sudo -v')
os.system('(cd '+deps_dir+'/build/MIOpenGEMM; sudo ' +
linuxFlag+' make install -j8)')
# MIOpen
os.system('sudo -v')
os.system('(cd '+deps_dir+'/build/MIOpen; sudo ' +
linuxFlag+' make install -j8)')
if raliInstall == 'yes' or neuralNetInstall == 'yes':
# ProtoBuf
os.system('sudo -v')
os.system('(cd '+deps_dir+'/protobuf-'+ProtoBufVersion +
'; sudo '+linuxFlag+' make install -j8)')
if raliInstall == 'yes':
# RPP
os.system('sudo -v')
os.system('(cd '+deps_dir+'/rpp/build; sudo ' +
linuxFlag+' make install -j8)')
if ffmpegInstall == 'yes':
# FFMPEG
os.system('sudo -v')
os.system('(cd '+deps_dir+'/ffmpeg; sudo ' +
linuxFlag+' make install -j8)')
print("\nMIVisionX Dependencies Installed with MIVisionX-setup.py V-"+__version__+"\n")
else:
print("\nMIVisionX Dependencies Installation with MIVisionX-setup.py V-"+__version__+"\n")
os.system('mkdir '+deps_dir)
# Create Build folder
os.system('(cd '+deps_dir+'; mkdir build )')
os.system('sudo -v')
os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y ' +
linuxSystemInstall_check+' install cmake git wget unzip pkg-config')
# Get Installation Source
os.system(
'(cd '+deps_dir+'; wget https://github.com/opencv/opencv/archive/'+opencvVersion+'.zip )')
os.system('(cd '+deps_dir+'; unzip '+opencvVersion+'.zip )')
if neuralNetInstall == 'yes':
os.system(
'(cd '+deps_dir+'; git clone https://github.com/RadeonOpenCompute/rocm-cmake.git )')
os.system(
'(cd '+deps_dir+'; wget https://github.com/ROCmSoftwarePlatform/MIOpenGEMM/archive/'+MIOpenGEMMVersion+'.zip )')
os.system('(cd '+deps_dir+'; unzip '+MIOpenGEMMVersion+'.zip )')
os.system(
'(cd '+deps_dir+'; wget https://github.com/ROCmSoftwarePlatform/MIOpen/archive/'+MIOpenVersion+'.zip )')
os.system('(cd '+deps_dir+'; unzip '+MIOpenVersion+'.zip )')
if raliInstall == 'yes' or neuralNetInstall == 'yes':
os.system(
'(cd '+deps_dir+'; wget https://github.com/protocolbuffers/protobuf/archive/v'+ProtoBufVersion+'.zip )')
os.system('(cd '+deps_dir+'; unzip v'+ProtoBufVersion+'.zip )')
if ffmpegInstall == 'yes':
os.system(
'(cd '+deps_dir+'; git clone --recursive -b n4.0.4 https://git.ffmpeg.org/ffmpeg.git )')
# Install
if raliInstall == 'yes' or neuralNetInstall == 'yes':
# package dependencies
os.system('sudo -v')
os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y ' +
# linuxSystemInstall_check+' install libssl-dev libboost-all-dev libboost-python-dev libboost-dev libboost-system-dev libboost-filesystem-dev')
linuxSystemInstall_check+' install libssl-dev python-dev python3-dev')
# Boost V 1.72.0 from source
os.system(
'(cd '+deps_dir+'; wget https://dl.bintray.com/boostorg/release/1.72.0/source/boost_1_72_0.tar.bz2 )')
os.system('(cd '+deps_dir+'; tar xjvf boost_1_72_0.tar.bz2 )')
os.system(
'(cd '+deps_dir+'/boost_1_72_0/; ./bootstrap.sh --prefix=/usr/local --with-python=python3 )')
os.system(
'(cd '+deps_dir+'/boost_1_72_0/; ./b2 stage -j16 threading=multi link=shared )')
os.system(
'(cd '+deps_dir+'/boost_1_72_0/; sudo ./b2 install threading=multi link=shared --with-system --with-filesystem)')
os.system(
'(cd '+deps_dir+'/boost_1_72_0/; sudo ./b2 install threading=multi link=static --with-system --with-filesystem)')
# Install half.hpp
os.system(
'(cd '+deps_dir+'; wget https://sourceforge.net/projects/half/files/half/1.12.0/half-1.12.0.zip )')
os.system('(cd '+deps_dir+'; unzip half-1.12.0.zip -d half-files )')
os.system('sudo -v')
os.system(
'(cd '+deps_dir+'; sudo cp half-files/include/half.hpp /usr/local/include/ )')
if neuralNetInstall == 'yes':
os.system('(cd '+deps_dir+'/build; mkdir rocm-cmake MIOpenGEMM MIOpen)')
# Install ROCm-CMake
os.system('(cd '+deps_dir+'/build/rocm-cmake; ' +
linuxCMake+' ../../rocm-cmake )')
os.system('(cd '+deps_dir+'/build/rocm-cmake; make -j8 )')
os.system('sudo -v')
os.system('(cd '+deps_dir+'/build/rocm-cmake; sudo ' +
linuxFlag+' make install )')
# Install MIOpenGEMM
# package dependencies
os.system('sudo -v')
os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y ' +
linuxSystemInstall_check+' install sqlite3 libsqlite3-dev libbz2-dev')
os.system('(cd '+deps_dir+'/build/MIOpenGEMM; '+linuxCMake +
' ../../MIOpenGEMM-'+MIOpenGEMMVersion+' )')
os.system('(cd '+deps_dir+'/build/MIOpenGEMM; make -j8 )')
os.system('sudo -v')
os.system('(cd '+deps_dir+'/build/MIOpenGEMM; sudo ' +
linuxFlag+' make install )')
# Install MIOpen
os.system('sudo -v')
os.system('(cd '+deps_dir+'/MIOpen-'+MIOpenVersion+'; sudo ' +
linuxFlag+' '+linuxCMake+' -P install_deps.cmake )')
os.system('(cd '+deps_dir+'/build/MIOpen; '+linuxCMake +
' -DMIOPEN_BACKEND=OpenCL -DMIOPEN_USE_MIOPENGEMM=On ../../MIOpen-'+MIOpenVersion+' )')
os.system('(cd '+deps_dir+'/build/MIOpen; make -j8 )')
os.system('(cd '+deps_dir+'/build/MIOpen; make MIOpenDriver )')
os.system('sudo -v')
os.system('(cd '+deps_dir+'/build/MIOpen; sudo ' +
linuxFlag+' make install )')
os.system('sudo -v')
os.system('(cd '+deps_dir+'/build/MIOpen; sudo ' +
linuxFlag+' '+linuxSystemInstall+' autoremove )')
# Install Packages for NN Apps
os.system('sudo -v')
os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y ' +
linuxSystemInstall_check+' install inxi aha build-essential')
os.system('sudo -v')
os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check +
' install python-matplotlib python-numpy python-pil python-scipy python-skimage cython')
os.system('sudo -v')
os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y ' +
linuxSystemInstall_check+' install qt5-default qtcreator')
if raliInstall == 'yes' or neuralNetInstall == 'yes':
# Install ProtoBuf
os.system('sudo -v')
os.system('(cd '+deps_dir+'/protobuf-'+ProtoBufVersion+'; sudo '+linuxFlag+' '+linuxSystemInstall +
' -y '+linuxSystemInstall_check+' install autoconf automake libtool curl make g++ unzip )')
os.system('sudo -v')
os.system('(cd '+deps_dir+'/protobuf-'+ProtoBufVersion +
'; sudo '+linuxFlag+' '+linuxSystemInstall+' autoremove )')
os.system('(cd '+deps_dir+'/protobuf-' +
ProtoBufVersion+'; ./autogen.sh )')
os.system('(cd '+deps_dir+'/protobuf-' +
ProtoBufVersion+'; ./configure )')
os.system('(cd '+deps_dir+'/protobuf-'+ProtoBufVersion+'; make -j8 )')
os.system('(cd '+deps_dir+'/protobuf-' +
ProtoBufVersion+'; make check -j8 )')
os.system('sudo -v')
os.system('(cd '+deps_dir+'/protobuf-'+ProtoBufVersion +
'; sudo '+linuxFlag+' make install )')
os.system('sudo -v')
os.system('(cd '+deps_dir+'/protobuf-'+ProtoBufVersion +
'; sudo '+linuxFlag+' ldconfig )')
# Install Packages for Apps
os.system('sudo -v')
os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y ' +
linuxSystemInstall_check+' install python-pip')
os.system('sudo -v')
os.system('sudo '+linuxFlag+' yes | pip install protobuf')
os.system('sudo -v')
os.system('sudo '+linuxFlag+' yes | pip install pytz')
os.system('sudo -v')
os.system('sudo '+linuxFlag+' yes | pip install numpy')
# Install OpenCV
os.system('(cd '+deps_dir+'/build; mkdir OpenCV )')
os.system('sudo -v')
os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check +
' install build-essential cmake git libgtk2.0-dev libavcodec-dev libavformat-dev libswscale-dev')
os.system('sudo -v')
os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check +
' install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libdc1394-22-dev')
os.system('(cd '+deps_dir+'/build/OpenCV; '+linuxCMake +
' -DWITH_OPENCL=OFF -DWITH_OPENCLAMDFFT=OFF -DWITH_OPENCLAMDBLAS=OFF -DWITH_VA_INTEL=OFF -DWITH_OPENCL_SVM=OFF ../../opencv-'+opencvVersion+' )')
os.system('(cd '+deps_dir+'/build/OpenCV; make -j8 )')
os.system('sudo -v')
os.system('(cd '+deps_dir+'/build/OpenCV; sudo '+linuxFlag+' make install )')
os.system('sudo -v')
os.system('(cd '+deps_dir+'/build/OpenCV; sudo '+linuxFlag+' ldconfig )')
if raliInstall == 'yes':
# Install Packages for RALI
os.system('sudo -v')
os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y ' +
linuxSystemInstall_check+' install libgflags-dev libgoogle-glog-dev liblmdb-dev')
# Install RPP
# Yasm/Nasm for TurboJPEG
if linuxSystemInstall == 'apt-get':
os.system('sudo -v')
os.system('sudo '+linuxFlag+' '+linuxSystemInstall +
' -y '+linuxSystemInstall_check+' install nasm yasm')
# json-cpp
os.system('sudo -v')
os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y ' +
linuxSystemInstall_check+' install libjsoncpp-dev')
# clang
os.system('sudo -v')
os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y ' +
linuxSystemInstall_check+' install clang')
# turbo-JPEG
os.system(
'(cd '+deps_dir+'; git clone -b 2.0.4 https://github.com/Indumathi31/libjpeg-turbo.git )')
os.system('(cd '+deps_dir+'/libjpeg-turbo; mkdir build; cd build; '+linuxCMake +
' -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RELEASE -DENABLE_STATIC=FALSE -DCMAKE_INSTALL_DOCDIR=/usr/share/doc/libjpeg-turbo-2.0.3 -DCMAKE_INSTALL_DEFAULT_LIBDIR=lib ..; make -j 4; sudo make install )')
# RPP
os.system('(cd '+deps_dir+'; git clone -b '+rppVersion+' https://github.com/GPUOpen-ProfessionalCompute-Libraries/rpp.git; cd rpp; mkdir build; cd build; ' +
linuxCMake+' -DBACKEND=OCL ../; make -j4; sudo make install)')
# Turn off for CentOS - TBD: turn on when RPP is supported on CentOS
# else:
# Nasm
#os.system('(cd '+deps_dir+'; curl -O -L https://www.nasm.us/pub/nasm/releasebuilds/2.14.02/nasm-2.14.02.tar.bz2 )')
#os.system('(cd '+deps_dir+'; tar xjvf nasm-2.14.02.tar.bz2 )')
#os.system('(cd '+deps_dir+'/nasm-2.14.02; ./autogen.sh; ./configure; make -j8 )')
#os.system('sudo -v')
#os.system('(cd '+deps_dir+'/nasm-2.14.02; sudo '+linuxFlag+' make install )')
# Yasm
#os.system('(cd '+deps_dir+'; curl -O -L https://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz )')
#os.system('(cd '+deps_dir+'; tar xzvf yasm-1.3.0.tar.gz )')
#os.system('(cd '+deps_dir+'/yasm-1.3.0; ./configure; make -j8 )')
#os.system('sudo -v')
#os.system('(cd '+deps_dir+'/yasm-1.3.0; sudo '+linuxFlag+' make install )')
# JSON-cpp
#os.system('sudo -v')
#os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check+' install jsoncpp')
# clang+boost
#os.system('sudo -v')
#os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check+' install boost-devel clang')
# turbo-JPEG
#os.system('(cd '+deps_dir+'; wget https://downloads.sourceforge.net/libjpeg-turbo/libjpeg-turbo-2.0.3.tar.gz )')
#os.system('(cd '+deps_dir+'; tar xf libjpeg-turbo-2.0.3.tar.gz )')
#os.system('(cd '+deps_dir+'/libjpeg-turbo-2.0.3; mkdir build; cd build; '+linuxCMake+' -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RELEASE -DENABLE_STATIC=FALSE -DCMAKE_INSTALL_DOCDIR=/usr/share/doc/libjpeg-turbo-2.0.3 -DCMAKE_INSTALL_DEFAULT_LIBDIR=lib ..; make -j 4; sudo make install )')
# RPP
#os.system('(cd '+deps_dir+'; git clone -b 0.3 https://github.com/GPUOpen-ProfessionalCompute-Libraries/rpp.git; cd rpp; mkdir build; cd build; '+linuxCMake+' -DBACKEND=OCL ../; make -j4; sudo make install)')
# Install ffmpeg
if ffmpegInstall == 'yes':
if linuxSystemInstall == 'apt-get':
os.system('sudo -v')
os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check +
' install autoconf automake build-essential cmake git-core libass-dev libfreetype6-dev')
os.system('sudo -v')
os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check +
' install libsdl2-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev')
os.system('sudo -v')
os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check +
' install libxcb-shm0-dev libxcb-xfixes0-dev pkg-config texinfo wget zlib1g-dev')
os.system('sudo -v')
os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check +
' install nasm yasm libx264-dev libx265-dev libnuma-dev libfdk-aac-dev')
# FFMPEG 4
os.system('sudo -v')
os.system('(cd '+deps_dir+'/ffmpeg; sudo '+linuxFlag+' ldconfig )')
os.system('(cd '+deps_dir+'/ffmpeg; export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig/"; ./configure --enable-shared --disable-static --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libass --enable-gpl --enable-nonfree)')
os.system('(cd '+deps_dir+'/ffmpeg; make -j8 )')
os.system('sudo -v')
os.system('(cd '+deps_dir+'/ffmpeg; sudo ' +
linuxFlag+' make install )')
else:
os.system('sudo -v')
os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check +
' install autoconf automake bzip2 bzip2-devel cmake freetype-devel libass-devel')
os.system('sudo -v')
os.system('sudo '+linuxFlag+' '+linuxSystemInstall+' -y '+linuxSystemInstall_check +
' install gcc gcc-c++ git libtool make mercurial pkgconfig zlib-devel')
# Nasm
os.system(
'(cd '+deps_dir+'; curl -O -L https://www.nasm.us/pub/nasm/releasebuilds/2.14.02/nasm-2.14.02.tar.bz2 )')
os.system('(cd '+deps_dir+'; tar xjvf nasm-2.14.02.tar.bz2 )')
os.system(
'(cd '+deps_dir+'/nasm-2.14.02; ./autogen.sh; ./configure; make -j8 )')
os.system('sudo -v')
os.system('(cd '+deps_dir+'/nasm-2.14.02; sudo ' +
linuxFlag+' make install )')
# Yasm
os.system(
'(cd '+deps_dir+'; curl -O -L https://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz )')
os.system('(cd '+deps_dir+'; tar xzvf yasm-1.3.0.tar.gz )')
os.system('(cd '+deps_dir+'/yasm-1.3.0; ./configure; make -j8 )')
os.system('sudo -v')
os.system('(cd '+deps_dir+'/yasm-1.3.0; sudo ' +
linuxFlag+' make install )')
# libx264
os.system(
'(cd '+deps_dir+'; git clone --depth 1 https://code.videolan.org/videolan/x264.git )')
os.system(
'(cd '+deps_dir+'/x264; ./configure --enable-static --disable-opencl; make -j8 )')
os.system('sudo -v')
os.system('(cd '+deps_dir+'/x264; sudo ' +
linuxFlag+' make install )')
# libx265
os.system('(cd '+deps_dir+'; hg clone http://hg.videolan.org/x265 )')
os.system(
'(cd '+deps_dir+'/x265/build/linux; ./make-Makefiles.bash; make -j8 )')
os.system('sudo -v')
os.system('(cd '+deps_dir+'/x265/build/linux; sudo ' +
linuxFlag+' make install; sudo '+linuxFlag+' ldconfig )')
# libfdk_aac
os.system(
'(cd '+deps_dir+'; git clone https://github.com/mstorsjo/fdk-aac.git )')
os.system(
'(cd '+deps_dir+'/fdk-aac; autoreconf -fiv; ./configure --disable-shared; make -j8 )')
os.system('sudo -v')
os.system('(cd '+deps_dir+'/fdk-aac; sudo ' +
linuxFlag+' make install )')
# FFMPEG 4
os.system('sudo -v')
os.system('(cd '+deps_dir+'/ffmpeg; sudo '+linuxFlag+' ldconfig )')
os.system('(cd '+deps_dir+'/ffmpeg; export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig/"; ./configure --disable-shared --enable-static --enable-libx264 --enable-libx265 --enable-libass --enable-gpl --enable-nonfree)')
os.system('(cd '+deps_dir+'/ffmpeg; make -j8 )')
os.system('sudo -v')
os.system('(cd '+deps_dir+'/ffmpeg; sudo ' +
linuxFlag+' make install )')
print("\nMIVisionX Dependencies Installed with MIVisionX-setup.py V-"+__version__+"\n")