title: Compiling Basic C-Language CUDA code in Linux (Ubuntu)
body: <p>I've spent a lot of time setting up the CUDA toolchain on a machine running Ubuntu Linux (11.04).  The rig has two NVIDIA Tesla GPUs, and I'm able to compile and run test programs from the NVIDIA GPU Computing SDK such as deviceQuery, deviceQueryDrv, and bandwidthTest.</p>
  
  <p>My problems arise when I try to compile basic sample programs from books and online sources.  I know you're supposed to compile with NVCC, but I get compile errors whenever I use it.  Basically any sort of include statement involving CUDA libraries gives a missing file/library error.  An example would be:</p>
  
  <pre><code>#include &lt;cutil.h&gt;
  </code></pre>
  
  <p>Do I need some sort of makefile to direct the compiler to these libraries or are there additional flags I need to set when compiling with NVCC?</p>
  
  <p>I followed these guides:</p>
  
  <p><a href="http://hdfpga.blogspot.com/2011/05/install-cuda-40-on-ubuntu-1104.html" rel="nofollow">http://hdfpga.blogspot.com/2011/05/install-cuda-40-on-ubuntu-1104.html</a>   <a href="http://developer.download.nvidia.com/compute/DevZone/docs/html/C/doc/CUDA_C_Getting_Started_Linux.pdf" rel="nofollow">http://developer.download.nvidia.com/compute/DevZone/docs/html/C/doc/CUDA_C_Getting_Started_Linux.pdf</a></p>