tar -xvf opencv-4.4.0.tar.gz
tar -xvf opencv_contrib-4.4.0.tar.gz
cd /data/opencv-4.4.0/build
cmake -DCMAKE_BUILD_TYPE=RELEASE \
-DCMAKE_INSTALL_PREFIX=/usr/local/opencv4 \
-DINSTALL_C_EXAMPLES=ON \
-DOPENCV_GENERATE_PKGCONFIG=ON \
-DINSTALL_PYTHON_EXAMPLES=ON \
-DBUILD_SHARED_LIBS=ON \
-DWITH_TBB=ON \
-DWITH_V4L=ON \
-DBUILD_opencv_world=OFF \
-DOPENCV_PYTHON3_INSTALL_PATH=/usr/local/opencv4/python3 \
-DWITH_QT=ON \
-DWITH_OPENGL=ON \
-DWITH_FFMPEG=ON \
-DHAVE_FFMPEG=OFF \
-DWITH_CUDA=ON \
-DHAVE_CUDNN=ON \
-DCUDNN_INCLUDE_DIRS=/data/cuda/include \
-DCUDNN_LIBRARY=/usr/lib/x86_64-linux-gnu/libcudnn.so.8.0.4 \
-DWITH_CUFFT=ON \
-DWITH_CUBLAS=ON \
-DWITH_NVCUVID=OFF \
-DHAVE_NVCUVID=OFF\
-DWITH_NVCUVENC=ON \
-DHAVE_NVCUVENC=ON \
-DBUILD_CUDA_STUBS=ON \
-DBUILD_opencv_cudalegacy=ON \
-DBUILD_opencv_cudacodec=ON \
-DCUDA_FAST_MATH=ON \
-DCUDA_ARCH_BIN="8.6" \
-DCUDA_TOOLKIT_ROOT_DIR="/usr/local/cuda-11.1" \
-DOPENCV_EXTRA_MODULES_PATH="/data/opencv_contrib-4.4.0/modules" \
-DBUILD_NEW_PYTHON_SUPPORT=ON \
-DBUILD_opencv_python3=ON \
-DHAVE_opencv_python3=ON \
-DPYTHON3_EXECUTABLE=/usr/bin/python3 \
-DPYTHON3_DEFAULT_EXECUTABLE=/usr/bin/python3 \
-DPYTHON3_INCLUDE_PATH=/usr/include/python3.6 \
-DPYTHON3_NUMPY_INCLUDE_DIRS=/usr/lib/x86_64-linux-gnu/python3.6/site-packages/numpy/core/include \
-DPYTHON3_PACKAGES_PATH=/usr/lib/x86_64-linux-gnu/python3.6/site-packages \
-DPYTHON3_LIBRARIES=/usr/lib/x86_64-linux-gnu/libpython3.6.so \
-DPYTHON3_LIBRARIES_PATH=/usr/lib/x86_64-linux-gnu \
-D OpenGL_GL_PREFERENCE=GLVND \
-D BUILD_opencv_rgbd=OFF \
-D WITH_QT=ON \
-D WITH_OPENGL=ON \
-D WITH_GTK_2_X=ON \
-DBUILD_EXAMPLES=OFF ..
make -j32
make install
Thursday, 28 July 2022
How to build opencv in ubuntu20, rtx3050, nvidia-driver-515?
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment