How to install Octave 4.0.0 in Ubuntu 14.04

134,187

Solution 1

You have two options:

  1. Use the octave ppa, which already has the 4.0 version. You can install octave like this:

    sudo add-apt-repository ppa:octave/stable
    sudo apt-get update
    sudo apt-get install octave
    
  2. Download and compile the sources yourself:

    sudo apt-get build-dep octave
    wget ftp://ftp.gnu.org/gnu/octave/octave-4.0.0.tar.gz
    tar xf octave-4.0.0.tar.gz
    cd octave-4.0.0/
    ./configure
    make 
    sudo make install
    

Solution 2

This worked for me at the end.

In terminal, install

sudo apt-get build-dep octave

In synaptic, install

libqt4-opengl-dev

Then, download octave-4.0.0.tar.gz from ftp://ftp.gnu.org/gnu/octave/

unzip octave-4.0.0.tar.gz to home.

cd octave-4.0.0
./configure
make
sudo make install

This worked on all the machines I tried in my laboratory.

Solution 3

You can try this, just type the following commands in terminal and compile the source easily:

sudo apt-get install gcc g++ gfortran make libblas-dev liblapack-dev libpcre3-dev libarpack2-dev libcurl4-gnutls-dev epstool libfftw3-dev transfig libfltk1.3-dev libfontconfig1-dev libfreetype6-dev libgl2ps-dev libglpk-dev libreadline-dev gnuplot libgraphicsmagick++1-dev libhdf5-serial-dev openjdk-7-jdk libsndfile1-dev llvm-dev lpr texinfo libglu1-mesa-dev pstoedit libjack0 libjack-dev portaudio19-dev libqhull-dev libqrupdate-dev libqscintilla2-dev libqt4-dev libqtcore4 libqtwebkit4 libqt4-network libqtgui4 libsuitesparse-dev zlib1g-dev libxft-dev autoconf automake bison flex gperf gzip librsvg2-bin icoutils libtool perl rsync tar libosmesa6-dev libqt4-opengl-dev

wget ftp://ftp.gnu.org/gnu/octave/octave-4.0.0.tar.gz
tar xf octave-4.0.0.tar.gz
rm octave-4.0.0.tar.gz
cd octave-4.0.0/
./configure
make -j4
sudo make install

This was OK for Ubuntu & Mint (you can use the command "make" without arguments if you are using a old computer).

Solution 4

I think you need fort77 compiler... try this:

sudo apt-get install g++ gcc fort77
sudo apt-get build-dep octave
wget ftp://ftp.gnu.org/gnu/octave/octave-4.0.0.tar.xz
tar Jxvf octave-4.0.0.tar.xz
cd octave-4.0.0
./configure
make
sudo make install

Solution 5

Use this link:

Five simple instructions to compile Octave 4.0.0 on Ubuntu


  1. get necessary dev-tools

    sudo apt-get install g++ gcc gfortran make autoconf automake bison flex gperf gzip icoutils librsvg2-bin libtool perl rsync tar
    
  2. get necessary packages

    sudo apt-get install libblas-dev liblapack-dev libpcre3-dev libarpack2-dev libcurl4-gnutls-dev epstool libfftw3-dev transfig libfltk1.3-dev libfontconfig1-dev libfreetype6-dev libgl2ps-dev libglpk-dev libreadline-dev gnuplot libgraphicsmagick++-dev libhdf5-serial-dev openjdk-7-jdk libsndfile1-dev llvm-dev lpr texinfo libgl1-mesa-dev libosmesa6-dev pstoedit portaudio19-dev libqhull-dev libqrupdate-dev libqscintilla2-dev libqt4-dev libqtcore4 libqtwebkit4 libqt4-network libqtgui4 libsuitesparse-dev libxft-dev zlib1g-dev
    
  3. download and extract

    cd /tmp
    wget -c ftp://ftp.gnu.org/gnu/octave/octave-4.0.0.tar.gz
    tar -xzf octave-4.0.0.tar.gz
    cd octave-4.0.0
    
  4. configure and make

    ./configure --prefix=/opt/octave-4.0.0 CPPFLAGS=-I/usr/include/hdf5/serial LDFLAGS=-L/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/hdf5/serial
    make
    make check
    
  5. install

    sudo make install
    
Share:
134,187

Related videos on Youtube

Yuvaraj V
Author by

Yuvaraj V

Updated on September 18, 2022

