MATLAB: Does MCC fail to compile the program on Intel Mac using MATLAB Compiler v4.10 (R2009a)

applicationbuilddeployfailurelibraryMATLAB Compilerobjectsharedstandalone

I am trying to compile magicsquare on Intel Mac using the following command
mcc -m magicsquare.m -R -nojvm -v
However, MCC fails with the following output in the MATLAB command window ERROR: Warning: You have specified '-R -nojvm', which may restrict or eliminate MATLAB graphics functionality at runtime. dyld: Library not loaded: libtbb.dylib Referenced from: /home/…./R2009a/ship/unix/dist/bin/maci/libmwservices.dylib Reason: image not found Trace/BPT trap "/home/……./R2009a/ship/unix/dist/bin/maci/mcc" -E "/tmp/09408Zse7xJ_37896" -Y "/home/……../.matlab/R2009a_licenses:/home/…./R2009a/ship/unix/dist/licenses/license.dat:/home/……../R2009a/ship/unix/dist/licenses/trial_0_R2009a.lic": Trace/breakpoint trap ??? Error using ==> mcc Error executing mcc, return status = 133 (0x85).

Best Answer

MCC commands expect the DYLD_LIBRARY_PATH to be set before compiling your program. Verify that the DYLD_LIBRARY_PATH is set to the following on Intel Mac systems:
DYLD_LIBRARY_PATH = $matlabroot/bin/maci:matlabroot/sys/os/maci:/System/Library/Frameworks/JavaVM.framework/JavaVM:/System/Library/Frameworks/JavaVM.framework/Libraries
where $matlabroot is the MATLAB installation directory on your machine and can be found by typing 'matlabroot' at the MATLAB command prompt.
This information is also included in MATLAB Help Documentation here:
<http://www.mathworks.com/help/releases/R2016a/compiler/set-mcr-paths-on-mac-or-linux-with-scripts.html>