Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

build:
name: Build from OpenVINO source
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -31,7 +31,7 @@ jobs:
- name: Checkout LFS obects
run: git lfs checkout
- name: Install system dependencies
run: sudo apt update && sudo apt install -y clang cmake libclang-dev gnupg2 libdrm2 libglib2.0-0 libusb-1.0 lsb-release libgtk-3-0 libtool libopencv-dev libopencv-core3.2 udev unzip dos2unix
run: sudo apt update && sudo apt install -y clang cmake libclang-dev gnupg2 libdrm2 libglib2.0-0 libusb-1.0-0-dev lsb-release libgtk-3-0 libtool libopencv-dev libopencv-core4.2 udev unzip dos2unix
- name: Build (openvino-sys from source)
run: cargo build --verbose
- name: Run tests
Expand Down
35 changes: 27 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This Dockerfile demonstrates how to build the openvino bindings using an installation of OpenVINO. For instructions
# to install OpenVINO see the OpenVINO documentation, e.g.
# https://docs.openvinotoolkit.org/latest/openvino_docs_install_guides_installing_openvino_apt.html.
FROM rust:1.45
FROM rust:1.50

# Setup Rust.
RUN rustup component add rustfmt
Expand All @@ -26,6 +26,9 @@ RUN apt install -y libopencv-dev libopencv-core3.2
WORKDIR /usr/src/openvino
COPY . .

# Hack to allow the opencv crate to build with an older version of the OpenCV libraries (FIXME).
RUN sed -i 's/"opencv-4"/"opencv-32"/g' crates/openvino-tensor-converter/Cargo.toml

# Build openvino libraries.
WORKDIR /usr/src/openvino/inference-engine/ie_bridges/rust
RUN OPENVINO_INSTALL_DIR=/opt/intel/openvino cargo build -vv
Expand Down
8 changes: 6 additions & 2 deletions crates/openvino-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,12 @@ fn build_from_source_using_cmake() -> Vec<PathBuf> {
.define("NGRAPH_ONNX_IMPORT_ENABLE", "ON")
.define("ENABLE_OPENCV", "OFF")
.define("ENABLE_CPPLINT", "OFF")
// Because OpenVINO by default wants to build its binaries in its own tree, we must specify
// that we actually want them in Cargo's output directory.
// As described in https://github.com/intel/openvino-rs/issues/8, the OpenVINO source
// includes redundant moves. These were previously warnings but newer compilers treat
// them as errors.
.cxxflag("-Wno-error=redundant-move")
// Because OpenVINO by default wants to build its binaries in its own tree, we must
// specify that we actually want them in Cargo's output directory.
.define("OUTPUT_ROOT", out_dir);
config
}
Expand Down
5 changes: 3 additions & 2 deletions crates/openvino-tensor-converter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ publish = false
log = "0.4"
pretty_env_logger = "0.4"
structopt = { version = "0.3", default-features = false }
# Note: the features below are very system-specific, see https://github.com/twistedfall/opencv-rust.
opencv = {version = "0.45", default-features = false, features = ["opencv-32", "buildtime-bindgen", "clang-runtime"]}
# Note: by default this will attempt to find a 4.x version of OpenCV libraries (e.g.
# `libopencv-dev`).
opencv = {version = "0.49", default-features = false, features = ["opencv-4", "buildtime-bindgen", "clang-runtime"]}