NVIDIA/cuda-quantum

Downstream cmake integration fails to find `fmt`

boschmitt opened this issue · 0 comments

Required prerequisites

  • Consult the security policy. If reporting a security vulnerability, do not report the bug using this form. Use the process described in the policy to report the issue.
  • Make sure you've read the documentation. Your issue may be addressed there.
  • Search the issue tracker to verify that this hasn't already been reported. +1 or comment there if it has.
  • If possible, make a PR with a failing test to give us a starting point to work on!

Describe the bug

When trying to create a downstream project with CUDAQ cmake integration, the configuration step fails to find the fmt library required by CUDAQ.

The issue is that fmt honors CMAKE_INSTALL_LIBDIR while CUDAQ does not. Hence, on certain systems, installing CUDAQ will end up placing the required fmt in lib64/ instead of lib/. CUDAQ cmake modules will fail to find it as it looks for it in lib/. (It is unclear at this point if this could affect other scenarios, i.e., not only downstream integration.)

Steps to reproduce the bug

Follow the docs on a system where CMAKE_INSTALL_LIBDIR is lib64.

Expected behavior

Correctly find fmt in the downstream cmake integration.

Is this a regression? If it is, put the last known working version (or commit) here.

Not a regression

Environment

Suggestions

We should honor CMAKE_INSTALL_LIBDIR and change all hardcoded lib in the building system. Alternatively, we could force CMAKE_INSTALL_LIBDIR to lib in our main configuration file or change the downstream integration to look for fmt in the correct location (based on CMAKE_INSTALL_LIBDIR.