...
코드 블럭 |
---|
# 현재 경로 : ~/opencv-4.5.1 $ mkdir build $ cd build |
CMake를 사용하여 빌드 설정
코드 블럭 |
---|
$ cmake -D WITH_CUDA=ON \ -D ENABLE_PRECOMPILED_HEADERS=OFF \ -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-4.5.1/modules \ -D WITH_GSTREAMER=ON \ -D WITH_LIBV4L=ON \ -D BUILD_opencv_python2=ON \ -D BUILD_opencv_python3=ON \ -D BUILD_TESTS=OFF \ -D BUILD_PERF_TESTS=OFF \ -D BUILD_EXAMPLES=OFF \ -D CMAKE_BUILD_TYPE=RELEASE \ -D CMAKE_INSTALL_PREFIX=/usr/local \ -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-4.5.1/modules \ -D EIGEN_INCLUDE_PATH=/usr/include/eigen3 \ -D CUDA_ARCH_BIN="7.2" \ -D CUDA_ARCH_PTX="" \ -D WITH_CUDNN=ON \ -D WITH_CUBLAS=ON \ -D ENABLE_FAST_MATH=ON \ -D CUDA_FAST_MATH=ON \ -D OPENCV_DNN_CUDA=ON \ -D ENABLE_NEON=ON \ -D WITH_QT=OFF \ -D WITH_OPENMP=ON \ -D WITH_OPENGL=ON \ -D BUILD_TIFF=ON \ -D WITH_FFMPEG=ON \ -D WITH_TBB=ON \ -D BUILD_TBB=ON \ -D WITH_EIGEN=ON \ -D WITH_V4L=ON \ -D OPENCV_ENABLE_NONFREE=ON \ -D INSTALL_C_EXAMPLES=ON \ -D INSTALL_PYTHON_EXAMPLES=ON \ -D BUILD_NEW_PYTHON_SUPPORT=ON \ -D BUILD_opencv_python3=TRUE \ -D OPENCV_GENERATE_PKGCONFIG=ON \ -D BUILD_EXAMPLES=OFF .. |
opencv와 contribs modules 컴파일 빌드 (많은 시간 소요)
코드 블럭 |
---|
# 코어 개수에 따라 옵션을 주세요 # 예) make -j4 $ make $ sudo make install $ sudo ldconfig |
...