Compile Octave 4.4 on Ubuntu
One might choose to compile GNU Octave to use the latest development source. However, most users should instead download Octave or on Linux install Octave flatpack This procedure was tested with Ubuntu 18.04, g++ 7.3, LLVM 6.0 and Java/OpenJDK 10.
apt install g++ make gawk gfortran gnuplot texi2html icoutils libxft-dev gperf flex libbison-dev libqhull-dev libglpk-dev libcurl4-gnutls-dev librsvg2-dev libqrupdate-dev libgl2ps-dev libarpack2-dev libreadline-dev libncurses-dev libhdf5-dev llvm-dev default-jdk texinfo libfftw3-dev libgraphicsmagick++1-dev libfreeimage-dev transfig epstool librsvg2-bin libosmesa6-dev libsndfile-dev lzip libatlas-base-dev liblapack-dev libsundials-dev
graphical prereqs–if you only want the command line Octave + GNUplot-based plotting, you can OMIT these prereqs:
qtbase5-dev qttools5-dev libqscintilla2-qt5-dev
Octave development prioritizes Qt over the other two GUI methods (FLTK, GNUplot).
Download Octave source octave-*.tar.lz and extract
tar -xf octave-4*.lz
Configure GNU Octave build:
mkdir ~/.local/octave
in the directory where you extracted Octave source:
./configure --prefix=$HOME/.local/octave
configure
takes a minute or two, perhaps several minutes on slower systems.
Usually it will tell you if a prerequisite library is missing.
Configure Octave 4.4 results
If you get errors with conflicting libraries, try before the ./configure
command:
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
Installing GNU Octave takes 30-60 minutes:
make -j -l2 CFLAGS=-O CXXFLAGS=-O LDFLAGS=
make install
limit make
resource usage with make -j -l2
.
use this new GNU Octave by adding to ~/.bashrc
export PATH="$HOME/.local/octave/bin/:$PATH"
Configure ~/.octaverc to nicer defaults.
Test Octave build:
make check
results in:
PASS 14981
FAIL 0
XFAIL (reported bug) 35
SKIP (missing feature) 71
SKIP (run-time condition) 12
Notes
- Download Windows Octave installer
- MacOS easy Octave install:
brew install octave
- GNU Octave release history
If fonts look terrible in GNU Octave Terminal or Editor, fix by changing to a better font:
- Edit → Preferences → Terminal → Font → Liberation Mono
- Edit → Preferences → Editor Styles → Octave → Default → Liberation Mono
libinterp/corefcn/jit-typeinfo.cc:216:1: error: ‘octave_jit_octave’ has not been declared octave_jit_octave::err_nan_to_logical_conversion (void)
This error (for Octave 4.2) comes from the
non-functioning JIT;
please do not use --enable-jit
at ./configure
with Octave 4.2.
lrelease: could not exec ‘/usr/lib/x86_64-linux-gnu/qt5/bin/lrelease’: No such file or directory
this error fixed by
apt install qttools5-dev-tools
- Qt5 libraries
- Octave 4.2 configure results (obsolete)
Related: Easy 10 second Octave install