Compile-time failure and warnings on VC++17/19

Compile-time failure and warnings on VC++17/19

Our project had previously built fine with up to 2019R1. As of R2, seeing the following errors:

 

In file included from C:\.conan\44ec23\1\integrations\openvino\VinoStage.cpp:17:
In file included from C:\.conan\44ec23\1\integrations\openvino/VinoStage.h:22:
In file included from C:\.conan\9f437e\1\include\inference_engine.hpp:21:
In file included from C:\.conan\9f437e\1\include\ie_plugin_dispatcher.hpp:11:
In file included from C:\.conan\9f437e\1\include\ie_plugin_ptr.hpp:11:
In file included from C:\.conan\9f437e\1\include/details/ie_so_pointer.hpp:14:
In file included from C:\.conan\9f437e\1\include\ie_plugin.hpp:17:
In file included from C:\.conan\9f437e\1\include\ie_iexecutable_network.hpp:17:
C:\.conan\9f437e\1\include/ie_parameter.hpp(271,16): error: 'this' argument to member function 'get' has type 'const RealData<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >', but function is not marked const
        return dynamic_cast<const RealData<T> &>(*obj).get();
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\.conan\9f437e\1\include/ie_parameter.hpp(252,20): note: in instantiation of function template specialization 'InferenceEngine::Parameter::dyn_cast<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >' requested here
            return dyn_cast<U>(&left) == dyn_cast<U>(&rhs);
                   ^
C:\.conan\9f437e\1\include/ie_parameter.hpp(256,41): note: in instantiation of function template specialization 'InferenceEngine::Parameter::RealData<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::equal<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >' requested here
            return rhs.is(typeid(T)) && equal<T>(*this, rhs);
                                        ^
C:\.conan\9f437e\1\include/ie_parameter.hpp(57,19): note: in instantiation of member function 'InferenceEngine::Parameter::RealData<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::operator==' requested here
        ptr = new RealData<typename std::decay<T>::type>(std::forward<T>(parameter));
                  ^
C:\.conan\9f437e\1\include/ie_parameter.hpp(64,33): note: in instantiation of function template specialization 'InferenceEngine::Parameter::Parameter<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, void>' requested here
    Parameter(const char *str): Parameter(std::string(str)) {}      // NOLINT
                                ^
