This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [Q] Matlab MEX with gnu-win32


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
pwalmsley@iee.org   pjw42@cam.ac.uk    http://www2.eng.cam.ac.uk/~pjw42


-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]