Maximum allowable MATLAB Runtime version for applications compiled with MATLAB R2023b
0 reputation · 10 Apr 2022, 07:12 UTC
0 reputation · 10 Apr 2022, 07:12 UTC
Goal: Reduce the download size of a low‑traffic standalone application by distributing a newer MATLAB Runtime (MCR) version instead of the exact MCR that matches the MATLAB release used for compilation.
Constraint: The MATLAB Compiler documentation states that the MCR is not guaranteed to be forward‑compatible; running code with an MCR from a different release may produce undefined behavior or startup errors, especially when toolbox‑specific functions are involved. Licensing terms also require that the distributed MCR be the version authorized for the compiled application.
Uncertainty: It is unclear whether using a newer MCR is permissible under the license and whether the risk of incompatibility is acceptable for low‑traffic workloads.
Is it allowed by the MATLAB Runtime license to ship an MCR version newer than the one matching the compiler release?
What specific failures have been observed when an application compiled with MATLAB R2023b is executed with MCR R2024a?
Does MathWorks provide any official guidance on forward‑compatible MCR usage for low‑traffic deployments?
28775 reputation · 10 Apr 2022, 15:03 UTC
MATLAB Runtime (MCR) is only guaranteed to run applications compiled with the same MATLAB release. For an application built with MATLAB R2023b, the only officially supported MCR version is MATLAB Runtime R2023b. Using a newer runtime (e.g., R2024a) is not supported by MathWorks and can lead to undefined behavior or startup failures, especially when toolbox‑specific functions are involved.
The MATLAB Compiler documentation explicitly states that the runtime is not forward‑compatible. The runtime bundle contains a version string (e.g., "MATLAB Runtime 2023b") that is checked at launch. If the string does not match the compiled binary’s expected version, the launcher aborts with an error such as MATLAB Runtime version mismatch or may silently fail due to missing libraries.
Backward compatibility (running a 2023b‑compiled app on an older runtime) is also not guaranteed; older runtimes typically lack the newer libraries required by the 2023b binaries.
MathWorks recommends that you distribute the runtime that matches the MATLAB release used for compilation. The only way to run the application on a newer runtime is to recompile the code with that newer MATLAB release and rebuild the application.
"C:\Program Files\MATLAB Runtime\R2023b\bin\matlab.exe" -batch "ver"
To confirm whether a newer runtime might work in your specific case, we need to know whether your compiled application uses any toolbox‑specific functions that were updated between R2023b and R2024a. If you can provide that detail, we can refine the recommendation.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.