CUDA & Matlab Problem

I am trying to compile the Matlab CUDA example at
http://developer.nvidia.com/object/matlab_cuda.html

I have only made the following modification to the Makefile:
export MATLAB = /Applications/MATLAB_R2009a.app

Following the readme.txt, I execute unix(‘make’); from Matlab
(started with matlab -nodesktop) and get the following errors below.

Any help would be greatly appreciated.

Christoph

unix(‘make’);
/Applications/MATLAB_R2009a.app/bin/mex CFLAGS=‘-fPIC -D_GNU_SOURCE -pthread -fexceptions’ COPTIMFLAGS=‘-O3 -funroll-loops -msse2’ fft2_cuda.c
-I/usr/local/cuda/include -L/usr/local/cuda/lib -lcufft -Wl,-rpath,/usr/local/cuda/lib
Undefined symbols:
“_cudaMalloc”, referenced from:
_mexFunction in fft2_cuda.o
“_cudaMemcpy”, referenced from:
_mexFunction in fft2_cuda.o
_mexFunction in fft2_cuda.o
“_cudaFree”, referenced from:
_mexFunction in fft2_cuda.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

mex: link of ' "fft2_cuda.mexmaci"' failed.

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

Add -lcudart

That seems to have worked. Many thanks.

Christoph