Installation of Octave on PC, Mac, and Linux

Introduction: What is GNU Octave?

GNU Octave is an open source program similar to MATLAB, a program that is widely used by engineers. Octave features an interactive command line interface, as well as extensive graphic abilities provided by Gnuplot. Octave is mostly compatible with MATLAB. Programs written for MATLAB can be easily ported to Octave. Octave is free to install, and is compatible with most computer operating systems including: Mac OSX, Windows 98 and higher, and most Linux distributions.

This guide will take you through the basics of installing Octave and its prerequisites on Windows, Mac OSX, and Linux computers.

Table of contents:

Instructions for installing Octave on Mac OSX

This guide will cover the process of installing Octave on your Mac using pre-built packages from Octave-Forge. There are other options for installing Octave on the Mac. These methods include ports provided by the Fink project and MacPorts. However, the following method is easiest stand-alone way to install Octave on your Mac.

Before you begin the installation process, insure that you are running at least Mac OSX 10.4 and that you have access to the internet. You can check what version of OSX you are running by clicking on "About This Mac" in the Apple menu. The Octave application requires about 200MB of space once it is installed.

Step 1. Download and install Octave

1. To install Octave on your Mac, begin by downloading the latest binary release from here.

If you have an older PPC Mac, download the octave-3.2.3-ppc binary instead. The installation process on an older Mac should not differ much from the instructions presented here.

2. In the Finder, double-click on the downloaded octave-3.4.0-i386.dmg file in your "Downloads" folder, and wait for the disk image to mount.

3. Once the disk image has mounted, drag the Octave application, which is located inside, to your "Applications" folder.

Step 2. Install Gnuplot

Octave uses the Gnuplot application to plot graphs. In order to fully utilize Octave, you will need to install the Gnuplot application.

1. The Gnuplot application is available in the "Extras" folder on the disk image that you downloaded to install the Octave application.

2. Double-click on the gnuplot.dmg file located in the "Extras" folder of the disk image.

3. When the disk image has mounted drag the Gnuplot application to your "Applications" folder.

Step 3. Download and install AquaTerm

AquaTerm is a lightweight application that Gnuplot uses to display the graphs it has plotted. Without AquaTerm, Octave will display error messages.

1. Download AquaTerm from aquaterm.sourceforge.net. The latest version is available here.

2. Double-click to mount the downloaded disk image.

3. Inside the mounted disk image, double click on the AquaTerm.pkg file to install AquaTerm. Agree to the license and follow the prompts to install AquaTerm in your "Applications" folder.

Instead of AquaTerm, you can use the X11 environment to display the results of Gnuplot on your Mac. The X11 environment is available on the Mac OSX installation CD that came with your computer, but the software is not installed by default. You can install X11 and use it as a replacement for AquaTerm.

The advantage of X11 is that it provides a bit more interactivity than AquaTerm. The downside being that it is more processor intensive. If you want to try X11, launch gnuplot from the Terminal by typing "gnuplot" at the prompt. Change the default "aqua" setting to X11 by typing "set term x11" without quotes at the prompt. To switch back simply type "set term aqua."

Important: If you have an older Mac, running the 10.4 operating system, X11 is required for Octave to work. Install X11 using the CDs that came with your computer, or download the software from Apple. Click here for a link to the latest version of X11.

Step 4. Restart your computer

Restart your computer after the installation process is complete. This will help prevent some of the most common problems that you might encounter after installing Octave.

Step 5. Test your Octave installation

Launch Octave to make sure that everything is working correctly.

1. Double-click the Octave application located in your "Applications" folder.

After a few seconds the Mac Terminal application should open and display an Octave command prompt.

2. To make sure the application is working, enter a simple calculation at the prompt. For instance: Type "2+3" followed by the return key. In response, Octave should display "ans = 5."

3. To test Octave’s ability to plot graphs, type "fplot (@sin, [-10, 10], 201);" or something similar without quotes and press return. Octave should launch a separate AquaTerm window displaying the resulting graph.

4. To exit Octave type "exit" or "quit" without quotes at the command prompt and hit return.

Instructions for installing Octave on Windows

This guide will cover the process of installing Octave on Windows. Pre-built packages are available from Octave-Forge. If you are a Cygwin user, you can also install Octave through Cygwin. For most users, Cygwin is unnecessarily complicated, so this guide will focus on installing Octave from the stand-alone installers provided by Octave-Forge. You can install Octave on any Windows operating system from Windows 98 up. Octave requires about 200MB of space once it is installed

Step 1. Download and install Octave for Windows

1. Download the latest Octave installer for Windows from Octave-Forge. For a direct link to the download, click here.

2. Once the download is complete, run the downloaded program. If a security warning window pops up click "run." Before Octave can install, you must agree to the license.

3.Unless you are an expert user, allow the program to install Octave in the default location. The installer will place the Octave files in C:\Octave\.

4. During the installations process, the installer will present you with a list of components to install. If you have specialized needs, feel free to check any additional components that you would like to install, but do not un-check any of the default options. There is a good chance that doing so will result in problems running Octave.

