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

logging: Allow to use spdlog from system if present

Open frantisekz opened this issue 1 year ago • 6 comments
trafficstars

Some distributions (like Fedora) disallow fetching content from the internet build-time. Let's allow to link with spdlog from the host and use that if present during the build-time instead of content fetch.

frantisekz avatar Apr 26 '24 11:04 frantisekz

This fails for me when using the system spdlog as if spdlog_FOUND is set then the system library is not added to the targets link libraries.

loqs avatar Apr 27 '24 21:04 loqs

I can confirm @loqs, it does not fix the issue for me, which I have reported in https://github.com/oneapi-src/level-zero/issues/146

ConiKost avatar May 08 '24 16:05 ConiKost

Some distributions (like Fedora) disallow fetching content from the internet build-time. Let's allow to link with spdlog from the host and use that if present during the build-time instead of content fetch.

Would moving from fetchcontent to a submodule make this any better? I presume it would since the submodule would get fetched before build-time.

lisanna-dettwyler avatar May 08 '24 17:05 lisanna-dettwyler

Would moving from fetchcontent to a submodule make this any better? I presume it would since the submodule would get fetched before build-time.

Would you consider moving the fetch and build of spdlog / fmt to a submodule and allowing the use of the system libraries instead?

loqs avatar May 08 '24 19:05 loqs

Would system libraries be used by default or optionally? What is the use case for using a system spdlog if we're submoduling our own?

lisanna-dettwyler avatar May 08 '24 19:05 lisanna-dettwyler

As maintainer of level-zero in Gentoo Linux, I can say, that using system libs is a must. We don't allow using 3rd party libs to be included by a package except for some binary only packages. Packages are supposed to be compiled against system libs.

So please allow the usage of such libs. As you can see in #146, the changes are currently reverted as consequence.

Since Gentoo is source based, an optional compile option is fine @lisanna-dettwyler

ConiKost avatar May 08 '24 19:05 ConiKost

You should bump the cmake_minimum_required. Bumping it to 3.21 will allow you to skip the find_package. The minimum of 3.2 is already broken with the usage of FetchContent.

One thing that's missing for this PR to work is the target_link_libraries (also remove target_include_directories since it doesn't match)

LecrisUT avatar May 23 '24 06:05 LecrisUT

Replaced by https://github.com/oneapi-src/level-zero/pull/154 .

frantisekz avatar Jun 10 '24 14:06 frantisekz