Questions tagged [octave]

GNU Octave is a high-level interpreted language and software, primarily intended for numerical computations. Historically it has been solely run from the command-line (that is, through a terminal emulator) but since version 3.8.0 a graphical user interface (GUI) has been available as part of the software.

Screenshot of GNU Octave 4.0.0 running on 32-bit Ubuntu 15.04
Figure 1: Screenshot of the GNU Octave 4.0.0 command-line interface

GNU Octave is a high-level interpreted language that is mostly MATLAB(R)-compatible and is primarily intended for numerical computations. It provides a convenient command line interface (CLI) for solving linear and nonlinear problems numerically, although since version 3.8.0 (which is available in the official repositories for Ubuntu 14.04 and later) a graphical user interface (GUI) has also been available for the software (for versions 3.8.x this GUI may be called by running octave --force-gui). Octave uses some of the best and most respected numerical libraries and it can be dynamically extended with user-supplied C++ files.

Screenshot of the GNU Octave 4.0.0 GUI Figure 2: Screenshot of the GNU Octave 4.0.0 GUI in the Xfce desktop environment

Installing GNU Octave

Installation of Octave on Ubuntu is usually easiest done via APT or the Ubuntu Software Center, although installation from source is a viable alternative if one would prefer a different version of the software (like, for example, the latest version) to that available in the Ubuntu repositories. Installing GNU Octave from source is simple in itself (although it often takes hours of time, most of which is without the need for user input), but what makes the whole process more time-consuming and complicated is getting all the dependencies, fortunately, however the configure file that comes with the source code of GNU Octave often tells one when one is missing a dependency, or if a dependency is not available to the Octave during compilation.

Installing GNU Octave from source

Source code tarballs for GNU Octave may be found here. Alternatively if one knows the precise version of GNU Octave one wants one can use to get it, via:

ver=4.0.0 #Replace 4.0.0 with the version one wants.
wget -c https://ftp.gnu.org/gnu/octave/octave-$ver.tar.gz

A list of dependencies for Ubuntu systems (including their names in the Ubuntu repositories) can be found here at the official GNU Octave Wiki. Although this list may become out-dated, an alternate source for build dependencies is here, which is the official documentation for GNU Octave, but keep in mind this page can lag behind the updates too (e.g., as of 19 July 2015 this documentation was last updated in 2013) and does not give one the name of these dependencies as they appear in the Ubuntu repositories. Many of these dependencies could be installed by running sudo apt-get install build-dep octave. Once one believes one has all the dependencies required, extract the tarball into a desired directory and run the command trinity (that is, ./configure && make && sudo make install). For example, to extract the tarball and run the trinity, one could run:

tar -xzf octave-$ver.tar.gz
cd octave-$ver
./configure
make
sudo make install DESTDIR=/

It may be worthwhile only copying up to the ./configure stage, as the ./configure command will likely tell one if one is missing any required dependencies. For example, if the ./configure command gives:

Warning: HDF5 library not found. Octave will not be able to save or load HDF5 data files.

even though one is sure that HDF5 is installed on one's system, then in accordance with the answer given to this bug report, the ./configure line should be amended to:

./configure CPPFLAGS=-I/usr/include/hdf5/serial LDFLAGS=-L/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/hdf5/serial

Likewise one may receive a warning that Java was not found and hence autodetect will be used, but is unreliable. In this case look for the home directory for Java on your system, then at the ./configure line set it as your JAVA_HOME variable. For example, if you have a 32-bit system your ./configure line will likely be something like ./configure ... JAVA_HOME=/usr/lib/jvm/java-7-openjdk-i386, where ... could be blank, or could include the HDF5 bug solution outlined earlier in this tag wiki.

140 questions
293
votes
10 answers

How can you completely remove a package?

I am trying to do a clean install of the octave3.2 package. To do this, I removed it, then tried to reinstall it. When I reinstalled, an error occurred. It could be a bug in the package, but I want to make sure I have everything removed so that I…
user1012451
  • 3,235
45
votes
6 answers

How to install Octave 4.0.0 in Ubuntu 14.04

