Mex on macosx without xcode
53 views (last 30 days)
I want to compile mex files without installing xcode, using only Command Line Tools (from apple developer center).
Apple Command Line Tools install the compiler and adds standard libraries and headers to the system in a package much smaller than xcode (which is several GBs).
Running mex on linux is possible - I see no reason why matlab mex should require the huge SDKs for macos. A long evening of trial and error and hacking configuration files hasn't helped. Does anyone have a minimal working example of how to compile a mex file outside matlab, or a simple way to use mex without having xcode installed?
Best Regards, Magnus
Ian on 7 Jan 2022
There is another solution that works with 2021b: https://stackoverflow.com/a/41538477/415013 — I do not have enough space to install XCode and command-line tools can compile mex files so this solution works well! Mathworks should make it easier to use the command-line tools rather than require the massive XCode install...