octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Building on MinGW using MXE-built dependencies [WAS: Re: mxe-installer t


From: Philip Nienhuis
Subject: Building on MinGW using MXE-built dependencies [WAS: Re: mxe-installer try 2]
Date: Sun, 26 May 2013 21:32:10 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.11) Gecko/20100701 SeaMonkey/2.0.6

<Maintainers ML added; FYI this thread started as a private conversation over MXE fixes. The next weeks I'll have very little time for Octave so I figured I'd better hand it over to other possibly interested devs)

John Donoghue wrote:
On 05/25/2013 03:56 PM, Philip Nienhuis wrote:
:
<snip>
:
FYI, a complete MXE build from clean checkout nowadays only takes 2.5
hours (on a Lenovo X230 w core i5 CPU, Mageia 2 32b)

(should read: starting from a dist archive: ~2 hours incl. moving zip to native Windows & installing & testing)

BTW The last days I was trying to make a native (i.e. on Windows)
MinGW build env from the MXE stuff. I had some luck already in that
configure ran and part of the compile as well.
Motives:
- Not having to wait 30 minutes for a complete and blind Octave
cross-compile, + 10 mins for getting it to work on Windows itself, for
just a tiny patch
- I hope to be able to get Java in the picture; on MXE that doesn't
work as somehow the configure-generated files get confused if the
configure options in src/octave.mk are amended. Same goes for llvm

I took a quick look at mxe on mingw, but didnt have much luck - but then
really only spent 30 mins trying to get it to work - how many changes
needed to get it to work under mingw ?

(Other motives:
- The MXE build tree supposedly contains almost everything needed for a native MinGW build. MXE is a very effective way to build at least the required dependencies. - Preparing Octave for an MXE-build is time consuming: either make a dist or manually swap files in a dist.tar.gz, recompute its SHA1, update /src/octave.mk and copy the dist into /pkg )

The (my) aim is to get as far as ./run-octave, and to be able to build and run with --debug-enabled. Once MinGW Octave is sufficiently stable, I believe the archive (or installer) made with MXE on Linux is still the superior option.

Two weeks ago I had a first try with octave 3.6.4 on an WinXP box, I got as far as building in liboctave. Last week I started over again on Windows 7 but didn't get as far yet as I ran out of time; below is a rough sketch of what I did. Hopefully other MinGW developers will pick up so we can also build Octave "natively" on MinGW.

First an observation: the MinGW build tools do not seem to be thread safe, or maybe it is Windows' NTFS filesystem that isn't (don't mention FAT32). When building with "-j4" flag I got errors that some intermediate file couldn't be accessed or written; that message disappeared when I built on just one CPU core. But obviously that takes 3-4 times longer.


Install MinGW including MinGW dev tools but without compilers; stable MinGW (using mingw-get) still gives gcc-4.6.2 while MXE contains 4.7.2. MSYS is automatically included although most of MSYS is already in the mxe-octave zip.

Move the complete mxe-octave build dir (i.e., one that has succesfully built Octave) to a Windows partition (3.5 GB? IIRC). In ./mxe-octave the subdir /cross-tools isn't needed, nor /pkg, /log, /dist, /src + maybe a few others. MinGW and mxe-octave do not have to be merged, if only paths are entered correctly in MinGW style (e.g., /c/mingw/bin for C:\mingw\bin, /c/mxe-octave/usr/...)
Probably some clever mount-ing can help here but I didn't try yet.
NB: soft links do not exist on Windows, if you try "ln -s" you'll notice files are actually copied. Perhaps move mxe-octave such that from within an MSYS shell it mimics the tree on Linux (see below). In that case watch the 254 char limit for full path names on Windows.

Add all .../bin dirs in mxe-octave (except msys-base/bin) to the PATH (I use .profile in mingw/msys/1.0/home/<username> for that), also add subdir mxe-octave/usr/lib/gcc/i686-pc-mingw32 - but perhaps one can also copy the one file there to some bin subdir to keep the PATH short. I entered only the MinGW PATH + mxe-octave dirs + /c/windows + /c/windows/system32 into an "export PATH='...'" statement to get rid of all '/c/Program Files/<etc>' stuff except /c/Program Files/gs/gs9.07/bin - had I known before I would have installed ghostscript elsewhere.

As a rule of thumb the prerequisites for MXE itself (i.e. on Linux) translate to some extent for mxe-under-mingw.
At least autoconf and automake are included in mingw (-dev-tools).
pkg-config.exe is apparently needed, get it from somewhere (I used Tatsuro's dependency libs for ripping it from there). Maybe pkg-config.exe itself isn't needed after all, but I didn't get that far yet.

Set include dirs + other flags in environment vars (again I used Tatsuro's work as a template). Also set PKG_CONFIG_PATH to ...? (hmmm forgot what it was exactly but you'll get an error message mentioning the proper location).
Remember "/" = msys-base (i.e., \Mingw\msys\1.0\)

Currently a stumbling block is that the MXE-built native compilers don't work properly in 64-bit Windows 7 (which is on my main build machine these days). This will become evident during ./configure, but also during installation of packages in Octave (typically configure complains that "g++ can't build executables"). The fix for octave itself (pkg install ...) is easy: just set octave.exe "WinXP compatible" and binary package building goes OK. For MinGW/MSYS I hope I'd only have to set some main msys executable to WinXP-SP3 compatible first (I suppose all other .exes it calls will be treated similarly), but I still have to find out which one that is. But then again it may be more complicated, who knows.

From then on I suppose (hope) it is just a matter of trying first the easy case with stable Octave-3.6.4 and while trying to build that, solve issues as they appear. In a next step try 3.7.5+

Philip


reply via email to

[Prev in Thread] Current Thread [Next in Thread]