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.
6413 Discussions

OpenVINO inference engine legacy lib linking on Windows 10

Domi
Employee
1,149 Views

I'm using OpenVINO version 2021.4.2 and trying to build a plugin that has dependency on inference_engine_legacy dll (Windows build).

First thing I noticed is that the corresponding inference_engine_legacy .lib file is missing from the install package.

I downloaded 2021.4.2 version from github and compiled on Windows using VS2019.

Having now the inference_engine_legacy.lib tried to build a dll but I got a LNK2019 error regarding

ngraph::pass::ConvertOpSet1ToLegacy::type_info

Narrowed down the issue to this small code:

 

#include <memory>

#include "ngraph/function.hpp"
#include "ngraph/pass/manager.hpp"

#include "ngraph_transformations.hpp"
#include "transformations/convert_reduce_to_pooling.hpp"
#include "transformations/convert_opset1_to_legacy.hpp"
#include "transformations/common_optimizations.hpp"
#include "transformations/convert_interpolate_to_interp_or_resample.hpp"
#include "transformations/transpose_to_reshape.hpp"
#include "transformations/convert_minimum_to_power_and_max.hpp"

void my_ngraph_transformations(std::shared_ptr<ngraph::Function> ngraph_function) {
ngraph::pass::Manager manager;
// Optimizes ngraph function. Does optimizations such as removing useless consts or nodes with useless shape info
manager.register_pass<ngraph::pass::CommonOptimizations>();
// Converts some reducemean to pooling layers
manager.register_pass<ngraph::pass::ConvertReduceToPooling>();
// Converts the entire opset 1 into legacy or inference engine representation
manager.register_pass<ngraph::pass::ConvertOpSet1ToLegacy>();

// Use pass config to disable certain passes we dont need
auto pass_config = manager.get_pass_config();
// Disable because after HSwish decomposition, we look for Relu->Minimum group
// to merge into clamp if possible. Enabling this turns Minimum to Maximum with Mults
pass_config->disable<ngraph::pass::ConvertMinimum>();
// Dont need Interpolate -> resample transformation because we support Interpolate
pass_config->disable<ngraph::pass::ConvertInterpolateToInterpOrResampleMatcher>();
// Disabled because it may create a reshape that CoreDLA doesn't support
pass_config->disable<ngraph::pass::TransposeToReshape>();
manager.run_passes(ngraph_function);
}

Error is when building shared library (static is ok):

ngraph_transformations.cpp.obj : error LNK2019: unresolved external symbol "public: static struct ngraph::DiscreteTypeInfo const ngraph::pass::ConvertOpSet1ToLegacy::type_info" (?type_info@ConvertOpSet1ToLegacy@pass@ngraph@@2UDiscreteTypeInfo@3@B) referenced in function "public: void __cdecl ngraph::pass::PassConfig::disable<class ngraph::pass::ConvertOpSet1ToLegacy>(void)" (??$disable@VConvertOpSet1ToLegacy@pass@ngraph@@@PassConfig@pass@ngraph@@QEAAXXZ)
ngraph_transformations.cpp.obj : error LNK2019: unresolved external symbol "public: static struct ngraph::DiscreteTypeInfo const ngraph::pass::ConvertInterpolateToInterpOrResampleMatcher::type_info" (?type_info@ConvertInterpolateToInterpOrResampleMatcher@pass@ngraph@@2UDiscreteTypeInfo@3@B) referenced in function "public: void __cdecl ngraph::pass::PassConfig::disable<class ngraph::pass::ConvertInterpolateToInterpOrResampleMatcher>(void)" (??$disable@VConvertInterpolateToInterpOrResampleMatcher@pass@ngraph@@@PassConfig@pass@ngraph@@QEAAXXZ)
my_op_transformation.dll : fatal error LNK1120: 2 unresolved externals

 

What is the correct way of linking to inference_engine_legacy.dll.

One note: Linux version is fine, no issues linking to inference_engine_legacy.so .\

 

Thank you,

Domi

0 Kudos
4 Replies
Hairul_Intel
Moderator
1,014 Views

Hi Domi,

Thank you for reaching out to us.

 

Regarding the missing inference_engine_legacy.lib file from the install package, OpenVINO has removed the dependency on inference_engine_legacy since OpenVINO 2021.2 release. It is now linked by plugins directly.

 

Refer to the "Common Changes" subsection from "Inference Engine" section in "New and Changed in the Release 2" of Release Notes for Intel® Distribution of OpenVINO™ Toolkit 2021 for more information.

 

On another note, inference_engine_legacy.dll depends on tbb.dll as mentioned here. Follow Step 5 in the Build Steps guide to build the dependencies together with TBB binaries for OpenVINO in Windows.

 

 

Regards,

Hairul

 


0 Kudos
Domi
Employee
971 Views

Hi Hairul,

 

Thank you for your response.

Just to be clear, from your answer I get is that if I want to create my own plugin on Windows I would need to build OpenVINO from source on Windows.

 

Is that right?

 

Thank you,

Domi

0 Kudos
Hairul_Intel
Moderator
930 Views

Hi Domi,

It is possible to build your own plugin for Windows from source however, we do not have any tutorials on this particular subject.


As you’ve previously mentioned that there's no issue on Linux, we'd suggest you to add paths to the Threading Building Blocks (TBB) binaries used for the build to the %PATH% environment variable. By default, TBB binaries are downloaded by the CMake-based script to the <openvino_repo>/temp/tbb/bin folder.


Please do share with us the steps you used when building your plugin if you require further assistance.



Regards,

Hairul


0 Kudos
Hairul_Intel
Moderator
843 Views

Hi Domi,

Thank you for your question. If you need any additional information from Intel, please submit a new question as this thread is no longer being monitored.

 

 

Regards,

Hairul


0 Kudos
Reply