<HTML><HEAD></HEAD>
<BODY dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-FAMILY: 'Arial'; COLOR: #000000; FONT-SIZE: 10pt">
<DIV>
<DIV
style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none"><EM><B>From:</B>
</EM><A title=jamesbigler@gmail.com
href="mailto:jamesbigler@gmail.com"><EM>James Bigler</EM></A><EM> </EM></DIV>
<DIV style="FONT: 10pt tahoma">
<DIV style="BACKGROUND: #f5f5f5">
<DIV><EM><B>Sent:</B> Saturday, May 05, 2012 1:51 AM</EM></DIV>
<DIV><EM><B>To:</B> </EM><A title=ymyang@wisc.edu
href="mailto:ymyang@wisc.edu"><EM>Ming</EM></A><EM> </EM></DIV>
<DIV><EM><B>Cc:</B> </EM><A title=cmake@cmake.org
href="mailto:cmake@cmake.org"><EM>cmake@cmake.org</EM></A><EM> </EM></DIV>
<DIV><EM><B>Subject:</B> Re: [CMake] Moving large MSVS projects to
CUDA</EM></DIV></DIV></DIV>
<DIV><EM></EM> </DIV></DIV>
<DIV
style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none"><EM>On
Fri, May 4, 2012 at 12:39 PM, Ming <SPAN dir=ltr><<A
href="mailto:ymyang@wisc.edu" target=_blank>ymyang@wisc.edu</A>></SPAN>
wrote:<BR></EM>
<DIV class=gmail_quote>
<BLOCKQUOTE
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>
<DIV dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-FAMILY: 'Calibri'; FONT-SIZE: 12pt">
<DIV><EM>Hello CMake community,</EM></DIV>
<DIV><EM></EM> </DIV>
<DIV><EM>I have experience using CMake to generate sime cuda-enabled
executables (where the cpp’s reside in one folder, etc.).</EM></DIV>
<DIV><EM>I am attempting to move a large project that utilizes CMake, from
just c++ to CUDA enabled c++. </EM></DIV>
<DIV><EM></EM> </DIV>
<DIV><EM>It is a project that generates a large set of libraries (comprising a
toolkit), using various cmake scripts. I have modified the
“add_libraries” call to be “cuda_add_libraries”, and changed all of the .cc
files to .cu (but with no additional CUDA code). An approach I thought
would be similar to changing a simple program from add_executable to
“cuda_add_executable” and renaming the extension to “.cu”</EM></DIV>
<DIV><EM>My goal was first to have it compile properly in its original form
post migration, but am met with some very strange errors in visual
studio. </EM></DIV>
<DIV><EM></EM> </DIV>
<DIV><EM>I am wondering if anyone else has undertaken such a migration before
(libraries or binaries), and if so, what types of general steps need to be
taken other than just telling CMake we’re adding “.cu” files?</EM></DIV>
<DIV><EM></EM> </DIV>
<DIV><EM>Thanks all in advance,</EM></DIV>
<DIV><EM>Ming</EM></DIV></DIV></DIV></DIV><BR><EM>--<BR><BR>Powered by </EM><A
href="http://www.kitware.com"
target=_blank><EM>www.kitware.com</EM></A><BR><BR><EM>Visit other Kitware
open-source projects at </EM><A
href="http://www.kitware.com/opensource/opensource.html"
target=_blank><EM>http://www.kitware.com/opensource/opensource.html</EM></A><BR><BR><EM>Please
keep messages on-topic and check the CMake FAQ at: </EM><A
href="http://www.cmake.org/Wiki/CMake_FAQ"
target=_blank><EM>http://www.cmake.org/Wiki/CMake_FAQ</EM></A><BR><BR><EM>Follow
this link to subscribe/unsubscribe:<BR></EM><A
href="http://www.cmake.org/mailman/listinfo/cmake"
target=_blank><EM>http://www.cmake.org/mailman/listinfo/cmake</EM></A><BR></BLOCKQUOTE></DIV>
<DIV><BR><BR><EM>What kind of strange errors?<BR><BR>Typically when adding a new
CUDA enabled library, you simply start adding the .cu files with the host/device
code mixed to a cuda_add_* target.<BR><BR>James<BR></EM></DIV>
<DIV><FONT size=2 face=Arial>Thank you all for the reply,</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT face=Arial><FONT style="FONT-SIZE: 10pt"> -The code in question
is the Geant4 (<A title=http://geant4.web.cern.ch/geant4/support/download.shtml
href="http://geant4.web.cern.ch/geant4/support/download.shtml">http://geant4.web.cern.ch/geant4/support/download.shtml</A>)
toolkit, which uses CMake to handle its cross-platform configurations. The end
result of the toolkit is to compile a large set of
libraries.</FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT style="FONT-SIZE: 10pt">-I’ve changed all of the
source files from .cc to .cu, and changed all <EM>“add_library” </EM>terms to
</FONT><EM><FONT
style="FONT-SIZE: 10pt">“cuda_add_library”</FONT></EM></FONT></DIV>
<DIV><FONT size=2 face=Arial>-I’ve also updated all of the <EM>“include
directories”</EM> to <EM>“cuda_include_directories”</EM></FONT></DIV>
<DIV><FONT size=2 face=Arial>-The end result is that I am able to generate a
build directory (without any errors) using cmake, for VS2010. </FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>However when I attempt to build the package in an
analagous fashion, I get errors from visual studio informing me mid-build that
it:</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial><EM>Cannot load macro project “ for the following
reason:</EM></FONT></DIV>
<DIV><FONT size=2
face=Arial><EM>C:\...\Projects\VSMacros80\Samples\Samples.vsmacros’ is an
invalid or inaccessible macro project file</EM></FONT></DIV>
<DIV><EM><FONT size=2 face=Arial></FONT></EM> </DIV>
<DIV><FONT size=2 face=Arial>Once I acknowledge this message, it then
says:</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial><EM>CMake has regenerated 3 .sln and/or .vcproj
files.</EM></FONT></DIV>
<DIV><FONT size=2 face=Arial><EM>Click:</EM></FONT></DIV>
<DIV><FONT size=2 face=Arial><EM>--Yes to reload the whole
solution...</EM></FONT></DIV>
<DIV><FONT size=2 face=Arial><EM>--No to reload the solution
...</EM></FONT></DIV>
<DIV><FONT size=2 face=Arial><EM>--Cancel to do nothing</EM></FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>This message shows up even though CMake was done
generating files and was closed prior to the build.</FONT></DIV>
<DIV><FONT size=2 face=Arial>The same thing happens on my work computer, and I
am able to compile other programs just fine, so I do not believe it to be a
corrupt install of visual studio. Any suggestions on why this would occur
is appreciated!</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Thanks,</FONT></DIV>
<DIV><FONT size=2 face=Arial>Ming</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Uploaded screenshots of the error
messages:</FONT></DIV>
<DIV><A href="https://mywebspace.wisc.edu/ymyang/web/macroerr1.png"><FONT
face="Times New Roman">https://mywebspace.wisc.edu/ymyang/web/macroerr1.png</FONT></A><FONT
face="Times New Roman"> </FONT></DIV>
<DIV><A href="https://mywebspace.wisc.edu/ymyang/web/macroerr2.png"><FONT
face="Times New Roman">https://mywebspace.wisc.edu/ymyang/web/macroerr2.png</FONT></A><FONT
face="Times New Roman"> </FONT></DIV></DIV></DIV></DIV></BODY></HTML>