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,19 @@ 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**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should it be moved to some place below after pip package is installed?
E.g. we installed package, checked that device is available (OpenVINO is functional) and then we can highlight this mode

Copy link
Contributor

@kblaszczak-intel kblaszczak-intel Sep 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that would be our suggestion, as mentioned in a previous comment. We can make this change in a PR to follow, not to delay publishing.

| 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:

.. 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
mryzhov marked this conversation as resolved.
Show resolved Hide resolved
:ref:`Create a library with extensions <create_a_library_with_extensions>` section.
mryzhov 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)
:sync: cpp

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

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

# [cmake:integration_example_cpp]

set(TARGET_NAME_PY "ov_integration_snippet_py")
mryzhov marked this conversation as resolved.
Show resolved Hide resolved
# [cmake:integration_example_cpp_py]
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_PY} src/main.cpp)

target_link_libraries(${TARGET_NAME_PY} PRIVATE openvino::runtime)

# [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