|
"Thomas " <tclyue@gmail.com> writes:
Full name?
> I am running into a similar problem where I've a mexopts.bat written
> up in gfortran. It used to run in linux. Now, I want to convert the
> source code to be running in windows xp. Can you please post some
> hints as to how the cross-compilation is achieved. Thanks, Thomas
You have to setup a cross-compilation environment, that is
* Build and install a MinGW cross-compiler toolchain on your Unix box
Binutils: ./configure --host=i686-pc-mingw32 --target=i686-pc-mingw32
GCC: ./configure --host=i686-pc-mingw32 --target=i686-pc-mingw32 --enable-languages=c,c++,f77
* Install mingw-runtime and w32api in /usr/local/i686-pc-mingw32
* Install Matlab libraries and header files from your Windows box
in /usr/local/i686-pc-mingw32, for example
$ mkdir /usr/local/i686-pc-mingw32/matlab-7.1
$ cd /usr/local/i686-pc-mingw32/matlab-7.1
$ (cd "/mnt/Program Files/Matlab-7.1" && tar -cf- bin extern rtw simulink stateflow) | tar -xf-
* Adjust mexopts.sh, that is change compilers and tools from 'foo' to
'foo-i686-pc-mingw32' and change path names for libraries and header
files. As an alternative, use Libtool to build Matlab MEX-Files.
Libtool knows all details for cross-compiling loadable modules.
See also my Mextool script for building MEX-files with Libtool and
Automake/Autoconf.
--
Ralph Schleicher <http://ralph-schleicher.de>
Development * Consulting * Training
Mathematical Modeling and Simulation
Software Tools
|