Intel® Distribution of OpenVINO™ Toolkit
Community support and discussions about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all things computer vision-related on Intel® platforms.
6066 Discussions

Cannot get the C++ samples for VINO to build

shenoyd
Beginner
903 Views

I've installed VINO on my Windows machine.  I've created a build directory within the openvino-master\samples\cpp folder.  I've gone into that folder and ran:

 

cmake ..

 

but I'm getting the following errors:

 

 

Windows PowerShell                                          
Copyright (C) Microsoft Corporation. All rights reserved.   
                                                            
Try the new cross-platform PowerShell https://aka.ms/pscore6



    Directory: C:\Users\445973\Downloads\openvino-master\samples\cpp


Mode                LastWriteTime         Length Name                                                                                                                
----                -------------         ------ ----
d-----        1/24/2022   3:57 PM                build


PS C:\Users\me-user\Downloads\openvino-master\samples\cpp> cd build
PS C:\Users\me-user\Downloads\openvino-master\samples\cpp\build> cmake ..
-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.18363.
-- The C compiler identification is MSVC 19.30.30709.0
-- The CXX compiler identification is MSVC 19.30.30709.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.30.30705/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done

    OpenVINOConfig.cmake
    openvino-config.cmake

  Add the installation prefix of "OpenVINO" to CMAKE_PREFIX_PATH or set
  "OpenVINO_DIR" to a directory containing one of the above files.  If
  "OpenVINO" provides a separate development package or SDK, be sure it has
  been installed.


-- Configuring incomplete, errors occurred!
See also "C:/Users/me-user/Downloads/openvino-master/samples/cpp/build/CMakeFiles/CMakeOutput.log".

 

 

Here are the contents of CMakeOutput.log

 

The system is: Windows - 10.0.18363 - AMD64
Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded.
Compiler:  
Build flags: 
Id flags:  

The output was:
0
Microsoft (R) Build Engine version 17.0.0+c9eb9dd64 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 1/24/2022 3:58:13 PM.
Project "C:\Users\me-user\Downloads\openvino-master\samples\cpp\build\CMakeFiles\3.22.1\CompilerIdC\CompilerIdC.vcxproj" on node 1 (default targets).
PrepareForBuild:
  Creating directory "Debug\".
  Creating directory "Debug\CompilerIdC.tlog\".
InitializeBuildStatus:
  Creating "Debug\CompilerIdC.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
  C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\bin\HostX64\x64\CL.exe /c /nologo /W0 /WX- /diagnostics:column /Od /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"Debug\\" /Fd"Debug\vc143.pdb" /external:W0 /Gd /TC /FC /errorReport:queue CMakeCCompilerId.c
  CMakeCCompilerId.c
Link:
  C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\bin\HostX64\x64\link.exe /ERRORREPORT:QUEUE /OUT:".\CompilerIdC.exe" /INCREMENTAL:NO /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /PDB:".\CompilerIdC.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:".\CompilerIdC.lib" /MACHINE:X64 Debug\CMakeCCompilerId.obj
  CompilerIdC.vcxproj -> C:\Users\me-user\Downloads\openvino-master\samples\cpp\build\CMakeFiles\3.22.1\CompilerIdC\CompilerIdC.exe
PostBuildEvent:
  for %%i in (cl.exe) do @Echo CMAKE_C_COMPILER=%%~$PATH:i
  :VCEnd
  CMAKE_C_COMPILER=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\bin\Hostx64\x64\cl.exe
FinalizeBuildStatus:
  Deleting file "Debug\CompilerIdC.tlog\unsuccessfulbuild".
  Touching "Debug\CompilerIdC.tlog\CompilerIdC.lastbuildstate".
Done Building Project "C:\Users\me-user\Downloads\openvino-master\samples\cpp\build\CMakeFiles\3.22.1\CompilerIdC\CompilerIdC.vcxproj" (default targets).

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:01.45


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

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

The C compiler identification is MSVC, found in "C:/Users/me-user/Downloads/openvino-master/samples/cpp/build/CMakeFiles/3.22.1/CompilerIdC/CompilerIdC.exe"

Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded.
Compiler:  
Build flags: 
Id flags:  

The output was:
0
Microsoft (R) Build Engine version 17.0.0+c9eb9dd64 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 1/24/2022 3:58:15 PM.
Project "C:\Users\me-user\Downloads\openvino-master\samples\cpp\build\CMakeFiles\3.22.1\CompilerIdCXX\CompilerIdCXX.vcxproj" on node 1 (default targets).
PrepareForBuild:
  Creating directory "Debug\".
  Creating directory "Debug\CompilerIdCXX.tlog\".
InitializeBuildStatus:
  Creating "Debug\CompilerIdCXX.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
  C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\bin\HostX64\x64\CL.exe /c /nologo /W0 /WX- /diagnostics:column /Od /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"Debug\\" /Fd"Debug\vc143.pdb" /external:W0 /Gd /TP /FC /errorReport:queue CMakeCXXCompilerId.cpp
  CMakeCXXCompilerId.cpp
