FANDOM


On Ubuntu and other Debian-based operating systems usually a version of GNU Octave (GNO) may be found in the official software repositories, hence running:

sudo apt-get install octave

is usually sufficient to install some version of GNO, that varies according to one's operating system and release version (e.g., for Ubuntu 12.10 has version 3.6.2 while 15.04 has version 3.8.2). These versions are sometimes up to date in the latest versions of Ubuntu, but usually only for a few months at most. For example 15.04 (Vivid Vervet) was released 23 April 2015, the latest version of GNO was 3.8.2 at the time which was also the version in the Vivid repository. It was the current release up until 29 May 2015.

Building from sourceEdit

When the version of GNO available in the repositories of one's Linux distribution (LD) is not the one would like (which could be because it is out of date) then usually the best solution is to build GNO oneself from source. Building GNU Octave from source is usually relatively easy, the only difficult part per se is getting all the prerequisites required for the build.

PrerequisitesEdit

Via build-depEdit

Usually the following is sufficient on Debian-based LDs to get all the prerequisites required to build GNO from source:

sudo apt-get build-dep octave

But this is heavily dependent on whether the prerequisites for GNO stay constant between the version of GNO in the repositories and the one being built.

DependenciesEdit

A list of required build tools may be found here. Required external packages may be found here.

Dependencies and recommended packages[1][2]
Software Package name (15.04)
[note 1]
Software Center
[note 2]
Mandatory? Purpose?
ARPACK libarpack2-dev
Ubuntu Software Center install logo
Template:Yes Required for large scale eigenvalue problems.
ATLAS libatlas-base-dev
Ubuntu Software Center install logo
Template:No Can be used in conjunction with BLAS (although BLAS is a prerequisite for ATLAS and need not be installed separately) to improve performance of BLAS-dependent calculations.
Autoconf autoconf
Ubuntu Software Center install logo
Template:No Needed if you edit the configure.ac file.
Automake automake
Ubuntu Software Center install logo
Template:No Required if you edit the Makefile.am file.
Bison bison
Ubuntu Software Center install logo
Template:No Parser generator.
BLAS libblas-dev
Ubuntu Software Center install logo
Template:Yes Basic Linear Algebra Subprograms. Required for linear algebra calculations.
Build-essential[note 3] build-essential
Ubuntu Software Center install logo
Template:Yes Required for the build.
cURL libcurl4-gnutls-dev
Ubuntu Software Center install logo
Template:No Library for transferring data with URL syntax.
epstool epstool
Ubuntu Software Center install logo
Template:No Epstool is a utility to create or extract preview images in EPS files, fix bounding boxes and convert to bitmaps.
FFTW3 libfftw3-dev
Ubuntu Software Center install logo
Template:No Library for computing discrete Fourier transforms.
fig2dev transfig
Ubuntu Software Center install logo
Template:No Used to generate xfig figures.
Flex flex
Ubuntu Software Center install logo
Template:No Lexer analyser.
FLTK libfltk1.3-dev
Ubuntu Software Center install logo
Template:No Portable GUI technology.
fontconfig libfontconfig1-dev
Ubuntu Software Center install logo
Template:No
FreeType libfreetype6-dev
Ubuntu Software Center install logo
Template:No
gfortran gfortran
Ubuntu Software Center install logo
Template:Yes Required for building from source.
gl2ps libgl2ps-dev
Ubuntu Software Center install logo
Template:No
GLPK libglpk-dev
Ubuntu Software Center install logo
Template:No
GNU Readline libreadline-dev
Ubuntu Software Center install logo
Template:No
gnuplot gnuplot
Ubuntu Software Center install logo
Template:No
gperf gperf
Ubuntu Software Center install logo
Template:No Perfect hash function generator.
GraphicsMagick++ libgraphicsmagick++1-dev
Ubuntu Software Center install logo
Template:No
gzip gzip
Ubuntu Software Center install logo
Template:No Required for extracting .tar.gz archives.
HDF5 libhdf5-serial-dev
Ubuntu Software Center install logo
Template:No Required for reading HDF5 files.
Icoutils icoutils
Ubuntu Software Center install logo
Template:No Required for generating logo in .ico format.
LAPACK liblapack-dev
Ubuntu Software Center install logo
Template:Yes Linear algebra package.
Libsndfile libsndfile1-dev
Ubuntu Software Center install logo
Template:No
Libtool libtool
Ubuntu Software Center install logo
Template:No Package for building software libraries; it is required by automake.
LLVM llvm-dev
Ubuntu Software Center install logo
Template:No
lpr lpr
Ubuntu Software Center install logo
Template:No BSD lpr/lpd line printer spooling system
OpenGL libgl-dev
Ubuntu Software Center install logo
Template:No Used for superior graphics rendering to that provided by gnuplot.
OpenJDK openjdk-7-jdk
Ubuntu Software Center install logo
Template:No Java programming language compiler and libraries; required to call Java functions within GNO.
OSMesa libosmesa6-dev
Ubuntu Software Center install logo
Template:No OSMesa is required for extra rendering capabilities for GNO version 4.0 and higher.
PCRE libpcre3-dev
Ubuntu Software Center install logo
Template:Yes The Perl Compatible Regular Expression library.
Qhull libqhull-dev
Ubuntu Software Center install logo
Template:No Computational geometry library.
QRUPDATE libqrupdate-dev
Ubuntu Software Center install logo
Template:No QR factorization updating library.
QScintilla libqscintilla2-dev
Ubuntu Software Center install logo
Template:No Source code highlighter and manipulator.
Qt libqt4-dev libqtwebkit4
Ubuntu Software Center install logo
Ubuntu Software Center install logo
Template:No Required for building the GUI on versions ≥3.8.0.
SuiteSparse libsuitesparse-dev
Ubuntu Software Center install logo
Template:No Sparse matrix factorization library.
tar tar
Ubuntu Software Center install logo
Template:No Required for extracting .tar.gz directories from the command-line.
Texinfo texinfo
Ubuntu Software Center install logo
Template:No Package for generating online and print documentation.
zlib zlib
Ubuntu Software Center install logo
Template:No Data compression library.

InstallationEdit

After all the build dependencies have been installed, the rest should be fairly simple. The following script should install GNO:

  1. cd /tmp
  2. wget -c ftp://ftp.gnu.org/gnu/octave/octave-x.y.z.tar.gz
  3. tar -xzf octave-x.y.z.tar.gz
  4. mv octave-x.y.z octave
  5. sudo mv octave /opt/
  6. cd /opt
  7. sudo chmod 777 -R octave
  8. cd octave
  9. ./configure
  10. make
  11. sudo make install

where x,y,z need to be substituted according to the version of GNO being installed and the first 8 lines are not strictly required, but are merely added to show one way of getting the source tarball and installing GNO from that. The ./configure line sometimes will generate an error regarding its inability to detect certain dependencies that you may have installed earlier. If you get an error like this during configuration:

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

Then it may be necessary to add:[3]

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

to line 9, giving:

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

NotesEdit

  1. To install from terminal type
    sudo apt-get install <package-name>
  2. Click the picture to download these packages
  3. Consisting of:

Reference listEdit

  1. G.1.2 Build Tools. GNU Octave Documentation. Retrieved 15 June 2015.
  2. G.1.3 External Packages. GNU Octave Documentation. Retrieved 15 June 2015
  3. Bug #38928

Further readingEdit

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.