Step 2. Launch and test Octave

After the installation process is complete, launch Octave to insure that it is functioning correctly. During installation, the Octave installer put a startup folder in your Start Menu. You can find it by going to Start Menu -> All Programs -> GNU Octave. The startup folder contains a PDF manual and a Quick Reference card as well as a startup icon for Octave.

1. Launch Octave by going to the folder GNU Octave folder found here: Start Menu -> All Programs -> GNU Octave, and clicking on the Octave startup icon.

2. Wait for the Octave console to launch.

3.To check if Octave is functioning , enter a simple calculation at the prompt. For instance: Type "2+3" followed by the enter key. In response, Octave should display "ans = 5."

4. To exit Octave type "exit" or "quit" without quotes at the command prompt and hit enter.

Instructions for installing Octave on Linux

Octave is easy to install on Linux. Most Linux distributions have Octave binaries available. Any prerequisite software will be automatically downloaded and installed by your package management software.

Step 1. Install Octave

Below are specific instructions for some of the most common Linux distributions including Ubuntu, Debian, Fedora, RedHat, Gentoo, and SuSE. Other linux distributions will be able to install Gnu Octave in a similar manner to the examples given below.

Before you begin the installation process make sure you have access to the internet. Installing octave will require at least 200MB of free space.

Installing Octave on Ubuntu

1. Launch the Synaptic Package Management software from the top menubar by going to System -> Administration -> Synaptic Package Manager.

2. Click on "Search." Enter "Octave3.2" into the search box and press on enter.

3. Right-click on "Octave3.2" in the search results and choose "Mark for Installation." Synaptic will automatically mark all the supporting packages necessary to install and run Octave.

4. Click "Apply" in the toolbar and click on the confirmation menu when it pops up. The list of software to install will include Octave as well as its dependancies.

5. Wait for Synaptic to finish installing the program.

Installing Octave on Debian

If you are a Debian user and you have the Synaptic Package Manager installed, then you may follow the instructions for installing Octave on Ubuntu. If you prefer to install Octave from the command line, then follow these instructions:

1. From the terminal type "sudo aptitude --assume-yes install octave3.2 octave3.2-doc gnuplot" without quotes and press enter.

2. Type your password at the prompt and press enter.

3. Wait while Octave is installed.

Installing Octave on Fedora

The easiest way to install Octave on Fedora is through the command line.

1. From the command line, type "sudo yum install octave octave-forge gnuplot" without quotes and press enter.

2. Enter your password at the prompt, and accept all the default options when yum prompts you.

3. Wait while yum downloads and installs Octave.

Installing Octave on RedHat

Octave is included with the default installation of RedHat Linux.

Installing Octave on Gentoo

It is easy to install Octave through Gentoo's Portage package management system.

1. From the command line type "sudo emerge sync" without quotes and press enter. Wait while emerge updates itself.

2. Next, type "sudo emerge octave octave-forge" without quotes and press enter.

3. Wait while the program is installed.

Installing Octave on SuSE

Octave is included with the default installation of SuSE Linux.

Installing Octave on other Linux distributions

If your distribution is not covered in this guide, you have a few options for installing Octave. Your first step should be to open up the application that you usually use to install software, and perform a search for Octave. If you are lucky, your distribution already provides an Octave binary. If you do find an Octave package, then install it along with Gnuplot.

If you cannot find a pre-built binary for your operating system and you are comfortable compiling your own software, then you can compile your own binary. Octave is generally quite easy to build. Instructions on how to compile Octave is beyond the scope of this guide, but if you are interested, further information on building Octave is available here and here.

Step 2. Launch and test Octave

Make sure that your Octave installation has gone smoothly.

1. Launch Octave. After installation, most linux distributions place a shortcut to Octave somewhere in their "Applications" menu. You can also launch Octave through the command line. Simply type "octave" in your terminal window.

2. To make sure the application is working, enter a simple calculation at the prompt. For instance: Type "2+3" followed by the return key. In response, Octave should display "ans = 5."

3. To test Octave’s ability to plot graphs, type "fplot (@sin, [-10, 10], 201);" or something similar without quotes and press return.

4. To exit Octave type "exit" and hit enter.

If you do encounter errors, make sure that all the program files were installed successfully. Check that you are using the latest version of Octave. It is not necessary, but sometimes it is helpful to restart your computer after installing Octave.

Additional information and support

Further documentation for GNU Octave is available online. If you run into unexpected problems during the installation process, help is available through several websites.

The Octave community maintains a wiki at http://wiki.octave.org/. The octave-forge website is home to installation packages for Mac and Windows, as well as additional Octave packages. The complete Octave manual is available at http://www.gnu.org/software/octave/doc/interpreter/index.html. While you are running Octave, you can access the programs built in help system by typing "help" at the command prompt.

Unanswered questions can be addressed by the Octave users mailing list at help@octave.org. You can also subscribe to the Octave mailing list, or browse through the archives at http://www.octave.org/archive.html.

Quick Links
Student
Registration

Students
Employer
Registration

Employers
Educator
Registration

Educators
Consultants