Skip to content

Fix building with conan, vcpkg #30157

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

culhatsker
Copy link
Contributor

Details:

Conan fix:

When building with Conan, it creates some template expressions in include directories for dependencies.
They look like this:

$<$<CONFIG:Release>:/home/username/.conan2/p/b/onetb872df69a92f94/p/include>

The code in question used to be removing only the trailing triangle bracket '>' . That broke this template expression and made cmake treat it as a regular string, failing configuration.

Adding a condition checking that both beginning and the end of the string match before trimming a string fixes this error, but creates another issue:

Turns out some template expressions contain multiple include dirs, see debug output:

DEBUG: include_directories: $<BUILD_INTERFACE:/home/username/.conan2/p/b/openv9d048d5b6aa09/b/build/Release/src/plugins/intel_gpu/thirdparty/onednn_gpu_install/include;/home/username/.conan2/p/openv094e161e6063e/s/src/src/plugins/intel_gpu/thirdparty/onednn_gpu/src;/home/username/.conan2/p/openv094e161e6063e/s/src/src/plugins/intel_gpu/thirdparty/onednn_gpu/src/gpu/intel/jit/ngen;/home/username/.conan2/p/openv094e161e6063e/s/src/src/plugins/intel_gpu/thirdparty/onednn_gpu/third_party/ngen>

DEBUG: include_directory: $<BUILD_INTERFACE:/home/username/.conan2/p/b/openv9d048d5b6aa09/b/build/Release/src/plugins/intel_gpu/thirdparty/onednn_gpu_install/include
DEBUG: include_directory: /home/username/.conan2/p/openv094e161e6063e/s/src/src/plugins/intel_gpu/thirdparty/onednn_gpu/src
DEBUG: include_directory: /home/username/.conan2/p/openv094e161e6063e/s/src/src/plugins/intel_gpu/thirdparty/onednn_gpu/src/gpu/intel/jit/ngen
DEBUG: include_directory: /home/username/.conan2/p/openv094e161e6063e/s/src/src/plugins/intel_gpu/thirdparty/onednn_gpu/third_party/ngen>

They break into list items in such a way that the first part of template expression appears in the first item of the list and the closing part of the expression appears in the last item.

This can be fixed by checking and applying regular expression substitution here in addition to (or maybe in place of) substitution inside the loop.

Vcpkg fix:

Issue happens if onednn is installed in vcpkg environment as a package and user attempts to build openvino package with gpu feature on.

The include directy with ambient onednn appear before the one that is used in openvino and this breaks compilation.

There was a fix for this but seems that the issue was reintroduced with some changes.

This new fix tries to put include path for the correct onednn in the beginning of the include paths list to mitigate the issue.

Related to:

@github-actions github-actions bot added category: GPU OpenVINO GPU plugin category: build OpenVINO cmake script / infra labels Apr 15, 2025
@ilya-lavrenov ilya-lavrenov marked this pull request as ready for review April 16, 2025 06:48
@ilya-lavrenov ilya-lavrenov requested review from a team as code owners April 16, 2025 06:48
@ilya-lavrenov ilya-lavrenov self-assigned this Apr 16, 2025
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 category: GPU OpenVINO GPU plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants