Thread Subject: Need a Makefile for compiling engdemo.c

Subject: Need a Makefile for compiling engdemo.c

From: Mohammad Hasan

Date: 7 Nov, 2007 20:44:36

Message: 1 of 3

Hello,

I am intending to use some of the matlab functions in a
C++ program. I tested the engdemo.c program for this purpose
and it compiled and ran ok with the instruction given in
matlab reference manual. It requires to run the following
mex command in the matlab command window:

mex('-f', [matlabroot '/bin/engopts.sh'], mexfilename);


I find it very inconvenient way to compile c/c++ program. I
was wondering, if anybody already have a standard unix
makefile that can compile the engdemo.c program.

Thank you very much.
Hasan

Subject: Need a Makefile for compiling engdemo.c

From: Peter Boettcher

Date: 7 Nov, 2007 21:57:36

Message: 2 of 3

"Mohammad Hasan" <Mohammad.Hasan@mathworks.com> writes:

> Hello,
>
> I am intending to use some of the matlab functions in a
> C++ program. I tested the engdemo.c program for this purpose
> and it compiled and ran ok with the instruction given in
> matlab reference manual. It requires to run the following
> mex command in the matlab command window:
>
> mex('-f', [matlabroot '/bin/engopts.sh'], mexfilename);
>
>
> I find it very inconvenient way to compile c/c++ program. I
> was wondering, if anybody already have a standard unix
> makefile that can compile the engdemo.c program.

You can also call the exact same mex command from the UNIX command
line. Meaning it can be called from a Makefile.

Or, run the mex command line with an additional -n flag to see the
output. Then paste the appropriate CFLAGS and whatnot into your
Makefile.

-Peter

Subject: Need a Makefile for compiling engdemo.c

From: Mohammad Hasan

Date: 7 Nov, 2007 22:58:21

Message: 3 of 3

Peter Boettcher <boettcher@ll.mit.edu> wrote in message
<muy8x59lnvz.fsf@G99-Boettcher.llan.ll.mit.edu>...
> "Mohammad Hasan" <Mohammad.Hasan@mathworks.com> writes:
>
> > Hello,
> >
> > I am intending to use some of the matlab functions in a
> > C++ program. I tested the engdemo.c program for this purpose
> > and it compiled and ran ok with the instruction given in
> > matlab reference manual. It requires to run the following
> > mex command in the matlab command window:
> >
> > mex('-f', [matlabroot '/bin/engopts.sh'], mexfilename);
> >
> >
> > I find it very inconvenient way to compile c/c++ program. I
> > was wondering, if anybody already have a standard unix
> > makefile that can compile the engdemo.c program.
>
> You can also call the exact same mex command from the UNIX
command
> line. Meaning it can be called from a Makefile.
>
> Or, run the mex command line with an additional -n flag to
see the
> output. Then paste the appropriate CFLAGS and whatnot
into your
> Makefile.
>
> -Peter

Thank you, Peter. It worked. I really appreciate it.

Hasan

Tags for this Thread

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.

rssFeed for this Thread

Contact us at files@mathworks.com