Thread Subject: Need help with the mcc function

Subject: Need help with the mcc function

From: Rajesh Rajaram

Date: 7 Dec, 2007 20:04:17

Message: 1 of 10

Hi
I am trying to create a .exe file which I can give it to
others to use.

I made one using "mcc -m", but the exe file didn't run in
another computer.

Kindly help

Rajesh

Subject: Need help with the mcc function

From: Bruno Luong

Date: 7 Dec, 2007 20:10:21

Message: 2 of 10

Deployment application, see overview here:

http://www.mathworks.com/access/helpdesk/help/toolbox/compiler/index.html?/access/helpdesk/help/toolbox/compiler/f12-1000291.html&http://www.mathworks.com/support/solutions/data/1-PK18D.html

Bruno

Subject: Need help with the mcc function

From: Bruno Luong

Date: 7 Dec, 2007 20:18:23

Message: 3 of 10

Sorry, please see this link instead
http://www.mathworks.com/access/helpdesk/help/toolbox/compiler/bqskg8v-1.html

Subject: Need help with the mcc function

From: Rajesh Rajaram

Date: 7 Dec, 2007 20:41:42

Message: 4 of 10

Mr. Luong
I really appreciate your help. While this will solve my
problem I was hoping there would be a solution where I
could just give somebody a .exe file and they can run it
irrespective of what is already installed in those
computers. There are people in here who would be wary of
installing something in their computer.

Please let me know if there are any other solutions.

Once again thank you very much for your help.

Rajesh

Subject: Need help with the mcc function

From: Bruno Luong

Date: 7 Dec, 2007 21:18:31

Message: 5 of 10

"Rajesh Rajaram" <ae96010@yahoo.co.uk> wrote in message
<fjcb66$lg3$1@fred.mathworks.com>...
>
> Please let me know if there are any other solutions.
>

Unfortunately no. That's the way the MATLAB compiler works,
and there is no way to get around it.

Bruno

Subject: Need help with the mcc function

From: Rajesh Rajaram

Date: 7 Dec, 2007 21:44:39

Message: 6 of 10


> Unfortunately no. That's the way the MATLAB compiler
> works, and there is no way to get around it.

Mr. Bruno
Thank you for your time. I really appreciate your help.

Since mcc outputs a .c file also, I was wondering if I
could compile it with another c compiler and create an
executable. Although I dont want to write in a different
language, I am open to using a different compiler.

Thanks again

Rajesh

Subject: Need help with the mcc function

From: Bruno Luong

Date: 7 Dec, 2007 22:03:57

Message: 7 of 10

"Rajesh Rajaram" <ae96010@yahoo.co.uk> wrote in message
<fjces7$i47$1@fred.mathworks.com>...
>
> Since mcc outputs a .c file also, I was wondering if I
> could compile it with another c compiler and create an
> executable.

It's not possible, because the way how MATLAB RUNs the
program at Runtime.

MATLAB does not really compile the program in binary machine
instructions (as the word "compile" would suggest). What it
does is it encrypts your *.m files and archive them in the
corresponding *.ctf files. There is very little of things
the exe file really does: it expands the *ctf files into
individual *.m files, then it calls the Matlab Component
Runtime (MCR) in order to runs it. The conclusion is the MCR
is strictly required to be installed on the deployed machine.

Bruno

Subject: Need help with the mcc function

From: Bruno Luong

Date: 7 Dec, 2007 22:03:57

Message: 8 of 10

"Rajesh Rajaram" <ae96010@yahoo.co.uk> wrote in message
<fjces7$i47$1@fred.mathworks.com>...
>
> Since mcc outputs a .c file also, I was wondering if I
> could compile it with another c compiler and create an
> executable.

It's not possible, because the way how MATLAB RUNs the
program at Runtime.

MATLAB does not really compile the program in binary machine
instructions (as the word "compile" would suggest). What it
does is it encrypts your *.m files and archive them in the
corresponding *.ctf files. There is very little of things
the exe file really does: it expands the *ctf files into
individual *.m files, then it calls the Matlab Component
Runtime (MCR) in order to runs it. The conclusion is the MCR
is strictly required to be installed on the deployed machine.

Bruno

Subject: Need help with the mcc function

From: Rajesh Rajaram

Date: 10 Dec, 2007 18:18:03

Message: 9 of 10

> MATLAB does not really compile the program in binary
> machine instructions (as the word "compile" would
> suggest). What it does is it encrypts your *.m files and
> archive them in the corresponding *.ctf files. There is
> very little of things the exe file really does: it
> expands the *ctf files into individual *.m files, then
> it calls the Matlab Component Runtime (MCR) in order to
> runs it. The conclusion is the MCR is strictly required
> to be installed on the deployed machine.

Mr Bruno
I really appreciate your time and effort in helping me
out. Your answers have always addressed my concern/querry.

So my understanding regarding the exe file creation so far:
1. the exe files created by mcc - m option requires an
MCRInstaller.exe to be run in the computer where my exe
files will be run
2. I am presuming the c file it generates while using the
mcc -mc option cannot be compiled into a binary format exe
file using another c-compiler

Am I right so far?

Further, the MCRInstaller.exe found in
MATLAB\R2007a\toolbox\compiler\deploy\win32 is 150MB in
size!! Am I looking at the right location? because I felt
the filesize was rather big for me to ask everybody in my
company to install in their computers.

If it is true then it will be very difficult for me to
send my exe file as a .zip package along with the
MCRInstaller.

Thank you very much for your time and effort.

Rajesh

Subject: Need help with the mcc function

From: Bruno Luong

Date: 10 Dec, 2007 18:40:32

Message: 10 of 10

"Rajesh Rajaram" <ae96010@yahoo.co.uk> wrote in message
<fjjvsr$6of$1@fred.mathworks.com>...

> So my understanding regarding the exe file creation so far:
> 1. the exe files created by mcc - m option requires an
> MCRInstaller.exe to be run in the computer where my exe
> files will be run
> 2. I am presuming the c file it generates while using the
> mcc -mc option cannot be compiled into a binary format exe
> file using another c-compiler
>
> Am I right so far?


YES.

>
> Further, the MCRInstaller.exe found in
> MATLAB\R2007a\toolbox\compiler\deploy\win32 is 150MB in
> size!! Am I looking at the right location? because I felt
> the filesize was rather big for me to ask everybody in my
> company to install in their computers.

Correct.

>
> If it is true then it will be very difficult for me to
> send my exe file as a .zip package along with the
> MCRInstaller.
>

Not so difficult to me, but nobody has the same kind of
problem. There are few more precautions in deployment
application such as Windows .NET framework, and Java. But
I'll not detailed about them.

Bruno

Tags for this Thread

Everyone's Tags:

mcc, exe

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
mcc Rajesh Rajaram 7 Dec, 2007 15:05:03
exe Rajesh Rajaram 7 Dec, 2007 15:05:03
rssFeed for this Thread

Public Submission Policy

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.

Contact us at files@mathworks.com