Subject: Re: [Q] Matlab MEX with gnu-win32
From: [email-masked] ("P.J. Walmsley")

18 Jun 1997 02:59:06 -0700
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Sender: [email-masked]
Original-To: [email-masked]
In-Reply-To: <[email-masked]>
Original-Sender: [email-masked]

On Tue, 17 Jun 1997, Christian Joensson FOA 72 wrote:

> I'd like to know if someone has been able to build Matlab MEX files for
> Matlab 5.x using the gnu-win32 tools under either Sin '95 or NT 4.0?

I've not tried building mex files but I've linked in the matlab/mex 
libraries to my own C++ programs.  The makefile goes something like this:

MATLABVER=5
MATLABDIR=/mnt/nt_apps/matlab${MATLABVER}
MATLABINC=$(MATLABDIR)/extern/include
MATLABLIBDIR=$(MATLABDIR)/bin
MATLABLIBS=-lmat

matlablibs:
        @cp $(MATDIR)/bin/LIB*.DLL .
        @grep -v LIBRARY $(MATDIR)/extern/include/LIBMAT.DEF > libmat2.def
        @grep -v LIBRARY $(MATDIR)/extern/include/LIBENG.DEF > libeng2.def
        @grep -v LIBRARY $(MATDIR)/extern/include/LIBMX.DEF > libmx2.def
        @echo "******************** converting dlls *************************"
        dlltool --dllname libmat.dll --def libmat2.def --output-lib libmat.a
        dlltool --dllname libmx.dll --def libmx2.def --output-lib libmx.a
        dlltool --dllname libeng.dll --def libeng2.def --output-lib libeng.a
        dlltool --dllname libut.dll --output-lib libut.a
        -rm LIB*.DLL lib*2.def LIB*2.DEF
        @echo "******************** installing *************************"
        -mv libmat.a libmx.a libeng.a libut.a ../lib

------
typing 'make matlablibs' converts the dlls into import libraries that can 
be linked against.  I would imagine that to compile mex files you would 
need to hack around with the cmex.bat script to do something similar to this.

Paul Walmsley
------------------------------------------------------------------------
Signal Processing and Communications Laboratory             01223 330247
Cambridge University Engineering Department
[email-masked]   [email-masked]    http://www2.eng.cam.ac.uk/~pjw42

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".