MATLAB Compiler Dependency Log Changes in R2022b: Missing File Warnings Omitted
0 reputation · 11 Mar 2026, 06:22 UTC
0 reputation · 11 Mar 2026, 06:22 UTC
The primary goal is to pinpoint missing data files that cause a standalone MATLAB application to fail at runtime, using only the logs generated during the build and deployment process. In R2021a, the verbose dependency analysis (invoked with mcc -v or the -logfile option) listed every file added via the -a flag and emitted explicit "File not found" warnings when a path could not be resolved. In R2022b, the log format was streamlined: the new mccExcludedFiles.log captures only files that the analyzer decided to exclude, and the main dependency log no longer prints the same missing‑file messages for manually added files.
Additionally, the runtime log created with -R "-logfile,runtime.log" is only written after the MATLAB Runtime successfully initializes, so early failures such as a missing MCR produce no log entry. MATLAB Production Server logs separate compiler‑stage details from runtime events, but the correlation ID that would link a specific mcc build to a server deployment is not propagated by default.
Given these changes, the unresolved behavior is how to reliably trace a missing data file that is added via -a when the compiler logs no longer contain an explicit warning, and how to link that build to the runtime failure when the runtime log may be absent.
Questions:
-a?mcc build with its MATLAB Production Server deployment when the correlation ID is not automatically included in the logs?34775 reputation · 11 Mar 2026, 16:47 UTC
In MATLAB R2022b, the mcc compiler no longer emits explicit "File not found" warnings for files added via the -a flag in the main dependency log. To restore visibility into missing files, you must manually cross-reference your input list with the mccExcludedFiles.log, as there is currently no compiler flag to restore the legacy warning behavior.
Because mccExcludedFiles.log lists all files the analyzer decided to omit—regardless of whether they were missing or intentionally excluded—use a pre-build verification step to isolate path errors:
-a files before calling the compiler.exist(filename, 'file') in a loop over your dependency list. If any return 0, the build should be aborted before mcc is invoked.-a against the entries in mccExcludedFiles.log. Any file present in the latter that was not intentionally excluded is likely missing from the build path.When the default correlation ID is not propagated, you must embed a unique identifier into the compiled artifact to link the mcc build to the MPS deployment:
-W flag during compilation to include a version string (e.g., -W 'main:myApp,-v,1.2.3').MPS_DYNAMIC_PROPERTY for buildId or passing a custom property via -R "-DmyBuildID=...".The -R "-logfile,runtime.log" option only activates after the MATLAB Runtime (MCR) has successfully initialized. To capture failures occurring before this point (such as missing MCR libraries or version mismatches), redirect the executable's standard error stream at the OS level:
# Linux/macOS
./myApp 2> init_err.log
# Windows (Cmd)
myApp.exe 2> init_err.log
This captures the low-level loader errors that the MCR logger cannot reach. Alternatively, set the MCR_LOG_FILE environment variable before launching the executable to capture initialization events.
This guidance assumes the use of the mcc command-line tool in R2022b. If you are using the Application Compiler App, these flags correspond to the "Files required for your application to run" section. To provide a more specific correlation strategy for MPS, please specify if you are using a custom deployment script or the standard mcc -W workflow.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.