<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 11/14/2015 04:07 PM, Joshua Judson
      Rosen wrote:<br>
    </div>
    <blockquote cite="mid:5647A290.4010601@hackerposse.com" type="cite">
      <pre wrap="">Bruce Labitt <a class="moz-txt-link-rfc2396E" href="mailto:bruce.labitt@myfairpoint.net">&lt;bruce.labitt@myfairpoint.net&gt;</a> wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">
Pardon my denseness (density?), but what you have shown is still 
confusing to me.

ln -s thing-I-want-a-symlink-to where-I-want-to-put-it  &lt;-- I don't 
understand this :(

In my case, I want any reference to cc to point to 
/opt/compiler_cuda/gcc.  It turns out /opt/compiler_cuda/gcc will be a 
symlink as well.  Eventually the cc reference will end up pointing to 
gcc-4.9, since CUDA7.5 does not support gcc5.

Is it
1)  ln -s cc /opt/compiler_cuda/gcc      or
2)  ln -s /opt/compiler_cuda/gcc cc

Which one does what I want?  Seriously confused.
</pre>
      </blockquote>
      <pre wrap="">
I suspect you don't quite want either of those, actually.

It sounds a little like you're expecting "ln -s" to create a shell
command-alias or something (you never said *what directory* you want
to contain the "cc" symlink, but that's important!). It just creates a file.
In order for that file to be recognised as a command, you need to put it
in one of the directories that the shell searches ($PATH).

IF you want to used a symlink to create a "cc" command, you probably want
either:

        ln -s /opt/compiler_cuda/gcc /usr/local/bin/cc

... or:

        ln -s /opt/compiler_cuda/gcc ~/bin/cc

... depending on whether you're doing this for a system-wide default
or just for yourself. But I'm surprised that you're trying to do it
this way at all.

I usually just do something more like:

        export CC=/opt/compiler_cuda/gcc

... and then let the makefiles pick up that environment-variable.
Even if your Makefile is using implicit rules, it'll still pick up
and use the ${CC} value from your environment.

Are you actually using a Makefile or something that actually,
*explicitly*, has "cc" hardcoded rather than using "${CC}"?

I'd expect that you don't actually want to make a CUDA compiler
the default compiler for *all software* you build,
which is probably what you'll do by naming it "cc"
and putting it into your search-path....


</pre>
    </blockquote>
    <br>
    Original link:  from
<a class="moz-txt-link-freetext" href="http://askubuntu.com/questions/693145/installing-cuda-7-5-toolkit-on-ubuntu-15-10">http://askubuntu.com/questions/693145/installing-cuda-7-5-toolkit-on-ubuntu-15-10</a><br>
    <p><i>I wanna share my experience on installing CUDA 7.5 (in order
        to use with Theano) on Ubuntu 15.10. </i></p>
    <i>
    </i>
    <ol>
      <li>
        <p><i>I installed Ubuntu 15.10 and the video driver (352.41)
            from the "Additional Drivers" tab;</i></p>
      </li>
      <li>
        <p><i>Installed few dependencies like </i><i><code>nvidia-modprobe</code></i><i>
            (fix permissions problems), and for the samples compiling </i><i><code>freeglut3-dev
              libx11-dev libxmu-dev libxi-dev libglu1-mesa-dev</code></i></p>
      </li>
      <li>
        <p><i>And because it needs GCC 4.9: </i><i><code>sudo apt-get
              install gcc-4.9 g++-4.9</code></i><i>, then made symlinks
            in </i><i><code>/opt/compiler_cuda</code></i><i>(created
            the folder with an arbitrary name of my choice) as follows:</i><i><br>
          </i>
          <i><code>$ ls -la /opt/compiler_cuda/</code></i><i><br>
          </i>
          <i><code>lrwxrwxrwx 1 root root 22 Nov 2 16:14 cc -&gt;
              /opt/compiler_cuda/gcc</code></i><i><br>
          </i>
          <i><code>lrwxrwxrwx 1 root root 16 Nov 2 16:13 g++ -&gt;
              /usr/bin/g++-4.9</code></i><i><br>
          </i>
          <i><code>lrwxrwxrwx 1 root root 16 Nov 2 16:12 gcc -&gt;
              /usr/bin/gcc-4.9</code></i><i><br>
          </i><i>
            Registered </i><i><code>update-alternatives</code></i><i>
            with:</i><i><br>
          </i>
          <i><code>sudo update-alternatives --install /usr/bin/gcc gcc
              /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5</code></i><i><br>
          </i>
          <i><code>sudo update-alternatives --install /usr/bin/gcc gcc
              /usr/bin/gcc-4.9 50 --slave /usr/bin/g++ g++
              /usr/bin/g++-4.9</code></i><i><br>
          </i></p>
      </li>
      <li>
        <p><i>Downloaded "runfile (local)" 15.04 version, from </i><i><a
              href="https://developer.nvidia.com/cuda-downloads"
              rel="nofollow">CUDA 7.5 Downloads</a></i><i>; and
            installed with:</i><i><br>
          </i>
          <i><code>sudo sh cuda_7.5.18_linux.run --silent --toolkit
              --override</code></i><i><br>
          </i>
          <i><code>sudo sh cuda_7.5.18_linux.run --silent --samples
              --override</code></i><i><br>
          </i><i>
            and appended in </i><i><code>.bash_aliases</code></i><i>
            (.bashrc reads it):</i><i><br>
          </i>
          <i><code>export PATH=/usr/local/cuda-7.5/bin:$PATH</code></i><i><br>
          </i>
          <i><code>export
              LD_LIBRARY_PATH=/usr/local/cuda-7.5/lib64:$LD_LIBRARY_PATH</code></i></p>
      </li>
      <li>
        <p><i>Appended </i><i><code>compiler-bindir =
              /opt/compiler_cuda</code></i><i> in </i><i><code>nvcc.profile</code></i><i>,
            so nvcc can use it.</i></p>
      </li>
    </ol>
    <br>
    I'm trying to do step 3.  I have seen similar instructions in the
    past.  I may have done something like this in the past, but, I am
    temporarily suffering from CRS.  I believe this will work, although
    as you have stated, it may not be optimal.  For Wily Ubuntu 15.10,
    the default gcc is 5.2.  Nvidia is stuck at 4.9, hence the update
    alternatives command in step 3.<br>
    <br>
    Is there any reason step 3) won't work?<br>
    <br>
    To make the symlink <code>cc -&gt; /opt/compiler_cuda/gcc, <big>what
        is the command?<br>
        <br>
        Does <b>ln -s  /usr/bin/cc /opt/compiler_cuda/gcc</b>  do what
        the author states above?  Or do I have it backwards?  Let's just
        say this is a dyslexic moment. Please confirm if this makes
        sense, or I should be doing something else.<br>
        <br>
        As far as I know, nvcc has the smarts to use nvcc to compile
        cuda code, and gcc/g++ for everything else.<br>
        <br>
        Best regards<br>
        -Bruce<br>
        <br>
        <br>
      </big></code>
  </body>
</html>