Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOCX] Using OpenVINO from wheel #26695

Merged
merged 9 commits into from
Sep 27, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ Install Intel® Distribution of OpenVINO™ Toolkit from PyPI Repository
* is dedicated to users of all major OSes: Windows, Linux, and macOS
(all x86_64 / arm64 architectures)
* macOS offers support only for CPU inference

**Simplified Build and Integration**
The package includes CMake configurations, precompiled static libraries, and headers, which can be easily accessed through the Python API. You can use the `get_cmake_path()` method to retrieve the paths to the CMake configurations and libraries:
kblaszczak-intel marked this conversation as resolved.
Show resolved Hide resolved

.. code-block:: python

from openvino import get_cmake_path
cmake_path = get_cmake_path()

For detailed instructions on how to use these configurations in your build setup, check out the :ref:`Create a library with extensions <create_a_library_with_extensions>` section.
kblaszczak-intel marked this conversation as resolved.
Show resolved Hide resolved

.. tab-set::

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,13 @@ For details on additional CMake build options, refer to the `CMake page <https:/
.. doxygensnippet:: docs/snippets/CMakeLists.txt
:language: cpp
:fragment: [cmake:integration_example_c]


.. tab-item:: C++ (PyPi)
kblaszczak-intel marked this conversation as resolved.
Show resolved Hide resolved
:sync: cpp

.. doxygensnippet:: docs/snippets/CMakeLists.txt
:language: cpp
:fragment: [cmake:integration_example_cpp_py]

Build Project
++++++++++++++++++++
Expand Down
19 changes: 19 additions & 0 deletions docs/snippets/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,25 @@ target_link_libraries(${TARGET_NAME} PRIVATE openvino::runtime)

# [cmake:integration_example_cpp]

# [cmake:integration_example_cpp_py]
mryzhov marked this conversation as resolved.
Show resolved Hide resolved
cmake_minimum_required(VERSION 3.10)
set(CMAKE_CXX_STANDARD 11)

find_package(Python3 REQUIRED)
execute_process(
COMMAND ${Python3_EXECUTABLE} -c "from openvino.utils import get_cmake_path; print(get_cmake_path(), end='')"
OUTPUT_VARIABLE OpenVINO_DIR_PY
ERROR_QUIET
)

find_package(OpenVINO REQUIRED PATHS "${OpenVINO_DIR_PY}")

add_executable(${TARGET_NAME} src/main.cpp)

target_link_libraries(${TARGET_NAME} PRIVATE openvino::runtime)
mryzhov marked this conversation as resolved.
Show resolved Hide resolved

# [cmake:integration_example_cpp_py]

set(TARGET_NAME_C "ov_integration_snippet_c")
# [cmake:integration_example_c]
cmake_minimum_required(VERSION 3.10)
Expand Down
Loading