-
Notifications
You must be signed in to change notification settings - Fork 0
/
opencv.sh
71 lines (56 loc) · 1.75 KB
/
opencv.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
#!/usr/bin/env bash
# see
# http://docs.opencv.org/master/dd/dd5/tutorial_py_setup_in_fedora.html
#
set -x
clean="clean"
clean="no"
dnf="dnf"
dnf="no"
git="git"
git="no"
cd ~
if [ "$clean" = "clean" ]; then
sudo rm -rf opencv-install
mkdir opencv-install
fi
if [ "$dnf" = "dnf" ]; then
sudo dnf -y install cmake
sudo dnf -y install python3
sudo dnf -y install python3-devel
sudo dnf -y install python3-numpy
sudo dnf -y install gcc
sudo dnf -y install gcc-c++
sudo dnf -y install libpng-devel
sudo dnf -y install libjpeg-turbo-devel
sudo dnf -y install jasper-devel
sudo dnf -y install openexr-devel
sudo dnf -y install libtiff-devel
sudo dnf -y install libwebp-devel
sudo dnf -y install gtk2-devel
sudo dnf -y install libdc1394-devel
sudo dnf -y install libv4l-devel
sudo dnf -y install ffmpeg-devel
sudo dnf -y install gstreamer-plugins-base-devel
sudo dnf -y install tbb-devel
sudo dnf -y install eigen3-devel
sudo dnf -y install python-sphinx
sudo dnf -y install texlive
sudo dnf -y install git
fi
cd opencv-install
if [ "$git" = "git" ]; then
git clone --progress https://github.com/Itseez/opencv.git
fi
cd opencv
sudo rm -rf build
mkdir build
cd build
python3-config --config --prefix --exec-prefix --includes --libs --cflags --ldflags --extension-suffix --help --abiflags --configdir--
uname -a
#-D CMAKE_INSTALL_PREFIX=/usr/local/myopencv BUILD_DOCS=ON -D BUILD_TESTS=ON -D BUILD_PERF_TESTS=ON -D BUILD_EXAMPLES=ON ..
cmake -D CMAKE_BUILD_TYPE=RELEASE -D BUILD_opencv_python2=OFF -D BUILD_opencv_java=OFF -D CMAKE_INSTALL_PREFIX=$(python3 -c "import sys; print(sys.prefix)") -D PYTHON_EXECUTABLE=$(which python3) ..
make -j3
sudo make install
#make docs
#make html_docs