delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/06/18/02:59:06

From: pjw42 AT cam DOT ac DOT uk ("P.J. Walmsley")
Subject: Re: [Q] Matlab MEX with gnu-win32
18 Jun 1997 02:59:06 -0700 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <Pine.SUN.3.91.970618094759.15495B-100000.cygnus.gnu-win32@bootes.cus.cam.ac.uk>
Mime-Version: 1.0
X-Sender: pjw42 AT bootes DOT cus DOT cam DOT ac DOT uk
Original-To: gnu-win32 AT cygnus DOT com
In-Reply-To: <1.5.4.32.19970617074807.006a57ac@hobbe.lin.foa.se>
Original-Sender: owner-gnu-win32 AT cygnus DOT com

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


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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019