Closed ConiKost closed 3 months ago
Does https://github.com/oneapi-src/level-zero/pull/149 allow you to build with the system spdlog and libfmt? For me it failed to link properly.
Does https://github.com/oneapi-src/level-zero/pull/149 allow you to build with the system spdlog and libfmt? For me it failed to link properly.
Unfortunately not.
Hello, on Fedora Linux side, we face the same issue with the compilation attempting to clone online git spdlog repository which is disallowed in the Fedora build system. We have a working patch addressing the problem and it will be nice the team fixes the compilation issue by using the existing available system library.
Here is the full list of the patch file oneapi-level-zero-spdlog.patch
diff -up level-zero-1.17.2/CMakeLists.txt.spdlog level-zero-1.17.2/CMakeLists.txt
--- level-zero-1.17.2/CMakeLists.txt.spdlog 2024-05-22 16:25:52.000000000 -0600
+++ level-zero-1.17.2/CMakeLists.txt 2024-05-22 19:52:35.669074005 -0600
@@ -78,9 +78,6 @@ else()
endif()
add_definitions(-DLOADER_VERSION_SHA="${VERSION_SHA}")
-include(FetchContent)
-set(SPDLOG_ROOT "${FETCHCONTENT_BASE_DIR}/spdlog-src")
-
# Update other relevant variables to include the patch
set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
set(CMAKE_PROJECT_VERSION_PATCH "${PROJECT_VERSION_PATCH}")
@@ -187,7 +184,6 @@ endif()
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/source/wrapper/include)
-include_directories(${SPDLOG_ROOT}/include)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
diff -up level-zero-1.17.2/source/utils/CMakeLists.txt.spdlog level-zero-1.17.2/source/utils/CMakeLists.txt
--- level-zero-1.17.2/source/utils/CMakeLists.txt.spdlog 2024-05-22 16:25:52.000000000 -0600
+++ level-zero-1.17.2/source/utils/CMakeLists.txt 2024-05-22 19:58:08.784416938 -0600
@@ -1,23 +1,8 @@
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: MIT
-include(FetchContent)
-set(SPDLOG_REPO https://github.com/gabime/spdlog)
-set(SPDLOG_TAG v1.13.0)
-FetchContent_Declare(
- spdlog
- GIT_REPOSITORY ${SPDLOG_REPO}
- GIT_TAG ${SPDLOG_TAG}
-)
-FetchContent_makeAvailable(spdlog)
-
add_library(utils
STATIC
"logging.h"
"logging.cpp"
)
-
-target_include_directories(utils
- PUBLIC
- ${FETCHCONTENT_BASE_DIR}/spdlog-src/include
-)
@luyatshimbalanga that patch fails for me as it does not link to the system libraries. It would use the headers if they are already on the default search path. Could you explain how the system libraries are detected without using find_package or FindPkgConfig? See also https://github.com/oneapi-src/level-zero/pull/149#issuecomment-2126362948.
https://github.com/oneapi-src/level-zero/releases/tag/v1.17.6 now bundles the spdlog headers needed and has no dependencies on system spdlog.
@lisanna-dettwyler Thank you, I can confirm, that it works now.
It looks like, that commit https://github.com/oneapi-src/level-zero/commit/0eda14664e96fe313c7772fe83c95d21a8288823 broke something or exposed some bug. @Jemale
Compiling
level-zero-1.16.14
while already having installedspdlog
andlibfmt
fails in compilation. See Gentoo downstream bug fore mor analysis by sam. https://bugs.gentoo.org/930157This patch seems to work as workaround: