VS: CUDA compiler fails using Visual Studio generator at MSYS2 prompt
Hi there,
I want to build a VS2019 (16.4.3) solution using Cuda 10.2 with Cmake 3.16.1 but it's doesn't seem to work.
I'm stuck with this Cmake error : The CUDA compiler is not able to compile a simple test program.
I tried to open and compile the .vcxproj found in CmakeFiles/3.16.1/CompilerIdCUDA directly through VS2019. It's work fine.
I also tried to compile the CMakeCUDACompilerId.cu directly with nvcc using this command line : nvcc -v --keep --keep-dir tmp CMakeCUDACompilerId.cu
It's also work fine.
If I use ninja as generator with cmake, (using msvc BuildTools) it's work fine.
I only encounter this issue when I try to use Visual Studio 16 2019 generator.
Any advice on this ?
Thank a lot !
For information
$ nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Wed_Oct_23_19:32:27_Pacific_Daylight_Time_2019
Cuda compilation tools, release 10.2, V10.2.89
$ cmake --version
cmake version 3.16.1
CMake suite maintained and supported by Kitware (kitware.com/cmake).
$ cl.exe
Microsoft (R) C/C++ Optimizing Compiler Version 19.24.28315 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
$ /c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/2019/Community/VC/Auxiliary/Build/vcvars64.bat
**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.4.3
** Copyright (c) 2019 Microsoft Corporation
**********************************************************************
Edited by Brad King