Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • CMake CMake
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,802
    • Issues 3,802
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 16
    • Merge requests 16
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CMake
  • CMakeCMake
  • Issues
  • #23079

Closed
Open
Created Jan 05, 2022 by Mario Emmenlauer@emmenlau🌞Contributor

CUDA: I enabled c++20 in my project, now the configuration fails with `Target "XXX" requires the language dialect "CUDA20"` on MSVC

I have a project that used to build with C++17 without issues. It uses Cuda. I configure this with

    set_target_properties(XXX PROPERTIES
        CXX_STANDARD 20
        CXX_STANDARD_REQUIRED ON
        CXX_EXTENSIONS NO
        CUDA_STANDARD 20
        CUDA_ARCHITECTURES 50)

This used to work well when I used "17" instead of "20". Now with version "20" I get build errors on MSVC with the ClangCl compiler frontend:

-- Configuring done
CMake Error in CMakeLists.txt:
  Target "XXX" requires the language dialect "CUDA20" , but CMake does
  not know the compile flags to use to enable it.
-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.

I'm not really sure what that means?

If cmake does not (yet) support CUDA_STANDARD=20 with MSVC or ClangCl, it would be great if the error message could be more helpful. I've googled for a while for the current error message and could not find anything remotely useful for CUDA. If this really is the problem, something like this would be better:

  Target "XXX" wants to set the language dialect "CUDA_STANDARD" to "20".
  But the current compiler "xxx" does not support this, or cmake does not
  know the flags to enable it.
Edited Jan 11, 2022 by Brad King
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking