Is it possible to run a built exe without MCR?

I used deploytool to create a Windows Standalone Application. Is it possible to create an executable which doesn't depend on the MCR? Do I always have to provide the MCRInstaller, which has to be installed before running my executables created by MATLAB? Or is there an opportunity to bind the installed files in my package to make the exe completely "standalone"?

 Risposta accettata

Kaustubha Govind
Kaustubha Govind il 16 Mag 2011
When using the MATLAB Compiler to compile MATLAB code into a standalone executable, you do need to install the MCR because the generated code calls into these runtime libraries. Also, you can package the MCR together with the executable and have it installed automatically when the executable is run. If you are using deploytool, you simply need to select "Add MCR" and "Embed the MCR in the package" from the Package pane.
Note that MATLAB Coder is the other product that actually allows you to generate truly standalone C/C++ code from MATLAB code (without any need for additional libraries like the MCR). However, it supports only a limited subset of the MATLAB language.

7 Commenti

Hello, it's been a long time, do you know if a newer version of MATLAB allows us to create a .exe file that runs without the MCR?
If not, the MATLAB Coder is a standalone program, right?
I imagine it does not automatically turn your MATLAB code into a .exe that runs withour MCR, to adapt a big code into it would take too much time?
I'm
The situation has not changed. MATLAB Compiler and MATLAB Compiler SDK require MCR. MATLAB Coder does not require MCR but supports less of MATLAB and the toolboxes.
It is common to require some degree of rewriting or annotation when using MATLAB Coder. The amount of effort is difficult to estimate without knowing more about your code.
Hi,
Is it possible to reduce the size of the MCR file when it is embedded into the package, because I am trying to deploy a standalone app which does not require internet connectivity (hence I cannot use the option to install MCR from web) but the final package size is over 900 MB, which is not ideal.
Thanks in advance.
Frédéric Zanella
Frédéric Zanella il 19 Lug 2017
Modificato: Frédéric Zanella il 19 Lug 2017
Hello everybody,
I have actually 2 comments:
1) I've embedded the MCR in the EXE package during the deployment in order to prevent any of the many reported issues with the MCR but my customer has just informed me that he's got the famous "Could not find version 8.1 of the MCR." error message. Weird isn't it? I've just recommended him to manually install both 32-/64-bits versions but I don't have his feedback yet...
2) I have the same interest as Arjun Khurana i.e. reducing the file size. Looking forward to it :)
Thank you in advance for your feedback!
Hallo,
has the Matlab Compiler changed ?
I can't find the boxes to anable
"Add MCR" and "Embed the MCR in the package" from the Package pane.
It would be nice to be able to generate one exacutable file.
Thank you in advance.
Torsten Klement,
Which release are you using?
Are you using the Application Compiler App, deploytool, or some other interface to create your application? If you're using some other interface, give us more details about that interface.
I have to generate the exe shoul work in windows without installing the MCR.Can you please Tell me the way or procedure to generate .exe with inbuild MCR?

Accedi per commentare.

Più risposte (1)

walid merniz
walid merniz il 8 Ago 2011
thanks

6 Commenti

Hi,
I would like to know any *.exe from *.m file can run any other pc without installing Matlab or something if possible.
Thanks and best regards
Kyaw
Please see the second paragraph in my answer regarding MATLAB Coder.
The only way to do that would be to use MATLAB Coder (current product name), which creates C code. The product is expensive and there are quite a number of aspects of MATLAB that cannot be compiled with the product.
MATLAB Compiler generates a .exe but does require installation of MCR (MATLAB Component Runtime) on the target computer. It is possible to build self-extracting installers that will install MCR along with your .exe .
hi I cannot make m file to exe showing mcc error. Could u please tell me how to fix it.
Thank you. kaung
You need the MATLAB Compiler product for mcc .
Note: MATLAB Compiler is only available for the Standard / Professional license, and for the Academic license; it is not available for Student license or Home license.
Use "ver" on the command line or this line of code:
>> hasLicenseForToolbox = license('test', 'Compiler')

Accedi per commentare.

Categorie

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by