octave-maintainers
[Top][All Lists]
Advanced

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

cross compiling Octave for MinGW systems


From: John W. Eaton
Subject: cross compiling Octave for MinGW systems
Date: Fri, 16 Nov 2012 13:41:19 -0500

I've wanted to make it easier to build Octave for Windows for some
time now but have hesitated in part because I don't normally use
Windows and my only access is running it with VirtualBox.  That works
OK, but even then, I find that building Octave with MinGW is painfully
slow.  I've previously experimented with cross compiling Octave for
MinGW on my Debian system and found that it was much faster to work
that way, but dealing with the cross tools always seemed complicated.

Recently, I discovered the MXE project (http://mxe.cc) which appears
to solve many of the problems associated with building the cross tools
and many of the libraries that projects like Octave require.

MXE seemed like the perfect solution until I discovered that it does
not support shared libraries and the developers don't seem to
interested in adding support for them.  Octave really needs to be
linked with shared libraries, otherwise every .oct file would be
really huge.

I almost gave up on MXE, but since it seems quite nice for managing
the dependencies and building the compiler tools, I decided to try to
add support for shared libraries and see if I could use it to build
Octave.  My result is now published as an hg archive at
hg.octave.org.

If you'd like to give it a try, here is what you need to do:

  * install the required packages as described here:
    http://mxe.cc/#requirements

  * clone my fork of mxe:

      hg clone http://hg.octave.org/mxe-octave

  * build the cross tools and Octave:

      cd mxe-octave
      make octave

    If you have more than one core available, you can run

      make octave JOBS=4

    or similar to do parallel builds.

You'll end up with a minimal version of Octave (almost no
dependencies, no gui, reference blas and lapack).  You'll be building
a temporary snapshot that I created of the development sources from
2012-11-15.  You should be able to run the copy of Octave that you
build by copying the mxe-octave/usr/i686-pc-mingw directory tree to a
Windows system.  You'll need to run it inside some kind of terminal
(MinGW or cygwin) and you'll probably have to set the OCTAVE_HOME
environment variable to the location of the i686-pc-mingw directory
before running Octave.

In addition to all the missing dependencies, I see some issues with
line editing.  I'm sure there are many more problems.  For now, this
is just a proof of concept, but I plan to continue working on this
project so that Octave and all of its dependencies can built in the
MXE framework.

If I'm successful in building all of Octave and its dependencies this
way, then maybe we can get the MXE developers to accept our
changes to support shared libraries.  If not, I plan to continue
maintaining a forked version as long as it is useful for building
Octave for MinGW systems.

We might also be able to modify the environment to make it easy to
build Octave and all of its dependencies on other types of systems
even if we do not have to cross compile.  For example, any remaining
proprietary Unix systems that do not have nice package management
systems to handle installing all the required dependencies.

jwe


reply via email to

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