MATLAB Runtime Component Cache and Deployable Archive Embedding
Deployable archive data is automatically embedded directly in MATLAB® Compiler™ components by default and extracted to a temporary folder.
Automatic embedding enables usage of MATLAB Runtime Component Cache features through environment variables.
These variables allow you to specify the following:
Define the default location where you want the deployable archive to be automatically extracted
Add diagnostic error printing options that can be used when automatically extracting the deployable, for troubleshooting purposes
Tuning the MATLAB Runtime component cache size for performance reasons.
Use the following environment variables to change these settings.
|MCR_CACHE_ROOT||When set to the location of where you want the deployable archive to be extracted, this
variable overrides the default per-user component cache location. This is true
for embedded ||On macOS, this variable is ignored in MATLAB R2020a and later. The app bundle contains the files necessary for runtime.|
|MCR_CACHE_SIZE||When set, this variable overrides the default component cache size.||The initial limit for this variable is 32M (megabytes). This
may, however, be changed after you have set the variable the first
time. Edit the file |
You can override this automatic embedding and extraction behavior by compiling
-C option. See Overriding Default Behavior for details.
If you run
mcc specifying conflicting wrapper and target types, the
deployable archive will not be embedded into the generated component. For example, if you
mcc -W lib:myLib -T link:exe test.m test.c
test.exewill not have the deployable archive embedded in it, as if you had specified a
-Coption to the command line.
Do not extract the files within the
.ctf file and place them
individually under version control. Since the
.ctf file contains
interdependent MATLAB functions and data, the files within it must be accessed only by accessing
.ctf file. For best results, place the entire
.ctf file under version control.
Overriding Default Behavior
To extract the deployable archive in a manner prior to R2008b, alongside the compiled
COM component, compile using the
You can also implement this override by adding the
-c flag in the
Settings section of the compiler app.
If you are using a
compiler.build function, disable the
You might want to use this option to troubleshoot problems with the deployable archive, for example, as the log and diagnostic messages are much more visible.
For More Information
For more information about the deployable archive, see About the Deployable Archive.