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.