NCAR / spack-derecho

Spack production user software stack on the Derecho system
3 stars 0 forks source link

nvc++ compiler warning with -std=c++20 flag #21

Closed sjsprecious closed 4 months ago

sjsprecious commented 4 months ago

When compiling the CUDA kernel in my C++ code, I got the following warning message:

nvcc warning : The -std=c++20 flag is not supported with the configured host compiler. Flag will be ignored.

This happens to both nvhpc/23.7 and nvhpc/24.3 versions on Derecho. I am using cuda/12.2.1 for nvcc compiler.

benkirk commented 4 months ago

Since nvhpcngenerally relies on an underlying gcc, this isn’t surprising. The system gcc-7.5.0 is being used behind the scenes and it doesn’t support the newest c++ standards.

There are a few ways to have nvhpc use a newer gcc, of which we have several. Brian might have some ideas for a path of least resistance considering how things are tied together through spack.

I assume you need some c++20 functionality?

-Ben

On Mon, Jun 17, 2024 at 10:33 AM Jian Sun @.***> wrote:

When compiling the CUDA kernel in my C++ code, I got the following warning message:

nvcc warning : The -std=c++20 flag is not supported with the configured host compiler. Flag will be ignored.

This happens to both nvhpc/23.7 and nvhpc/24.3 versions on Derecho. I am using cuda/12.2.1 for nvcc compiler.

— Reply to this email directly, view it on GitHub https://github.com/NCAR/spack-derecho/issues/21, or unsubscribe https://github.com/notifications/unsubscribe-auth/AASBY3AKPMGRNHGFMJY5KWTZH4FW3AVCNFSM6AAAAABJOLCVMKVHI2DSMVQWIX3LMV43ASLTON2WKOZSGM2TONZWGE4DGMI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

vanderwb commented 4 months ago

I asked @sjsprecious to submit this following on from a Slack message he sent me. He is using our gcc-toolchain module to specify a newer GCC, but that isn't doing the trick for this use case. I am looking at what modifications need to happen there to make it work.

sjsprecious commented 4 months ago

Thanks @benkirk and @vanderwb for your comments. Yes, my C++ code is using some C++20 functionality, and thanks @vanderwb for working on this issue.

vanderwb commented 4 months ago

Confirmed fixed.