Invalid Matlab Runtime error
Show older comments
I am testing out matlab compiler by trying to install a compiled app on another PC. When I run the app I get a dos style popup with this error message:
MCR:mclmcr:MCLMCR_Invalid_Matlab_Runtime
It appears for less than a second then vanishes. These are the steps I followed:
Compile a dummy app with one line of code. Tick the "Runtime included in package" option. Link to where I have downloaded the appropriate version. Copy the mcr install executable to target PC and run it. This part seems to work fine. I am running R2023a update 3 (9.14.0.2286388) 64-bit (win64). The MCR download version is MATLAB_Runtime_R2023a_Update_3_win64. The target PC is a windows 64 bit ystem.
Then use the mcc command to compile my app. Copy that executable over to the other PC and run it.
Any ideas what the problem is?
Answers (1)
Gyan Vaibhav
on 14 May 2024
0 votes
Hi CM,
As much I can understand from your explanation above is:
- You have a simple matlab script which you make an dummy standalone app, and then install the executable and you are able to run it.
- When you do it using the mcc command you are unable to run it.
So, I tried the similar steps, and the first part worked well for me too. However, with the "mcc" command, when the executable ran, it got stuck for me on the command prompt window, and didn't progress ahead.
So, I tried adding the MATLAB Runtime Path for Deployment and it worked fine. However, as mentioned on the following page, we should not be required to do this in Windows environments, however, it fixes the similar issue.
Please follow the page here: https://www.mathworks.com/help/compiler/mcr-path-settings-for-run-time-deployment.html
Hope this helps.
Thanks
Gyan
6 Comments
CM
on 14 May 2024
Gyan Vaibhav
on 14 May 2024
So, yes I meant to update the environment variable. (You can search in the start menu for environment variables too, to edit those).
For a deployable executable to run you have to install MATLAB Runtime. Applications generated with MATLAB® Compiler™ or MATLAB Compiler SDK™ use the system library path to locate the MATLAB Runtime libraries. The MATLAB Runtime installer for Windows® automatically sets the library path during installation, but on Linux® or macOS you must add the libraries manually. : https://www.mathworks.com/help/compiler/mcr-path-settings-for-run-time-deployment.html
So, this step shouldn't be needed however, I just want you to add and check if that works, if for some reason it didn't update the Path environment variable. Also, many software installations, need such steps, if they are not automated, so this overhead, shouldn't be part of your program, rather MATLAB runtime's.
Thanks
Gyan
CM
on 18 May 2024
Gyan Vaibhav
on 18 May 2024
Edited: Gyan Vaibhav
on 18 May 2024
So, no I don't think so. I also tried both and saw the considerable size difference however, I feel the major part of it is due to the installer and all the files that are required for the installer mainly.
As I told you when I added the path manually, it worked fine for me.
I am currently not sure why it's not adding the path automatically and why it's not working for you even after adding the same.
I would suggest reinstalling the MATLAB runtime, as a last resort. If even that doesn't work out, try reaching out to Mathworks Technical Support.
PS: Avast could be a pain sometimes, if you want you can try disabling it and then generating the executable, and running it, just to be sure.
Thanks,
Gyan
CM
on 19 May 2024
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!