# MATLAB on MAC OS X

**URL:** <https://forums.developer.nvidia.com/t/matlab-on-mac-os-x/10526>\
**Category:** CUDA Programming and Performance\
**Created:** [July 1, 2009, 1:44am UTC](https://forums.developer.nvidia.com/t/matlab-on-mac-os-x/10526 "2009-07-01T01:44:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shebeck](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@shebeck](https://forums.developer.nvidia.com/u/shebeck)\
**Post date:** [July 1, 2009, 1:44am UTC](https://forums.developer.nvidia.com/t/matlab-on-mac-os-x/10526/1 "2009-07-01T01:44:43Z")

</div>

I installed CUDA 2.2 on my macbook pro. Based on the QuickStart guide, “deviceQuery”, “bandwidthTest”, and “particles” are working fine. Then, I downloaded MATLAB plug-in from the website ( [http://developer.nvidia.com/object/matlab\_cuda.html](http://developer.nvidia.com/object/matlab_cuda.html) ) and it did not work well.  
Specifically, when I ran unix(‘make’), following error appeared.

> > unix(‘make’);  
> > ./nvmex -f nvopts.sh Szeta.cu -I/usr/local/cuda/include -L/usr/local/cuda/lib -lcufft -Wl,-rpath,/usr/local/cuda/lib  
> > ./nvmex: line 931: nvcc: command not found

mex: compile of ‘Szeta.cu’ failed.

I tried adding -lcuda and -lcudart as well, but it didn’t work. How can I solve this problem?

p.s. I added path properly, and ‘nvcc -V’ in a terminal also worked.

---

<div class="post-metadata">

**Author:** ![justbeu](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@justbeu](https://forums.developer.nvidia.com/u/justbeu)\
**Post date:** [July 15, 2009, 1:17pm UTC](https://forums.developer.nvidia.com/t/matlab-on-mac-os-x/10526/2 "2009-07-15T13:17:59Z")

</div>

As i come up with the same question and i solved it in this way:  
in your nvopts.sh file rewrite the  
RPATH=“-Wl,-rpath-link,$TMW\_ROOT/bin/$Arch”  
CC=‘nvcc’  
CFLAGS=‘-O3 -Xcompiler “-fPIC -D\_GNU\_SOURCE -pthread -fexceptions -m32”’  
CLIBS=“$RPATH $MLIBS -lm -lstdc++”  
COPTIMFLAGS=‘-Xcompiler “-O3 -funroll-loops -msse2 -DNDEBUG”’  
CDEBUGFLAGS=‘-g’  
to  
RPATH=“-Wl,-rpath-link,$TMW\_ROOT/bin/$Arch”  
CC=‘/usr/local/cuda/bin/nvcc’  
CFLAGS=‘-O3 -Xcompiler “-fPIC -D\_GNU\_SOURCE -pthread -fexceptions -m32”’  
CLIBS=“$RPATH $MLIBS -lm -lstdc++”  
COPTIMFLAGS=‘-Xcompiler “-O3 -funroll-loops -msse2 -DNDEBUG”’  
CDEBUGFLAGS=‘-g’  
then i works well!
