From 3de133283896564d519cf7d4f15142a4dbab34fd Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Thu, 28 Sep 2023 19:55:20 +0400 Subject: [PATCH] VCPKG docs for dynamic OpenVINO build (#20127) * VCPKG docs for dynamic OpenVINO build * Apply suggestions from code review Co-authored-by: Ilya Lavrenov * Update installing-openvino-vcpkg.md * Update docs/install_guides/installing-openvino-vcpkg.md Co-authored-by: Ilya Lavrenov --------- Co-authored-by: Sebastian Golebiewski --- .../installing-openvino-vcpkg.md | 35 +++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/docs/install_guides/installing-openvino-vcpkg.md b/docs/install_guides/installing-openvino-vcpkg.md index c0eba8c8894..eb508a520f2 100644 --- a/docs/install_guides/installing-openvino-vcpkg.md +++ b/docs/install_guides/installing-openvino-vcpkg.md @@ -55,7 +55,7 @@ Installing OpenVINO Runtime vcpkg install 'openvino[core,cpu,ir]' - vcpkg also provides a way to install OpenVINO for any specific configuration you want via `triplets `, for example to install OpenVINO statically on Windows, use: + vcpkg also provides a way to install OpenVINO for any specific configuration you want via `triplets `__, for example to install OpenVINO statically on Windows, use: .. code-block:: sh @@ -64,6 +64,37 @@ Installing OpenVINO Runtime Note that the vcpkg installation means building all packages and dependencies from source, which means the compiler stage will require additional time to complete the process. +.. important:: + + If you are building OpenVINO as dynamic libraries and you want to use either Paddle, TensorFlow or ONNX frontends, you need to create `custom vcpkg `__ triplet file, like ``/triplets/community/x64-linux-release-dynamic.cmake``, which builds ``protobuf`` dependency statically: + + .. code-block:: sh + + # typical values of vcpkg toolchain + set(VCPKG_TARGET_ARCHITECTURE x64) + set(VCPKG_CRT_LINKAGE dynamic) + # by default, all libraries are built dynamically + set(VCPKG_LIBRARY_LINKAGE dynamic) + + set(VCPKG_CMAKE_SYSTEM_NAME Linux) + set(VCPKG_BUILD_TYPE release) + + set(VCPKG_FIXUP_ELF_RPATH ON) + + # OpenVINO specific additions: build statically the following internal dependencies + # IMPORTANT: you need to build at least protobuf statically, others can be dynamic + if(PORT MATCHES "^(ade|hwloc|onnx|protobuf|pugixml|snappy)$") + set(VCPKG_LIBRARY_LINKAGE static) + endif() + + + Then, you can use such a triplet file with the following command: + + .. code-block:: sh + + vcpkg install openvino:x64-linux-release-dynamic + + After installation, you can use OpenVINO in your product's cmake scripts: .. code-block:: sh @@ -74,7 +105,7 @@ And running from terminal: .. code-block:: sh - cmake -B -S -DCMAKE_TOOLCHAIN_FILE=/scripts/buildsystems/vcpkg.cmake + cmake -B -S -DCMAKE_TOOLCHAIN_FILE=/scripts/buildsystems/vcpkg.cmake Congratulations! You've just Installed and used OpenVINO in your project! For some use cases you may still need to install additional components. Check the