Difference between revisions of "Windows Installer"

From Octave
Jump to navigation Jump to search
Line 15: Line 15:
# <code>./configure</code>
# <code>./configure</code>
# <code> make nsis-installer </code> or <code> make tar-dist </code> (to get a compressed version)
# <code> make nsis-installer </code> or <code> make tar-dist </code> (to get a compressed version)
* Use "make JOBS=4" if you have a multicore system to enable parallel build.'''Do not''' "make -j"
==Installing requirements of MXE Octave==
==Installing requirements of MXE Octave==

Revision as of 19:11, 17 January 2015

This article is about how to make the Windows installer; if you'd like just to use the installer, see Octave for Microsoft Windows.

GNU Octave is primarily developed on GNU/Linux and other POSIX conformal systems. There have been many efforts in the past to build ports of GNU Octave for Windows. Take a look at the various ports of Octave available for Windows here.

Recently some work has been done in maintaining a unified build system mxe-octave (a fork of MXE) which anyone can use to produce cross as well as native builds of GNU Octave for Windows and Mac OS X platforms. This page contains instructions about creating a Windows installer using mxe-octave.

Steps to create Windows Installer

  1. Install all requirements of MXE Octave.
  2. hg clone http://hg.octave.org/mxe-octave/
  3. cd mxe-octave
  4. Make sure MXE version of all compiler tools are found first in path
    1. setenv PATH `pwd`/usr/bin:$PATH # for C shell
    2. PATH=`pwd`/usr/bin:$PATH # for Bourne shell
  5. autoconf
  6. ./configure
  7. make nsis-installer or make tar-dist (to get a compressed version)


  • Use "make JOBS=4" if you have a multicore system to enable parallel build.Do not "make -j"

Installing requirements of MXE Octave

MXE Octave requires a recent Unix system where all components as stated below are installed.

Debian (GNU/kFreeBSD & GNU/Linux)

aptitude install -R autoconf automake bash bison bzip2 \
                    cmake flex gettext git g++ intltool \
                    libffi-dev libtool libltdl-dev \
                    mercurial mingw32 openssl libssl-dev \
                    libxml-parser-perl make patch perl \
                    pkg-config scons sed unzip wget \
                    xz-utils yasm

On 64-bit Debian, install also:

aptitude install -R g++-multilib libc6-dev-i386

If you are using Ubuntu, then you can do apt-get install foo instead of aptitude install -R foo.

On a fesh Linux Mint 16 x86_64, in addition to the above also install:

sudo apt-get install libc6-dev-i386 gcc-multilib libgmp3-dev libmpfr4 libmpfr-dev
sudo apt-get build-dep gcc-4.8

If not installed you will get error messages like "/usr/include/stdc-predef.h:30:26: fatal error: bits/predefs.h: No such file or directory" or "/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.8/libgcc.a when searching for -lgcc" when compiling ocaml-core. The packages libgmp3-dev libmpfr4 libmpfr-dev libmpc-dev are needed for compiling the build-gcc.


yum install autoconf automake bash bison bzip2 cmake \
            flex gcc-c++ gettext git intltool make sed \
            libffi-devel libtool openssl-devel patch perl pkgconfig \
            scons yasm unzip wget xz

On 64-bit Fedora, there are open issues with the NSIS package.


pkg_add -r automake111 autoconf268 bash bison cmake \
           flex gettext git gmake gsed intltool libffi libtool \
           openssl patch perl p5-XML-Parser pkg-config \
           scons unzip wget yasm

Ensure that /usr/local/bin precedes /usr/bin in your $PATH:
For C style shells, edit .cshrc

setenv PATH /usr/local/bin:$PATH

For Bourne shells, edit .profile

export PATH = /usr/local/bin:$PATH

On 64-bit FreeBSD, there are open issues with the NSIS package.


pacman-g2 -S autoconf automake bash bzip2 bison cmake \
             flex gcc gettext git intltool make sed libffi libtool \
             openssl patch perl perl-xml-parser pkgconfig \
             scons unzip wget xz xz-lzma yasm

On 64-bit Frugalware, there are open issues with the NSIS package.


emerge sys-devel/autoconf sys-devel/automake \
       app-shells/bash sys-devel/bison app-arch/bzip2 \
       dev-util/cmake sys-devel/flex sys-devel/gcc \
       sys-devel/gettext dev-vcs/git \
       dev-util/intltool sys-devel/make sys-apps/sed \
       dev-libs/libffi sys-devel/libtool dev-libs/openssl sys-devel/patch \
       dev-lang/perl dev-perl/XML-Parser \
       dev-util/pkgconfig dev-util/scons app-arch/unzip \
       net-misc/wget app-arch/xz-utils dev-lang/yasm

Mac OS X

Install Xcode 4 and MacPorts, then run:

sudo port install autoconf automake bison cmake flex \
                  gettext git-core gsed intltool libffi libtool \
                  openssl p5-xml-parser pkgconfig scons \
                  wget xz yasm

Mac OS X versions ≤ 10.6 are no longer supported.


Make sure to update and upgrade packages as some of the default versions of packages are too old to work correctly.

mingw-get update
mingw-get upgrade

And then get required packages.

mingw-get install autoconf bash msys-bison msys-flex gcc gcc-c++ \
                  gcc-fortran gettext msys-m4 msys-make msys-sed \
                  libiconv msys-openssl msys-patch msys-perl \
                  msys-libarchive msys-unzip msys-wget msys-bsdtar

You will also need to install Windows versions of Python and Ghostscript and ensure they are in visible in the PATH.


zypper install -R autoconf automake bash bison bzip2 \
                  cmake flex gcc-c++ gettext-tools git \
                  intltool libffi-devel libtool make openssl \
                  libopenssl-devel patch perl \
                  perl-XML-Parser pkg-config scons \
                  sed unzip wget xz yasm

On 64-bit openSUSE, install also:

zypper install -R gcc-32bit glibc-devel-32bit \
                  libgcc46-32bit libgomp46-32bit \

Open Issues with NSIS

The NSIS package contains some native tools that are currently 32-bit only. In order to build these on a 64-bit system, multi-lib support must be enabled in the compiler toolchain. However, not all operating systems support this. Since no other packages depend on it, the remainder of MXE can be successfully built by simply specifying an empty build rule:

make nsis_BUILD=

Creating an NSIS based installer

The make nsis-installer command produces a basic NSIS installer that is ready to be distributed. You can however create a newer and better installer by getting a newer version of mxe-octave/makeinst-script.sh here. The script included hasn't been merged with main mxe-octave yet. (Note Nov 10 2013: this makeinst-script.sh doesn't work with the main mxe-octave repo; it errors out with "glibc detected" and gives up.)