title: PyCUDA failing to include <curand_kernel.h> - error: no extern "C" linkage
body: <p>I'm trying to create a random number from a normal distribution inside a CUDA kernel, using PyCUDA (version 2011,2,2), in Python 2.7.3 on a Tesla C2075 (CUDA 5.0, V0.2.1221). However I am having issues in trying to simply include the curand_kernel.h header. I have created the most simple test case (shown below), but on compilation I receive the error.</p>
  
  <blockquote>
    <p>/usr/local/cuda/bin/../include/curand_kernel.h(568): error: this declaration may not have extern "C" linkage</p>
  </blockquote>
  
  <p>Despite searching around I unfortunately still don't fully understand what the problem is, which has made it hard in trying to resolve it. Any help would be greatly appreciated.</p>
  
  <pre><code>import pycuda.driver as drv
  import pycuda.compiler
  import pycuda.autoinit
  import pycuda.gpuarray as gpuarray
  import pycuda.cumath as cumath
  from pycuda.compiler import SourceModule
  
  gpu_test_source = SourceModule("""
      #include &lt;curand_kernel.h&gt;
  
      __global__ void test_kernel()
      {
          return;
      }
  
  """)
  </code></pre>