Unable to make nvmex in ubuntu 8.10.

Using Matlab R2009a in Ubuntu 8.10 and cuda SDK/toolkit/driver version 2.2, I’ve been trying to get the cuda supporting version of mex (as downloaded here: http://developer.nvidia.com/object/matlab_cuda.html ) to work. I was originally getting the errors described in this thread: http://forums.nvidia.com/index.php?showtopic=87877 but I followed the instructions there and things improved somewhat. Now I am getting the following error. If anyone can help me resolve this issue I would greatly appreciate it.

[codebox]

/opt/matlab/bin/mex CFLAGS=‘-fPIC -D_GNU_SOURCE -pthread -fexceptions’ COPTIMFLAGS=‘-O3 -funroll-loops -msse2’ fft2_cuda.c \

    -I/usr/local/cuda/include -I/home/patrick/NVIDIA_CUDA_SDK/common/inc -L/usr/local/cuda/lib64 -lcufft -Wl,-rpath,/usr/local/cuda/lib64

Warning: You are using gcc version “4.3.2-1ubuntu12)”. The earliest gcc version supported

     with mex is "4.1".  The latest version tested for use with mex is "4.2".

     To download a different version of gcc, visit <a target='_blank' rel='noopener noreferrer' href='"http://gcc.gnu.org"'>http://gcc.gnu.org</a> 

/usr/bin/ld: cannot find -lcufft

collect2: ld returned 1 exit status

mex: link of ’ “fft2_cuda.mexa64”’ failed.

make: *** [fft2_cuda.mexa64] Error 1

[/codebox]

edit: nevermind, I figured it out. Turns out that lib64 wasn’t really a part of version 2.2, and I was missing -lcudart in one of the lines of the makefile.