Ncnn: Hi!Opencv not found..

Created on 23 Jul 2020  ·  2Comments  ·  Source: Tencent/ncnn

-- CMAKE_INSTALL_PREFIX = /paddle/deploy/ncnn/build/install
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Target arch: x86
-- Found OpenMP_C: -fopenmp (found version "4.0")
-- Found OpenMP_CXX: -fopenmp (found version "4.0")
-- Found OpenMP: TRUE (found version "4.0")
CMake Warning at examples/CMakeLists.txt:35 (message):
OpenCV not found, examples won't be built

-- Found Protobuf: /usr/local/lib/libprotobuf.so;pthread (found version "3.12.3")
CMake Warning at tools/quantize/CMakeLists.txt:18 (message):
OpenCV not found, quantize tools won't be built

-- Configuring done
-- Generating done
-- Build files have been written to: /paddle/deploy/ncnn/build

can you help me solve it?

Most helpful comment

Hi,
it is a warning that "opencv is not found", instead of an error.
To fix that warning, you have two choices:

  1. Turn of the build of examples by passing -DNCNN_BUILD_EXAMPLES=OFF when calling cmake, like:
mkdir build && cd build
cmake .. -DNCNN_BUILD_EXAMPLES=OFF
make -j
  1. Tell cmake where your opencv located, in the manner of cmake, such as specifing OpenCV_DIR variable, whose value is the directory that contains OpenCVConfig.cmake
mkdir build && cd build
cmake .. -DOpenCV_DIR=/home/zz/soft/opencv-3.4.11/share/OpenCV

Or you can just install opencv via sudo apt instal libopencv-dev, then don't have to specify OpenCV_DIR since cmake's smart enough to find it.

All 2 comments

Hi,
it is a warning that "opencv is not found", instead of an error.
To fix that warning, you have two choices:

  1. Turn of the build of examples by passing -DNCNN_BUILD_EXAMPLES=OFF when calling cmake, like:
mkdir build && cd build
cmake .. -DNCNN_BUILD_EXAMPLES=OFF
make -j
  1. Tell cmake where your opencv located, in the manner of cmake, such as specifing OpenCV_DIR variable, whose value is the directory that contains OpenCVConfig.cmake
mkdir build && cd build
cmake .. -DOpenCV_DIR=/home/zz/soft/opencv-3.4.11/share/OpenCV

Or you can just install opencv via sudo apt instal libopencv-dev, then don't have to specify OpenCV_DIR since cmake's smart enough to find it.

feel free to reopen issue if your problem is still not resolved :D

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zsliaoming picture zsliaoming  ·  3Comments

nihui picture nihui  ·  5Comments

jinfagang picture jinfagang  ·  4Comments

xhappy picture xhappy  ·  5Comments

sbsb99 picture sbsb99  ·  4Comments