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

Fix path to generated ov_plugins.hpp #26521

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

mateusztabaka
Copy link
Contributor

OpenVino fails to compile if it's used as a subdirectory in CMakeLists.txt. For example, below scenario:

$ git clone https://github.com/openvinotoolkit/openvino --recursive
$ cat CMakeLists.txt
project(testing)
add_subdirectory(openvino)
$ mkdir build
$ cmake -B build -S .
$ make -C build openvino_runtime_obj

ends with compilation error:

core_impl.cpp:32:10: fatal error: ov_plugins.hpp: No such file or directory
   32 | #include "ov_plugins.hpp"
      |          ^~~~~~~~~~~~~~~~

because of incorrect include path.
openvino_runtime_obj target expects ov_plugins.hpp to be present in ${CMAKE_CURRENT_BINARY_DIR} (which is build/openvino/src/inference in this case), but ov_plugins.hpp is generated to ${CMAKE_BINARY_DIR}/src/inference (which is build/src/inference). To fix that, ov_generate_plugins_hpp can use BINARY_DIR property of openvino_runtime_obj instead of ${CMAKE_BINARY_DIR}/src/inference.

OpenVino fails to compile if it's used as a subdirectory in CMakeLists.txt. For example, below scenario:
```
$ git clone https://github.com/openvinotoolkit/openvino --recursive
$ cat CMakeLists.txt
project(testing)
add_subdirectory(openvino)
$ mkdir build
$ cmake -B build -S .
$ make -C build openvino_runtime_obj
```

ends with compilation error:
```
core_impl.cpp:32:10: fatal error: ov_plugins.hpp: No such file or directory
   32 | #include "ov_plugins.hpp"
      |          ^~~~~~~~~~~~~~~~
```
because of incorrect include path.
openvino_runtime_obj target expects ov_plugins.hpp to be present in ${CMAKE_CURRENT_BINARY_DIR}
(which is build/openvino/src/inference in this case), but ov_plugins.hpp is generated
to ${CMAKE_BINARY_DIR}/src/inference (which is build/src/inference).
To fix that, ov_generate_plugins_hpp can use BINARY_DIR property of openvino_runtime_obj
instead of ${CMAKE_BINARY_DIR}/src/inference.
@mateusztabaka mateusztabaka requested a review from a team as a code owner September 10, 2024 13:34
@github-actions github-actions bot added the category: build OpenVINO cmake script / infra label Sep 10, 2024
@ilya-lavrenov ilya-lavrenov added this pull request to the merge queue Sep 11, 2024
@ilya-lavrenov ilya-lavrenov self-assigned this Sep 11, 2024
@ilya-lavrenov ilya-lavrenov added this to the 2024.5 milestone Sep 11, 2024
Merged via the queue into openvinotoolkit:master with commit c5adb2e Sep 11, 2024
150 checks passed
@mateusztabaka mateusztabaka deleted the ov_plugins_hpp branch September 11, 2024 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: build OpenVINO cmake script / infra
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants