Octave for Microsoft Windows

This article is about using pre-built installers of Octave for Windows; for instructions about building it, see Windows Installer.

GNU Octave is primarily developed on GNU/Linux and other POSIX conform systems. The ports of GNU Octave to Microsoft Windows use different approaches to get most of the original Octave and adapt it to Microsoft Windows idiosyncrasies (e.g. dynamic libraries, file paths, permissions, environment variables, GUI system, etc). Bear this in mind and don't panic if you get unexpected results. There are a lot of suggestions on the mailing lists for tuning your Octave installation. GNU Octave standalone ports for Windows are independently compiled using either the MinGW or Microsoft Visual Studio development environments (3.6 or before).

Packages

Pre-built octave-forge packages are prepared for official release. If you installed Octave 4.0.3 using the executable installer you can confirm the package list by typing the command below from the Octave command prompt:

>> pkg list

If you instead installed Octave from the .zip archive, you need to first rebuild the package list on your local machine. (The command above will produce a blank output.) Do this by typing the following command:

>> pkg rebuild

Other packages can be installed by

>> pkg install -forge <package name>

For detailed instruction of installing Octave-Forge packages is shown at Octave-Forge

For 64 bit binary distributed from the unofficial site, pre-built package are not prepared.
Please follow the instruction on the distribution page.

gnuplot

Current octave for windows ships a not full featured gnuplot. Therefore you cannot use the full features of gnuplot graphics toolkit
(e.g. cannot use cairo based devise like "-dpdfcairo"). If you want use it, please use the following instruction

make an .octaverc file in USERPROFILE directory by your favorite text editor and set gnuplot_binary e.g.

gnuplot_binary 'C:\Program Files (x86)\gnuplot\bin\gnuplot.exe'

Please do not forget to quote the path name by single quote (') if name of which has (a) white space(s).
gnuplot ver. 5 supports windows, wxt and qt terminal. On octave, windows terminal is default.
If you want change it to wxt terminal, execute

run cygwin setup-x86.exe (for cygwin 32 bit) or setup-x86_64.exe (for cygwin 64 bit) and select them in the Math category.

All the package dependencies will be also installed.

Graphics is based on X and to plot you will need to start octave within xterm (or similar).

I recommend to install "xinit", "xlaunch" and "gnuplot". These packages will pull all the functional Xserver.

Otherwise the only graphics will be ASCII art ;-)

Notes

When building from development source (default branch)

"make check"

passes almost all the tests. Only, and not substantial, failures are:

/pub/hg/octave/src/data.cc : 8 failures due to different handling of complex Inf on sort
/pub/hg/octave/src/syscalls.cc: 1 failure on fork. This disappears when octave is installed
/pub/hg/octave/scripts/sparse/svds.m: 1 failure due to test sensitivity on starting point. See
https://mailman.cae.wisc.edu/pipermail/octave-maintainers/2011-September/024715.html

To build from cygwin source package, you need to install "cygport" and the relevant development libraries

Older instructions

MinGW ports

Octave-4.0.0

The easiest way to install GNU Octave on Microsoft Windows is using MXE builds. For the current 4.0.0 release installers can be found at ftp.gnu.org.

Known issues specific to windows version 4.0.0.

Both cli and gui cannot handle path name of which contains non-ascii characters. (For 3.8, cli can handle non-ascii code if codepage is properly set to the machine locale)

Packages

Pre-build octave-forge packages are not prepared from octave-3.8 or later for windows. You can install some octave-forge packages using archived sources and build script. However, small flaws exist in current octave-4.0.0_0 distribution. Before install, correct version number of general and signal packages version to 2.0.0 and 1.3.2, respectively and comment out install io package as "#try_install io-2.2.7.tar.gz" in C:\octave\octave-4.0.0\src\build_packages.m". Then execute

This is a 7z archive which includes additional binaries and libraries for a set of octaveforge packages.

The included packages are:

actuarial-1.1.0

ad-1.0.6_patched

audio-1.1.4

benchmark-1.1.1

bim-1.1.1

bioinfo-0.1.2

cgi-0.1.0

civil-engineering-1.0.7

