Building mxe-octave

I have been working for a while on cross-compiling Octave for Windows platform using M Cross Environment (MXE) with MinGW, and after hours of compilation I have a functional version of Octave built for Windows, though not a complete one. You can download the zipped package here.

The package contains pre-compiled binaries of almost all the dependencies needed to run Octave. If you want to install Octave from this package, all you need to do is extract it, and then execute the file /bin/octave.exe from a MinGW/MSys or Cygwin shell. Executing the file directly by double clicking on it also starts Octave. You can write a simple hello world program to test if the package is working properly.

> printf("Hello World\n")

prints Hello World
After running make octave and ./mk-dist, I have a total of 102 items in the installed-packages directory. For the sake of a comprehensive report, following is the list of packages.

hdf5 msys-sed of-general of-control libiconv
native-gcc gnutls tiff pstoedit build-gperf
libtool msys-gzip freetds openssl gnuplot
gcc-mpfr msys-diffutils uuid msys-grep arpack
libpng libxml2 suitesparse npp glpk
build-bison libidn freetype msys-make nettle
gmsys-findutils texinfo libssh2 jasper binutils
of-communications pthreads fltk termcap postgresql
lapack gcc-gmp fontconfig msys-tar qscintilla
xz of-io gettext build-texinfo build-autoconf
curl jpeg w32api native-binutils qhull
qhull sqlite expat libodbc++ qt
build-pkg-config of-optim readline of-miscellaneous pcre
build-cmake of-struct gcc msys-bash blas
build-libtool of-specfun libgcrypt zlib build-automake
msys-gawk gmp octave msys-libmagic lcmsl
build-flex msys-less fftw of-image dbus
libgpg_error bzip2 gcc-mpc of-statistics msys-msys-core
llvm check-requirements msys-file graphicsmagick msys-termcap
msys-regex of-signal libmng msys-libiconv qrupdate
msys-libintl

I had faced a few problems while building mxe-octave, because of which it took me a lot of time to complete the cross-compilation. One of the errors thrown at me was while building pkg-config-0.28. Strangely, I got the error even though I had the latest version of libtool installed.

/home/ani/mxe-octave/tmp-build-pkg-config/pkg-config-0.28/configure: line 2600: syntax error near unexpected token `2.2'
/home/ani/mxe-octave/tmp-build-pkg-config/pkg-config-0.28/configure: line 2600: `LT_PREREQ(2.2)'
make[1]: *** [build-only-build-pkg-config] Error 2

I fixed the above error by omitting the call to the command autoreconf in the file mxe-octave/src/build-pkg-config.mk. I did it by appending -h to autoreconf. Removing the command entirely should also do the same thing. If anyone is facing similar problems while building mxe-octave, then he/she can try the above workaround.

During a recent update, John. W. Eaton set “make octave” as the new and default target for all packages. I am presuming that “make octave” downloads and builds only the packages specific to Octave, while “make” builds many others which are not needed (Eg. Glib, which I was trying to build unnecessarily). So I figured out that it is wise to use “make octave”.

I will now probably start working on adding a few missing dependencies to mxe-octave.

Hello World!

I am very excited to let you know that I have been selected as a Google Summer of Code student to work for GNU Octave. My sincere thanks to the Octave community, and my teacher Mukesh Tiwari for encouraging me. I will use this blog to post updates about my GSoC work at least once a week (or more often if I get something to update). I have provided the details of my project below.

Project Title: Improve Binary Packaging
URL: http://www.google-melange.com/gsoc/project/google/gsoc2013/ani07nov/23001

I have decided to work on the mxe-octave repository by John W. Eaton in an attempt to improve his work. Right now I am trying to fix some problems I am facing while building his fork of MXE. When I run ‘make’ some packages fail with a build error. I switched from Ubuntu to OpenSUSE and the errors have minimized (no idea how), but I am yet to get a complete version of Octave built for Windows. The Community Bonding Period of GSoC will be over by June 16. My aim will be to solve these issues before the coding period starts. I will also chalk out a more revised time-line and goals for the mid-term evaluation once I am all set.