# <code>hg clone http://hg.octave.org/mxe-octave/</code>
# <code>cd mxe-octave</code>
# <code>make nsis-installer</code>
* Use <code>make tar-dist</code> or <code>make zip-dist</code> instead of <code>nsis-installer</code> if you want to build just an archive of the files to install on Windows instead of an installer wizard.
* By default, packages will be built one at a time, but you may use <code>make JOBS=4</code> (choose a number other than 4 that is appropriate for your system) to build each package in parallel. You may also combine this with the <code>-j</code> option for Make to build more than one package at a time, but be careful as using <code>make -j4 JOBS=4</code> can result in as many as 16 jobs running at once.
* Use <code>./configure --disable-strip-dist-files</code> if you want to keep debug symbols in the installed binaries for debugging on Windows. Beware as the total Octave distribution will be > 2 GB, the max. size for an NSIS installer.Your only options are to make zip-dist or tar-dist installers.
* Include gdb in the installer by running <code>make gdb</code> before making the <code>nsis-installer</code> target.
====Step 1: Prepare mxe-octave====
Clone the mxe-octave
reop to some directory of your choice:
http://hg.octave.org/mxe-octave <name of mxe-octave build dir>
where <name of mxe-octave build dir> is some other name than just the default "mxe-octave".
Once downloaded, go into the <name of mxe-octave build dir> subdir and do:
./configure <options you want>
make nsis-installer JOBS=<some number>Your author usually has "--enable-devel-tools --enable-octave=default --enable-binary-packages" as configure options and use JOBS=7 on my core i5 system.For stable branch it is "--enable-devel-tools --enable-octave=stable --enable-binary-packages --enable-64 --enable-fortran-int64" or "--enable-devel-tools --enable-octave=stable --enable-binary-packages --enable-windows64"*
the first configure option also includes gdb and an MSYS shell in the binary* the second avoids the ~700 MB max. array size limit for 32-bit executables but Octave will only run on 64-bit Windows (most Windows systems are 64 bit anyway these days). Note: this option does NOT imply 64-bit indexing* the third option is just for a placeholder; it'll invoke src/default-octave.mk (one of the three octave .mk files in mxe: src/stable-octave.mk and src/octave.mk, corresponding to the "--enable-octave=" configure option), I found that octave.mk lags a bit behind* the fourth option cross-compiles the binary modules in Octave-Forge packages, which wil save time when installing them once in Windows.
If you seriously want to work with gdb, also have --disable-strip-dist-files as configure option. However, in that case chances are that you cannot build an .exe installer anymore as it becomes too big for NSIS (that has a 2 GB installer file size limit) so instead of "make nsis-installer" you'll need to invoke
make zip-dist <options>
====Step 2: To build your first Octave-for Windows development version:====
* build Octave on Linux (in separate source and build trees) including your favorite mods and patches.
* once Octave runs fine in Linux (using make check and trying your mods using ./run-octave & from the build dir, all of this still on the Linux side), do: make
all dist* This will produce a dist archive called "octave-<version>.tar. gz" in the top directory. Move or copy this dist archive to the <mxe-octave build>/pkg folder (or symlink to it from there)
Note that this step requires the Octave be configured with Java (i.e., you need javac and jar on your system).
==== Step 3: Building the Octave installer====
* be sure to adapt <mxe-octave build>/src/default-octave.mk to read "## No Checksum" at the $(PKG)_CHECKSUM line and
check octave version and archive type (tar. gz rather than tar.bz2). The checksum is only needed when you download a dist archive from the Internet, not so much when you copy it within your own home network, let alone your own computer.
* check if in the top of the main Makefile "default-octave" is mentioned for OCTAVE_TARGET rather than "stable-octave" of just "octave" (that name refers to the .mk filename in the src folder).
* ... and then run (in the <mxe-octave build> folder)
make nsis-installer <options>
====Step 3A (second and later builds)====
For next builds, mxe-octave is already configured and all dependencies have been built so the only thing to do is having a new Octave version + installer built:
(to be sure mxe-octave picks up the new Octave archive). If you've renamed the dist archive, be sure it matches with the package name in src/default-octave.mk.
====Step 4: Install on Windows====
* move the installer in <mxe-octave build>/dist/ to the Windows side (USB thumb drive, LAN copy, whatever).
* install it there.
If you've made a
zip-dist you'll have to manually create the desktop and Start Menu shortcuts (for octave and the MSYS-shell).