combinatorics-2.0.0

communications-1.1.1_patched

control-2.4.2

data-smoothing-1.3.0

dataframe-0.9.1

econometrics-1.1.1

fenv-0.1.0

financial-0.4.0

fits-1.0.2

fpl-1.3.3

fuzzy-logic-toolkit-0.4.2

ga-0.10.0

general-1.3.2

generate_html-0.1.5

geometry-1.6.0

gnuplot-1.0.1

gsl-1.0.8

ident-1.0.7

image-2.0.0

informationtheory-0.1.8

integration-1.0.7_svn20120128

io-1.2.1

irsa-1.0.7

java-1.2.9_patched

linear-algebra-2.2.0

lssa-0.1.2

mapping-1.0.7

mechanics-1.3.1

miscellaneous-1.2.0

missing-functions-1.0.2

msh-1.0.6

multicore-0.2.15

nan-2.5.5

ncarray-1.0.0

nlwing2-1.2.0

nnet-0.1.13

nurbs-1.3.6

ocs-0.1.3_svn20120128_patched

octcdf-1.1.5

octclip-1.0.3

octgpr-1.2.0

octproj-1.1.2

odebvp-1.0.6

odepkg-0.8.4

optim-1.2.2

optiminterp-0.3.4

outliers-0.13.9

physicalconstants-1.0.0

plot-1.1.0

quaternion-2.0.2

queueing-1.2.1

secs1d-0.0.9

secs2d-0.0.8

secs3d-0.0.1

signal-1.2.1

simp-1.1.0

sockets-1.0.8_patched

specfun-1.1.0

special-matrix-1.0.7

splines-1.1.2

statistics-1.2.0

strings-1.1.0_patched

struct-1.0.10

symband-1.0.10

symbolic-1.1.0

tcl-octave-0.1.8

time-2.0.0

tsa-4.2.4

video-1.0.2_patched

vrml-1.0.13_patched

windows-1.2.1

xraylib-1.0.8

zenity-0.5.7

Maintainer: Nitzan Arazi

Latest update: 2013-03-31

Manual installation instructions

Create an installation directory of which doesn't have space chars (i.e. C:\Octave\Octave3.6.4_gcc4.6.2\). This directory is referred hereafter as <your_install_dir>.

