Skip to content

Commit c8481fd

Browse files
Maik Zickermannniliha
authored andcommitted
adjust opencv build script
1 parent 696e392 commit c8481fd

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

jetson_nano/build_opencv/build_opencv.sh

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -e
55

66
# change default constants here:
77
readonly PREFIX=/usr/local # install prefix, (can be ~/.local for a user install)
8-
readonly DEFAULT_VERSION=4.4.0 # controls the default version (gets reset by the first argument)
8+
readonly DEFAULT_VERSION=4.2.0 # controls the default version (gets reset by the first argument)
99
readonly CPUS=$(nproc) # controls the number of jobs
1010

1111
# better board detection. if it has 6 or more cpus, it probably has a ton of ram too
@@ -54,7 +54,6 @@ install_dependencies () {
5454
# package repository or should already be installed (eg. CUDA).
5555
echo "Installing build dependencies."
5656
sudo apt-get update
57-
sudo apt-get dist-upgrade -y --autoremove
5857
sudo apt-get install -y \
5958
build-essential \
6059
cmake \
@@ -90,34 +89,39 @@ install_dependencies () {
9089
libxvidcore-dev \
9190
libx264-dev \
9291
pkg-config \
93-
python-dev \
94-
python-numpy \
9592
python3-dev \
9693
python3-numpy \
9794
python3-matplotlib \
9895
qv4l2 \
9996
v4l-utils \
100-
v4l2ucp \
10197
zlib1g-dev
98+
# python-dev \
99+
# python-numpy \
100+
# v4l2ucp \
102101
}
103102

104103
configure () {
105104
local CMAKEFLAGS="
106105
-D BUILD_EXAMPLES=OFF
107-
-D BUILD_opencv_python2=ON
106+
-D BUILD_PERF_TESTS=OFF
107+
-D BUILD_TESTS=OFF
108+
-D BUILD_opencv_python2=OFF
108109
-D BUILD_opencv_python3=ON
110+
-D CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-10.0
109111
-D CMAKE_BUILD_TYPE=RELEASE
112+
-D CMAKE_C_COMPILER=/usr/bin/gcc-7
113+
-D CMAKE_CXX_COMPILER=/usr/bin/g++-7
110114
-D CMAKE_INSTALL_PREFIX=${PREFIX}
111-
-D CUDA_ARCH_BIN=5.3,6.2,7.2
115+
-D CUDA_ARCH_BIN=5.3
112116
-D CUDA_ARCH_PTX=
113117
-D CUDA_FAST_MATH=ON
114-
-D CUDNN_VERSION='8.0'
115118
-D EIGEN_INCLUDE_PATH=/usr/include/eigen3
116119
-D ENABLE_NEON=ON
117120
-D OPENCV_DNN_CUDA=ON
118121
-D OPENCV_ENABLE_NONFREE=ON
119122
-D OPENCV_EXTRA_MODULES_PATH=/tmp/build_opencv/opencv_contrib/modules
120123
-D OPENCV_GENERATE_PKGCONFIG=ON
124+
-D OPENCV_PYTHON3_INSTALL_PATH=/usr/local/lib/python3.8/dist-packages
121125
-D WITH_CUBLAS=ON
122126
-D WITH_CUDA=ON
123127
-D WITH_CUDNN=ON

0 commit comments

Comments
 (0)