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

Extract to directory:

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


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
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 check

I get:

PASS 11503

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:\

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:


Reference (Jordi G. H.):



Leave a Comment