Extract the complete directories tree from Octave3.6.4_gcc4.6.2_20130329.7z to the installation directory keeping the original directory structure as in the archive (you can use 7-zip tool from http://www.7-zip.org/). Note that the archive contains Octave3.6.4_gcc4.6.2 folder, so you want to extract to the *parent* of <your_install_dir>.

Copy octave3.6.4_gcc4.6.2.lnk to any convenient location and edit its properties respectively to point to <your_install_dir>\bin\octave.exe and <your_install_dir>\doc\octave\icons\octave-logo.ico as an icon

Copy octave3.6.4_gcc4.6.2_docs.lnk to any convenient location and edit its properties respectively to point to <your_install_dir>\doc\octave and <your_install_dir>\doc\octave\icons\octave-logo.ico as an icon.

At this point you can:

a. Launch and use octave by double-clicking the copied octave3.6.4_gcc4.6.2.lnk

b. Access and browse the documentation files by double-clicking the copied octave3.6.4_gcc4.6.2_docs.lnk

In case the default library is not properly functioning on the actual cpu, or you wish to explore the performance with another library, you can manually replace the default one by performing the following procedures (where libblas.dll.<libblas_source> should be replaced with the full name of the desired library from the list below these instructions):

Exit octave

Delete <your_install_dir>\bin\libblas.dll

Make a copy of the desired <your_install_dir>\bin\libblas.dll.<libblas_source>

Rename the copy of the desired <your_install_dir>\bin\libblas.dll.<libblas_source> to libblas.dll

The following is a list of the available libblas.dll.<libblas_source> options:

libblas.dll.ref - reference blas implementation, very slow but most stable

Manual installation instructions for the Octave-forge packages

Extract the complete directories tree from Octave3.6.4_gcc4.6.2_pkgs_20130331.7z to the installation directory (<your_install_dir>) keeping the original directory structure as in the archive (you can use 7zip tool from http://www.7-zip.org/).

In order to update octave_packages database with your installation tree and auto-load most packages (excluding 'ad' and 'windows' which may crash octave when loaded and 'clear all' is executed), launch Octave and execute the following five rebuild commands from the octave console:

Last pkg rebuild command is required in order for the java pkg entry to be moved to the top of <your_install_dir>\share\octave\octave_packages db file - thus java pkg is loaded before io pkg is loaded, and io pkg related jars are added to java class path.

You can optionally adjust your installed packages status per your specific needs and usage by executing the following commands:

This is a 7z archive which includes additional binaries and libraries for a set of octaveforge packages.

The included packages are:

actuarial-1.1.0

ad-1.0.6_patched

audio-1.1.4

benchmark-1.1.1

bim-1.0.2

bioinfo-0.1.2

civil-engineering-1.0.7

combinatorics-1.0.9

communications-1.1.0_svn20120127_patched

control-2.2.5

data-smoothing-1.3.0

dataframe-0.9.1

econometrics-1.0.8

fenv-0.1.0

financial-0.3.2

fpl-1.2.0

fuzzy-logic-toolkit-0.3.0

ga-0.9.8

general-1.2.2

generate_html-0.1.3

geometry-1.4.0

gnuplot-1.0.1

gpc-0.1.7

gsl-1.0.8

ident-1.0.7

image-1.0.15

informationtheory-0.1.8

integration-1.0.7_svn20120128

io-1.0.17

irsa-1.0.7

java-1.2.8_patched

linear-algebra-2.1.0_svn20120225

mapping-1.0.7

mechanics-1.2.0

miscellaneous-1.0.11_svn20120127

missing-functions-1.0.2

msh-1.0.2

multicore-0.2.15

nan-2.5.2

nlwing2-1.2.0

nnet-0.1.13

nurbs-1.3.5

ocs-0.1.3_svn20120128_patched

octclip-1.0.0

octgpr-1.2.0

odebvp-1.0.6

odepkg-0.8.0_svn20120127

optim-1.0.17_patched

optiminterp-0.3.4_svn20120128_patched

outliers-0.13.9

physicalconstants-0.1.7

plot-1.1.0

quaternion-1.0.0

queueing-1.0.0

secs1d-0.0.8

secs2d-0.0.8

secs3d-0.0.1

signal-1.1.2

simp-1.1.0

sockets-1.0.7_svn20120128_patched

specfun-1.1.0

special-matrix-1.0.7

spline-gcvspl-1.0.8

splines-1.0.7

statistics-1.1.0_svn20120128

strings-1.0.7

struct-1.0.9

symband-1.0.10

symbolic-1.1.0

tcl-octave-0.1.8

time-1.0.9

tsa-4.1.1

video-1.0.2_patched

vrml-1.0.12_svn20111014_patched

windows-1.1.0

xraylib-1.0.8

zenity-0.5.7

Maintainer: Nitzan Arazi

Latest update: 2012-03-03

Manual installation instructions

Create an installation directory of which doesn't have space chars (i.e. C:\Octave\Octave3.6.1_gcc4.6.2\). This directory is referred hereafter as <your_install_dir>.

Extract the complete directories tree from Octave3.6.1_gcc4.6.2_20120303.7z to the installation directory keeping the original directory structure as in the archive (you can use 7-zip tool from http://www.7-zip.org/). Note that the archive contains Octave3.6.1_gcc4.6.2 folder, so you want to extract to the *parent* of <your_install_dir>.

Copy octave3.6.1_gcc4.6.2.lnk to any convenient location and edit its properties respectively to point to <your_install_dir>\bin\octave.exe and <your_install_dir>\share\octave\3.6.1\imagelib\octave-logo.ico as an icon

Copy octave3.6.1_gcc4.6.2_docs.lnk to any convenient location and edit its properties respectively to point to <your_install_dir>\doc\octave and <your_install_dir>\share\octave\3.6.1\imagelib\octave-logo.ico as an icon.

At this point you can:

a. Launch and use octave by double-clicking the copied octave3.6.1_gcc4.6.2.lnk

b. Access and browse the documentation files by double-clicking the copied octave3.6.1_gcc4.6.2_docs.lnk

In case the default library is not properly functioning on the actual cpu, or you wish to explore the performance with another library, you can manually replace the default one by performing the following procedures (where libblas.dll.<libblas_source> should be replaced with the full name of the desired library from the list below these instructions):

Exit octave

Delete <your_install_dir>\bin\libblas.dll

Make a copy of the desired <your_install_dir>\bin\libblas.dll.<libblas_source>

Rename the copy of the desired <your_install_dir>\bin\libblas.dll.<libblas_source> to libblas.dll

The following is a list of the available libblas.dll.<libblas_source> options:

libblas.dll.ref - reference blas implementation, very slow but most stable

Manual installation instructions for the Octave-forge packages

Extract the complete directories tree from Octave3.6.1_gcc4.6.2_pkgs_20120303.7z to the installation directory (<your_install_dir>) keeping the original directory structure as in the archive (you can use 7zip tool from http://www.7-zip.org/).

In order to update octave_packages database with your installation tree and auto-load most packages (excluding 'ad' and 'windows' which may crash octave when loaded and 'clear all' is executed), launch Octave and execute the following 3 rebuild commands from the octave console:

Last pkg rebuild command is required in order for the java pkg entry to be moved to the top of <your_install_dir>\share\octave\octave_packages db file - thus java pkg is loaded before io pkg is loaded, and io pkg related jars are added to java class path.

You can optionally adjust your installed packages status per your specific needs and usage by executing the following commands:

This is a 7z archive which includes additional binaries and libraries for a set of octaveforge packages.

The included packages are:

actuarial-1.1.0

ad-1.0.6_patched

audio-1.1.4

benchmark-1.1.1

bim-1.0.2

bioinfo-0.1.2

civil-engineering-1.0.7

combinatorics-1.0.9

communications-1.1.0_svn20120127_patched

control-2.2.4

data-smoothing-1.2.3

dataframe-0.8.2

econometrics-1.0.8

fenv-0.1.0

financial-0.3.2

fpl-1.2.0

fuzzy-logic-toolkit-0.3.0

ga-0.9.8

general-1.2.2

generate_html-0.1.3

geometry-1.4.0

gnuplot-1.0.1

gpc-0.1.7

gsl-1.0.8

ident-1.0.7

image-1.0.15

informationtheory-0.1.8

integration-1.0.7_svn20120128

io-1.0.16

irsa-1.0.7

java-1.2.8_patched

linear-algebra-2.1.0_svn20120127

mapping-1.0.7

mechanics-1.2.0

miscellaneous-1.0.11_svn20120127

missing-functions-1.0.2

msh-1.0.2

multicore-0.2.15

nlwing2-1.2.0

nnet-0.1.13

nurbs-1.3.5

ocs-0.1.3_svn20120128_patched

octclip-1.0.0

octgpr-1.2.0

odebvp-1.0.6

odepkg-0.8.0_svn20120127

optim-1.0.17_patched

optiminterp-0.3.4_svn20120128_patched

outliers-0.13.9

physicalconstants-0.1.7

plot-1.1.0

quaternion-1.0.0

secs1d-0.0.8

secs2d-0.0.8

secs3d-0.0.1

signal-1.1.2

simp-1.1.0

sockets-1.0.7_svn20120128_patched

specfun-1.1.0

special-matrix-1.0.7

spline-gcvspl-1.0.8

splines-1.0.7

statistics-1.1.0_svn20120128

strings-1.0.7

struct-1.0.9

symband-1.0.10

symbolic-1.1.0

tcl-octave-0.1.8

time-1.0.9

tsa-4.1.1

video-1.0.2_patched

vrml-1.0.12_svn20111014_patched

windows-1.1.0

xraylib-1.0.8

zenity-0.5.7

Maintainer: Nitzan Arazi

Latest update: 2012-01-28

Manual installation instructions

Create an installation directory of which doesn't have space chars (i.e. C:\Octave\Octave3.6.0_gcc4.6.2\). This directory is referred hereafter as <your_install_dir>.

Extract the complete directories tree from Octave3.6.0_gcc4.6.2_20120129.7z to the installation directory keeping the original directory structure as in the archive (you can use 7-zip tool from http://www.7-zip.org/).

Copy octave3.6.0_gcc4.6.2.lnk to any convenient location and edit its properties respectively to point to <your_install_dir>\bin\octave.exe and <your_install_dir>\share\octave\3.6.0\imagelib\octave-logo.ico as an icon

Copy octave3.6.0_gcc4.6.2_docs.lnk to any convenient location and edit its properties respectively to point to <your_install_dir>\doc\octave and <your_install_dir>\share\octave\3.6.0\imagelib\octave-logo.ico as an icon.

At this point you can:

a. Launch and use octave by double-clicking the copied octave3.6.0_gcc4.6.2.lnk

b. Access and browse the documentation files by double-clicking the copied octave3.6.0_gcc4.6.2_docs.lnk

Manual installation instructions for the Octave-forge packages

Extract the complete directories tree from Octave3.6.0_gcc4.6.2_pkgs_20120128.7z to the installation directory (<your_install_dir>) keeping the original directory structure as in the archive (you can use 7zip tool from http://www.7-zip.org/).

In order to update octave_packages database with your installation tree and auto-load most packages (excluding 'ad' and 'windows' which may crash octave when loaded and 'clear all' is executed), launch Octave and execute the following 3 rebuild commands from the octave console:

Last pkg rebuild command is required in order for the java pkg entry to be moved to the top of <your_install_dir>\share\octave\octave_packages db file - thus java pkg is loaded before io pkg is loaded, and io pkg related jars are added to java class path.

You can optionally adjust your installed packages status per your specific needs and usage by executing the following commands:

Notes

Although there are some remaining known issues, some bugs reported to the octave-3.2.3 have been corrected. In addition, useful octave-forge packages are added (Java, Jhandles, ....). Please see RELEASE_NOTES.txt for details:

It is reported that the oct2mat octave-forge package affects plot related commands. The purpose of the package is to convert m-file into matlab-compatible coding style. Please see the documentation of the octave-forge (oct2mat - freetb4matlab) from http://octave.sourceforge.net/functions_by_package.php)

Realistic solution at this moment, do not install the oct2mat package when you install octave with octave-forge packages if you do not use this package. Another solution is to execute

pkg rebuild -noauto oct2mat

at the octave prompt and then restart octave. The operation results in the oct2mat package not to be auto-loaded in startup. When you want to use oct2mat, execute

pkg load oct2mat

The plot octave-forge package still have ginput code although the ginput function is now merge into octave itself. Therefore conflict occur if the plot package is installed. To avoid this problem, rename 'ginput.m' in the folder ..\Octave\3.2.4_gcc-4.4.0\share\octave\packages\plot-1.0.7, for example ginput.ob.m. In some computers which has one core CPU, response of ginput is very slow. In the case, modify '__gnuplot_ginput__.m' according to the following thread. http://old.nabble.com/ginput-on-Octave-3.2.4-mingw32-to28093888.html

From gnuplot-4.4.0, the default terminal of gnuplot for windows is the wxt terminal. Some users may set the GNUTERM environmental variable for the windows terminal being default. The gnuplot for windows allows to set GNUTERM to 'win' (abbreviated form) but octave does not recognize the abbreviated form for terminal name. If one would like set GNUTERM to windows terminal, one should specify it as 'windows' (full form) but not 'win' (abbreviated form). In detail see the following thread: http://old.nabble.com/flicking-problem-again-Octave-3.2.4-mingw32-td28038688.html

Octave with Visual Studio

Octave binaries compiled with Microsoft Visual Studio are available for download from Octave-Forge site. These binaries come in the form of an easy-to-use installer (created with NSIS) and are provided in 2 flavors: pre-compiled version for Visual Studio 2008 and for Visual Studio 2010.

These binaries do not include the Microsoft Visual C++ compiler. This must be installed separately, but is only required if you plan to compile and link source code against the pre-compiled octave release. If the Visual C++ compiler is not present on the target system, then the Visual C++ runtime libraries must be installed prior the installation of these binaries. These runtime libraries are support libraries that are required by any code compiled with the Visual C++ compiler. They can be downloaded for free from the Microsoft download site:

Note that if you already installed other software on your system, there is a possibility that these runtime libraries are already present. Search for a files named msvcr90.dll (Visual Studio 2008) or msvcr100.dll (Visual Studio 2010) in the %WINDIR% directory (usually C:\WINDOWS).

Installation

The pre-compiled versions for Visual Studio come in the form of a self-installing executable. Simply download the executable, run it and follow the installer instructions. To avoid possible problems with white spaces in the octave paths, it is strongly recommended to install octave in a directory that do not contain any white spaces.

Octave-Forge packages are not installed by default. To install packages, expand the section "Octave Forge" in the component selection page of the installer and select the packages you wish to install. Note that installed packages are not loaded by default. To use the packages, you still need to load them into octave.

Printing (installing Ghostscript)

In order to use the print command ghostscript must be installed.
The installer may be obtained at
sourceforge.

The instructions below assume the GLP version of Ghostscript is installed with
the Destination directory C:\Program Files (x86)\GPLGS\.
The Destination directory may be different for 32 bit and 64 bit windows and can also
change for different versions of Ghostscript. Therefore, it is important that the user
make note of the Destination directory used to install Ghostscript and use it in place of
the Destination directory used in these instructions.

In order for Octave to find Ghostscript, the directory containing Ghostscript's command line
program must be in the command shell's path. The name of Ghostscript's command
line program may vary. Some examples are gswin32c.exe, gswin64c.exe,
gs.exe, and mgs.exe.
To directory containing Ghostscript's command line program may either be added to the command
shell's using Windows Control Panel, or by having Octave modify the path variable to
include the directory where Ghostscript's command line programs resides.

For the latter, to following lines may be placed in the ~/.octaverc
file (where ~ indicates the user's home folder).
The variable gs_path should be set to the Destination
directory where Ghostscript was installed.

In this case, the value of gs_path has been set to the location of Ghostscript's command
line program for the GPL's 8.15 version of Ghostscript. The location for other versions may differ.
Please determine the location of the installed Ghostscript command line program and make the needed
adjustments to these instructions.

To set the path via the Control Panel,

Go to Control Panel --> System and Security --> System

Click Advanced System Settings

Click Environment Variables

In the System Variables area, locate the Path variable, highlight it and click Edit.

Add the Destination directory where Ghostscript is installed and confirm the change by clickiing OK, OK, OK.

If the 64 bit version of Ghostscript is installed, Octave will not automatically detect it. To use the 64 bit version an
option telling Octave about it must be passed to the print command. For example to produce PDF
output for a figure, using the 64 bit version of Ghostscript, the command below may be used.

print -Ggswin64c.exe figure.pdf

At this point most of Octave's printing functionality should work. When output is
produced using the print command the warnings below will be given.

warning: print.m: epstool binary is not available.
Some output formats are not available.
warning: print.m: fig2dev binary is not available.
Some output formats are not available.
warning: print.m: pstoedit binary is not available.
Some output formats are not available.

For the print command to be fully functional, each of these utilities will also need to be installed,
and their locations added to the Path variable via either the Control Panel
or Octave's ~/.octaverc file.

Using the Visual C++ compiler with Octave

As of version 3.6.1, the Microsoft Visual C++ compiler is not automatically detected. If you need to use it from octave (for instance to compile a MEX, OCT file, and building packages), then you must configure your system by updating the appropriate environment variables: %PATH%, %INCLUDE% and %LIB%. One way to achieve this easily is to call the vcvarsall.bat script (from the Visual C++ installation directory) prior executing octave. You can for instance automate this by creating a batch script with the following content (adapt paths to your actual installation):

Alternative

In addition to the instructions provided in the Octave manual and Octave-Forge repository, a basic toolkit for building Octave in windows using the MSVC compiler has been produced by Michael Goffioul. It consists of a set of scripts that can be used to compile Octave and its dependencies.