66This repository contains the [ openvino-sys] crate (low-level, unsafe bindings) and the [ openvino]
77crate (high-level, ergonomic bindings) for accessing OpenVINO™ functionality in Rust.
88
9- [ openvino-sys ] : crates/openvino-sys
109[ openvino ] : crates/openvino
10+ [ openvino-sys ] : crates/openvino-sys
11+ [ openvino-finder ] : crates/openvino-finder
1112[ upstream ] : crates/openvino-sys/upstream
1213[ docs ] : https://docs.rs/openvino
1314[ ci ] : https://github.com/abrown/openvino-rs/actions?query=workflow%3ACI
@@ -39,15 +40,14 @@ source /opt/intel/openvino/setupvars.sh
3940cargo test
4041```
4142
42- The quickest method to build [ openvino] and [ openvino-sys] is with a local installation of OpenVINO™
43- (see, e.g., [ installing from an apt repository] [ install-apt ] ). The build script will attempt to
44- locate an existing installation (see [ openvino-finder] ) and link against its shared libraries.
45- Provide the ` OPENVINO_INSTALL_DIR ` environment variable to point at a specific installation. Ensure
46- that the correct libraries are available on the system's load path; OpenVINO™'s ` setupvars.sh `
47- script will do this automatically.
43+ The quickest method to build the [ openvino] and [ openvino-sys] crates is with a local installation
44+ of OpenVINO™ (see, e.g., [ installing from an apt repository] [ install-apt ] ). The build script will
45+ attempt to locate an existing installation (see [ openvino-finder] ) and link against its shared
46+ libraries. Provide the ` OPENVINO_INSTALL_DIR ` environment variable to point at a specific
47+ installation. Ensure that the correct libraries are available on the system's load path; OpenVINO™'s
48+ ` setupvars.sh ` script will do this automatically.
4849
4950[ install-apt ] : https://docs.openvinotoolkit.org/latest/openvino_docs_install_guides_installing_openvino_apt.html
50- [ openvino-finder ] : crates/openvino-finder
5151
5252
5353
@@ -70,26 +70,28 @@ high-level users, call `openvino::Core::new` first to automatically load and lin
7070
7171### Build from OpenVINO™ sources
7272
73+ First, build OpenVINO by cloning the [ openvino] repository and following the [ OpenVINO™ build
74+ documentation] . Then, using the top-level directory as ` <openvino-repo> ` (not the CMake build
75+ directory), build this crate:
76+
7377``` shell script
74- git submodule update --init --recursive
75- cargo build -vv --features openvino-sys/from-source
76- cargo test --features openvino-sys/from-source
78+ OPENVINO_BUILD_DIR=< openvino-repo> cargo build
79+ OPENVINO_BUILD_DIR=< openvino-repo> cargo test
7780```
7881
79- [ openvino] and [ openvino-sys] can also be built directly from OpenVINO™'s source code using CMake.
80- This is not tested across all OS and OpenVINO™ versions--use at your own risk! Also, this build
81- process can be quite slow and there are quite a few dependencies. Some notes:
82- - first, install the necessary packages to build OpenVINO™; steps are included in the [ CI
83- workflow] ( .github/workflows )
84- but reference the [ OpenVINO™ build documentation] ( https://github.com/openvinotoolkit/openvino/blob/master/build-instruction.md )
85- for the full documentation
86- - OpenVINO™ has a plugin system for device-specific libraries (e.g. GPU); building all of these
87- libraries along with the core inference libraries can take >20 minutes. To avoid over-long build
88- times, [ openvino-sys] exposes several Cargo features. By default, [ openvino-sys] will only build
89- the CPU plugin; to build all plugins, use ` --features all ` (see
90- [ Cargo.toml] ( crates/openvino-sys/Cargo.toml ) ).
91- - OpenVINO™ includes other libraries (e.g. ngraph, tbb); see the
92- [ build.rs] ( crates/openvino-sys/build.rs ) file for how these are linked to these libraries.
82+ Some important notes about the path passed in ` OPENVINO_BUILD_DIR ` :
83+ - ` <openvino-repo> ` should be an absolute path (or at least a path relative to the
84+ ` crates/openvino-sys ` directory, which is the current directory when used at build time)
85+ - ` <openvino-repo> ` should either be outside of this crate's tree or in the ` target ` directory (see
86+ the limitations on [ ` cargo:rustc-link-search ` ] ).
87+
88+ The various OpenVINO libraries and dependencies are found using the [ openvino-finder] crate. Turn on
89+ logging to troubleshoot any issues finding the right libraries, e.g., `RUST_LOG=info
90+ OPENVINO_BUILD_DIR=... cargo build -vv`.
91+
92+ [ openvino ] : https://github.com/openvinotoolkit/openvino
93+ [ OpenVINO™ build documentation ] : https://github.com/openvinotoolkit/openvino/blob/master/build-instruction.md
94+ [ `cargo:rustc-link-search` ] : https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-link-search
9395
9496
9597
0 commit comments