-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_clean.sh
51 lines (38 loc) · 1.07 KB
/
build_clean.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
#!/bin/bash
set -e
echo "OpenCV clean build"
CVVERSION="4.0.0"
# Save current working directory
CWD=$(pwd)
# Clean build directories
rm -rf build install
# Create directory for installation
mkdir install
mkdir install/opencv-"$CVVERSION"
# Set swap to 512 MB
sudo sed -i 's/CONF_SWAPSIZE=100/CONF_SWAPSIZE=512/g' /etc/dphys-swapfile
sudo /etc/init.d/dphys-swapfile stop
sudo /etc/init.d/dphys-swapfile start
#git clone https://github.com/opencv/opencv.git
#git clone https://github.com/opencv/opencv.git -b $CVVERSION --depth 1
#cd opencv
#git checkout $CVVERSION
#cd $CWD
#or
#wget https://github.com/opencv/opencv/archive/refs/tags/$CVVERSION.tar.gz
#tar xzvf $CVVERSION.tar.gz
#git clone https://github.com/opencv/opencv_contrib.git
#cd opencv_contrib
#git checkout $cvVersion
#cd ..
# Create direcory for build
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-DCMAKE_INSTALL_PREFIX=$CWD/install/opencv-"$CVVERSION" \
-DENABLE_VFPV3=ON \
-DENABLE_NEON=ON \
-DWITH_V4L=ON \
../opencv
make -j$(nproc)
make install