as of now, clang doesn't support OMP (not Orthogonal Matching Pursuit, Open Multi-Processing)
in MATLAB 2013a, mex defaults to using XCode & clang to compile mex scripts
I edited /Applications/MATLAB_R2013.a/bin/mexopt.sh
to have the following at the bottom
CC='/opt/local/bin/gcc-mp-4.8'
SDKROOT='/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk'
MACOSX_DEPLOYMENT_TARGET='10.9'
ARCHS='x86_64'
CFLAGS="-fno-common -no-cpp-precomp -arch $ARCHS -isysroot $SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
CFLAGS="$CFLAGS -fexceptions"
CLIBS="$MLIBS"
COPTIMFLAGS='-O2 -DNDEBUG'
CDEBUGFLAGS='-g'
CLIBS="$CLIBS -lstdc++"
CXX='/opt/local/bin/g++-mp-4.8'
CXXFLAGS="-fno-common -fexceptions -arch $ARCHS -isysroot $SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
CXXLIBS="$MLIBS -lstdc++"
CXXOPTIMFLAGS='-O2 -DNDEBUG'
CXXDEBUGFLAGS='-g'
LD="$COMPILER"
LDEXTENSION='.mexa64'
LDFLAGS="-pthread -shared"
LDOPTIMFLAGS='-O'
LDDEBUGFLAGS='-g'
note that CC and CXX refer to versions of gcc I've installed via MacPorts
even if your code doesn't use OMP, using gcc should still work on Mac
at the MATLAB prompt, I then ran
>>> mex -setup
to select this edited file as the compilation options script for my .matlab user profile