title: Matlab mex setup on Mac OS X
body: <p>I'm trying to setup mex with Matlab R2013a on my Mac. The following are the compilers I have on the machine (through Xcode I believe). How can I update the compiler and configure the mex setup?</p>
  
  <pre><code>fadama:[~]$ gcc --version
  Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-   include-dir=/usr/include/c++/4.2.1
  Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
  Target: x86_64-apple-darwin12.5.0
  Thread model: posix
  fadama:[~]$ llvm-gcc --version
  i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
  Copyright (C) 2007 Free Software Foundation, Inc.
  This is free software; see the source for copying conditions.  There is NO
  warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  </code></pre>
  
  <p>I was able to finally setup the mex.</p>
  
  <p>When I try compiling the sample code from "Accelerating Matlab with GPUs. A Primer with Examples", I get the following errors:</p>
  
  <pre><code>&gt;&gt; system('nvcc -c AddVectors.cu')
  clang: error: unsupported option '-dumpspecs'
  clang: error: no input files
  
  ans =
  
       1
  </code></pre>
  
  <p>Please help. I'm on a Mac with updated Xcode.</p>
  
  <p>Thank you in advance.</p>