I know this has been on the forums before but I’m growing ever desperate. Im hoping one of you can help me with this problem. I have a .cu file that I can compile perfectly well thanks to the following suggestion by mfatica in this thread by laxxy: http://forums.nvidia.com/index.php?showtopic=153697. Typing
nvcc -c knn.cu -Xcompiler -fPIC -I /Applications/MATLAB_R2009b.app/extern/include/
in the terminal and then
mex knn.o -L/usr/local/cuda/lib/ -lcudart -lcufft -lcuda
in the matlab terminal compiles ‘knn.mexmaci’ successfully. However, running the app only returns “Library not loaded: @rpath/libcudart.dylib”. These lines are returned by printenv (minus uninteresting stuff),
LD_LIBRARY_PATH=/usr/local/cuda/cudaprof/bin:/usr/local/cuda/lib:/usr/lib:/usr/openwin/lib:/usr/dt/lib:/X11.6/lib:/X11.5/lib:/uva/lib:/gnu/lib:/usr/local/cuda/lib:/usr/local/cuda/lib PATH=/usr/local/cuda/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/X11/bin DYLD_LIBRARY_PATH=/usr/local/cuda/lib:/usr/local/cuda/lib:
As you can see, I’ve set the environment variables numerous times. So far, I’ve only come across posts where the problem is solved by setting the environment variables. Is there any other way to work around this?