Can't build with CUDA-Q when project already uses a version of `fmt`
@sacpis is already working on this.
Since Jun 5, 2025.
- Dominant language
- C++
- Stars
- 1.1k
- Forks
- 456
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 165
Description
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
This is sort of related to https://github.com/NVIDIA/cuda-quantum/issues/1704. When building my project which uses CUDA-Q, I get a linking error because the version of fmt lib used in CUDA-Q is far older (3 years old commit) than the version used in my project. I don't think the version of fmt used in a downstream project should be constrained by the version used by CUDA-Q.
Steps to reproduce the bug
- Create a cmake project that uses fmt lib and CUDA-Q
- Use a recent version of fmt lib in the cmake project (e.g. 11.1.4)
- Create a hello-world source file which uses:
fmt::print()andfmt::join()- some cuda-q functions that also use fmt
- Try to build
You will get an error saying there are ambiguous definitions of fmt functions. I.e. cuda-q has linked against the older version of fmt and the example project has linked against the newer version.
Expected behavior
It builds.
Is this a regression? If it is, put the last known working version (or commit) here.
Not a regression
Environment
- CUDA-Q version: latest (0.11.0)
- Python version: n/a
- C++ compiler: g++
- Operating system: ubuntu 22.04
Suggestions
Either
- upgrade the version of fmt in cuda-q
- allow me to specify the version of fmt i want to use with the build
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.