CUDA and Mex Files , libstdc++ error Error when running szeta example

Hello
I am trying to get CUDA working with MATLAB,
While trying to make the example, the make process seems to carry on albeit not too smoothly,
The FS_2D example also runs before I do the make
However after the make I get an error as below:

??? Invalid MEX-file ‘/home/pmistry/Matlab_Cuda_1.1/Szeta.mexa64’: /usr/local/matlab/bin/glnxa64/…/…/sys/os/glnxa64/libstdc++.so.6: version `CXXABI_1.3.1’ not found (required by /usr/local/cuda/lib/libcudart.so).

Error in ==> FS_2Dturb at 89
d1 = dt*Szeta(zeta,k,nu4);

Do I need to move the directory MATLAB_CUDA_1.1 somewhere else by default?

The file in question is located in Matlab’s Directory

I did a rpm -qa | grep libstdc++

compat-libstdc+±33-3.2.3-61
libstdc+±devel-4.1.2-13.fc6
compat-libstdc+±33-3.2.3-61
compat-libstdc+±296-2.96-138
libstdc+±4.1.2-13.fc6
libstdc+±4.1.2-13.fc6

I dont know much about libstdc++, Am I missing something?

I have dropped the OP of the make command too anyways.

!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
Warning: You are using gcc version “4.1.2”. The earliest gcc version supported
with mex is “3.4.0”. The latest version tested for use with mex is “3.4.5”.
To download a different version of gcc, visit http://gcc.gnu.org
/usr/local/matlab/bin/mex CFLAGS=’-fPIC -D_GNU_SOURCE -pthread -fexceptions’ COPTIMFLAGS=’-O3 -funroll-loops -msse2’ fft2_cuda_sp_dp.c
-I/usr/local/cuda/include -L/usr/local/cuda/lib -lcufft -Wl,-rpath,/usr/local/cuda/lib
Warning: You are using gcc version “4.1.2”. The earliest gcc version supported
with mex is “3.4.0”. The latest version tested for use with mex is “3.4.5”.
To download a different version of gcc, visit http://gcc.gnu.org
/usr/local/matlab/bin/mex CFLAGS=’-fPIC -D_GNU_SOURCE -pthread -fexceptions’ COPTIMFLAGS=’-O3 -funroll-loops -msse2’ ifft2_cuda.c
-I/usr/local/cuda/include -L/usr/local/cuda/lib -lcufft -Wl,-rpath,/usr/local/cuda/lib
Warning: You are using gcc version “4.1.2”. The earliest gcc version supported
with mex is “3.4.0”. The latest version tested for use with mex is “3.4.5”.
To download a different version of gcc, visit http://gcc.gnu.org
./nvmex -f nvopts.sh Szeta.cu -I/usr/local/cuda/include -L/usr/local/cuda/lib -lcufft -Wl,-rpath,/usr/local/cuda/lib

Thank You,

Hi!

This is not a CUDA related problem but a general mex issue under linux. The solution is to move the files libstdc++ and maybe also the c lib away from the matlab subdirectory $MATLAB/sys/os/glnx$ARCH/. In adition matlab messes with the LD_LIBRARY_PATH. Therefore LDPATH_PREFIX=’/usr/lib:’ must be set in the file .matlab7rc.sh in $MATLAB/bin.

Manuel