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

[Feature Request] Make fmt and spdlog Optional with a -D_USE_EXTERNAL_SPDLOG_FMT Flag #16951

Open
ava6969 opened this issue Sep 27, 2024 · 1 comment
Labels
feature request New feature or request

Comments

@ava6969
Copy link

ava6969 commented Sep 27, 2024

if (USE_EXTERNAL_SPDLOG_FMT)
  find_package(fmt CONFIG REQUIRED)
  find_package(spdlog CONFIG REQUIRED)
else()
  include(cmake/thirdparty/get_fmt.cmake)
  include(cmake/thirdparty/get_spdlog.cmake)
endif()

This feature proposes adding the ability to optionally use externally provided versions of fmt and spdlog by introducing a CMake flag: -D_USE_EXTERNAL_SPDLOG_FMT. When this flag is set, the build system will skip downloading or configuring fmt and spdlog via rapids-cmake and instead rely on external installations, such as those installed via package managers like vcpkg or system-level package management.
Key Benefits:
Flexibility: Allows developers to integrate pre-existing installations of fmt and spdlog, avoiding redundant or conflicting installations.
Compatibility: This makes it easier for projects that already manage dependencies using systems like vcpkg or Conan to integrate with RMM without modifying dependency configurations.
Customization: Developers can control and customize the versions of fmt and spdlog used in the build process.

Proposed Changes:
Introduce a new CMake option: -D_USE_EXTERNAL_SPDLOG_FMT=ON.
When the flag is set to ON, CMake will use find_package(spdlog) and find_package(fmt) to locate the external installations instead of using rapids-cmake to fetch and configure them.
If the flag is not set, the current behavior of using rapids-cmake to fetch spdlog and fmt will be maintained, ensuring backward compatibility.

Use Case Example:
Developers who have installed spdlog and fmt via vcpkg or other package managers can configure the project as follows:

cmake .. -D_USE_EXTERNAL_SPDLOG_FMT=ON \
  -DCMAKE_PREFIX_PATH=/path/to/external/installations \
  -DCMAKE_TOOLCHAIN_FILE=/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake

This setup will automatically link the external versions of spdlog and fmt during the build process.

@ava6969 ava6969 added the feature request New feature or request label Sep 27, 2024
@bdice
Copy link
Contributor

bdice commented Sep 27, 2024

Thanks for the issue! There is a related discussion about removing spdlog from RAPIDS public APIs here: rapidsai/build-planning#104

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants