MantisBT - CMake
View Issue Details
0015697CMakeCMakepublic2015-08-14 16:372016-01-04 11:52
Dominic Meiser 
 
normalminoralways
closedfixed 
MSVC 18.0.40629Windows7
CMake 3.2.2 
CMake 3.4CMake 3.4 
0015697: CUDA separable compilation intermediate file doesn't get created
When I compile with CUDA_SEPARABLE_COMPILATION=TRUE the custom command for the generation of the intermediate_link.obj does not get triggered. When I change line 1590 in FindCUDA.cmake (master version from earlier today) to `set(do_obj_build_rule TRUE)` the custom command does run and compilation succeeds. I don't see the bug here.

I'm seeing this behavior with cmake 3.2.2 and master revision 17ecfd8210.
configure a cuda library target with CUDA_SEPARABLE_COMPILATION=TRUE and build.
This is with cuda toolkit 7.0
No tags attached.
patch 0001-FindCUDA.cmake-Fix-object-build-rule-for-separate-co.patch (1,365) 2015-08-20 10:21
https://public.kitware.com/Bug/file/5514/0001-FindCUDA.cmake-Fix-object-build-rule-for-separate-co.patch
patch 0002-FindCUDA.cmake-Fix-object-build-rule-for-separate-co.patch (1,361) 2015-08-20 11:34
https://public.kitware.com/Bug/file/5515/0002-FindCUDA.cmake-Fix-object-build-rule-for-separate-co.patch
Issue History
2015-08-14 16:37Dominic MeiserNew Issue
2015-08-14 17:49Dominic MeiserNote Added: 0039283
2015-08-17 09:38Brad KingStatusnew => resolved
2015-08-17 09:38Brad KingResolutionopen => unable to reproduce
2015-08-20 10:20Dominic MeiserNote Added: 0039306
2015-08-20 10:21Dominic MeiserFile Added: 0001-FindCUDA.cmake-Fix-object-build-rule-for-separate-co.patch
2015-08-20 10:28Dominic MeiserNote Added: 0039307
2015-08-20 10:28Dominic MeiserStatusresolved => feedback
2015-08-20 10:28Dominic MeiserResolutionunable to reproduce => reopened
2015-08-20 10:42Brad KingStatusfeedback => new
2015-08-20 10:42Brad KingResolutionreopened => open
2015-08-20 11:14Brad KingNote Added: 0039310
2015-08-20 11:30Dominic MeiserNote Added: 0039311
2015-08-20 11:34Dominic MeiserFile Added: 0002-FindCUDA.cmake-Fix-object-build-rule-for-separate-co.patch
2015-08-20 11:52Brad KingNote Added: 0039312
2015-08-20 11:53Brad KingStatusnew => resolved
2015-08-20 11:53Brad KingResolutionopen => fixed
2015-08-20 11:53Brad KingFixed in Version => CMake 3.4
2015-08-20 11:53Brad KingTarget Version => CMake 3.4
2015-08-20 11:57Dominic MeiserNote Added: 0039313
2016-01-04 11:52Robert MaynardNote Added: 0040118
2016-01-04 11:52Robert MaynardStatusresolved => closed

Notes
(0039283)
Dominic Meiser   
2015-08-14 17:49   
I must have made a mistake earlier. I cannot reproduce this with master anymore. Sorry for the bother.
(0039306)
Dominic Meiser   
2015-08-20 10:20   
Turns out I wasn't able to reproduce the issue because I switched compilers to VS2012 and VS2010. But when I went back to VS 2013 the problem is reproducible.

It appears that the workaround for the object build rules used for VS2010 and VS2012 does not work for VS2013. Apparently the multilevel object dependency problem has been fixed in VS2013. The attached patch solves the problem for me.
(0039307)
Dominic Meiser   
2015-08-20 10:28   
See note #0039306 for explanation of why I wasn't able to reproduce this earlier.
(0039310)
Brad King   
2015-08-20 11:14   
> + if (MSVC_VERSION GREATER 1599 AND NOT MSVC_VERSION LESS 1800)

Did you mean

+ if (MSVC_VERSION GREATER 1599 AND MSVC_VERSION LESS 1800)

?
(0039311)
Dominic Meiser   
2015-08-20 11:30   
Yes, you are correct. I'm updating the patch.
(0039312)
Brad King   
2015-08-20 11:52   
Re 0015697:0039311: Thanks, applied:

 FindCUDA: Fix object build rule for separate compilation on VS 2013+
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9b2f6992 [^]
(0039313)
Dominic Meiser   
2015-08-20 11:57   
Great, thanks.
(0040118)
Robert Maynard   
2016-01-04 11:52   
Closing resolved issues that have not been updated in more than 4 months.