CMake-Fehler: Fehler erforderliche interne CMake-Variable nicht gesetzt ... _CMAKE_CUDA_WHOLE_FLAGC++

Programme in C++. Entwicklerforum
Anonymous
 CMake-Fehler: Fehler erforderliche interne CMake-Variable nicht gesetzt ... _CMAKE_CUDA_WHOLE_FLAG

Post by Anonymous »

Ich versuche, ein Projekt von mir mit CUDA zu konfigurieren, etwa so:

Code: Select all

cmake \
-DCMAKE_CUDA_ARCHITECTURES=61 \
-DCMAKE_BUILD_TYPE=Release \
-DCUDAToolkit_ROOT=/usr/local/cuda-11.6 \
-DCMAKE_CUDA_COMPILER=/usr/local/cuda-11.6/bin/nvcc \
-DCMAKE_CUDA_HOST_COMPILER=/usr/bin/g++-11 \
-S /path/to/src_dir \
-B /path/to/build_dir
und erhalte:

Code: Select all

-- The C compiler identification is GNU 11.5.0
-- The CXX compiler identification is GNU 11.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc-11 - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++-11 - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The CUDA compiler identification is unknown
-- Check for working CUDA compiler: /usr/local/cuda-11.6/bin/nvcc
CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
Missing variable is:
_CMAKE_CUDA_WHOLE_FLAG
CMake Error at /opt/cmake/share/cmake-4.1/Modules/CMakeTestCUDACompiler.cmake:48 (try_compile):
Failed to generate test project build system.
Call Stack (most recent call first):
examples/CMakeLists.txt:8 (enable_language)
Ich weiß, dass sich der NVCC genau dort befindet (und wenn ich CMake auf einen anderen Pfad verweise, erhalte ich die Fehlermeldung, dass der NVCC nicht gefunden wird). Ich weiß auch, dass die Architekturflagge echt ist.
Also, was ist los? Was bedeutet Variable? Und was muss ich tun, damit meine CMake-Konfiguration erfolgreich ist?

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post