MantisBT - CMake
View Issue Details
0014078CMakeCMakepublic2013-04-12 18:322013-10-07 10:09
szotsaki 
James Bigler 
normalminoralways
closedno change required 
Linux x64openSUSE12.3
CMake 2.8.10.2 
 
0014078: FindCUDA "-D${cuda_target}_EXPORTS" generates invalid identifier
I use CMake as out-of-source-build way, and that's why my cuda_add_library call looks like this:

cuda_add_library(../models/program_gpu ../models/program_gpu.cu MODULE)

Because it's built as a MODULE, the following line applies in FindCUDA.cmake:
if(_cuda_build_shared_libs)
  list(APPEND nvcc_flags "-D${cuda_target}_EXPORTS")
endif()

It generates the following:
/usr/local/cuda-5.0/bin/nvcc [...] -D../models/program_gpu_EXPORTS [...]

Apart from that fact it's not useful, the C standard says it's not valid also. So I got the following error message from nvcc:
<command-line>:0:1: error: macro names must be identifiers
No tags attached.
Issue History
2013-04-12 18:32szotsakiNew Issue
2013-04-12 19:10szotsakiNote Added: 0032823
2013-04-15 08:57Brad KingAssigned To => James Bigler
2013-04-15 08:57Brad KingStatusnew => assigned
2013-04-15 08:57Brad KingStatusassigned => resolved
2013-04-15 08:57Brad KingResolutionopen => no change required
2013-10-07 10:09Robert MaynardNote Added: 0034030
2013-10-07 10:09Robert MaynardStatusresolved => closed

Notes
(0032823)
szotsaki   
2013-04-12 19:10   
I've just realized that the first parameter is just a name and can be anything. It's my fault, it's not really a bug.

I can't close this report myself, but I'm sorry for the unnecessary noise.
(0034030)
Robert Maynard   
2013-10-07 10:09   
Closing resolved issues that have not been updated in more than 4 months.