Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-28861

errors shown in cuda header files, when building with cmake

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • Qt Creator 9.0.2
    • None
    • Linux (Kubuntu 22.04), Cuda 12.0
    • Linux/X11

    Description

      The inbuilt analyser in the editor shows me errors for .cuh and .h files. The errors are for example "Unsupported option '--exp-extended-lambda', Unsupported option ..". I guess, that creator tries to compile the file using clang for code warnings, supplies nvcc flags specified in the CMake file, and clang stops with errors. a regular build works correctly, which means, that CMake is setup correctly.

      Here is a demo project:
      CMakeLists.txt

      cmake_minimum_required(VERSION 3.18)
      project(cuda_test LANGUAGES CUDA CXX)
      string(APPEND CMAKE_CUDA_FLAGS " --expt-extended-lambda --expt-relaxed-constexpr")
      
      add_library(testlib kernel.cuh kernel.cu)
      target_include_directories(testlib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
      

      kernel.cuh and kernel.cu are empty. it's the same when using kernel.h. i've also attached the project as a zip.

      The errors are shown, when you open the project in creator, and then click on kernel.cuh. kernel.cu does not show the error, but there is also no completion. after I added cu to the list of c++ sources in the mime types, it behaves the same as .cuh files.

      the .cuh header also doesn't show under the Header Files. but that's a different bug and not so important.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            cadam Cristian Adam
            adamce Adam
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes