MATLAB example problems

I have Ubuntu 9.10, 64 bit. gcc compiler 4.2 and Matlab 2009b. I’m trying to compile the matlab 2dFFT example.
When running unix(‘make’), I was getting error:

/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
/usr/bin/ld: cannot find -lcufft

I changed my Makefile to have lib64 and added -lcudart as suggested elsewhere but now I have another error:

/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/lib64 -lcufft -lcudart -Wl,-rpath,/usr/local/cuda/lib64
/usr/bin/ld: cannot find -lstdc++
collect2: ld returned 1 exit status

Also how can you run commands starting with nvcc from inside matlab?

Found answer here

In MATLAB, you can do:

>> !nvcc --version

to run NVCC commands from the command prompt. You need to make sure NVCC is in your path and cuda/lib is in your library path.

Hope this helps!