Compiling Octave 4.2 on Ubuntu 16.04

Related:


Linux compile latest Octave

This procedure was tested with Ubuntu 16.04, g++ 6.2, LLVM 3.8 and Java 8.

  1. Prereqs
    apt install g++ make gawk gfortran gnuplot texi2html icoutils libxft-dev gperf flex libbison-dev libqhull-dev libglpk-dev libcurl4-gnutls-dev libfltk1.3-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 libjasper-dev libfreeimage-dev transfig epstool librsvg2-bin libosmesa6-dev libsndfile-dev portaudio19-dev lzip libatlas-dev liblapack-dev libqt5scintilla2-dev qttools5-dev-tools
    

    Octave 4.2 works with QT4 or QT5; here we use QT5.

  2. Download GNU Octave Source octave-*.tar.lz and extract
    tar -xf octave-4*.lz
    
  3. Compile GNU Octave Source
    mkdir /opt/octave4
    chown $(whoami):$(whoami) /opt/octave4
    
    cd octave-4*
    
    # this fixes problems with conflicting libraries
    export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
    
    ./configure --prefix=/opt/octave4
    

    Configure Octave 4 results

  4. Install GNU Octave–takes 30-60 minutes:

    make -j4
    make install
    
    -jN
    N is number of threads
  5. Tell Linux to use this new GNU Octave by adding to ~/.bash_aliases
    alias octave="/opt/octave4/bin/octave -q"
    
  6. (optional) Test Octave

     make check
    

    PASS 14868 FAIL 0 XFAIL 33 SKIPPED 43

GNU Octave hard to read font fix

If fonts look terrible in GNU Octave Terminal or Editor, fix by changing to a better font:

  1. Edit → Preferences → Terminal → Font → Liberation Mono
  2. Edit → Preferences → Editor Styles → Octave → Default → Liberation Mono

Notes

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 comes from the non-functioning JIT in Octave 4.2; please do not use --enable-jit at ./configure.


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

Leave a Comment