Link:
  C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\bin\HostX64\x64\link.exe /ERRORREPORT:QUEUE /OUT:".\CompilerIdCXX.exe" /INCREMENTAL:NO /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /PDB:".\CompilerIdCXX.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:".\CompilerIdCXX.lib" /MACHINE:X64 Debug\CMakeCXXCompilerId.obj
  CompilerIdCXX.vcxproj -> C:\Users\me-user\Downloads\openvino-master\samples\cpp\build\CMakeFiles\3.22.1\CompilerIdCXX\CompilerIdCXX.exe
PostBuildEvent:
  for %%i in (cl.exe) do @Echo CMAKE_CXX_COMPILER=%%~$PATH:i
  :VCEnd
  CMAKE_CXX_COMPILER=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\bin\Hostx64\x64\cl.exe
FinalizeBuildStatus:
  Deleting file "Debug\CompilerIdCXX.tlog\unsuccessfulbuild".
  Touching "Debug\CompilerIdCXX.tlog\CompilerIdCXX.lastbuildstate".
Done Building Project "C:\Users\me-user\Downloads\openvino-master\samples\cpp\build\CMakeFiles\3.22.1\CompilerIdCXX\CompilerIdCXX.vcxproj" (default targets).

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:01.16


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

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

The CXX compiler identification is MSVC, found in "C:/Users/me-user/Downloads/openvino-master/samples/cpp/build/CMakeFiles/3.22.1/CompilerIdCXX/CompilerIdCXX.exe"

Detecting C compiler ABI info compiled with the following output:
Change Dir: C:/Users/me-user/Downloads/openvino-master/samples/cpp/build/CMakeFiles/CMakeTmp

Run Build Command(s):C:/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/amd64/MSBuild.exe cmTC_ec549.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=17.0 /v:m && Microsoft (R) Build Engine version 17.0.0+c9eb9dd64 for .NET Framework

Copyright (C) Microsoft Corporation. All rights reserved.



  Microsoft (R) C/C++ Optimizing Compiler Version 19.30.30709 for x64

  CMakeCCompilerABI.c

  Copyright (C) Microsoft Corporation.  All rights reserved.

  cl /c /Zi /W3 /WX- /diagnostics:column /Od /Ob0 /D _MBCS /D WIN32 /D _WINDOWS /D "CMAKE_INTDIR=\"Debug\"" /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"cmTC_ec549.dir\Debug\\" /Fd"cmTC_ec549.dir\Debug\vc143.pdb" /external:W3 /Gd /TC /errorReport:queue "C:\Program Files\CMake\share\cmake-3.22\Modules\CMakeCCompilerABI.c"

  cmTC_ec549.vcxproj -> C:\Users\me-user\Downloads\openvino-master\samples\cpp\build\CMakeFiles\CMakeTmp\Debug\cmTC_ec549.exe




Detecting CXX compiler ABI info compiled with the following output:
Change Dir: C:/Users/me-user/Downloads/openvino-master/samples/cpp/build/CMakeFiles/CMakeTmp

Run Build Command(s):C:/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/amd64/MSBuild.exe cmTC_562cf.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=17.0 /v:m && Microsoft (R) Build Engine version 17.0.0+c9eb9dd64 for .NET Framework

Copyright (C) Microsoft Corporation. All rights reserved.



  Microsoft (R) C/C++ Optimizing Compiler Version 19.30.30709 for x64

  CMakeCXXCompilerABI.cpp

  Copyright (C) Microsoft Corporation.  All rights reserved.

  cl /c /Zi /W3 /WX- /diagnostics:column /Od /Ob0 /D _MBCS /D WIN32 /D _WINDOWS /D "CMAKE_INTDIR=\"Debug\"" /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /Fo"cmTC_562cf.dir\Debug\\" /Fd"cmTC_562cf.dir\Debug\vc143.pdb" /external:W3 /Gd /TP /errorReport:queue "C:\Program Files\CMake\share\cmake-3.22\Modules\CMakeCXXCompilerABI.cpp"

  cmTC_562cf.vcxproj -> C:\Users\me-user\Downloads\openvino-master\samples\cpp\build\CMakeFiles\CMakeTmp\Debug\cmTC_562cf.exe




 

I'm trying to trial VINO and compile the sample code examples.  Is there something I can run or check to see where I am going wrong here?

 

0 Kudos
4 Replies
Zulkifli_Intel
Moderator
888 Views

Hello Shenoyd,

 

Greetings to you.

 

To build the C or C++ sample applications on Windows, go to the <INSTALL_DIR>\openvino\samples\c or <INSTALL_DIR>\openvino\samples\cpp directory respectively, and run the build_samples_msvc.bat batch file.

 

For more information, you can refer to Build the Sample Applications on Microsoft Windows OS.

 

Sincerely,

Zulkifli

 

rachingenieria
Beginner
870 Views

Hi, Kind regards Engineers

 

I have a similar problem, I have a Rapsberry pi4 with an NC2.

Configuration:

cmake --version  cmake version 3.17.5

Openvino 2021.4.752

Python 3.7

OpenCV 4.5.3-openvino

 

