On Mon, May 7, 2012 at 11:41 AM, Ming <span dir="ltr">&lt;<a href="mailto:ymyang@wisc.edu" target="_blank">ymyang@wisc.edu</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div dir="ltr">
<div dir="ltr">
<div style="font-size:10pt;font-family:&#39;Arial&#39;">
<div><div><div class="h5">
<div style="font-size:small;font-style:normal;text-decoration:none;font-family:&#39;Calibri&#39;;display:inline;font-weight:normal">
<div style="FONT-STYLE:normal;DISPLAY:inline;FONT-FAMILY:&#39;Calibri&#39;;FONT-SIZE:small;FONT-WEIGHT:normal;TEXT-DECORATION:none"><font face="Arial"></font><i></i> </div>
<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:&#39;Arial&#39;;FONT-SIZE:10pt">
  <div><font face="Arial"><font style="FONT-SIZE:10pt"><i>  -The code in 
  question is the Geant4 (</i><a title="http://geant4.web.cern.ch/geant4/support/download.shtml" href="http://geant4.web.cern.ch/geant4/support/download.shtml" target="_blank"><i>http://geant4.web.cern.ch/geant4/support/download.shtml</i></a><i>) 
  toolkit, which uses CMake to handle its cross-platform configurations. The end 
  result of the toolkit is to compile a large set of 
  libraries.</i></font></font></div>
  <div><font face="Arial"><i><font style="FONT-SIZE:10pt">-I’ve changed all of 
  the source files from .cc to .cu, and changed all “add_library” terms to 
  </font><font style="FONT-SIZE:10pt">“cuda_add_library”</font></i></font></div>
  <div><font face="Arial"><i>-I’ve also updated all of the “include directories” 
  to “cuda_include_directories”</i></font></div>
  <div><font face="Arial"><i>-The end result is that I am able to generate a 
  build directory (without any errors) using cmake, for VS2010. 
  </i></font></div>
  <div><font face="Arial"></font><i></i> </div>
  <div><font face="Arial"><i>However when I attempt to build the package in an 
  analagous fashion, I get errors from visual studio informing me mid-build that 
  it:</i></font></div>
  <div><font face="Arial"></font><i></i> </div>
  <div><font face="Arial"><i>Cannot load macro project “ for the following 
  reason:</i></font></div>
  <div><font face="Arial"><i>C:\...\Projects\VSMacros80\Samples\Samples.vsmacros’ 
  is an invalid or inaccessible macro project file</i></font></div>
  <div><font face="Arial"></font><i></i> </div>
  <div><font face="Arial"><i>Once I acknowledge this message, it then 
  says:</i></font></div>
  <div><font face="Arial"></font><i></i> </div>
  <div><font face="Arial"><i>CMake has regenerated 3 .sln and/or .vcproj 
  files.</i></font></div>
  <div><font face="Arial"><i>Click:</i></font></div>
  <div><font face="Arial"><i>--Yes to reload the whole 
  solution...</i></font></div>
  <div><font face="Arial"><i>--No to reload the solution ...</i></font></div>
  <div><font face="Arial"><i>--Cancel to do nothing</i></font></div>
  <div><font face="Arial"></font><i></i> </div>
  <div><font face="Arial"><i>This message shows up even though CMake was done 
  generating files and was closed prior to the build.</i></font></div>
  <div><font face="Arial"><i>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!</i></font></div>
  <div><font face="Arial"></font><i></i> </div>
  <div><font face="Arial"><i>Thanks,</i></font></div>
  <div><font face="Arial"><i>Ming</i></font></div>
  <div><font face="Arial"></font><i></i> </div>
  <div><font face="Arial"><i>Uploaded screenshots of the error 
  messages:</i></font></div>
  <div><a href="https://mywebspace.wisc.edu/ymyang/web/macroerr1.png" target="_blank"><font face="Times New Roman"><i>https://mywebspace.wisc.edu/ymyang/web/macroerr1.png</i></font></a><font face="Times New Roman"><i> </i></font></div>


  <div><a href="https://mywebspace.wisc.edu/ymyang/web/macroerr2.png" target="_blank"><font face="Times New Roman"><i>https://mywebspace.wisc.edu/ymyang/web/macroerr2.png</i></font></a><font face="Times New Roman"><i> 
</i></font></div></div></div></div></blockquote></div>
<blockquote></blockquote></div>
<div><br><i>I believe the macro error is a known problem with the CMake VS 
macro in VS 2010 (MS broke it).  The regeneration of the project files is 
also a known behavior of FindCUDA.  The dependencies are computed by nvcc 
during build and saved in a file.  When the dependency file is regenerated 
CMake will want to reconfigure to add those new dependencies to the project 
file.  This is the expected behavior.<br><br>My current recommendation for 
CUDA + VS 2010 is to specify CMAKE_SUPPRESS_REGENERATION OFF in your project 
file&#39;s CMakeLists.txt:<br>option(CMAKE_SUPPRESS_REGENERATION &quot;Suppress 
regeneration of build scripts during build&quot; ON)<br><br>This will disable the VS 
CMake plugin, requiring you to manually configure with CMake when you change the 
build scripts.  I also recommend configuring CMake after your first build 
to pick up the file level dependencies that CUDA 
generates.<br><br>James<br></i></div>
</div></div><div><font face="Arial">Hey James, </font></div>
<div><font face="Arial">Thanks you for the reply.  I am a bit new to 
this (and definitely jumping into the deep end with what I am attempting).  
Could you elaborate on what you mean by “manually configure with CMake” after 
the initial build?  Is it safe to interpret that as re-running CMake-gui 
after a build, for the same source and build directories?.  Or is there 
something else implied?  I’ve had issues in the past trying to perform a 
configure command in CMake-gui when the buidl directory already 
existed..?</font></div>
<div><font face="Arial"></font> </div>
<div><font face="Arial">Thanks!</font></div><span class="HOEnZb"><font color="#888888">
<div><font face="Arial">Ming</font></div></font></span></div></div></div></div>
</blockquote></div><br>By design, CMake should detect configuration changes and reconfigure before the build starts.  The VS plugin was designed to provide a single dialog box that would allow for reloading of the entire solution with a single click rather than having to click &quot;reload&quot; for each project one at a time.  This plugin doesn&#39;t work properly in VS 2010, because MS broke something.<br>

<br>To run the configuration manually, you would need to configure your build from the CMake-GUI instead of relying on VS to run the configuration during the build.  You would use the same build and source directory.  This should work fine.<br>