Main Content

Understand themclmcrrtProxy Layer

All application and software components generated byMATLAB®Compiler™andMATLAB Compiler SDK™need to link against only one MATLAB library,mclmcrrt. This library provides a proxy API for all the public functions in MATLAB libraries used for matrix operations, MAT-file access, utility and memory management, and applicationMATLAB Runtime. Themclmcrrtlibrary lies between deployed MATLAB code and these other version-dependent libraries, providing the following functionality:

  • Ensures that multiple versions of theMATLAB Runtimecan coexist

  • Provides a layer of indirection

  • Ensures applications are thread-safe

  • Loads the dependent (re-exported) libraries dynamically

The relationship betweenmclmcrrtand other MATLAB libraries is shown in the following figure.

The MCLMCRRT Proxy Layer

In the figure, solid arrows designate static linking and dotted arrows designate dynamic linking. The figure illustrates how themclmcrrtlibrary layer sits above themclmcrandmcrlibraries. Themclmcrlibrary contains the run-time functionality of the deployed MATLAB code. Themcrmodule ensures each bundle of deployed MATLAB code runs in its own context at run time. Themclmcrrtproxy layer, in addition to loading themclmcr, also dynamically loads theMXandMATmodules, primarily formxArraymanipulation. For more information, see the MathWorks®Support database和搜索信息rmation on theMSVCshared library.

Caution

Deployed applications must only link to themclmcrrtproxy layer library (mclmcrrt.libon Windows®,mclmcrrt.soon Linux®, andmclmcrrt.dylibonMacintosh). Do not link to the other libraries shown in the figure, such asmclmcr,libmx, and so on.