Problems Compiling Matlab Code into Standalone

Complete Compiling-Newbie here... I have a MATLAB code that I would like to be able to run on computers w/o MATLAB. Unfortunately, using mcc -m Mycode.m doesn't seem to produce a stand alone program... Any ideas or help?

 Risposta accettata

Titus Edelhofer
Titus Edelhofer il 23 Nov 2011
Hi,
some things to check:
  • I guess the compiler is installed, otherwise you would have got an error "unknown function mcc".
  • Has the compiler been set up? Run "mbuild -setup" to be sure.
  • Run "mcc -v -m Mycode". Does it produce warnings/errors that might help diagnose?
Titus

9 Commenti

Hi Titus,
I ran "mbuild -setup" and the result that I it ran fine. It was successful in updating my options file.
I also ran "mcc -v -m Mycode" and I got an error. Before the error MATLAB output: "Compiler version: 4.11 (R2009b)". The error was:
??? Error using ==> mcc
Error executing mcc, return status = 1 (0x1).
As before, I am still in the dark... maybe this helps you!
Thanks again.
John: Is that the complete output that you need? No additional error information?
Kaustubha: What I put in my above comment was the only error that I received... any thoughts?
John, you are in the folder, where Mycode.m is? I.e., "dir Mycode.m" gives a result?
Can you try it with a simpler program, for example one that has only one line that says m=10; ?
Maybe you can try to compile from the deploytool instead of the command line.
So the first issue that I had was Matlab could not compile my code because I already had a version compiled into that directory. When I removed the old version and reran "mcc -m -v Mycode" everything worked fine. I have a code that runs... but how do I get it to run on computers that don't have Matlab? Also, when I run the code, it does not exit the "Matlab Environment"... That is, I have a blinking cursor but I can't type anything in the command line. Anyone know how to get back to the command line?
These are really new questions. You need to install and extract the MCR on the other computers (they need to be running the same OS as the compiled version). The last line of your code needs to be quit, or a little less frustrating
if isdeployed, quit, end
Daniel: I wrote these up as new questions... What I am looking for is a way to run my programs without having to install MCR on other machines. Ideas?

Accedi per commentare.

Più risposte (0)

Categorie

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by