Thread Subject: mex linux source for windows

Subject: mex linux source for windows

From: Lars Barring

Date: 27 Sep, 2007 20:40:29

Message: 1 of 3

Dear all,

We have a some Linux C-library code that has been
successfully mexed for Linux. Now we would like to
transport this this to the Windows environment.

I have very little experience in this area so all
suggestions would be welcome. I have been searching the
web and found some web pages on mingw, cygwin, and
gnumex. While these seems to be pointing in the right
direction, more direct/specific/hands-on suggestions and
experience would be most welcome.


Many thanks,
Lars

Subject: mex linux source for windows

From: Ralph Schleicher

Date: 28 Sep, 2007 20:29:20

Message: 2 of 3

"Lars Barring" <lars.barring@myworkplace.se> writes:

> We have a some Linux C-library code that has been
> successfully mexed for Linux. Now we would like to
> transport this this to the Windows environment.
>
> I have very little experience in this area so all
> suggestions would be welcome. I have been searching the
> web and found some web pages on mingw, cygwin, and
> gnumex. While these seems to be pointing in the right
> direction, more direct/specific/hands-on suggestions and
> experience would be most welcome.

Hi Lars,

if you want to create Windows MEX files using a Unix style build
environment, you have to setup a cross-compiler (either Linux:MinGW
or Cygwin:MinGW). Then compilation is as easy as

# Directory containing a copy of $MATLAB/bin, $MATLAB/extern, and
# $MATLAB/simulink/include from a Matlab Windows installation.
export MATLAB=/opt/w32/matlab-6.1
export MATLAB_ARCH=win32
export MEXEXT=dll
/configure --build=i686-pc-linux-gnu --host=i686-pc-mingw32

Useful tools can be found at

http://home.allgaeu.org/rschleic/rs/pub/m-config/
http://home.allgaeu.org/rschleic/rs/pub/mextool/

--
Ralph

5425 days of Linux experience.

Subject: mex linux source for windows

From: Chris Van Kleeck

Date: 1 Feb, 2008 17:20:19

Message: 3 of 3

Ralph Schleicher <rs+usenet@nunatak.allgaeu.org> wrote in
message <87ve9uwn33.fsf@bravo.nunatak.allgaeu.org>...
> "Lars Barring" <lars.barring@myworkplace.se> writes:
>
> > We have a some Linux C-library code that has been
> > successfully mexed for Linux. Now we would like to
> > transport this this to the Windows environment.
> >
> > I have very little experience in this area so all
> > suggestions would be welcome. I have been searching the
> > web and found some web pages on mingw, cygwin, and
> > gnumex. While these seems to be pointing in the right
> > direction, more direct/specific/hands-on suggestions and
> > experience would be most welcome.
>
> Hi Lars,
>
> if you want to create Windows MEX files using a Unix style
build
> environment, you have to setup a cross-compiler (either
Linux:MinGW
> or Cygwin:MinGW). Then compilation is as easy as
>
> # Directory containing a copy of $MATLAB/bin,
$MATLAB/extern, and
> # $MATLAB/simulink/include from a Matlab Windows installation.
> export MATLAB=/opt/w32/matlab-6.1
> export MATLAB_ARCH=win32
> export MEXEXT=dll
> /configure --build=i686-pc-linux-gnu --host=i686-pc-mingw32
>
> Useful tools can be found at
>
> http://home.allgaeu.org/rschleic/rs/pub/m-config/
> http://home.allgaeu.org/rschleic/rs/pub/mextool/
>
> --
> Ralph



Ralph,
Do you know if it is possible to use a Linux compiled mex
function as a s-function in Simulink (DOS). Or is there
another cross compiler required to do this?

Tags for this Thread

Everyone's Tags:

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.

Tag Activity for This Thread
Tag Applied By Date/Time
linux Chris Van Kleeck 1 Feb, 2008 12:25:01
sfunction Chris Van Kleeck 1 Feb, 2008 12:25:01
simulink Chris Van Kleeck 1 Feb, 2008 12:25:00
mex Lars Barring 27 Sep, 2007 16:45:04
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com