I am using Ubuntu 14.04.2. I want to install the latest version of Octave (Octave 4.0.0 ). But in official Ubuntu repository ,there is only octave version 3.8 available for download/install. How can I install Octave 4.0.0 safely/easily in Ubuntu…
Yuvaraj V
  • 1,806
25
votes
4 answers

How do you install the latest version of GNU Octave?

Yet again I am to turn to this wonderful resource available to me and ask, how do I install the latest version of GNU Octave (not Octave 3.2.4 -- the one available in the software centre)?
Josh Pinto
  • 8,089
22
votes
9 answers

Comparison of Octave, Spyder, Freemat and Scilab as alternatives to MATLAB

I am trying to find an alternative for MATLAB and have so far found: GNU Octave Spyder FreeMat Scilab I'm trying to find which is the best alternative to MATLAB. I'm particularly concerned with performance and the integrity of the results.
user33831
  • 119
  • 3
  • 5
  • 12
20
votes
2 answers

Installing latest version of GNU Octave when I have already installed other version

I have installed Gnu Octave by using apt-get install octave. This installed version 4.0.3 on my machine. I want to install the latest available version. How can I: Uninstall the version I have? Install the latest version?
11
votes
2 answers

How to install statistics package in Octave(4.0.0) in Ubuntu 16.04?

I have tried >> pkg install -forge statistics , but it showed error: the following dependencies were unsatisfied: statistics needs io >= 1.0.18 What should I do now?
Rangerix
  • 471
  • 2
  • 6
  • 11
11
votes
4 answers

When will Octave 3.6.1 be available to be installed?

At this point, octave 3.2 is the version available for directly installation in ubuntu 12.04. But latest stable octave is 3.6.1 now. Will Octave 3.6.1 be packaged for ubuntu 12.04?
G. He
  • 910
9
votes
2 answers

Building ATLAS (and later Octave w/ ATLAS)

I'm trying to set up ATLAS (so I can later compile octave with ATLAS support). If I'm correct, I still need to build this manually due to the environment specific optimizations. I do see a package for ATLAS, but it looks like it's using the cross…
David Parks
  • 2,586
8
votes
2 answers

Installing symbolic package in octave in Ubuntu 14.04

I have installed octave with the following commands: sudo add-apt-repository ppa:picaso/octave sudo apt-get install octave Then from octave I used the following command: pkg install -forge symbolic I got the following error: configure: error:…
8
votes
2 answers

How to force Octave to launch in GUI mode from the dock?

I wonder how to execute "octave --force-gui" (3.8.1) in Ubuntu (14.04) from the graphical interface without having to go through the terminal? (The default icon in the dock bar executes "octave" which is okay but because there is nowadays a nice GUI…
Anders
  • 235
8
votes
6 answers

How to install the latest Octave

I want to install Octave on my Ubuntu LTS with apt-get. The problem is that the official repositories list only Octave 3.0 and Octave 3.2, whereas the latest Octave is Octave 3.6. How do I update the repositories of apt-get to get Octave 3.6?
7
votes
2 answers

Why are there so many OpenBLAS packages and which one would yield fastest results?

In Ubuntu 20.04, there are many packages for OpenBLAS. ~$ apt search openblas p libopenblas-base - Optimized BLAS (linear algebra) library (transitional) p …
6
votes
1 answer

Octave command window showing unreadable text

When I start Octave, on the command window I see this: However, after I run some commands, I can see they are in history and they do execute. I can see the text if I copy-paste it somewhere. How can I make the command window text visible?
5
votes
1 answer

Octave display error, Really small fonts

I've installed Octave 4.2.0 on Ubuntu 16.04: wget ftp://ftp.gnu.org/gnu/octave/octave-4.2.0.tar.gz tar xf octave-4.2.0.tar.gz rm octave-4.2.0.tar.gz cd octave-4.2.0/ ./configure make -j8 sudo make install However there is a graphical bug in my…
user46581
  • 181
5
votes
1 answer

How can I install a package from Octave Forge?

How can I install a package from Octave Forge? I am using imresize function and I get this error warning: the 'imresize' function belongs to the image package from Octave Forge which seems to not be installed in your system. I tried doing this…
1
2 3
9 10