C:\.conan\9f437e\1\include/ie_parameter.hpp(235,12): note: 'get' declared here
        T& get() & {
           ^
C:\.conan\9f437e\1\include/ie_parameter.hpp(236,20): error: no matching function for call to 'get'
            return std::get<0>(*this);
                   ^~~~~~~~~~~
C:\.conan\9f437e\1\include/ie_parameter.hpp(271,56): note: in instantiation of member function 'InferenceEngine::Parameter::RealData<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::get' requested here
        return dynamic_cast<const RealData<T> &>(*obj).get();
                                                       ^
C:\.conan\9f437e\1\include/ie_parameter.hpp(252,20): note: in instantiation of function template specialization 'InferenceEngine::Parameter::dyn_cast<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >' requested here
            return dyn_cast<U>(&left) == dyn_cast<U>(&rhs);
                   ^
C:\.conan\9f437e\1\include/ie_parameter.hpp(256,41): note: in instantiation of function template specialization 'InferenceEngine::Parameter::RealData<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::equal<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >' requested here
            return rhs.is(typeid(T)) && equal<T>(*this, rhs);
                                        ^
C:\.conan\9f437e\1\include/ie_parameter.hpp(57,19): note: in instantiation of member function 'InferenceEngine::Parameter::RealData<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::operator==' requested here
        ptr = new RealData<typename std::decay<T>::type>(std::forward<T>(parameter));
                  ^
C:\.conan\9f437e\1\include/ie_parameter.hpp(64,33): note: in instantiation of function template specialization 'InferenceEngine::Parameter::Parameter<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, void>' requested here
    Parameter(const char *str): Parameter(std::string(str)) {}      // NOLINT
                                ^
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\include\utility(452,63): note: candidate template ignored: could not match 'pair' against 'RealData'
_NODISCARD constexpr tuple_element_t<_Idx, pair<_Ty1, _Ty2>>& get(
                                                              ^
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\include\utility(469,69): note: candidate template ignored: could not match 'pair' against 'RealData'
_NODISCARD constexpr const tuple_element_t<_Idx, pair<_Ty1, _Ty2>>& get(
                                                                    ^
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\include\utility(488,64): note: candidate template ignored: could not match 'pair' against 'RealData'
_NODISCARD constexpr tuple_element_t<_Idx, pair<_Ty1, _Ty2>>&& get(
                                                               ^
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\include\utility(505,70): note: candidate template ignored: could not match 'pair' against 'RealData'
_NODISCARD constexpr const tuple_element_t<_Idx, pair<_Ty1, _Ty2>>&& get(
                                                                     ^
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\include\tuple(638,65): note: candidate template ignored: failed template argument deduction
_NODISCARD constexpr tuple_element_t<_Index, tuple<_Types...>>& get(
                                                                ^
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\include\tuple(645,71): note: candidate template ignored: failed template argument deduction
_NODISCARD constexpr const tuple_element_t<_Index, tuple<_Types...>>& get(
                                                                      ^
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\include\tuple(652,66): note: candidate template ignored: failed template argument deduction
_NODISCARD constexpr tuple_element_t<_Index, tuple<_Types...>>&& get(
                                                                 ^
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\include\tuple(660,72): note: candidate template ignored: failed template argument deduction
_NODISCARD constexpr const tuple_element_t<_Index, tuple<_Types...>>&& get(
                                                                       ^
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\include\array(415,27): note: candidate template ignored: could not match 'array' against 'RealData'
_NODISCARD constexpr _Ty& get(array<_Ty, _Size>& _Arr) noexcept {
                          ^
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\include\array(421,33): note: candidate template ignored: could not match 'array' against 'RealData'
_NODISCARD constexpr const _Ty& get(const array<_Ty, _Size>& _Arr) noexcept {
                                ^
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\include\array(427,28): note: candidate template ignored: could not match 'array' against 'RealData'
_NODISCARD constexpr _Ty&& get(array<_Ty, _Size>&& _Arr) noexcept {
                           ^
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\include\array(433,34): note: candidate template ignored: could not match 'array' against 'RealData'
_NODISCARD constexpr const _Ty&& get(const array<_Ty, _Size>&& _Arr) noexcept {
                                 ^
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\include\utility(459,28): note: candidate template ignored: invalid explicitly-specified argument for template parameter '_Ty1'
_NODISCARD constexpr _Ty1& get(pair<_Ty1, _Ty2>& _Pr) noexcept { // get reference to element _Ty1 in pair _Pr
                           ^
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\include\utility(464,28): note: candidate template ignored: invalid explicitly-specified argument for template parameter '_Ty2'
_NODISCARD constexpr _Ty2& get(pair<_Ty1, _Ty2>& _Pr) noexcept { // get reference to element _Ty2 in pair _Pr
                           ^
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\include\utility(476,34): note: candidate template ignored: invalid explicitly-specified argument for template parameter '_Ty1'
_NODISCARD constexpr const _Ty1& get(
                                 ^
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\include\utility(482,34): note: candidate template ignored: invalid explicitly-specified argument for template parameter '_Ty2'
_NODISCARD constexpr const _Ty2& get(
                                 ^
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\include\utility(495,29): note: candidate template ignored: invalid explicitly-specified argument for template parameter '_Ty1'
_NODISCARD constexpr _Ty1&& get(pair<_Ty1, _Ty2>&& _Pr) noexcept { // get rvalue reference to element _Ty1 in pair _Pr
                            ^
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\include\utility(500,29): note: candidate template ignored: invalid explicitly-specified argument for template parameter '_Ty2'
_NODISCARD constexpr _Ty2&& get(pair<_Ty1, _Ty2>&& _Pr) noexcept { // get rvalue reference to element _Ty2 in pair _Pr
                            ^
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\include\utility(512,35): note: candidate template ignored: invalid explicitly-specified argument for template parameter '_Ty1'
_NODISCARD constexpr const _Ty1&& get(
                                  ^
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\include\utility(518,35): note: candidate template ignored: invalid explicitly-specified argument for template parameter '_Ty2'
_NODISCARD constexpr const _Ty2&& get(
                                  ^
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\include\tuple(670,27): note: candidate template ignored: invalid explicitly-specified argument for template parameter '_Ty'
_NODISCARD constexpr _Ty& get(tuple<_Types...>& _Tuple) noexcept { // get reference to _Ty element of tuple
                          ^
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\include\tuple(677,33): note: candidate template ignored: invalid explicitly-specified argument for template parameter '_Ty'
_NODISCARD constexpr const _Ty& get(
                                ^
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\include\tuple(685,28): note: candidate template ignored: invalid explicitly-specified argument for template parameter '_Ty'
_NODISCARD constexpr _Ty&& get(tuple<_Types...>&& _Tuple) noexcept { // get rvalue reference to _Ty element of tuple
                           ^
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\include\tuple(692,34): note: candidate template ignored: invalid explicitly-specified argument for template parameter '_Ty'
_NODISCARD constexpr const _Ty&& get(
                                 ^

 

A number of warnings may deserve some attention as well, but first things first ...

19 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Dear Alex A.,

I think perhaps you're using the wrong C++ Language Standard in the Visual Studio settings. Please check the below documentation:

https://docs.microsoft.com/en-us/cpp/build/reference/std-specify-language-standard-version?view=vs-2019 . For OpenVino -std=c++11 should be fine. 

Kindly let me know if this is the issue.

Thanks,

Shubha

 

I wish it was that easy -- but we run with std:c++17

Dear Alex A.,

Gotcha. You actually state stdc++17  in the title too - oops, sorry I missed that. Well if the project builds with stdc++17 on OpenVino 2019R1 and fails to build in OpenVino2019R2 then this seems like a bug to me.

I will escalate on your behalf. Thanks for your patience -

Shubha

Dear Alex A.

Can you kindly  give us a small project *.zip package which demonstrates the issue ? If you'd prefer to send this privately over PM, let me know and I will PM you.

Thanks,

Shubha

Unfortunately, it is part of a much larger project/build system. I'll see if I can come up with a sample build environment that demonstrates the issue.

But, as I've mentioned -- it's -std=c++17, with either MSVC 17 or 19, and clang-cl frontend.

Also, the same build environment can build our code when using 2019R1

Dear Alex A.

What do you mean by this ? clang-cl frontend ? I mean is this configurable within Visual Studio ?

I think clang-cl frontend is something I may have missed before.  So I guess we need to follow these MS VS instructions ?

The development team tried compiling the samples as -std=c++17 on OpenVino 2019R2 and of course, this posed no problems.

If you can come up with a toy project which demonstrates the issue on VS 2017 or 2019 that would be perfect.

Thanks,

Shubha

Shubha,

Please see the attached project. It reproduces the problem for me, when employing the following steps to create the build environment from scratch:

* Download fresh Windows 10 VM (Microsoft Edge and IE Test Environments - https://kb.parallels.com/116237
        * may want to expand the HDD to 60GB to fit everything
* Download/Install VS2019 from https://visualstudio.microsoft.com/downloads/ (set up Desktop Development with C++ -- all features)
* Download/install CMake 3.15.2 - https://cmake.org/download/
* Download/install Python 3.7.4 - https://www.python.org/downloads/release/python-374/ to C:\Python37
* Download/install OpenVino (installer kept crashing on this VM only -- succeeds everywhere else, copied the installation from another machine)
* Download/install Clang from http://releases.llvm.org/7.0.0/LLVM-7.0.0-win64.exe
* Download/install git from https://git-scm.com/download/win
* Download Ninja from https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-win.zip, put it in PATH (C:\Python37, for example)
* Launch x64 Native Tools Command Prompt for VS 2019
* set PATH="C:\Program Files\CMake\bin";%PATH%;C:\Python37;C:\Python37\scripts;"C:\Program Files\LLVM\bin";"C:\Program Files\Git\usr\bin"
* pip3 install conan
* set CC=clang-cl
* set CXX=clang-cl
* place the contents of the zip to C:\Users\IEUser\Desktop

* cd C:\Users\IEUser\Desktop\OVTest
* mkdir build
* cd build
* conan install ..
* conan build ..

Attachments: 

AttachmentSize
Downloadapplication/zip OVTest.zip2.87 KB

Hi Alex,

It seems that there are plenty of inference engine code improvements from 2019 R1 to 2019 R2. I picked one of your errors:

C:\.conan\9f437e\1\include/ie_parameter.hpp(271,16): error: 'this' argument to member function 'get' has type 'const RealData<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >', but function is not marked const
        return dynamic_cast<const RealData<T> &>(*obj).get();
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Attaching the code diff snapshot among ie_parameter.hpp from 2019 R1 to 2019 R2. Request you to verify and update the improved code accordingly.

Hemanth,

Which code should I update? The example of compilation failure I've provided includes a file with an empty function, which includes <inference_engine.hpp> ... did I miss anything?

Dear Alex A.,

Actually the OpenVino R2 does introduce a lot of Core Inference Engine API changes but the release is backwards compatible - so your old code should work.

I'm still working on this,

Thanks for your patience (and providing reproduction steps). My guess is that i should be able to repro it with just the Samples, given your reproduction steps.

Shubha

 

Dear Alex A.

I don't plan on doing this * Download fresh Windows 10 VM (Microsoft Edge and IE Test Environments - https://kb.parallels.com/116237
        * may want to expand the HDD to 60GB to fit everything

When I attempt to repro your issue. I don't think it should be relevant. Let me know if I'm wrong.

Thanks,

Shubha

I made sure you're able to reproduce the failure -- and the steps document creating a build environment as similar as possible to the one where the original failure was encountered, from scratch.

If you're able to reproduce it using less steps -- all the better. But, considering you haven't been able to reproduce it so far, maybe the shortest path is following the one I've outlined?

Dear Alex A.,

OK fair enough. Please be patient. I will definitely go through your steps to reproduce. Thanks for being so diligent and responsive !

Shubha

 

Dear Alex A.,

I reproduced your error using your carefully scripted instructions. Thanks ! I will file a bug.

Shubha

Shubha, thanks! Any guesses on timeframe for the fix?

Dear Alex A.,

Well it won't be immediate. But probably in time for the next release. And fortunately, the OpenVIno team releases pretty often. I will let you know as soon as I find out.

Thanks,

Shubha

 

Seems like the fix hasn't made it into 2.0.1, which was released today. Any update on the status / expectations?

Dear Alex A.,

All I can say is that it's being worked on. Sorry for the trouble and thanks for your patience !

Shubha

 

Leave a Comment

Please sign in to add a comment. Not a member? Join today