Does MEX compiler (and the associated shared files) automatically ship with all MATLAB distributions of any license type?

3 views (last 30 days)
When creating a mex file, I see many dependencies on other (MATLAB) shared files buried in it. The question is, if I take this compiled file to another system (of the same architecture) with some random MATLAB license, are all of these dependency files guaranteed to exist in that particular installation of MATLAB? Is there a particular license that would not have mex dependency files?
A King
A King on 28 Dec 2020
Interesting. That's good know. I guess the only way to ensure compatibility is to just use it with different MATLAB versions.

Sign in to comment.

Accepted Answer

James Tursa
James Tursa on 28 Dec 2020
Mex routines are not guaranteed to be compatible between different versions of MATLAB, for the very dependency reasons you already mention. You are probably going to be OK with same MATLAB version on same architecture. But anything other than that will just depend on the particulars and can't be guaranteed. Some mex routines will run fine on several versions of MATLAB. Others will not. And, of course, if the mex routine makes callbacks into MATLAB for specific functions then that would be another source of potential incompatibility.
  1 Comment
A King
A King on 28 Dec 2020
Edited: A King on 28 Dec 2020
James, thank you. Do you know if it possible to staticly links all mex dependencies via the MEX compiler flags? Does matlab also provide the archive versions of their shared libraries? or is dynamic linking the only possiblity?

Sign in to comment.

More Answers (0)


Find more on Write C Functions Callable from MATLAB (MEX Files) in Help Center and File Exchange





Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!