Closed starhou closed 2 years ago
Hi @starhou,
Can you provide more information on reproducing the problem (e.g. corresponding CMakeLists.txt, CMake verion & OS version)?
Those directories are handled by targets in the mmdeploy cmake package so that any target depend on mmdeploy libs will include them automatically.
CMakeLists.txt
‘s path is mmdeploy/build/install/example
after compiled using below
mkdir build && cd build
cmake .. \
-DMMDEPLOY_BUILD_SDK=ON \
-DCMAKE_CXX_COMPILER=g++-7 \
-DONNXRUNTIME_DIR=/path/to/onnxruntime \
-DMMDEPLOY_TARGET_DEVICES=cpu \
-DMMDEPLOY_TARGET_BACKENDS=ort \
-DMMDEPLOY_CODEBASES=all
cmake --build . -- -j$(nproc) && cmake --install .
I used Ubuntu 20.04, cmake 3.20 , it seems the auto-generated CMakeLists
do not contain these two paths.
mmdeploy/build/install/include
mmdeploy/build/install/lib
The erros occurs when run below
cmake -DOpenCV_DIR=path/to/OpenCV/lib/cmake/OpenCV \
-DMMDeploy_DIR=${MMDEPLOY_DIR}/build/install/lib/cmake/MMDeploy ..
make object_detection
I failed to reproduce the problem following your steps.
Below is a slightly modified version of the example CMakeLists.txt. I added line 9 to print all mmdeploy libs obtained from find_package(MMDeploy)
.
# Copyright (c) OpenMMLab. All rights reserved.
cmake_minimum_required(VERSION 3.14)
project(mmdeploy-example)
find_package(OpenCV REQUIRED)
find_package(MMDeploy REQUIRED)
# Add this line
message(STATUS "${MMDeploy_LIBS}")
function(add_example name)
add_executable(${name} ${name}.cpp)
target_link_libraries(${name} ${MMDeploy_LIBS} -Wl,--disable-new-dtags
opencv_imgcodecs opencv_imgproc opencv_core)
endfunction()
add_example(image_classification)
add_example(object_detection)
add_example(image_restorer)
add_example(image_segmentation)
add_example(ocr)
Can you try it on your configuration by re-running cmake to see what's printed? It's crucial to see whether MMDeploy_LIBS
contains valid targets to further diagnose the problem.
Thank you, maybe it's another problem with my environment, I installed it many times before I succeeded, but it finally worked
when I run the Run MMDeploy SDK Demo
I got an error that can't find 'detect.h'
Bug fix
It was solved after I add
to the CMakeLists.txt in path
.../localwork/mmdeploy/build/install/example