I have run the openvino default demos and they work correctly with the above configuration.

I need to install "Open Zoo Demos" to use "Object Detection Python* Demo",  since I have a custom model in YOLO 3, I have passed it to IR (xml and bin) and it works fine (Detect the objects). I have tested the models in DL workbench (docker on Windows) and Ubuntu 18 using Openvino with "open model zoo demos" loading a similar configuration.

 

I have followed these guides:

https://www.intel.com/content/www/us/en/support/articles/000055510/boards-and-kits/neural-compute-st...

https://docs.openvino.ai/latest/omz_demos.html#doxid-omz-demos

https://docs.openvino.ai/latest/omz_demos_object_detection_demo_python.html

 

The problem that happens is when I try to install the "open zoo demos" on Rapsberry Pi, when build the demo applications manually.

..............

.............

(opencv4-4) pi@raspberrypi:~/mzo_build $ source /opt/intel/openvino_2021/bin/setupvars.sh
[setupvars.sh] OpenVINO environment initialized
(opencv4-4) pi@raspberrypi:~/mzo_build $ cmake -DCMAKE_BUILD_TYPE=Release /opt/intel/openvino_2021/deployment_tools/open_model_zoo/demos
CMake Error at CMakeLists.txt:146 (find_package):
By not providing "FindOpenVINO.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "OpenVINO",
but CMake did not find one.

Could not find a package configuration file provided by "OpenVINO" with any
of the following names:

OpenVINOConfig.cmake
openvino-config.cmake

Add the installation prefix of "OpenVINO" to CMAKE_PREFIX_PATH or set
"OpenVINO_DIR" to a directory containing one of the above files. If
"OpenVINO" provides a separate development package or SDK, be sure it has
been installed.


-- Configuring incomplete, errors occurred!
See also "/home/pi/mzo_build/CMakeFiles/CMakeOutput.log".
(opencv4-4) pi@raspberrypi:~/mzo_build $

.............................

 

The same happens when I do it using the script 

sudo ./build_demos.sh 

with Open Model Zoo in the openvino folder according to the guide

https://github.com/openvinotoolkit/openvino/wiki/BuildingCode

git clone https://github.com/openvinotoolkit/open_model_zoo.git
cmake -E copy_directory ./open_model_zoo/ opt/intel/openvino_2021//deployment_tools/open_model_zoo/

 

The same error appears again

...........................................

 

(opencv4-4) pi@raspberrypi:~/mzo_build $ cd /opt/intel/openvino_2021/deployment_tools/open_model_zoo/demos/
(opencv4-4) pi@raspberrypi:/opt/intel/openvino_2021/deployment_tools/open_model_zoo/demos $ sudo ./build_demos.sh

Setting environment variables for building demos...
[setupvars.sh] WARNING: Can not find OpenVINO Python binaries by path /opt/intel/python
[setupvars.sh] WARNING: OpenVINO Python environment does not set properly
[setupvars.sh] OpenVINO environment initialized
-- The C compiler identification is GNU 8.3.0
-- The CXX compiler identification is GNU 8.3.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
-- Found OpenCV: /usr/local (found version "4.5.2") found components: core highgui videoio imgproc imgcodecs gapi
CMake Error at CMakeLists.txt:146 (find_package):
By not providing "FindOpenVINO.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "OpenVINO",
but CMake did not find one.

Could not find a package configuration file provided by "OpenVINO" with any
of the following names:

OpenVINOConfig.cmake
openvino-config.cmake

Add the installation prefix of "OpenVINO" to CMAKE_PREFIX_PATH or set
"OpenVINO_DIR" to a directory containing one of the above files. If
"OpenVINO" provides a separate development package or SDK, be sure it has
been installed.


-- Configuring incomplete, errors occurred!
See also "/root/omz_demos_build/CMakeFiles/CMakeOutput.log".
Error on or near line 105; exiting with status 1

 

 

..............................

I have tried using both Openvino with the pre-installed packages and building the packages according to the guide getting the same error.

 

Thanks

 

Zulkifli_Intel
Moderator
851 Views

Hello shenoyd and rachingenieria,

 

You can build the sample applications manually by following these steps:

 

1.     Navigate to a build directory that you have access to.

cd build

 

2.     Run CMake to generate the Make files for release or debug configuration. For C++ samples:

·      For release configuration:

cmake -DCMAKE_BUILD_TYPE=Release <INSTALL_DIR>/openvino/samples/cpp

·      For debug configuration:

cmake -DCMAKE_BUILD_TYPE=Debug <INSTALL_DIR>/openvio/samples/cpp

 

3.     Run make to build the samples:

make 

 

The build sample will be in ~/openvino/bin/intel64/Release @ ~/openvino/bin/intel64/Debug directory depending on your configuration.

 

For more detail, please refer to the Build the Sample Applications.

 

Sincerely,

Zulkifli

 

 

Zulkifli_Intel
Moderator
818 Views

Hello. This thread will no longer be monitored since we have provided a solution. If you need any additional information from Intel, please submit a new question.


Sincerely,

Zulkifli


Reply