[17378] in Athena Bugs

home help back first fref pref prev next nref lref last post

Re: your bug report re the Matlab compiler

daemon@ATHENA.MIT.EDU (Alex T Prengel)
Fri Nov 19 17:00:19 1999

Message-Id: <199911192200.RAA15488@dit.mit.edu>
To: Michael Taylor <mtaylor@MIT.EDU>
cc: bugs@MIT.EDU, alexp@MIT.EDU
In-reply-to: "[17376] in bugs"
In-Reply-To: Your message of "Fri, 19 Nov 1999 13:38:30 EST."
             <199911191838.NAA17804@schooner.mit.edu> 
Date: Fri, 19 Nov 1999 17:00:09 -0500
From: Alex T Prengel <alexp@MIT.EDU>


>Actually, I don't care if the application is stand-alone.  I just want to
>compile my MATLAB code into C so that it will run faster.  Can this be done on
>Athena?

Michael, the terminology is confusing. The quick answer is "no, you can't,
in the sense I think you want".

The longer answer: the Matlab compiler works in two modes- in the
first, it generates C (or C++) code (intended to build stand-alone
applications that run fast) which makes calls to the Matlab Library.
If this mode is used, the link step will try to link against the
Matlab library and will fail because we don't have the library. By
using suitable compiler switches, you may be able to make it generate
the initial C/C++ code. But you won't be able to compile it into anything
useful, because you will get unresolved calls to the Matlab library
not licensed on Athena (mbuild essentially does this and is missing on
Athena because we can't do this).

In the other mode, it generates what are called "C Mex files" which can be
compiled on Athena, into what are called "Mex files", which are binaries which
can only be run within the Matlab environment. These will run significantly 
faster under some circumstances, depending on the type of computation. This
is the only way we can use the Matlab compiler on Athena as it is currently
configured. 

As for the stand-alone case, the compiler can be made to either
generate this C/C++ code explicitly, or proceed directly to the final
step- a binary Mex file, which will (or should) work. The latter can then
be loaded into Matlab and run.

Type "help mcc" within Matlab for details on various option
switches available for the compiler.

                                             Alex






home help back first fref pref prev next nref lref last post