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

[level-zero] fixed pkg-config generation #43054

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ilya-lavrenov
Copy link
Contributor

@ilya-lavrenov ilya-lavrenov commented Jan 2, 2025

Required for #43053 to use vcpkg's level-zero via pkg-config

@MonicaLiu0311 MonicaLiu0311 changed the title level-zero: fixed pkg-config generation [level-zero] fixed pkg-config generation Jan 2, 2025
@MonicaLiu0311 MonicaLiu0311 added the category:port-bug The issue is with a library, which is something the port should already support label Jan 2, 2025
@MonicaLiu0311
Copy link
Contributor

No pkgconfig file was found in the lib/ folder after installation:
image

@MonicaLiu0311 MonicaLiu0311 marked this pull request as draft January 3, 2025 08:41
@ilya-lavrenov
Copy link
Contributor Author

ilya-lavrenov commented Jan 6, 2025

No pkgconfig file was found in the lib/ folder after installation: image

Looks like it's expected as per https://github.com/oneapi-src/level-zero/blob/master/source/CMakeLists.txt#L52-L66

Created PR to upstream oneapi-src/level-zero#254 to have pkg-config files on all platforms and update vcpkg patch.

@ilya-lavrenov ilya-lavrenov marked this pull request as ready for review January 6, 2025 11:52
@MonicaLiu0311
Copy link
Contributor

When testing usage, the following error occurs:

error C1083: Cannot open include file: 'level-zero/ze_api.h': No such file or directory [E:\test_usage\cmakeUsage\build\main.vcxproj]
test.cpp
#include <iostream>
#include "level-zero/ze_api.h"

using namespace std;

int main()
{
cout << "Hello CMake." << endl;
return 0;
}

CMakeLists.txt
cmake_minimum_required (VERSION 3.8)

set(CMAKE_TOOLCHAIN_FILE "E:/level-zero/scripts/buildsystems/vcpkg.cmake")

project ("test")

add_library (main "test.cpp")

find_package(PkgConfig REQUIRED)
pkg_check_modules(TEST REQUIRED IMPORTED_TARGET level-zero)
target_include_directories(main PRIVATE ${TEST_INCLUDE_DIRS})
target_link_libraries(main PRIVATE ${TEST_LIBRARIES})

@ilya-lavrenov
Copy link
Contributor Author

#include "level-zero/ze_api.h"

Include directory is incorrect, must be #include "level_zero/ze_api.h"

I wonder why has vcpkg_fixup_pkgconfig not fixed pkgconfig file for debug build? I had to patch it manually

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants