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?

 채택된 답변

Titus Edelhofer
Titus Edelhofer 2011년 11월 23일

0 개 추천

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

John Ogren
John Ogren 2011년 11월 23일
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?
John Ogren
John Ogren 2011년 11월 23일
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?
Image Analyst
Image Analyst 2011년 11월 23일
Can you try it with a simpler program, for example one that has only one line that says m=10; ?
Image Analyst
Image Analyst 2011년 11월 23일
Maybe you can try to compile from the deploytool instead of the command line.
John Ogren
John Ogren 2011년 11월 23일
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?
Daniel Shub
Daniel Shub 2011년 11월 23일
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
John Ogren
John Ogren 2011년 11월 23일
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?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by