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
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
  • 7,919
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
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
  • 1
  • 4
  • 12
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
4
votes
1 answer

Octave install error when libreadline was installed to /usr/local/

I installed Octave 3.8.1 a few months ago and discovered that the GNU readline was not working properly. I tried reinstalling Octave 3.8.0, but the GNU readline does not work for the previous version now. GNU readline was working properly for Octave…
linuxfreebird
  • 215
  • 1
  • 6
  • 17
4
votes
2 answers

GNU Octave Command Window unreadable text

GNU Octave Command Window showing unreadable text. Ubuntu 16.04 LTS. GNU Octave 4.2.2. Intel® HD Graphics 520 (Skylake GT2). Octave was installed by means of the Terminal.
3
votes
0 answers

Binding Octave Libraries

I am working with embed octave. While building the library, I encountered this error, can anyone suggest solution for this. /usr/local/lib/octave/5.1.0/oct/x86_64-pc-linux-gnu/PKG_ADD:…
2
votes
1 answer

Change default workspace in Octave

I freshly installed Octave on my Computer and was wondering if I could switch the default workspace from /home/user to, let's say,/home/user/Octave but could not find any advice online... I am using Ubuntu 14.04 if that's of any importance. Any help…
2
votes
1 answer

GNU Octave documentation failure

When starting GNU Octave, I get this error window Looking in /usr/share/octave/4.4.1/doc I found I did not have write access to the .qhc file there. I tried to give everyone write access to it, but that didn't help. Octave runs just fine, but the…
1
vote
0 answers

Installing Octave on Ubuntu 16.04 with Nvidia Running

I am trying to install Octave on Xenial which has an Nvidia graphics card. Octave installs but quits as soon as I try to start it from command line. Please suggest any solutions. I have octave running on a number of other machines but that run…
1
vote
2 answers

GNU Octave installation problem with Ubuntu 14.04

I installed Ubuntu 14.04 LTS on my Dell Vostro laptop and then tried installing GNU octave using the following commands: sudo apt-add-repository ppa:octave/stable sudo apt-get update sudo apt-get install octave After the installation, when I type…
Siva
  • 21
1
vote
0 answers

Octave-control package installation is not working

I have sucessfully installed octave and octave-control from ubuntu repo. but when i try to use it I get following error. enter octave:2> num = [ 1 2] num = 1 2 octave:3> den = [ 2 4 6] den = 2 4 6 octave:4> sys = tf(num,den) error:…
1
vote
1 answer

Need help getting serial data using Octave

I'm trying to use Octave and the Instrument Control package to read in serial data through the USB port. Right now I'm just sending test data through the port. Zeros and ones. I'm getting correct data through the USB when I use screen: screen…
JDD
  • 183
1
vote
2 answers

How I can update my octave-3.2.4 to octave-3.6.2?

I'm having Problems with using imsgesc and ginput in my octave-3.2.4 version and would like to upgrade to octave-3.6.2, how can this be done?
1
2