How to compile CUDA examples? cannot find GL/glu.h

When I tried to compile CUDA examples under Ubuntu 9.04, it looks like it cannot find GL/glu.h:

make[1]: Entering directory /home/humorstar/NVIDIA_GPU_Computing_SDK/C/common' make[1]: Leaving directory /home/humorstar/NVIDIA_GPU_Computing_SDK/C/common’
make[1]: Entering directory /home/humorstar/NVIDIA_GPU_Computing_SDK/C/common' In file included from ./../common/inc/paramgl.h:24, from src/paramgl.cpp:19: ./../common/inc/GL/glut.h:60:20: error: GL/glu.h: No such file or directory make[1]: *** [obj/release/paramgl.cpp.o] Error 1 make[1]: Leaving directory /home/humorstar/NVIDIA_GPU_Computing_SDK/C/common’
make: *** [lib/libparamgl.so] Error 2
humorstar@C2210-103480:~/NVIDIA_GPU_Computing_SDK/C$ sudo make
make[1]: Entering directory /home/humorstar/NVIDIA_GPU_Computing_SDK/C/common' make[1]: Leaving directory /home/humorstar/NVIDIA_GPU_Computing_SDK/C/common’
make[1]: Entering directory /home/humorstar/NVIDIA_GPU_Computing_SDK/C/common' In file included from ./../common/inc/paramgl.h:24, from src/paramgl.cpp:19: ./../common/inc/GL/glut.h:60:20: error: GL/glu.h: No such file or directory make[1]: *** [obj/release/paramgl.cpp.o] Error 1 make[1]: Leaving directory /home/humorstar/NVIDIA_GPU_Computing_SDK/C/common’
make: *** [lib/libparamgl.so] Error 2

How to fix this problem? Thank you,

sudo apt-get install freeglut-devel, I think

I installed freeglut and all possible mesa packages, this glu problem is solve, but then another problem:

make[1]: Entering directory `/home/humorstar/NVIDIA_GPU_Computing_SDK/C/src/postProcessGL’

/usr/bin/ld: cannot find -lXi

collect2: ld returned 1 exit status

make[1]: *** […/…/bin/linux/release/postProcessGL] Error 1

make[1]: Leaving directory `/home/humorstar/NVIDIA_GPU_Computing_SDK/C/src/postProcessGL’

make: *** [src/postProcessGL/Makefile.ph_build] Error 2

I have no clue what is missing now. At this point, only histogram and SobolQRNG have been compiled. When I tried to run histogram, it says:

./histogram: error while loading shared libraries: libcudart.so.2: cannot open shared object file: No such file or directory

What should I do to make it run?

Thank you.

go on, missing libXi

sudo apt-get install libxi-dev

add the directory containing your libcudart.so.2 file into your LD_LIBRARY_PATH environment variable or

add that directory ( /usr/local/cuda/lib ) to your ldconfig

If you are using 64bit version Ubuntu 9.04 x86_64 and if your cuda install dir is:

/usr/local/cuda

Change the $LD_LIBRARY_PATH /usr/local/cuda/lib

to

/usr/local/cuda/lib64

for example by adding the following to your .bashrc file in your /home directory:

export LD_LIBRARY_PATH=/usr/local/cuda/lib64/:$LD_LIBRARY_PATH

For a convenient PATH setting you can add the following to your .bashrc file:

export PATH=/usr/local/cuda/lbin/:$PATH

After doing that you exit bash, open a new one or you do a:

source ~/.bashrc

thanks for source ~/.bashrc