How to run compiled MATLAB executable without MATLAB installed?
40 views (last 30 days)
Show older comments
I use mcc -m main.m to create an exe file. When I run it on another computer that does not have Matlab installed, I get this error
Could not find version 24.1 of the MATLAB Runtime. Attempting to load mclmcrrt24_1.dll. Please install the correct version of the MATLAB Runtime. Contact your vendor if you do not have an installer for the MATLAB Runtime.
I asked GPT, and it suggested I use mcc -m main.m -R -logfile But it doesn't work.
I have developed an image-processing algorithm using MATLAB and created an interface in C#. However, the MATLAB runtime is quite large, so I’d prefer not to require users to install MATLAB or the MATLAB runtime when I release the interface.
I want the executable file to run on computers that do not have MATLAB or the MATLAB runtime installed. Is there any solution for this? How can I achieve that?
0 Comments
Answers (1)
dpb
on 22 Oct 2024
"....the MATLAB runtime is quite large, so I’d prefer not to require users to install MATLAB or the MATLAB runtime when I release the interface."
Well, "If a frog had wings..." comes to mind.
If you want to run the compiled .exe on other machines, they will have to have the runtime installed whether you would prefer that or not.
It is a sizable download, that is true, and it would agoodthing™ if Mathworks would make the build more intelligent so only the actual pieces the app needs are downloaded instead of the whole thing, but so far that option isn't available.
You can deploy in one of two ways, either bind the runtime in with the executable, increasing its size, or have the runtime download/install the first time the app is installed on the machine. I'd suggest the latter, but it's either, or, your choice, but there is no third choice of "make the app create the runtime code for itself".
4 Comments
dpb
on 23 Oct 2024
Thanks for that update, Walter. For primarily having to deal with an IT group to update anything with the apps I've built for the local college foundation, I've stuck with R2022b in order to not have to update the runtime. If it could be shrunk considerably, that might be worthwhile although it probably doesn't do anything to help with the semmingly interminable startup time of the compiled apps, does it?
Bruno Luong
on 23 Oct 2024
Edited: Bruno Luong
on 23 Oct 2024
I just play a liitle bit with minimal MCR new R2024 feature mentioned by Walter.
In the magicsquare example, the minimal installer is 2.02 Gb vs 7.3 for the full version.
It takes 10s to open exe the first time. So somewhat it helps but not spectacular.
Not sure where the minima MCR is installed. It not appears in Control Panel Programs and Features in Windows system. If someone knows please let me know. NOTE that I install-uninstall the full MCR some time later.
See Also
Categories
Find more on Introduction to Installation and Licensing 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!