got a build error in NX plugin "opencv_object_detection_analytics_plugin"

In Progress

Comments

21 comments

  • Avatar
    Andrey Terentyev

    Hello,

    Could you please provide the following info: OS version, VMS build number, Metadata SDK version, cmake version, python version, conan version?

    Could you please share the entire cmake building log file?

     which configuration you have used.

    Tested configurations are listed in the readme.md file.

    0
    Comment actions Permalink
  • Avatar
    Ali Ergin Hacimahmutoglu

    Hi Andrey, 

    After I have sent you the post. I have used the version "metadata_sdk-5.0.0.35269"  It worked fine.  I successfully built the step1 and step2. 

    However I could not add the conan to the project. When you build step3 to the project, I have an error like below: 

     

    Then, I have installed the "Conan extension 1.2.2.346" for visual studio. It did not work. it seems that, this extension not fits to the project.  You can see the  picture below the options are blacked out. 

     

    The versions I am using:

     "visual studio 2019",

    "cmake version 3.19.4.0"

    "visual studio cmake tools MSVC_14.28.29910"

    Could you help me, how can I install the Conan to Visual studio and build the step3, 4, 5.

    Thanks,

     

     

     

     

    0
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    Hi Ali,

    It seems you don't have conan installed in your system.

    According to the official conan documentation, the recommended way for installing conan goes via pip.

    https://docs.conan.io/1/installation.html

    That means you need python to be installed first.

    0
    Comment actions Permalink
  • Avatar
    Ali Ergin Hacimahmutoglu

    Hi Andrey,  

    I have installed the Conan with the python pip executable,  however I am still taking a visual studio build  error  like  the below  

    It seems that Visual studio doesn't recognize the installed conan.exe,  and trying to install it. 

    Phyton pip  installs the Conan to the current path  "C:\Users\admin\AppData\Local\Programs\Python\Python310\Scripts

    I think, that doesn't relate with the visual studio cmake build.  I am not sure, possibly visual studio looking for a  installed Conan in its current build directory.

    Is there a way of installation  for visual studio. I could not find a clear solution for it

    Thanks,  

     

     

    0
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    Please share the cmake log file messages from the Output tab

    0
    Comment actions Permalink
  • Avatar
    Ali Ergin Hacimahmutoglu

    Here is the log file in the VS cmake build, 

     

    The system is: Windows - 10.0.19042 - AMD64
    Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded.
    Compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29910/bin/Hostx64/x64/cl.exe 
    Build flags: 
    Id flags:  

    The output was:
    0
    Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29910 for x64
    Copyright (C) Microsoft Corporation.  All rights reserved.

    CMakeCCompilerId.c
    Microsoft (R) Incremental Linker Version 14.28.29910.0
    Copyright (C) Microsoft Corporation.  All rights reserved.

    /out:CMakeCCompilerId.exe 
    CMakeCCompilerId.obj 


    Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "CMakeCCompilerId.exe"

    Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "CMakeCCompilerId.obj"

    The C compiler identification is MSVC, found in "C:/Users/admin/Desktop/newerVersion/metadata_sdk/samples/step3/out/build/x64-Debug/CMakeFiles/3.19.20122902-MSVC_2/CompilerIdC/CMakeCCompilerId.exe"

    Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded.
    Compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29910/bin/Hostx64/x64/cl.exe 
    Build flags: 
    Id flags:  

    The output was:
    0
    Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29910 for x64
    Copyright (C) Microsoft Corporation.  All rights reserved.

    CMakeCXXCompilerId.cpp
    Microsoft (R) Incremental Linker Version 14.28.29910.0
    Copyright (C) Microsoft Corporation.  All rights reserved.

    /out:CMakeCXXCompilerId.exe 
    CMakeCXXCompilerId.obj 


    Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "CMakeCXXCompilerId.exe"

    Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "CMakeCXXCompilerId.obj"

    The CXX compiler identification is MSVC, found in "C:/Users/admin/Desktop/newerVersion/metadata_sdk/samples/step3/out/build/x64-Debug/CMakeFiles/3.19.20122902-MSVC_2/CompilerIdCXX/CMakeCXXCompilerId.exe"

    Detecting C compiler ABI info compiled with the following output:
    Change Dir: C:/Users/admin/Desktop/newerVersion/metadata_sdk/samples/step3/out/build/x64-Debug/CMakeFiles/CMakeTmp

    Run Build Command(s):C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe cmTC_b85a3 && [1/2] Building C object CMakeFiles\cmTC_b85a3.dir\CMakeCCompilerABI.c.obj
    [2/2] Linking C executable cmTC_b85a3.exe

     

    Detecting CXX compiler ABI info compiled with the following output:
    Change Dir: C:/Users/admin/Desktop/newerVersion/metadata_sdk/samples/step3/out/build/x64-Debug/CMakeFiles/CMakeTmp

    Run Build Command(s):C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe cmTC_79399 && [1/2] Building CXX object CMakeFiles\cmTC_79399.dir\CMakeCXXCompilerABI.cpp.obj
    [2/2] Linking CXX executable cmTC_79399.exe

     

     

    0
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    Could you, please, do the following:

    1. Close the project in Visual Studio

    2. Delete the directory Visual Studio uses for storing build artifacts. Most probably it's the "out" directory inside the "step3"

    3. Delete the .vs folder in the step3 directory.

    4. Start Visual Studio.

    5. Open the "step3" folder in Visual Studio.

    6. Wait until the error. Make a screenshot of the error.

    7. Switch to the Output tab. Press Ctrl+A, Ctrl+C.

    8. Switch to your text editor and press Ctrl+V to paste the text copied.

    9. Save to a file.

    10. Place the file and the screenshot made in step 6 to a cloud storage and share the link here in a post.

    Please share the output of this command

    conan remote list
    0
    Comment actions Permalink
  • Avatar
    Ali Ergin Hacimahmutoglu

    Hi, 

    Here is the we-transfer link file of the output log.  

    https://we.tl/t-OPMjFT5r8O

    It is written that, there should be user profile for conan in the pc.  

    Also the output of  "conan remote list"  below,   

    Thanks.

    0
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    Thanks for the log file.

    The error is quite clear

    1> [CMake] ERROR: The default build profile 'C:\Users\admin\.conan2\profiles\default' doesn't exist.
    1> [CMake] You need to create a default profile (type 'conan profile detect' command)
    1> [CMake] or specify your own profile with '--profile:build=<myprofile>'

    You have installed conan, but have not configured it.

    In the guide, the instructions for configuring in Linux are given

    https://meta.nxvms.com/docs/developers/knowledgebase/235-step-4-adding-object-detection

    Configure these settings in the default conan profile:

    conan profile update settings.arch=x86_64 default
    conan profile update settings.os=Linux default
    conan profile update settings.compiler.libcxx=libstdc++11 default
    conan profile update settings.compiler=gcc default

    For Windows those have to be changed respectively.

    I'd suggest reading conan manual for clear understanding what those mean.

    In your case, those should be

    conan profile update settings.arch=x86_64 default
    conan profile update settings.os=Windows default
    conan profile update settings.compiler="Visual Studio" default

    or you could proceed with what is suggested in the error message

    conan profile detect
    0
    Comment actions Permalink
  • Avatar
    Ali Ergin Hacimahmutoglu

    Hi Andrey, 

    I have again a problem, I have just sent  you my output log below, It seems that,  my vs studio c++ compiler cannot read the correct parameters of the conan profile. 

    I have also sent you the detailed log file with we-transfer. The link is below: 

    https://we.tl/t-xIvIgcf1eR  

    As I said before, Visual studio is not reading,  my conan profile like below, 

    Can you advise me any solution for that.

    Thanks,  

     

     

    0
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    Hello,

    Ok. I got, what the thing is.

    You have conan version 2.0. You need conan 1.59. Please, reinstall it.

    Proceed with

    pip uninstall conan
    pip install conan==1.59.0

    Then check with instructions given in the readme.md. Without Visual Studio first.

    Change to plugin directory and proceed with

    mkdir build
    cd build
    cmake -DmetadataSdkDir=/PATH_TO_METADATA_SDK/ -DCMAKE_BUILD_TYPE=Release ../step3
    cmake --build . --config Release
    0
    Comment actions Permalink
  • Avatar
    Ali Ergin Hacimahmutoglu

    Hi Andrey, 

      As you have said, I have changed the Conan version to 1.59.0, and I have to stopped to use the Visual Studio as building software.  I got an different error this time. This error is a building error of conan, I have post the CMD output in the link below. You can check it.  

     https://we.tl/t-S2PPHHHuHy

    I am changing the compiler from Visual Studio 17 2022 to MingGW . Do you advice me to do that, if yes:

    The default "cmakeLists.txt"  file in step3 is written as in the 4. line like 

    set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded")   I have changed to

    SET(CMAKE_CXX_COMPILER "C:/MinGW/bin/g++")   but it did not worked. 

     Do you have any documentation for that?

    Thanks,

     

     

     

        

    0
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    Hello,

    I am changing the compiler from Visual Studio 17 2022 to MingGW . Do you advice me to do that, if yes:

    No. Please avoid doing that. We don't use this configuration for Windows and have never tried. It would require times more time to troubleshoot your issue.

    This error is a building error of conan, I have post the CMD output in the link below. You can check it.  

    As I can see in the log, there is progress.

    Here are several notes.

    ade/0.1.2a: WARN: Using the new toolchains and generators without specifying a build profile (e.g: -pr:b=default) is discouraged and might cause failures and unexpected behavior

    I'd suspect you have not created default conan profile after reinstalling conan of version 1.59.

    Please, do it. Add the compiler.runtime=MT to the default profile.

    Here is the root cause of the error.

    'cmake' is not recognized as an internal or external command,
    operable program or batch file.
    ade/0.1.2a: ade/0.1.2a: ERROR: Package '871c6303207aa1b539e682559d0b5180e15f0c30' build failed

    Please, have a fresh start.

    Delete the nx_open_integrations repo folder and re-clone it from GitHub.

    Delete content of the build directory.

    Restart your computer.

    Run CLI.

    Make sure cmake is accessible

    cmake --version

    Make sure the commands executed without errors

    conan profile listconan profile show default

    In your case, the output should look like this

    [settings]
    os=Windows
    os_build=Windows
    arch=x86_64
    arch_build=x86_64
    compiler=Visual Studio
    compiler.version=17
    build_type=Release
    compiler.runtime=MT
    [options]
    [conf]
    [build_requires]
    [env]

    change settings respectively, if it does not

    conan remote list

    should give you

    conan-center: https://center.conan.io [Verify SSL: True]

    Please, try installing the ade library manually in cli.

    conan install ade/0.1.2a@

    Change to plugin directory and proceed with

    mkdir build
    cd build
    cmake -DmetadataSdkDir=/PATH_TO_METADATA_SDK/ -DCMAKE_BUILD_TYPE=Release ../step3
    cmake --build . --config Release

    The most important thing. The path I'm trying to guide you along is the working one, it has been tested.

    The primary goal is to make it building as it was supposed to. Afterward, you could experiment with changing settings to suite your needs.

     

    0
    Comment actions Permalink
  • Avatar
    Ali Ergin Hacimahmutoglu

    Hi Andrey,

    I got  error when I try to install  ade/0.1.2a. I think that is the cause of the build problem. I am not sure but it seems that the profile for the Conan isn't correct for  ade/0.1.2a . Here is the cmd output below,

     

    I have also put the detailed log information when I try to install  ade/0.1.2a  The Link for the we transfer is below

    https://we.tl/t-aHuDnwT0vp

    Do I have to change any settings inside the profile like the compiler.version=17 .

    Could you help me about it.

    Thanks,

     

    0
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    Hello,

    I'm sorry.

    You wrote you have

    visual studio 2019

    then you wrote

    I am changing the compiler from Visual Studio 17 2022

    I got confused and mislead you. My bad.

    If you have VS 2019, you should use compiler.version=16.

    Here is a useful table

    You can check compiler version in VS by going Help->About Microsoft Visual Studio.

    https://cmake.org/cmake/help/latest/variable/MSVC_VERSION.html

    Independent of the compiler version, you could specify 

    --build=missing

    to compile library from the source code if no suitable precompiled library has been found for your configuration.

    conan install --build=missing ade/0.1.2a@
    0
    Comment actions Permalink
  • Avatar
    Ali Ergin Hacimahmutoglu

    Hi Andey, 

    Visual studio 2017 , 2019,  2022 installed in my machine. C-make is choosing the newest compiler.  Andrey, I think we are lost in the posts.  I am using c-make to built , I am not using any version of Visual Studio since you have wrote "Then check with instructions given in the readme.md. Without Visual Studio first"   

    Also  you can check the log files in my previous post  https://we.tl/t-S2PPHHHuHy(expired)  https://we.tl/t-jSB7A2hndp  My Built tool is not Visual studio. If it is possible, can you sent me  TeamViewer or a similar link and we can look together. 

    Thanks,

        

    0
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    Hello,

     I am using c-make to built, I am not using any version of Visual Studio since you have wrote 

    That's correct. Keep doing.

    I meant that you could start Visual Studio for checking the compiler version.

    Please, try to explicitly indicate the build profile

    conan install --build=missing -pr:b=default ade/0.1.2a@ 

    Here is how it works in my machine

    0
    Comment actions Permalink
  • Avatar
    Ali Ergin Hacimahmutoglu

    Hi Andrey, 

    As we have talked before, I have started from scratch, and reconfigure the environment. This time like your environment, I have used the version= 16 for mscv, and  the conan successfully installed the ade/0.1.2a,   protobuf/3.17.1, zlib/1.2.13  however I got an error in the  installation of the opencv. Below you can  see the details

        I have tried to install opencv separately with the command. "conan install --build=missing -pr:b=default opencv/4.5.5@"  but it did not work. I have tried to install from remotes, but it doesn't work either. It seems that, all installation has to be done in the same built. I have put all cmd output as a detailed log in the below link, 

    https://we.tl/t-4oYuTvKzNf   Could you please help me, how can I solve the build failure of the opencv. 

    Thanks,

        

     

    0
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    Hello Ali Ergin Hacimahmutoglu,

    If the issue is still relevant, could you share

    1. the command line you're trying to build with,

    2. cmake log file,

    3. the latest code of your project.

    0
    Comment actions Permalink
  • Avatar
    Ali Ergin Hacimahmutoglu

    Hi Andrey, 

    For installation of conan I use python ==> 
    (python scripter stays in the path of "C:\Users\admin\AppData\Local\Programs\Python\Python310\Scripts") 


    "pip install conan==1.59.0"

    C:\Users\admin\AppData\Local\Programs\Python\Python310\Scripts>pip install conan==1.59.0

    in order to build the project I use again this
    there is a separate folder for  "build". 


    "cmake -S C:\Users\admin\Desktop\newerVersion\metadata_sdk\samples\step3  
    -B C:\Users\admin\Desktop\build"

    C:\Users\admin\AppData\Local\Programs\Python\Python310\Scripts>cmake -S C:\Users\admin\Desktop\newerVersion\metadata_sdk\samples\step3 -B C:\Users\admin\Desktop\build

    https://we.tl/t-lbHGhrKbUz
    Above is the link for,
    -source project folder. 
    -target build folder.
    -commandPrompt output file.

    - python script folder, we transfer link is here; https://we.tl/t-URzTyLWpIr

    Thanks for helping me a lot , 

    0
    Comment actions Permalink
  • Avatar
    Ali Ergin Hacimahmutoglu

    Hi  Andrey,

    I was tried to send everything to you. Could you please tell me, if anything wrong. 

    Thanks,

    0
    Comment actions Permalink

Please sign in to leave a comment.