Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CPU Dockerfile not building: CMake cannot find "Findncnn.cmake" #356

Closed
rickvanveen opened this issue Apr 14, 2022 · 4 comments
Closed

CPU Dockerfile not building: CMake cannot find "Findncnn.cmake" #356

rickvanveen opened this issue Apr 14, 2022 · 4 comments
Assignees

Comments

@rickvanveen
Copy link

Describe the bug

I tried to build the "docker/CPU/Dockerfile" file. I have copied this file to my local system and ran the commands pasted in the following section. The final step of the docker build process seems to fail because errors occurring (see "Error traceback").

Reproduction

  1. What command or script did you run?
 docker build -t mmdeploy:0.3 -f .\docker\Dockerfile .
  1. Did you make any modifications on the code or config? Did you understand what you have modified?

I did not make any modification to the Dockerfile.

Environment

I'm running docker desktop on windows 10.

Error traceback

#16 204.3 CMake Error at /root/workspace/mmdeploy/build/install/lib/cmake/MMDeploy/MMDeployConfig.cmake:39 (find_package):
#16 204.3   By not providing "Findncnn.cmake" in CMAKE_MODULE_PATH this project has
#16 204.3   asked CMake to find a package configuration file provided by "ncnn", but
#16 204.3   CMake did not find one.
#16 204.3
#16 204.3   Could not find a package configuration file provided by "ncnn" with any of
#16 204.3   the following names:
#16 204.3
#16 204.3     ncnnConfig.cmake
#16 204.3     ncnn-config.cmake
#16 204.3
#16 204.3   Add the installation prefix of "ncnn" to CMAKE_PREFIX_PATH or set
#16 204.3   "ncnn_DIR" to a directory containing one of the above files.  If "ncnn"
#16 204.3   provides a separate development package or SDK, be sure it has been
#16 204.3   installed.
#16 204.3 Call Stack (most recent call first):
#16 204.3   CMakeLists.txt:5 (find_package)
#16 204.3
#16 204.3
#16 204.3 -- Configuring incomplete, errors occurred!
#16 204.3 See also "/root/workspace/mmdeploy/build/install/example/build/CMakeFiles/CMakeOutput.log".
------
executor failed running [/bin/bash -xo pipefail -c cd mmdeploy && rm -rf build/CM* && mkdir -p build && cd build && cmake ..     -DMMDEPLOY_BUILD_SDK=ON     -DCMAKE_CXX_COMPILER=g++-7     -DONNXRUNTIME_DIR=${ONNXRUNTIME_DIR}     -Dncnn_DIR=/root/workspace/ncnn/build/install/lib/cmake/ncnn     -DInferenceEngine_DIR=/opt/intel/openvino/deployment_tools/inference_engine/share     -DMMDEPLOY_TARGET_DEVICES=cpu     -DMMDEPLOY_BUILD_SDK_PYTHON_API=ON     -DMMDEPLOY_TARGET_BACKENDS="ort;ncnn;openvino"     -DMMDEPLOY_CODEBASES=all &&    cmake --build . -- -j$(nproc) && cmake --install . &&    cd install/example  && mkdir -p build && cd build &&    cmake -DMMDeploy_DIR=/root/workspace/mmdeploy/build/install/lib/cmake/MMDeploy .. &&    cmake --build . && export SPDLOG_LEVEL=warn &&    if [ -z ${VERSION} ] ; then echo "Built MMDeploy master for CPU devices successfully!" ; else echo "Built MMDeploy version v${VERSION} for CPU devices successfully!" ; fi]: exit code: 1

Bug fix

I think it has something to do with CMake not finding "Findncnn.cmake". I would not know how to fix that though.

@irexyc
Copy link
Collaborator

irexyc commented Apr 14, 2022

You can try to modify the example build command in line 106. Add -DInferenceEngine_DIR and -Dncnn_DIR like this:

cmake -DMMDeploy_DIR=/root/workspace/mmdeploy/build/install/lib/cmake/MMDeploy -DInferenceEngine_DIR=/opt/intel/openvino/deployment_tools/inference_engine/share -Dncnn_DIR=/root/workspace/ncnn/build/install/lib/cmake/ncnn .. &&\

I will check it tomorrow and update the Dockerfile asap.

@rickvanveen
Copy link
Author

I have tried to add the option to line 106, but couldn't get that syntax right. It did start building with the following, I copied a few lines around 106 below. However, the error remained.

-DMMDEPLOY_CODEBASES=all &&\
cmake -DInferenceEngine_DIR=/opt/intel/openvino/deployment_tools/inference_engine/share -Dncnn_DIR=/root/workspace/ncnn/build/install/lib/cmake/ncnn .. && \
cmake --build . -- -j$(nproc) && cmake --install . &&\

I did try it with the full line you provides as well, but this didn't fix it as well.

@irexyc
Copy link
Collaborator

irexyc commented Apr 15, 2022

the command you paste missing -DMMDeploy_DIR

can you try this one? I test it on my machine and build success.

@rickvanveen
Copy link
Author

I tried it and it worked! Thank you looking into this and so quickly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants