octave-maintainers
[Top][All Lists]
Advanced

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

update: cross compiling Octave for MinGW systems


From: John W. Eaton
Subject: update: cross compiling Octave for MinGW systems
Date: Wed, 12 Dec 2012 16:18:10 -0500

Last month I posted some info about cross compiling Octave for Windows
systems with MinGW using MXE (http://mxe.cc).  I now have nearly all
the Octave dependencies building this way, along with a recent
snapshot of the current Octave development sources.

To see the current state of the project, here is what you need to do
(on a GNU/Linux system; I've used Debian, it should also work on
Fedora and the other systems listed on the MXE requirements page):
 
  * 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 an almost complete version of Octave built for
Windows with MinGW.  At this point, you can run

  ./mk-dist

to build the a version of GCC that can run on Windows and create a
file dist/octave.tar.bz2 that includes Octave and all its
dependencies.  You can copy this file over to a Windows system.  Start
a MinGW/MSys or Cygwin shell and unpack it with

  tar jxf octave.tar.bz2

If you do this in your MinGW/MSys or Cygwin home directory, you can set
then environment variable

  OCTAVE_HOME=$HOME/octave

and add $HOME/octave/bin to your path:

  PATH=$HOME/octave/bin:$PATH

Then you should be able to start Octave.

If you also add

  CC=gcc
  CXX=g++
  F77=gfortran
  CXX_LD=g++
  DL_LD=g++

to your environment, you should be able to build a package.  For
example,

  octave> pkg -forge install control

works for me.

The missing dependencies that I know of are

  HDF5:  I have not yet found a way to build the HDF5 libraries for
         MinGW, and they seemed to have dropped support recently.

  ghostscript, pstoedit, fig2dev:
         These are needed for printing figures.  I think it should be
         possible to get them to build with MXE, but I have not tried
         yet.

  Qt, Qscintilla:
         These libraries are only needed for the GUI that will be
         included in an upcoming release of Octave.

  LLVM:  This package is only needed for the experimental JIT compiler
         that will be included in an upcoming release of Octave.

  Java:  This dependency is only needed for the experimental Java
         interface that will be included in an upcoming release of
         Octave.

I'm working on building these and including them in my fork of MXE.

If this is to be made truly stand alone and independent of MinGW/MSys
or Cygwin, then the dependencies would also need to include things
like less, Texinfo, make, bison, flex, etc. and other tools that might
be needed to either build packages that contain C++, C, or Fortran
files, or to build Octave itself on Windows systems.  I'm not sure it
whether to go that far, or just require that people install MinGW if
they want to do development.

In addition to missing dependencies, I'm working on fixing the
following problems:

  * we should not have to set OCTAVE_HOME, CC, CXX, F77, etc. in the
    environment.

  * make the build work for the stable released version of Octave.

  * include everything necessary to run Octave so that it can be
    installed without requiring MinGW/MSys to be installed.

  * modify MXE so that all of this can be done "natively" in a Cygwin
    or MinGW/MSys shell, or any other Unix-like system so that we can
    easily build Octave and all its dependencies on other systems that
    don't have package systems to provide all the required
    dependencies.

  * see whether this approach will also work for cross compiling for
    OS X systems.

I'm also thinking about distributing the dependency libraries that I
build with this system so that people who have no way of cross
compiling Octave but want to build it with MinGW running on a Windows
system can easily do so without having to build everything from
source.

I don't recall seeing any responses to the last post I made about this
topic.  Is anyone else interested in it?  Has anyone tried using my
fork of MXE to build Octave?

jwe


reply via email to

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