Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
mcc runs in the backgroud

Subject: mcc runs in the backgroud

From: Igor

Date: 31 Oct, 2012 23:40:08

Message: 1 of 8

If I call

deploytool('-build','myproject.prj');

from an m-file, mcc.exe is started in the background and matlab won't wait for it, before continuing to the next statements.

As i can see from http://www.mathworks.co.uk/help/compiler/deploytool.html , this behavior is undocumented...

Should it be like this, or this is a bug?

How do I avoid this behavior and wait till it's done?
How do I get compilation result (OK or failed) for further processing within my script?

For now, the best solution I know about is something like this: http://www.mathworks.co.uk/support/solutions/en/data/1-AY3C0L/index.html?product=ML&solution=1-AY3C0L
to wait till mcc is done.

And just to check, if file was modified to determine compilation result.

Subject: mcc runs in the backgroud

From: Bruno Luong

Date: 1 Nov, 2012 06:21:08

Message: 2 of 8

Can you just call MCC directly?

Bruno

Subject: mcc runs in the backgroud

From: Igor

Date: 1 Nov, 2012 15:18:08

Message: 3 of 8

"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <k6t4ck$2a6$1@newscl01ah.mathworks.com>...
> Can you just call MCC directly?
>
> Bruno

Hi Bruno,
Thanks for your answer!

Do you mean by system(...)?
But in this case I should form mcc command line myself, shouldn't I?
Is there a function to automatically create mcc command from prj file?

Also, one more question about the approach I use:
Isn't there any further steps after mcc.exe is done, like link.exe or something?
Matlab also a copies resulting exe from ".\src" to ".\distrib"...
So, it might be not enough to wait for mcc.exe to terminate, isn't it?
Is there any final trigger I should wait for?

For now, I just wait another 10 seconds after mcc.exe is complete....

Subject: mcc runs in the backgroud

From: Bruno Luong

Date: 1 Nov, 2012 16:58:10

Message: 4 of 8

"Igor" wrote in message <k6u3rg$mpq$1@newscl01ah.mathworks.com>...
> "Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <k6t4ck$2a6$1@newscl01ah.mathworks.com>...
> > Can you just call MCC directly?
> >
> > Bruno
>
> Hi Bruno,
> Thanks for your answer!
>
> Do you mean by system(...)?

No I meant using the MCC command under MATLAB.

Bruno

Subject: mcc runs in the backgroud

From: Igor

Date: 1 Nov, 2012 22:30:09

Message: 5 of 8

Well, that pretty similar... It still has nothing to do with .prj files ...
So, the questions remain the same....

Subject: mcc runs in the backgroud

From: Bruno Luong

Date: 2 Nov, 2012 06:00:09

Message: 6 of 8

"Igor" wrote in message <k6ut5h$23r$1@newscl01ah.mathworks.com>...
> Well, that pretty similar... It still has nothing to do with .prj files ...
> So, the questions remain the same....

On my MATLAB when I invoke "mcc -m ...", it's a blocking command, meaning when it's done the exe is built, it does not return right the way and it does not do the work in the background.

I don't know what is those .prj file. I don't use those.

Bruno

Subject: mcc runs in the backgroud

From: Yair Altman

Date: 2 Nov, 2012 09:42:08

Message: 7 of 8

"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <k6vnh9$q8r$1@newscl01ah.mathworks.com>...
> "Igor" wrote in message <k6ut5h$23r$1@newscl01ah.mathworks.com>...
> > Well, that pretty similar... It still has nothing to do with .prj files ...
> > So, the questions remain the same....
>
> On my MATLAB when I invoke "mcc -m ...", it's a blocking command, meaning when it's done the exe is built, it does not return right the way and it does not do the work in the background.
>
> I don't know what is those .prj file. I don't use those.
>
> Bruno

Igor - in your deploytool, the log window lists the Matlab commands that it is using (the main one being mcc). Simply copy these commands to a new text file (e.g., myCompile.m) and then run this file from the Matlab command window. It should block as requested until the script is done.

Yair Altman
http://UndocumentedMatlab.com
 

Subject: mcc runs in the backgroud

From: Igor

Date: 3 Nov, 2012 15:05:08

Message: 8 of 8

"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <k6vnh9$q8r$1@newscl01ah.mathworks.com>...
>
> On my MATLAB when I invoke "mcc -m ...", it's a blocking command, meaning when it's done the exe is built, it does not return right the way and it does not do the work in the background.
>
> I don't know what is those .prj file. I don't use those.
>
> Bruno

mcc is a blocking command, yep....

There's a deploytool command, see http://www.mathworks.co.uk/help/compiler/deploytool.html . On the whole - it's just a GUI for mcc.

I just prefer to drag&drop required files to a build project, and save them as a prj, rather then create a "buildfile" myself...

"Yair Altman" wrote in message <k704hg$8j9$1@newscl01ah.mathworks.com>...
> Igor - in your deploytool, the log window lists the Matlab commands that it is using (the main one being mcc). Simply copy these commands to a new text file (e.g., myCompile.m) and then run this file from the Matlab command window. It should block as requested until the script is done.


Hi, Yair. Thanks for your suggestion. Yep, just copy-pasting command line to my own buildfile might be an easiest workaround... Still just a workaround, though...

On the first place, I'm trying to understand, whether "deploytool -build" behaviour is normal, or is it a bug...

Tags for this Thread

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.

Contact us