[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: |
Thu, 3 Jan 2013 16:14:29 -0500 |
Here is another update about my experiences 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.
Since my last update, I've added LLVM, Qt, and QScintilla to the list
of dependencies and made it possible to build either a snapshot of the
development version of Octave or the latest release candidate of
Octave 3.6.4.
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
add $HOME/octave/bin to your path:
PATH=$HOME/octave/bin:$PATH
Then you should be able to start Octave. Or, I think clicking on the
program in the Windows file manager should also start it.
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
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.
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.
To build the test release of Octave 3.6.4 instead of the development
snapshot, execute
make octave-stable
instead. Note that you'll need to modify the mk-dist script by hand
to do this instead of building "octave" if you want to build a tar
file with the stable version of Octave.
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 CC, CXX, F77, etc. in the environment.
* include everything necessary to run Octave so that it can be
installed without requiring MinGW/MSys to be installed (this may
already work; would someone like to check?).
* 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.
jwe