MantisBT - CMake | ||||||||||
View Issue Details | ||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | |||||
0012099 | CMake | CMake | public | 2011-04-17 10:07 | 2012-05-09 15:26 | |||||
Reporter | Ofri Sadowsky | |||||||||
Assigned To | James Bigler | |||||||||
Priority | high | Severity | major | Reproducibility | have not tried | |||||
Status | closed | Resolution | fixed | |||||||
Platform | OS | Windows 7 x64 | OS Version | |||||||
Product Version | CMake 2.8.4 | |||||||||
Target Version | CMake 2.8.7 | Fixed in Version | CMake 2.8.7 | |||||||
Summary | 0012099: Unable to quote cmd line args to be passed to nvcc | |||||||||
Description | I am trying to build a CUDA project with Visual Studio 2010 and CMake. I know that this is a sensitive issue. Basically, I get a compilation error when nvcc tries to parse a stddef.h file, and runs into the use of an undefined macro named "nullptr". A colleague of mine had patched my VS2010/CUDA setup so that with an ordinary VS project I can properly compile CUDA source files into .obj. One of the steps involved changing the VS rules so that the command line includes the following text: -Xcompiler "/Dnullptr=0 /Dnullptr_t=__nullptr_t /D__nullptr=((void*)0)" The quotation marks are essential, because otherwise the parentheses around the (void *) are parsed incorrectly. As you can see, the missing macros are defined, so that the original problem is bypassed. However hard I tried, I could not produce the proper quotation marks to be passed as nvcc command line arguments. It came to a point that when I take the command line produced within the CMake-generated VS project (using Verbose mode), and simply add the above options, my source file get compiled. But I can't get CMake to produce the same outcome. Example: Use the OPTIONS flag on the cuda_add_library. By default, this simply separates the -Xcompiler from the rest of the stuff, and creates an invalid command line, where "Xcompiler" becomes one of the options for Xcompiler. If I remove the "-Xcompiler" then I can't get the quotation right around the options, and then the parentheses scramle things up. It looks as though something is wrong in the way that the OPTIONS are parsed. I can't pinpoint the issue, and I can't get around it. | |||||||||
Steps To Reproduce | You can use an empty .cu file. project(Test_CMake) find_package(CUDA) if(NOT CUDA_FOUND) message(SEND_ERROR "CUDA package not found!") endif() cuda_add_library(Test_CMake emptyfile.cu) Try the various options. | |||||||||
Additional Information | ||||||||||
Tags | No tags attached. | |||||||||
Relationships |
| |||||||||
Attached Files | ||||||||||
Issue History | ||||||||||
Date Modified | Username | Field | Change | |||||||
2011-04-17 10:07 | Ofri Sadowsky | New Issue | ||||||||
2011-04-17 13:20 | Ofri Sadowsky | Note Added: 0026205 | ||||||||
2011-04-18 12:17 | Brad King | Assigned To | => James Bigler | |||||||
2011-04-18 12:17 | Brad King | Status | new => assigned | |||||||
2011-04-18 15:46 | James Bigler | Relationship added | duplicate of 0011726 | |||||||
2011-04-18 15:47 | James Bigler | Note Added: 0026221 | ||||||||
2011-12-14 22:58 | James Bigler | Note Added: 0027981 | ||||||||
2011-12-14 22:58 | James Bigler | Status | assigned => resolved | |||||||
2011-12-14 22:58 | James Bigler | Fixed in Version | => CMake 2.8.7 | |||||||
2011-12-14 22:58 | James Bigler | Resolution | open => fixed | |||||||
2011-12-16 17:15 | David Cole | Target Version | => CMake 2.8.7 | |||||||
2012-05-09 15:26 | David Cole | Note Added: 0029443 | ||||||||
2012-05-09 15:26 | David Cole | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|