Sunday, 4 September 2011

How to install Octave on Mac OS X Snow Leopard

I found that the easiest way to install Octave is to download the binary file from ="">here. It can just be installed by dragging and dropping, which is great. Alternatively, the instructions to install Octave from the source is available from the Octave homepage.

For snow leopard, make sure to apply the following fix to get Octave to work as mentioned here:

1 - mkoctfile
Since OSX 10.6 the Apple shipped version of gcc builds by default 64bit binaries.
As the libraries included with version 3.2.3 are 32bit, you need to apply the following patch in order for mkoctfile to work:
1.1) open the folder /Applications in the finder
1.2) right-click on and select "show package contents"
1.3) navigate to /Applications/
1.4) right-click on the file "mkoctfile" and select "Open with -> Other ... ->"
1.5) right after the line:

# along with this program; If not, see

add the lines


and save.

A binary for Gnuplot is included in the octave.dmg, which is needed to plot graphs. However, if Gnuplot is already installed on your system (see here for a short how-to) you will have to set the environment variable for the gnuplot terminal to use X11, or octave may give errors if aquaterm is not installed. To do so, just add:

export GNUTERM=X11

to your .bash_profile

If you wish to use the binary for gnuplot (version 4.2 as of writing) from the octave.dmg, look here on how to get it to work properly.

No comments:

Post a Comment