Compiling Octave 3.8 for Ubuntu 12.04

You should instead just use the easy 10 second Octave PPA install or compile GNU Octave 4 instead.

Download source

wget -P ~/Downloads http://ftp.gnu.org/pub/gnu/octave/octave-3.8.2.tar.bz2

Extract to directory:

tar -C ~/Downloads -xvf ~/Downloads/octave-3.8*.tar.bz2

Prerequisites

apt install gfortran debhelper automake dh-autoreconf texinfo texlive-latex-base texlive-generic-recommended epstool transfig pstoedit libreadline-dev libncurses5-dev gperf libhdf5-dev serial-dev libblas-dev liblapack-dev libfftw3-dev texi2html less libpcre3-dev flex libglpk-dev libsuitesparse-dev gawk ghostscript libcurl4-gnutls-dev libqhull-dev desktop-file-utils libfltk1.3-dev libgl2ps-dev libgraphicsmagick++1-dev libftgl-dev libfontconfig1-dev libqrupdate-dev libarpack2-dev dh-exec libqt4-dev libqscintilla2-dev default-jdk dpkg-dev gnuplot-x11 libbison-dev libxft-dev llvm-dev

Note: for Ubuntu 12.04, you will have to get LLVM 3.2 Binaries and extract somewhere – you’ll manually link to these in the configure step below.\ E.g.

wget -P ~/Downloads http://llvm.org/releases/3.2/clang+llvm-3.2-x86_64-linux-ubuntu-12.04.tar.gz
tar -C ~/Downloads xvf ~/Downloads/clang+llvm-3.2-x86_64-linux-ubuntu-12.04.tar.gz

Configure Ubuntu

 ./configure --enable-jit

You may get the error:

configure: WARNING: JAVA_HOME environment variable not initialized. Auto-detection will proceed but is unreliable.

For me, Java was found automatically despite this error.

For Ubuntu 12.04, get the LLVM 3.2 binaries as noted in the prior section, and add to the ./configure

--prefix=/opt/octave3.8 LLVM\_CONFIG=\~/Downloads/clang+llvm-3.2-x86\_64-linux-ubuntu-12.04/bin/llvm-confige

Compile Octave 3.8

takes about 30 minutes to compile on a Sandy Bridge i7-2600 CPU.

make

make check

I get:

PASS 11503
FAIL 0
XFAIL 7

make install

ln -s /opt/octave3.8/bin/octave /usr/local/bin/octave3.8

Run Octave 3.8 with GUI

octave3.8 --force-gui

You can of course make a bash alias to always add that –force-gui for you.

nano ~/.bash_aliases

and add the line

alias octave38="octave3.8 --force-gui"

Notes re: LLVM version:

As of this comment from mtmiller on January 2014, Octave 3.8 requires LLVM 3.2 or 3.3 to compile:

https://savannah.gnu.org/bugs/?41061#comment9\

Ubuntu 12.04 defaults to LLVM 2.9, which is now too old for Octave 3.8. I would suggest considering the Pre-Built Binaries

Note: surf() seems to be broken with the otherwise fast and great FLTK plotting.

As Ian notes, when you need surf(), circumvent this problem by falling back to gnuplot by typing in Octave:

graphics_toolkit('gnuplot')  

Reference (Jordi G. H.):

http://octave.1599824.n4.nabble.com/Please-release-RC1-to-octave-unstable-PPA-td4659924.html

Categories:

Updated:

Leave a Comment