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

Using find_package(CUDAQ REQUIRED) in CMake does not work #2513

Open
3 of 4 tasks
diehlpk opened this issue Jan 15, 2025 · 1 comment
Open
3 of 4 tasks

Using find_package(CUDAQ REQUIRED) in CMake does not work #2513

diehlpk opened this issue Jan 15, 2025 · 1 comment

Comments

@diehlpk
Copy link

diehlpk commented Jan 15, 2025

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

Using find_package(CUDAQ REQUIRED) in a CMake project results in the following error

-- The CUDA Quantum compiler identification is NVQ++ - /opt/nvidia/cudaq/bin/nvq++
-- Number of NVIDIA GPUs detected: 1
-- CUDA Quantum Target = nvidia
-- Configuring done
CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
Missing variable is:
CMAKE_CUDAQ_CREATE_SHARED_LIBRARY
CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
Missing variable is:
CMAKE_CUDAQ_CREATE_SHARED_LIBRARY
-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.

Steps to reproduce the bug

Using the latest image and include include find_package(CUDAQ REQUIRED) in your CMake project.

Expected behavior

I would assume that CMAKE_CUDAQ_CREATE_SHARED_LIBRARY should be set, since I am not sure what provide. It seems that On or Off does not work.

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

Not a regression

Environment

  • CUDA-Q version:
  • Python version:
  • C++ compiler:
  • Operating system:

Suggestions

No response

@scothalverson
Copy link

I think I have resolved this for Patrick. Needed to add set_target_properties(LIB_NAME PROPERTIES LINKER_LANGUAGE CXX) to CMake to get C++ libraries to link properly. Waiting on Patrick to confirm this works for him.

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

No branches or pull requests

2 participants