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 http://developer.download.nvidia.com/compute/cuda/3_2_prod/docs/Getting_Started_Linux.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
make

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 libGLU.so, libXmu.so, and libglut.so do not exist.

But if you look closer there will be files similar to them such as, libGLU.so.1, libGLU.so.i.3.070900 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/libGLU.so.1 /usr/lib/libGLU.so
sudo ln -s /usr/lib/libXmu.so.1 /usr/lib/libXmu.so

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 libGL.so 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/libGL.so

sudo ln -s /usr/lib/libGl.so.1 /usr/lib/libGL.so

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>