forked from sairajreddy/Raspbian_OS_Setup
-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathRaspbianInstallARMComputeLib.sh
41 lines (29 loc) · 1.15 KB
/
RaspbianInstallARMComputeLib.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
#!/bin/bash
# Install ARM Compute library
# Copyright 2020 The MathWorks, Inc.
VERSION=19.05
GITHUB=https://github.com/ARM-software/ComputeLibrary/archive/v
INSTALLDIR=/opt/ComputeLibrary
PACKAGESTOINSTALL=(libopencv-dev scons)
for pkg in "${PACKAGESTOINSTALL[@]}"
do
echo "Installing $pkg ..."
sudo apt install $pkg
done
echo "Download source code for ARM Compute library $VERSION "
if [ ! -d "$INSTALLDIR" ]; then
mkdir -p $INSTALLDIR
fi
cd $INSTALLDIR; wget $GITHUB$VERSION.tar.gz
echo "Extracting the downloaded source code"
cd $INSTALLDIR ; tar -xvf v$VERSION.tar.gz ;
echo "Installing ARM Compute library $VERSION "
cd $INSTALLDIR/ComputeLibrary-$VERSION ; scons Werror=1 debug=0 asserts=0 neon=1 opencl=0 build=native -j2 ; cd - ;
echo "Adding ARM Compute Library path to env ARM_COMPUTELIB"
sudo echo "ARM_COMPUTELIB=$INSTALLDIR/ComputeLibrary-$VERSION" >> /etc/environment;
echo "Copying libraries from build folder to lib"
if [ ! -d "$INSTALLDIR/ComputeLibrary-$VERSION/lib" ]; then
sudo mkdir -p $INSTALLDIR/ComputeLibrary-$VERSION/lib
fi
sudo cp -v $INSTALLDIR/ComputeLibrary-$VERSION/build/*.so $INSTALLDIR/ComputeLibrary-$VERSION/lib/
echo "Done."