openvino_finder - Rust (original) (raw)

Crate openvino_finder

Source

Expand description

This crate provides a mechanism for locating the OpenVINO files installed on a system.

OpenVINO can be installed several ways: from an archive, from an APT repository, via Python pip. The Rust bindings need to be able to:

  1. locate the shared libraries (e.g., libopenvino_c.so on Linux) — see find
  2. locate the plugin configuration file (i.e., plugins.xml) — see find_plugins_xml.

These files are located in different locations based on the installation method, so this crate encodes “how to find” OpenVINO files. This crate’s goal is to locate only the latest versionof OpenVINO; older versions may continue to be supported on a best-effort basis.

Problems with the OpenVINO bindings are most likely to be due to “finding” the right files. Bothfind and find_plugins_xml provide various ways of configuring the search paths, first by examining special environment variables and then by looking in known installation locations. When installing from an archive, OpenVINO provides a setup script (e.g.,source /opt/intel/openvino/setupvars.sh) that sets these special environment variables. Note that you may need to have the OpenVINO environment ready both when building (cargo build) and running (e.g., cargo test) when the libraries are linked at compile-time (the default). By using the runtime-linking feature, the libraries are only searched for at run-time.

If you do run into problems, the following chart summarizes some of the known installation locations of the OpenVINO files as of version 2022.3.0:

Installation Method Path Available on Notes
Archive (.tar.gz) /runtime/lib/ Linux : intel64,armv7l,arm64
Archive (.tar.gz) /runtime/lib//Release MacOS : intel64,armv7l,arm64
Archive (.zip) /runtime/bin//Release Windows : intel64,armv7l,arm64
PyPI /site-packages/openvino/libs Linux, MacOS, Windows Find install folder with pip show openvino
DEB /usr/lib/x86_64-linux-gnu/openvino-/ Linux (APT-based) This path is for plugins; the libraries are one directory above
RPM /usr/lib64/ Linux (YUM-based)

Linking

Distinguish which kind of library to link to.

find

Find the path to an OpenVINO library.

find_plugins_xml

Find the path to the plugins.xml configuration file.