Comments

  • Yuvaraj V
    Yuvaraj V over 1 year

    I am using Ubuntu 14.04.2. I want to install the latest version of Octave (Octave 4.0.0 ). But in official Ubuntu repository ,there is only octave version 3.8 available for download/install.

    How can I install Octave 4.0.0 safely/easily in Ubuntu 14.04.2?

    I don't want to install/compile it directly from source which is available at official website, because I feel it is not easy method to install.

    • mdd
      mdd almost 9 years
      Please see the answer in this question for a manual installation: askubuntu.com/questions/138832/how-to-install-the-latest-oct‌​ave
    • Andrew Wallace
      Andrew Wallace almost 9 years
      @MatthiasDiener hit it right on the head. The GNU Octave website says "The delay between an Octave source release and the availability of a package for a particular GNU/Linux distribution varies. The Octave project has no control over that process". That means that you either use 3.8 or install from source. I can't seem to find a PPA from the GNU Octave site, and I'm not sure it would be wise to trust any other PPA source for it.
    • mdd
      mdd almost 9 years
      @AndrewWallace Did you find any ppa with Octave 4.0? I could only find ppas with 3.8. Even the Ubuntu wily packages are only at 3.8.2.
    • Andrew Wallace
      Andrew Wallace almost 9 years
      Upon further inspection, no, there were no PPAs for 4.0.0.
    • Sudip Bhandari
      Sudip Bhandari about 6 years
      use synaptic package manager and make your life easier
  • Yuvaraj V
    Yuvaraj V almost 9 years
    compiling from source method is not working... make step is giving error "No targets specified and no makefile found. "
  • mdd
    mdd almost 9 years
    This probably means that your configure step is not successful. Can you post the full error message?
  • mdd
    mdd almost 9 years
    An explanation might be that you miss the packages to build octave. Please try running sudo apt-get build-dep octave and run configure again.
  • Pilot6
    Pilot6 over 8 years
    This is what OP did NOT want. You suggest installing it from source.
  • Bendermh
    Bendermh over 8 years
    " (i don't want to install/compile it directly from source which is available at official website,because i feel it is not easy method to install ) " Do you think that copy & paste 8 lines is not easy?
  • Pilot6
    Pilot6 over 8 years
    But your method is exactly compiling directly from source.
  • Bendermh
    Bendermh over 8 years
    Yes Pilot6, it is a compiling from source method. But if you read the question, the only reason given by the user is that compiling in not easy...
  • Ernir
    Ernir over 8 years
    Upvoting because this is an useful answer, even if it wasn't the answer the OP hoped to get. (Sorry, OP!)
  • mdd
    mdd over 8 years
    @Bendermh: Did you just copy my answer??
  • ZenoCosini
    ZenoCosini over 8 years
    I compiled the source as in 2. However I then get the problem as described here: askubuntu.com/questions/650396/… Any suggestion?
  • mdd
    mdd over 8 years
    @MicheleV: Please use the ppa (as per my solution #1). It should be much easier to install, and it already contains the QT gui if I saw correctly.
  • ZenoCosini
    ZenoCosini over 8 years
    @ M Diener I actually did so, for I was trying 1. first, but then I had unmet dependences. So then I proceeded in following the 2. method.
  • mdd
    mdd over 8 years
    @MicheleV: Which Ubuntu version are you running? I just tried in Ubuntu 14.04, the ppa seems to work fine.
  • ZenoCosini
    ZenoCosini over 8 years
    @M Diener: Elementary OS 0.3.1 Freya (64-bit), which is built on Ubuntu 14.04. I also tried to use --force-gui (which worked in 3.8.2) but with no success.
  • mdd
    mdd over 8 years
    Hmm. I'm not sure if elementary is compatible with that ppa. Maybe try opening a new question with more information regarding the missing dependencies.
  • guntbert
    guntbert over 8 years
    This is a verbatim copy of the page you linked. Do you own the copyright?
  • David Foerster
    David Foerster about 8 years
    This is the same as the 2nd part of mdiener's answer except that it lists the build dependencies individually instead of using apt-get build-dep.
  • Ivan Nahin
    Ivan Nahin about 8 years
    .. to install from the source you need fort77 pakage... and build-dep doesn't install the fortran compiler (that was my case) sorry for my English :/
  • Abhishek
    Abhishek almost 8 years
    This worked for me. Apart from this, had to give R/W permission to /home/<name>/.config/octave directory
  • Michael Macha
    Michael Macha over 7 years
    I bumped into the same issue as @Abhishek on 16.04; but all you really need to do is "sudo chown [user] ~/.config/octave/qt-settings"; the rest of the directory structure doesn't seem to be a concern to Octave.
  • rmustakos
    rmustakos about 7 years
    @Bendermh Copying and pasting the text is easy enough, but I'm some 25 minutes into compilingit on a 3 core, 4 GB VM. In the end, I'm going to have to end up compiling it on each machine I want it on. So, no, it isn't hard, but yes, it is a major pain to do for more than one machine.
  • MF.OX
    MF.OX about 7 years
    For installing newer version 4.2+ under Ubuntu 16.04 or newer there is a tutorial here: scivision.co/compiling-octave-4-on-ubuntu Old way to build from source will not work any more.