[CMake] CMake CUDA 3.8+/9 support as a first class language with out Visual Studio Support... err what?

Brian J. Davis bitminer at gmail.com
Fri Jul 28 20:40:01 EDT 2017


@Robert

Adding CUDA to my PROJECT(4DRTProto CXX CUDA)

Yields:


CMake Error at 
C:/projects/4DRTProto/4DRTProto_3rdParty/platform/tools/cmake-3.9.0-rc6-win64-x64/share/cmake-3.9/Modules/CMakeTestCUDACompiler.cmake:45 
(message):
   The CUDA compiler "C:/Program Files/NVIDIA GPU Computing
   Toolkit/CUDA/v8.0/bin/nvcc.exe" is not able to compile a simple test
   program.

   It fails with the following output:

    Change Dir: C:/projects/4DRTProto/4DRTProto/build/CMakeFiles/CMakeTmp



   Run Build Command:"C:/Program Files (x86)/MSBuild/12.0/bin/MSBuild.exe"
   "cmTC_20a4f.vcxproj" "/p:Configuration=Debug" 
"/p:VisualStudioVersion=12.0"

   Microsoft (R) Build Engine version 12.0.31101.0


   [Microsoft .NET Framework, version 4.0.30319.42000]


   Copyright (C) Microsoft Corporation.  All rights reserved.





   Build started 7/28/2017 7:33:34 PM.


   Project
"C:\projects\4DRTProto\4DRTProto\build\CMakeFiles\CMakeTmp\cmTC_20a4f.vcxproj"
   on node 1 (default targets).


   PrepareForBuild:


     Creating directory "cmTC_20a4f.dir\Debug\".

     Creating directory 
"C:\projects\4DRTProto\4DRTProto\build\CMakeFiles\CMakeTmp\Debug\".

     Creating directory "cmTC_20a4f.dir\Debug\cmTC_20a4f.tlog\".


   InitializeBuildStatus:


     Creating "cmTC_20a4f.dir\Debug\cmTC_20a4f.tlog\unsuccessfulbuild" 
because "AlwaysCreate" was specified.


   C:\Program Files
   (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\BuildCustomizations\CUDA
   8.0.targets(216,9): error : Item 'main.cu' Code Generation value is 
not in
   the expected format '[Arch],[Code]'.
[C:\projects\4DRTProto\4DRTProto\build\CMakeFiles\CMakeTmp\cmTC_20a4f.vcxproj]



   Done Building Project
"C:\projects\4DRTProto\4DRTProto\build\CMakeFiles\CMakeTmp\cmTC_20a4f.vcxproj"
   (default targets) -- FAILED.





   Build FAILED.






"C:\projects\4DRTProto\4DRTProto\build\CMakeFiles\CMakeTmp\cmTC_20a4f.vcxproj"
   (default target) (1) ->


   (AddCudaCompileMetadata target) ->


     C:\Program Files 
(x86)\MSBuild\Microsoft.Cpp\v4.0\V120\BuildCustomizations\CUDA 
8.0.targets(216,9): error : Item 'main.cu' Code Generation value is not 
in the expected format '[Arch],[Code]'. 
[C:\projects\4DRTProto\4DRTProto\build\CMakeFiles\CMakeTmp\cmTC_20a4f.vcxproj]





       0 Warning(s)

       1 Error(s)





   Time Elapsed 00:00:00.35






   CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
   CMakeLists.txt:14 (PROJECT)


And so it goes the CMake, CUDA, Visual Studio Experience.  Maybe time to 
revert back to FindCUDA in CMAKE version 3.2.  Sure is awesome.






More information about the CMake mailing list