Problem with nvmex on Matlab 7.4 2007a cannot link to .so or execute script

hi, I am having a hard time trying to get CUDA to work on Matlab 7.4 2007a.

On Linux it returned error saying that it cannot link with the lcudart.so lib, but I setup the all the path, and included -I and -L and everything, but it just wouldn’t link, because it cannot find the file or directory.

unix(‘make’);
/usr/local/matlab/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
fft2_cuda.o: In function mexFunction': fft2_cuda.c:(.text+0x8d8): undefined reference to cudaMalloc’
fft2_cuda.c:(.text+0x8f6): undefined reference to cudaMemcpy' fft2_cuda.c:(.text+0x95e): undefined reference to cudaMemcpy’
fft2_cuda.c:(.text+0x9c4): undefined reference to `cudaFree’
collect2: ld returned 1 exit status

mex: link of 'fft2_cuda.mexglx' failed.

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

I have a feeling that something in Matlab is not set right.
I also noticed that it’s only been tested with matlab 2006b and 2007b, does that mean 2007a wouldn’t work?

Any help would appreciated, thanks!

Finally got it working, just had to add -lcudart after -lcufft in makefile and had to address some path in the make file that is it.

You may also have to use “-lcuda” or “-lcudart”, in addition to “-lcufft”.

-jm