Errors Compiling GPU Computing SDK examples

I have been trying to install the CUDA SDK and related components under Ubuntu 10.10 following the examples on the nVidia website in the following PDF

Everything went well up until the point where I had to compile the GPU Computing SDK examples using the following:

cd ~/NVIDIA_GPU_Computing_SDK/C

This resulted in an compile error of :

/usr/bin/ld: cannot find -lGL
/usr/bin/ld: cannot find -lGLU
/usr/bin/ld: cannot find -lXmu
/usr/bin/ld: cannot find -lglut
collect2: ld returned 1 exit status
make[1]: *** [../../bin/linux/release/randomFog] Error 1
make[1]: Leaving directory `/home/msturge/NVIDIA_GPU_Computing_SDK/C/src/randomFog'
make: *** [src/randomFog/Makefile.ph_build] Error 2

It seems that during the install several simplinks were not created correctly, if you look in /usr/lib you will see that,, and do not exist.

But if you look closer there will be files similar to them such as,, and similar files for libXmu and libglut

So all we have to do here to fix the problem is create the simlinks ourselves with the following commands

sudo ln -s /usr/lib/ /usr/lib/
sudo ln -s /usr/lib/ /usr/lib/

So that takes care of our libGLU and libXmu problems, now to solve the libglut issues. If you cannot find any entries for libglut in your /usr/lib folder than install it using:

sudo apt-get install glutg3-dev

And finally the most troublesome of the broken libraries in my case I found that this file was in fact created but it was linked to a file path that did not exist, so lets remove the broken value and create a new one.

sudo rm /usr/lib/

sudo ln -s /usr/lib/ /usr/lib/

And that should do it, the SDK Examples should not compile without issue.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>