<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>analog feelings, digital world &#187; PYTHONPATH</title>
	<atom:link href="http://notonlyzeroesandones.site40.net/tag/pythonpath/feed/" rel="self" type="application/rss+xml" />
	<link>http://notonlyzeroesandones.site40.net</link>
	<description>code is the modern poetry ;)</description>
	<lastBuildDate>Mon, 05 Oct 2009 22:06:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>VS 2008 &amp; CUDA</title>
		<link>http://notonlyzeroesandones.site40.net/2009/02/15/vs-2008-cuda/</link>
		<comments>http://notonlyzeroesandones.site40.net/2009/02/15/vs-2008-cuda/#comments</comments>
		<pubDate>Sun, 15 Feb 2009 15:15:41 +0000</pubDate>
		<dc:creator>Maciek Talaska</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[CUDA]]></category>
		<category><![CDATA[Custom Build Rules]]></category>
		<category><![CDATA[PYTHONPATH]]></category>

		<guid isPermaLink="false">http://notonlyzeroesandones.site40.net/2009/02/15/vs-2008-cuda/</guid>
		<description><![CDATA[As a proud owner of nVidia graphic card (and being some kind of a fan of nVidia for their effort into graphics programming) I decided to go and try CUDA. At the moment the newest version is 2.1. The first thing after installing something you want to try out is to go and look at [...]]]></description>
			<content:encoded><![CDATA[<p align="justify">As a proud owner of nVidia graphic card (and being some kind of a fan of nVidia for their effort into graphics programming) I decided to go and try CUDA. At the moment the newest version is 2.1. The first thing after installing something you want to try out is to go and look at the samples, right? The same thing I thought, but unfortunately there were some problems compiling samples from nVidia CUDA SDK. </p>
<p align="justify">I tried to compile one of the simplest samples, but I instead of success I saw error message:</p>
<blockquote><p align="left">1&gt;&#8212;&#8212; Build started: Project: cudaOpenMP, Configuration: Debug Win32 &#8212;&#8212;     <br />1&gt;Compiling with CUDA Build Rule&#8230;      <br />1&gt;&quot;C:Program FilesnVidiaCUDAbinnvcc.exe&quot;&#160;&#160; -arch sm_10 -ccbin &quot;C:Program FilesMicrosoft Visual Studio 9.0VCbin&quot;&#160;&#160;&#160; -Xcompiler &quot;/EHsc /W3 /nologo /Od /Zi&#160;&#160; /MTd&#160; &quot; -IC:Program FilesnVidiaCUDAinclude -I../../common/inc -maxrregcount=32&#160; &#8211;compile -o DebugcudaOpenMP.cu.obj cudaOpenMP.cu       <br />1&gt;nvcc fatal&#160;&#160; : A single input file is required for a non-link phase when an outputfile is specified      <br />1&gt;Linking&#8230;      <br />1&gt;LINK : fatal error LNK1181: cannot open input file &#8216;.DebugcudaOpenMP.cu.obj&#8217;      <br />1&gt;Build log was saved at &quot;file://d:MDTempProjectsCUDAprojectscudaOpenMPDebugBuildLog.htm&quot;      <br />1&gt;cudaOpenMP &#8211; 1 error(s), 0 warning(s)      <br />========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========</p>
</blockquote>
<p align="justify">(this is copy &amp; paste from&#160; VS Output window)</p>
<p align="justify">and the error in VS Error Window:</p>
<blockquote><p>Error&#160;&#160;&#160; 1&#160;&#160;&#160; fatal error <a href="http://support.microsoft.com/kb/815645">LNK1181</a>: cannot open input file &#8216;.DebugcudaOpenMP.cu.obj&#8217;&#160;&#160;&#160; cudaOpenMP&#160;&#160;&#160; cudaOpenMP</p>
</blockquote>
<p align="justify">The error enlisted in VS Error window is connected with linker (it is unable to find input file) so the <em>real</em> problem lies somewhere else: at the compile time. I have copied the command line that invokes nVidia’s compiler (because no other compiler is aware of all the extension nVidia created for the purpose of creating CUDA). The command line was:</p>
<blockquote><p align="justify">&quot;C:Program FilesnVidiaCUDAbinnvcc.exe&quot;&#160;&#160; -arch sm_10 -ccbin &quot;C:Program FilesMicrosoft Visual Studio 9.0VCbin&quot;&#160;&#160;&#160; -Xcompiler &quot;/EHsc /W3 /nologo /Od /Zi&#160;&#160; /MTd&#160; &quot; -IC:Program FilesnVidiaCUDAinclude -I../../common/inc -maxrregcount=32&#160; &#8211;compile -o DebugcudaOpenMP.cu.obj cudaOpenMP.cu</p>
</blockquote>
<p align="justify">Do you see the problem? Well, I didn’t see what’s wrong at the first sight too ;) Anyway, to cut it short: the problem lies in the path where nVidia CUDA SDK is installed. I have chosen to install it in “Program FilesnVidia” and not in the root directory (this is the default location – as far as I can remember). The thing is that Program Files without quotes is treated&#8230; yup, you guessed ;) everyone familiar with the way command lines arguments are being passed to programs knows that space IS a delimiter. OK. What is the solution? Very, very simple, you need to change a bit the “CUDA Build Rule”, and to change it, you need to do the following:</p>
<ol>
<li>
<div align="justify">Open your VS and open any project / solution from nVidia CUDA samples</div>
</li>
<li>
<div align="justify">Right-click on project (not on solution) and click on “Custom Build Rules”, you should see a dialog:       <br /><a href="http://notonlyzeroesandones.site40.net/wp-content/uploads/2009/02/image.png"><img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="412" alt="image" src="http://notonlyzeroesandones.site40.net/wp-content/uploads/2009/02/image-thumb.png" width="644" border="0" /></a> </div>
</li>
<li>
<div align="justify">Choose “Cuda Build Rule v2.1.0” and click on “Modify Rule File&#8230;” button, another window will pop-up:       <br /> <a href="http://notonlyzeroesandones.site40.net/wp-content/uploads/2009/02/image1.png"><img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="456" alt="image" src="http://notonlyzeroesandones.site40.net/wp-content/uploads/2009/02/image-thumb1.png" width="644" border="0" /></a> </div>
</li>
<li>
<div align="justify">Click on “Cuda Build Rule” and then on “Modify Build Rule&#8230;”       <br />&#160;<a href="http://notonlyzeroesandones.site40.net/wp-content/uploads/2009/02/image2.png"><img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="576" alt="image" src="http://notonlyzeroesandones.site40.net/wp-content/uploads/2009/02/image-thumb2.png" width="605" border="0" /></a> </div>
</li>
<li>
<div align="justify">And finally this is the window you need to make changes in. The “Include” property (highlighted) need to be modified (simply: put [value] into quotes, so the switch for Include will look like: –I”[value]”. Now your project should compile without any errors or warnings (I assume that you’re compiling one of the nVidia CUDA samples).</div>
</li>
<li>
<div align="justify">Remember that you may have to add (register) .cu files in VS environment, but it is clearly described in readme.txt located in /doc/syntax_highlighting in your CUDA SDK directory.</div>
</li>
</ol>
<p align="justify">The same kind of problem you may have after installing Python and some python IDEs that modify environment and add PYTHONPATH. If you install Python in “Program Files” the same thing happens. The solution is to edit your PYTHONPATH variable and change it, instead of “Program Files” you may type “Progra~1” (check what is yours “Program Files” directory 8+3 name using “dir /X” command). </p>
<p align="justify">Hope it helps. Happy coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://notonlyzeroesandones.site40.net/2009/02/15/vs-2008-cuda/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- www.000webhost.com Analytics Code -->
<script type="text/javascript" src="http://analytics.hosting24.com/count.php"></script>
<noscript><a href="http://www.hosting24.com/"><img src="http://analytics.hosting24.com/count.php" alt="web hosting" /></a></noscript>
<!-- End Of Code -->
