Unable to finish tutorial "Step 3. Adding object detection" due to failed to download opencv files from Conan

Answered

Comments

15 comments

  • Avatar
    Andrey Terentyev

    Hello James,

    It's a known issue. I'm sorry for making troubles with that.

    I hope, we'll fix it next week along with several other bugs.

    I'll update here later.

    JIRA-VMS-23218

    0
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    Hi,

    We have updated our repository in GitHub with several fixes.

    Please, rebase to the newest code version and check if the issue persists.

    0
    Comment actions Permalink
  • Avatar
    James Yu

    Hi Andrey,
    I pull the latest master

    * commit 0d6207b0177cf4af39c62360365c1ad50adf31c3 (HEAD -> master, origin/x/VMS-23218_repair_opnecv_plugin_building, origin/master, origin/HEAD)
    | Author: Andrey Terentyev <aterentyev@networkoptix.com>
    | Date: Fri Jun 25 19:23:11 2021 +0300
    |
    | VMS-23218: opencv_plugin - fix OpenCV options

    and "Run CMake" reports this error:

    ERROR: opencv/4.1.2: option 'with_gtk' doesn't exist
    Possible options are ['shared', 'fPIC', 'contrib', 'contrib_freetype', 'contrib_sfm', 'parallel', 'with_jpeg', 'with_png', 'with_tiff', 'with_jpeg2000', 'with_openexr', 'with_eigen', 'with_webp', 'with_quirc', 'with_cuda', 'with_cublas', 'with_cufft', 'dnn', 'detect_cpu_baseline']
    CMake Error at /tmp/QtCreator-LYJS2K/qtc-cmake-XXy277sC/conan.cmake:631 (message):
    Conan install failed='1'
    Call Stack (most recent call first):
    CMakeLists.txt:68 (conan_cmake_install)

    According to the "Possible options" I remove "opencv:with_gtk=False" and "opencv:with_v4l=False" in CmakeLists.txt, yet here is another error:

    ERROR: opencv/4.1.2: 'settings.arch' value not defined
    CMake Error at /tmp/QtCreator-LYJS2K/qtc-cmake-XXy277sC/conan.cmake:631 (message):
    Conan install failed='1'
    Call Stack (most recent call first):
    CMakeLists.txt:66 (conan_cmake_install)

    Maybe another update is coming up shortly?

    0
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    Hi James,

    I've just rechecked in the completely new directory.

    git clone https://github.com/networkoptix/nx_open_integrations.git

    and followed the instructions in the cpp/vms_server_plugins/opencv_object_detection_analytics_plugin/readme.md. Everything works for me.

    "Run CMake" reports this error:

    Could you please share the cmake command line you are starting?

    Could you please share the output of these command?

    conan search
    conan remote list
    conan profile show default

     

    Make sure you don't have another OpenCV version installed with conan by using this command.

    conan search

    Just remove each of them by

    conan remove

    Make sure you have the Conan center in your remotes

    conan remote list

    here is the command for adding it as a remote

    conan remote add conancenter https://center.conan.io
    0
    Comment actions Permalink
  • Avatar
    James Yu

    Hi Andrey,

    I tried to remove existing nx_open_integrations folder and did a fresh got clone.
    I also use cmake command directly, for example:

    cmake -DmetadataSdkDir=/root/develop/metadata_sdk/ -DCMAKE_BUILD_TYPE=Release ../step3

    Still, I got same error.
    Here is the complete CMakeOutput.log.

    "conan search" returns:

    Existing package recipes:

    Eigen/3.3.5@kestrel/stable
    aligner/1.5.9@kestrel/stable
    attribute/1.5.9@kestrel/stable
    august/1.5.9@kestrel/stable
    blur/1.5.9@kestrel/stable
    classifier/1.5.9@kestrel/stable
    counter/1.5.9@kestrel/stable
    decoder/1.5.9@kestrel/stable
    defake/1.5.9@kestrel/stable
    demuxer/1.5.9@kestrel/stable
    essos/1.5.9@kestrel/stable
    eyestate/1.5.9@kestrel/stable
    feature/1.5.9@kestrel/stable
    gtest/1.8.1@kestrel/stable
    harpy/1.5.9@kestrel/stable
    headpose/1.5.9@kestrel/stable
    hermes/1.5.9@kestrel/stable
    horae/1.5.9@kestrel/stable
    hpc_ppl/7.9.1@hpc/release
    hunter/1.5.9@kestrel/stable
    kestrel/1.5.9@kestrel/stable
    kestrel_nart/1.5.9@kestrel/stable
    kestrel_nart/1.5.10@kestrel/stable
    kestrel_ppl/1.5.9@kestrel/stable
    live2i/1.5.9@kestrel/stable
    live3d/1.5.9@kestrel/stable
    liveness/1.5.9@kestrel/stable
    opencv/4.1.2
    pageant/1.5.9@kestrel/stable
    pplcv/1.7.1@hpc/stable
    raven/1.5.9@kestrel/stable
    senu/1.5.9@kestrel/stable
    textdetection/1.5.9@kestrel/stable
    textrecognition/1.5.9@kestrel/dev-1-5-9-without-pool

    opencv/4.1.2 is the only opencv version in search result.

     

    "conan remote list" returns:

    kestrel: http://conan.kestrel.sensetime.com/artifactory/api/conan/kestrel [Verify SSL: True, Disabled: True]
    conancenter: https://center.conan.io [Verify SSL: True]
    conan-center: https://conan.bintray.com [Verify SSL: True]
    nx_open_intergrations: https://api.bintray.com/conan/networkoptix/nx_open_intergrations [Verify SSL: True]

    I have the Conan center in my remotes.

     

     

    0
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    James,

    Please, do the following.

    conan remove opencv/4.1.2
    conan remote remove nx_open_intergrations
    conan remote remove conan-center

    Try again.

    0
    Comment actions Permalink
  • Avatar
    James Yu

    Andrey,

    I execute all these commands and still get same result.

    conan remove opencv/4.1.2
    conan remote remove nx_open_intergrations
    conan remote remove conan-center

    Command history is here.

    0
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    James,

    The issue is about your environment, not about the code in the repository.

    Something strange is happening in your system.

    What is your linux flavour, version?

    The message appears several times:

    /usr/lib/python3/dist-packages/requests/__init__.py:80: RequestsDependencyWarning: urllib3 (1.25.11) or chardet (3.0.4) doesn't match a supported version!
      RequestsDependencyWarning)

    It's about the python requests module. I highly recommend updating your OS of at least the python and its modules.

    Here is the output, revealing the root cause.

    -- Conan executing: /usr/local/bin/conan install . -s build_type=Release -s compiler=gcc -s compiler.version=7 -s compiler.libcxx=libstdc++11 -g=cmake
    Configuration:
    [settings]
    build_type=Release
    compiler=gcc
    compiler.libcxx=libstdc++11
    compiler.version=7
    [options]
    [build_requires]
    [env]

    You don't have several options

    arch=x86_64
    arch_build=x86_64
    os=Linux
    os_build=Linux

    I have in my conan profile.

    You should configure at least two of them:

    arch=x86_64
    os=Linux

    The error message

    ERROR: opencv/4.1.2: option 'with_gtk' doesn't exist

    is about the conan recipe trying to apply options absent and to be removed for the specific OS, that is not indicated in your profile.

    0
    Comment actions Permalink
  • Avatar
    James Yu

    I am testing on Ubuntu 18.04

    This is how my conan profile (~/.conan/profiles/default) looks like now:

    [settings]
    [options]
    arch=x86_64
    arch_build=x86_64
    os=Linux
    os_build=Linux
    [build_requires]
    [env]

    the "with_gtk doesn't exit" error is gone, but I see another error ("ERROR: option 'arch' doesn't exist"), perhaps there are a few more configs to be added?

    -- Conan executing: /usr/local/bin/conan install . -s build_type=Release -s compiler=gcc -s compiler.version=7 -s compiler.libcxx=libstdc++11 -g=cmake
    Configuration:
    [settings]
    build_type=Release
    compiler=gcc
    compiler.libcxx=libstdc++11
    compiler.version=7
    [options]
    arch=x86_64
    arch_build=x86_64
    os=Linux
    os_build=Linux
    [build_requires]
    [env]

    /usr/lib/python3/dist-packages/requests/__init__.py:80: RequestsDependencyWarning: urllib3 (1.26.6) or chardet (4.0.0) doesn't match a supported version!
    RequestsDependencyWarning)
    ERROR: option 'arch' doesn't exist
    Possible options are []
    CMake Error at /root/develop/nx_open_integrations/cpp/vms_server_plugins/opencv_object_detection_analytics_plugin/build_step3/conan.cmake:522 (message):
    Conan install failed='1'
    Call Stack (most recent call first):
    /root/develop/nx_open_integrations/cpp/vms_server_plugins/opencv_object_detection_analytics_plugin/build_step3/conan.cmake:759 (old_conan_cmake_install)
    CMakeLists.txt:61 (conan_cmake_run)


    -- Configuring incomplete, errors occurred!
    See also "/root/develop/nx_open_integrations/cpp/vms_server_plugins/opencv_object_detection_analytics_plugin/build_step3/CMakeFiles/CMakeOutput.log".

    Also, I tried to upgrade with "pip3 install --upgrade urllib3 chardet", but that version doesn't match warning still shows up.

     

    0
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    James,

    Sorry for misleading you. My bad.

    These

    arch=x86_64
    os=Linux

    have to be settings, not options.

    Like this

    $ conan profile show default
    Configuration for profile default:

    [settings]
    compiler=gcc
    compiler.version=7
    compiler.libcxx=libstdc++11
    build_type=Release
    os=Linux
    arch=x86_64
    [options]
    [build_requires]
    [env]
    0
    Comment actions Permalink
  • Avatar
    James Yu

    Thank you Andrey,

    "cmake -DmetadataSdkDir=/root/develop/metadata_sdk/ -DCMAKE_BUILD_TYPE=Release ../step3" is fine now, however, when I do "cmake --build . --config Release", it complains about "No such file or directory".

    [ 62%] Building CXX object CMakeFiles/opencv_object_detection_analytics_plugin.dir/src/sample_company/vms_server_plugins/opencv_object_detection/device_agent.cpp.o
    In file included from /root/develop/nx_open_integrations/cpp/vms_server_plugins/opencv_object_detection_analytics_plugin/step3/src/sample_company/vms_server_plugins/opencv_object_detection/device_agent.cpp:3:0:
    /root/develop/nx_open_integrations/cpp/vms_server_plugins/opencv_object_detection_analytics_plugin/step3/src/sample_company/vms_server_plugins/opencv_object_detection/device_agent.h:5:10: fatal error: filesystem: No such file or directory
    #include <filesystem>
    ^~~~~~~~~~~~
    compilation terminated.
    CMakeFiles/opencv_object_detection_analytics_plugin.dir/build.make:89: recipe for target 'CMakeFiles/opencv_object_detection_analytics_plugin.dir/src/sample_company/vms_server_plugins/opencv_object_detection/device_agent.cpp.o' failed
    make[2]: *** [CMakeFiles/opencv_object_detection_analytics_plugin.dir/src/sample_company/vms_server_plugins/opencv_object_detection/device_agent.cpp.o] Error 1
    CMakeFiles/Makefile2:121: recipe for target 'CMakeFiles/opencv_object_detection_analytics_plugin.dir/all' failed
    make[1]: *** [CMakeFiles/opencv_object_detection_analytics_plugin.dir/all] Error 2
    Makefile:90: recipe for target 'all' failed
    make: *** [all] Error 2

     

     

     

     

    0
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    James,

    You have gcc version 7, where <filesystem> has to be <experimental/filesystem>. The -lstdc++fs has to be linked, as well.

    We moved from the experimental features to the c++17 standard, and to comply with that  the code was changed accordingly.

    You need to upgrade you gcc at least to the version 8.

    We'll fix the readme.md in the repository to reflect this prerequisite.

    0
    Comment actions Permalink
  • Avatar
    James Yu

    Thanks Andrey,

    I can now build through step3~ step5 after upgrading gcc to version 9.

    Your support is much appreciated.

    0
    Comment actions Permalink
  • Avatar
    Steve Techs

    I built step 3 and got this error: 

    ERROR: libopenjp2 >= 2.1.0 not found using pkg-config

    Here is my conan default profile:

    [settings]
    os=Linux
    os_build=Linux
    arch=x86_64
    arch_build=x86_64
    compiler=gcc
    compiler.version=11
    compiler.libcxx=libstdc++11
    build_type=Release
    [options]
    [conf]
    tools.system.package_manager:mode=install
    tools.system.package_manager:sudo=True
    [build_requires]
    [env]
     
     
     
    0
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    Hello Steve Techs,

    Most probably you don't have libopenjp2 installed in your OS.

    Could you please create a separate thread on the forum if installation of the libraty does not help?

    Please, provide OS, cmake, canon, g++ versions as well as step by step description of what you are doing with commands utilized.

    0
    Comment actions Permalink

Please sign in to leave a comment.