NVIDIA / NVIDIA/cuda-quantum

Can't build with CUDA-Q when project already uses a version of `fmt`

Open
#2,997 0 comments 0 reactions 1 assignee View on GitHub

@sacpis is already working on this.

Since Jun 5, 2025.

dependencies stale-notified
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
  1. Create a cmake project that uses fmt lib and CUDA-Q
  2. Use a recent version of fmt lib in the cmake project (e.g. 11.1.4)
  3. Create a hello-world source file which uses:
    1. fmt::print() and fmt::join()
    2. some cuda-q functions that also use fmt
  4. 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

  1. upgrade the version of fmt in cuda-q
  2. allow me to specify the version of fmt i want to use with the build

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.