title: Cuda compiler not working with GCC 4.5 +
body: <p>I am new to Cuda, and I am trying to compile this simple <code>test_1.cu</code> file:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  __global__ void kernel(void)
  {
  }
  
  int main (void)
  {
      kernel&lt;&lt;&lt;1,1&gt;&gt;&gt;();
      printf( "Hello, World!\n");
      return 0;
  
  }
  </code></pre>
  
  <p>using this: <code>nvcc test_1.cu</code></p>
  
  <p>The output I get is: </p>
  
  <pre><code>In file included from /usr/local/cuda/bin/../include/cuda_runtime.h:59:0,
                   from &lt;command-line&gt;:0:
  /usr/local/cuda/bin/../include/host_config.h:82:2: error: #error -- unsupported GNU version! gcc 4.5 and up are not supported!
  </code></pre>
  
  <p>my gcc --version:</p>
  
  <pre><code>gcc (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1
  Copyright (C) 2011 Free Software Foundation, Inc.
  This is free software; see the source for copying conditions.  There is NO
  warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  </code></pre>
  
  <p>How can I install a second version of gcc (4.4 -) along with 4.6 without messing everything up?</p>
  
  <p>I found this old topic:</p>
  
  <p><a href="https://stackoverflow.com/questions/6622454/cuda-incompatible-with-my-gcc-version">CUDA incompatible with my gcc version</a></p>
  
  <p>the answer was:</p>
  
  <blockquote>
    <p>gcc 4.5 and 4.6 are not supported with CUDA - code won't compile and
    the rest of the toolchain, including cuda-gdb, won't work properly.
    You cannot use them, and the restriction is non-negotiable.</p>
    
    <p>Your only solution is to install a gcc 4.4 version as a second
    compiler (most distributions will allow that). There is an option to
    nvcc --compiler-bindir which can be used to point to an alternative
    compiler. Create a local directory and the make symbolic links to the
    supported gcc version executables. Pass that local directory to nvcc
    via the --compiler-bindir option, and you should be able to compile
    CUDA code without effecting the rest of your system.</p>
  </blockquote>
  
  <p>But I have no idea how to do it</p>