Hi everyone, I’m just starting to learn CUDA with MATLAB and this example program I found in a book (appears) to compile correctly after entering:
!nvcc -c AddVectors.cu -Xcompiler -fPIC -I /Applications/MATLAB_R2013a.app/extern/include/
mex AddVectorsCuda.cpp AddVectors.o -lcudart -lcufft -L /usr/local/cuda/lib
However when I try and actually run the program I get the message:
Invalid MEX-file ‘/blah…/AddVectorsCuda.mexmaci64’:
dlopen(/blah…/AddVectorsCuda.mexmaci64, 6): Library not
loaded: @rpath/libcudart.6.0.dylib
Referenced from: /blah…/AddVectorsCuda.mexmaci64
Reason: image not found
I’ve got
DYLD_LIBRARY_PATH=/usr/local/cuda/lib:/Developer/NVIDIA/CUDA-6.0/lib: and PATH=/Library/Frameworks/Python.framework/Versions/3.3/bin:/usr/local/cuda/bin:/Developer/NVIDIA/CUDA-6.0/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/texbin
all set up in .bash_profile, and “libcudart.6.0.dylib” definitely exists in the expected location, but is MATLAB still not knowing where to look for certain libraries?