Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.
6403 Discussions

OpenVINO 2019 R2 sample app with Intel C++ Compiler 2018

Tomasz_N_Intel
Employee
609 Views

Hi All,

I'm trying to create a simple C++ application that is using Inference Engine from OpenVINO 2019 R2. I created my solution using cmake from a simple CMakeLists.txt file where I first call:

find_package(InferenceEngine 1.6 REQUIRED)

And then I'm linking to:

  • ${InferenceEngine_LIBRARIES}
  • IE::ie_cpu_extension

Before calling cmake, I first execute 'setupvars.bat' from 'openvino/bin' directory.

The generated solution compiles correctly when I'm using default Microsoft compiler (Visual Studio 2017 (v141)), but when I'm switching to Intel C++ Compiler 2018 I'm getting bunch of errors during compilation of 'ie_cpu_extension' project (I pasted here only first 5 error messages, complete error list in the attachment):

1>ext_argmax.cpp
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.13.26128\include\xtr1common(97): error : "is_same_v" is not a function or static data member
1>      _INLINE_VAR constexpr bool is_same_v = is_same<_Ty, _Uty>::value;
1>                                 ^
1>
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.13.26128\include\xtr1common(97): error : "constexpr" is not valid here
1>      _INLINE_VAR constexpr bool is_same_v = is_same<_Ty, _Uty>::value;
1>                  ^
1>
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.13.26128\include\xtr1common(266): error : "is_integral_v" is not a function or static data member
1>      _INLINE_VAR constexpr bool is_integral_v = is_integral<_Ty>::value;
1>                                 ^
1>
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.13.26128\include\xtr1common(266): error : "constexpr" is not valid here
1>      _INLINE_VAR constexpr bool is_integral_v = is_integral<_Ty>::value;
1>                  ^
1>
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.13.26128\include\xtr1common(301): error : "is_floating_point_v" is not a function or static data member
1>      _INLINE_VAR constexpr bool is_floating_point_v = is_floating_point<_Ty>::value;

My setup:

  • Intel C++ Compiler 2018 Update 2 (from parallel_studio_xe_2018.2.046)
  • Intel OpenVINO 2019 R2 (2019.2.275)
  • Visual Studio 2017

Do I need to do something extra to make it work with Intel C++ Compiler or I'm missing something else? Any suggestions?

Thanks in advance!

0 Kudos
3 Replies
Shubha_R_Intel
Employee
609 Views

Dear Tomasz N,

Those errors look like the Visual Studio settings is using the wrong C++ std.  . For OpenVino -std=c++11 should be fine.  If you're just doing normal stuff (like not using a clang front-end), then you shouldn't get these errors.

Also I didn't realize there was a Visual Studio 2018. I thought there was a 2017 then a 2019. By the way please don't use Visual Studio 2019 with OpenVino because while OpenVino has no problems, Visual Studio 2019  is full of bugs. It's just not worth it to switch over at this point.

You might be interested in this forum post . There I point to the below article on how to set C++ language standard version in Visual Studio.

https://docs.microsoft.com/en-us/cpp/build/reference/std-specify-language-standard-version?view=vs-2019

Hope it helps,

Shubha

0 Kudos
Tomasz_N_Intel
Employee
609 Views

Hi,

I did some digging and I think I found the root cause. In the CMakeLists.txt file of 'ie_cpu_extention' project there is another *.cmake file included:
C:\Program Files (x86)\IntelSWTools\openvino_2019.2.275\deployment_tools\inference_engine\src\extension\cmake\OptimizationFlags.cmake

In this file there is a '/Qvc14' compilation flag added for Intel compiler on Windows, i.e.:

target_compile_options(${TARGET_NAME} PUBLIC "/Qvc14")

According to:
https://software.intel.com/en-us/cpp-compiler-developer-guide-and-reference-qvc

/Qvc14 - Specifies compatibility with Microsoft* Visual Studio 2015.

In my case I'm using Visual Studio 2017, so for me it started compiling once I changed all the occurences of '/Qvc14' to '/Qvc14.1' in the OptimizationFlags.cmake file. I also checked what will happen if I do not specify those flags at all and it seems it's also working.

PS: I don't think I mentioned VS2018 in my previous post :)

Regards,
Tomasz

0 Kudos
Shubha_R_Intel
Employee
609 Views

Dear Tomasz N,

Very interesting. Thanks for sharing your findings with the OpenVino community ! And I'm super glad that you solved your issues by changing Qvc14 to Qvc14.1 in C:\Program Files (x86)\IntelSWTools\openvino_2019.2.275\deployment_tools\inference_engine\src\extension\cmake\OptimizationFlags.cmake.

Shubha

0 Kudos
Reply