level-zero icon indicating copy to clipboard operation
level-zero copied to clipboard

Adding Pkgconfig Files on Windows LevelZeroSDK Package

Open mschilling0 opened this issue 9 months ago • 0 comments

When I download the latest driver installation, I see the "LevelZeroSDK" installed (Thanks!). However, I noticed in 1.21.6,

the pc files (ze_loader/level-zero) are no longer there.

Image

I was using this to find the version in our build scripts, e.g.,

https://github.com/intel/pti-gpu/blob/master/sdk/cmake/Modules/FindLevelZero.cmake

find_library(
  LevelZero_LIBRARY
  NAMES ze_loader
  HINTS ENV LIBRARY_PATH
        ${PC_ze_loader_LIBRARY_DIRS}
        ${PC_ze_loader_LIBDIR}
  PATHS ${CMAKE_LIBRARY_PATH}
        ENV LD_LIBRARY_PATH
  PATH_SUFFIXES lib
)

get_filename_component(LevelZero_LIBRARY_DIR ${LevelZero_LIBRARY} DIRECTORY)
# AFAIK, version can only be found via pc file. This is part of a regular level
# zero install.
find_path(
  LevelZero_PkgConfig_DIR
  NAMES libze_loader.pc
  HINTS ${LevelZero_LIBRARY_DIR}
  PATH_SUFFIXES pkgconfig
                lib/pkgconfig
                lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig
                ${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig
                lib64/pkgconfig
                lib64/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig
  NO_CMAKE_PATH
  NO_CMAKE_ENVIRONMENT_PATH
  NO_SYSTEM_ENVIRONMENT_PATH
  NO_CMAKE_SYSTEM_PATH
)

if(LevelZero_PkgConfig_DIR)
  file(READ "${LevelZero_PkgConfig_DIR}/libze_loader.pc" LevelZero_PkgConfig)
  string(REGEX MATCH "[0-9]+\.[0-9]+\.[0-9]+" LEVEL_ZERO_VER_FOUND "${LevelZero_PkgConfig}")
  set(LevelZero_VERSION ${LEVEL_ZERO_VER_FOUND})
endif()

Can it be added back or there? (Also, I will edit this file to add the new environment variable, thanks!).

(Also, I will note, albeit, uncommon pkgconfig can be used on Windows).

mschilling0 avatar Apr 07 '25 20:04 mschilling0