From 509fbc295d52358c7a9e739f7ce59fab9c449dce Mon Sep 17 00:00:00 2001 From: wangguanzhong Date: Tue, 13 Jun 2023 10:40:51 +0800 Subject: [PATCH] [cherry-pick] fix opencv compile (#8346) --- deploy/cpp/scripts/build.sh | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/deploy/cpp/scripts/build.sh b/deploy/cpp/scripts/build.sh index 1937c7a05..bc5e9b91d 100644 --- a/deploy/cpp/scripts/build.sh +++ b/deploy/cpp/scripts/build.sh @@ -40,11 +40,39 @@ then echo "set OPENCV_DIR for x86_64" # linux系统通过以下命令下载预编译的opencv mkdir -p $(pwd)/deps && cd $(pwd)/deps - wget -c https://paddledet.bj.bcebos.com/data/opencv-3.4.16_gcc8.2_ffmpeg.tar.gz - tar -xvf opencv-3.4.16_gcc8.2_ffmpeg.tar.gz && cd .. + wget -c https://bj.bcebos.com/v1/paddledet/data/opencv-3.4.7.tar.gz + tar -xvf opencv-3.4.7.tar.gz + cd opencv-3.4.7 + + OPENCV_INSTALL_PATH=./opencv3 + rm -rf build + mkdir build + cd build + + cmake .. \ + -DCMAKE_INSTALL_PREFIX=${OPENCV_INSTALL_PATH} \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_SHARED_LIBS=OFF \ + -DWITH_IPP=OFF \ + -DBUILD_IPP_IW=OFF \ + -DWITH_LAPACK=OFF \ + -DWITH_EIGEN=OFF \ + -DCMAKE_INSTALL_LIBDIR=lib64 \ + -DWITH_ZLIB=ON \ + -DBUILD_ZLIB=ON \ + -DWITH_JPEG=ON \ + -DBUILD_JPEG=ON \ + -DWITH_PNG=ON \ + -DBUILD_PNG=ON \ + -DWITH_TIFF=ON \ + -DBUILD_TIFF=ON + + make -j + make install + cd ../../../ # set OPENCV_DIR - OPENCV_DIR=$(pwd)/deps/opencv-3.4.16_gcc8.2_ffmpeg + OPENCV_DIR=$(pwd)/deps/opencv-3.4.7/build/opencv3 elif [ "$MACHINE_TYPE" = "aarch64" ] then -- GitLab