Skip to content

[BUG]: CMake fails when using nvc++ as a c++ compiler #4232

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

Open
1 task done
zkhatami opened this issue Mar 21, 2025 · 4 comments
Open
1 task done

[BUG]: CMake fails when using nvc++ as a c++ compiler #4232

zkhatami opened this issue Mar 21, 2025 · 4 comments
Assignees
Labels
bug Something isn't working right. needs info Cannot make progress without more information.

Comments

@zkhatami
Copy link

Is this a duplicate?

Type of Bug

Something else

Component

Thrust

Describe the bug

After this commit:
4f5c287

when using nvc++ as a c++ compiler, CMake fails with this error:

CMake Error at cmake/CCCLBuildCompilerTargets.cmake:34 (message):
  CCCL developer builds require that CMAKE_CUDA_HOST_COMPILER exactly matches
  CMAKE_CXX_COMPILER when using nvcc:

How to Reproduce

cmake /path/to/cccl

Expected behavior

To see thrust tests/examples being pulled and passed successfully.

Reproduction link

No response

Operating System

No response

nvidia-smi output

No response

NVCC version

No response

@zkhatami zkhatami added the bug Something isn't working right. label Mar 21, 2025
@github-project-automation github-project-automation bot moved this to Todo in CCCL Mar 21, 2025
@alliepiper
Copy link
Contributor

This is expected when CMake has different settings for the CUDA host compiler and C++ compiler. Our build system for tests/examples requires that the CXX and CUDA_HOST compilers match. Try:

cmake -DCMAKE_CXX_COMPILER=nvc++ -DCMAKE_CUDA_HOST_COMPILER=nvc++ /path/to/cccl

These can also be set using the CXX and CUDAHOSTCXX environment variables.

@zkhatami
Copy link
Author

Do we always need to set CUDA-related environment variables, even if the tests are not meant to be compiled for the device? It seems that CUDA_COMPILER and CUDA_HOST_COMPILER are required even for host-only tests. Can we separate them?

@alliepiper
Copy link
Contributor

Can you share the full cmake command you're using to configure your build?

@alliepiper alliepiper added the needs info Cannot make progress without more information. label Apr 23, 2025
@alliepiper
Copy link
Contributor

Need more info to understand usescase to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working right. needs info Cannot make progress without more information.
Projects
Status: Todo
Development

No branches or pull requests

2 participants