Octave for Debian systems: Difference between revisions

m
→‎HDF5: The HDF5 flags have to be set on current Ubuntu
(→‎The right way: Remove outdated table. It is redundant to Building and super hard to maintain... Update info for Ubuntu 18.04 (LTS), rather than 18.10.)
m (→‎HDF5: The HDF5 flags have to be set on current Ubuntu)
(14 intermediate revisions by 5 users not shown)
Line 1: Line 1:
For Debian, and Debian-based distributions such as Ubuntu, specific solutions.
* ''This article addresses the [[:Category:Installation|installation]] and [[Building]] of GNU Octave on Debian, and Debian-based distributions such as Ubuntu.''


== Pre-compiled binaries ==
== Installing Octave ==


Binary packages for Octave and many Octave-Forge packages are provided by all versions of Debian and Ubuntu. These are the most well-tested binaries available and should work best for most users.
Binary packages for GNU Octave and many [[Octave Forge]] packages are provided by all versions of Debian and Ubuntu. These are the most well-tested binaries available and should work best for most users. To install them, run:


  sudo apt-get install octave
  sudo apt-get install octave


Aside the {{codeline|octave}} package that installs GNU Octave, other pieces of it are split over multiple packages. These are {{codeline|octave-doc}}, {{codeline|octave-info}}, and {{codeline|octave-htmldoc}} for the documentation; {{codeline|liboctave-dev}} for the octave development header files and mkoctfile (required to install Octave Forge packages); and {{codeline|octave-dbg}} for the debugging symbols.
In Debian and Ubuntu the "complete" GNU Octave software is split over multiple packages. To obtain the complete features of Octave, install additionally


For Debian stable users, there may also be newer packages available in backports, so don't forget to check there.
* {{codeline|octave-doc}}, {{codeline|octave-info}}, and {{codeline|octave-htmldoc}} for the documentation;
* {{codeline|liboctave-dev}} for the octave development header files and mkoctfile (required to install Octave Forge packages); and
* {{codeline|octave-dbg}} for the debugging symbols.


=== Octave packages ===
Many Octave packages are also distributed by Debian and Ubuntu.  These are tested to work the best with the respective Octave version.  Install them via:
 
Many Octave packages are also distributed by your Linux distribution.  These are tested to work the best with your Octave version.  For example:


  sudo apt-get install octave-control octave-image octave-io octave-optim octave-signal octave-statistics
  sudo apt-get install octave-control octave-image octave-io octave-optim octave-signal octave-statistics


=== Octave's Personal Package Archive (PPA) for Ubuntu ===
Up to 2018, the [https://launchpad.net/~octave GNU Octave Team] on Launchpad actively maintained a PPA providing more up to date packages of Octave. These are backported from Debian unstable and are still useful for older Ubuntu installations. To set up your system to install these packages, run:
 
For some Ubuntu releases the Octave packages are too old (Ubuntu 12.04 only has Octave version 3.2).  The [https://launchpad.net/~octave GNU Octave Team] on Launchpad maintains a PPA providing more up to date packages of Octave for all versions of Ubuntu. These are backported from Debian unstable (the Ubuntu Octave Team needs help testing and preparing the packages so if you can help with this, contact [[User:Mtmiller|Mike Miller]]). To set up your system to install these packages:


  sudo apt-add-repository ppa:octave/stable
  sudo apt-add-repository ppa:octave/stable
Line 25: Line 23:
  sudo apt-get install octave
  sudo apt-get install octave


== Building Octave ==
== Building Octave from source ==


: ''For general build instructions, see [[Building]].''
: ''For general build instructions, see [[Building]].''
Line 46: Line 44:
==== The right way ====
==== The right way ====


The right way is to install all the dependencies listed on the [[Building#Dependencies|Building]] wiki page.  For the sake of convenience, some "one liner" to install them are listed below.  If a package is not found, please search manually for it on either
The right way is to install all the dependencies listed on the [[Building#Dependencies|Building]] wiki page.  One can either search for the respective packages manually on


* https://packages.debian.org or
* https://packages.debian.org
* https://packages.ubuntu.com
* https://packages.ubuntu.com


'''Ubuntu 18.04 (LTS)'''
or, for the sake of convenience, use some "one-liner" to install them:


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-x11 libgraphicsmagick++1-dev libhdf5-serial-dev openjdk-8-jdk libsndfile1-dev llvm-dev lpr texinfo libgl1-mesa-dev libosmesa6-dev pstoedit portaudio19-dev libqhull-dev libqrupdate-dev libqscintilla2-dev libsuitesparse-dev texlive texlive-generic-recommended libxft-dev zlib1g-dev autoconf automake bison flex gperf gzip icoutils librsvg2-bin libtool perl rsync tar qtbase5-dev qttools5-dev qttools5-dev-tools libqscintilla2-qt5-dev
* '''Ubuntu 20.04'''


'''Ubuntu 16.04 (LTS)'''
:<pre>sudo apt-get install gcc g++ gfortran make libblas-dev liblapack-dev libpcre3-dev libarpack2-dev libcurl4-gnutls-dev epstool libfftw3-dev fig2dev libfltk1.3-dev libfontconfig1-dev libfreetype6-dev libgl2ps-dev libglpk-dev libreadline-dev gnuplot-x11 libgraphicsmagick++1-dev libhdf5-dev openjdk-8-jdk libsndfile1-dev llvm-dev texinfo libgl1-mesa-dev libosmesa6-dev pstoedit portaudio19-dev libqhull-dev libqrupdate-dev libsuitesparse-dev texlive-latex-extra libxft-dev zlib1g-dev autoconf automake bison flex gperf gzip icoutils librsvg2-bin libtool perl rsync tar qtbase5-dev qttools5-dev qttools5-dev-tools libqscintilla2-qt5-dev libsundials-dev</pre>


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-x11 libgraphicsmagick++1-dev libhdf5-serial-dev openjdk-8-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 libqt4-opengl-dev libsuitesparse-dev texlive libxft-dev zlib1g-dev autoconf automake bison flex gperf gzip icoutils librsvg2-bin libtool perl rsync tar
[[User:KaKiLa|KaKiLa]] ([[User talk:KaKiLa|talk]]) 03:34, 17 June 2020 (PDT) lpr conflict with cups-bsd


'''Debian 9'''
* '''Ubuntu 19.10'''
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-8-jdk libsndfile1-dev llvm-dev texinfo libgl1-mesa-dev libosmesa6-dev pstoedit portaudio19-dev libjack-jackd2-dev libqhull-dev libqrupdate-dev libqscintilla2-dev libqt4-dev libqtcore4 libqtwebkit4 libqt4-network libqtgui4 libqt4-opengl-dev libsuitesparse-dev texlive libxft-dev zlib1g-dev autoconf automake bison flex gperf gzip icoutils librsvg2-bin libtool perl rsync tar


'''Debian 8'''
:<pre>sudo apt-get install gcc g++ gfortran make libblas-dev liblapack-dev libpcre3-dev libarpack2-dev libcurl4-gnutls-dev epstool libfftw3-dev fig2dev libfltk1.3-dev libfontconfig1-dev libfreetype6-dev libgl2ps-dev libglpk-dev libreadline-dev gnuplot-x11 libgraphicsmagick++1-dev libhdf5-dev openjdk-8-jdk libsndfile1-dev llvm-dev lpr texinfo libgl1-mesa-dev libosmesa6-dev pstoedit portaudio19-dev libqhull-dev libqrupdate-dev libsuitesparse-dev texlive-latex-extra texlive-libxft-dev zlib1g-dev autoconf automake bison flex gperf gzip icoutils librsvg2-bin libtool perl rsync tar qtbase5-dev qttools5-dev qttools5-dev-tools libqscintilla2-qt5-dev libsundials-dev</pre>


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 libgl1-mesa-dev libosmesa6-dev pstoedit portaudio19-dev libqhull-dev libqrupdate-dev libqscintilla2-dev libqt4-dev libqtcore4 libqtwebkit4 libqt4-network libqtgui4 libqt4-opengl-dev libsuitesparse-dev texlive libxft-dev zlib1g-dev autoconf automake bison flex gperf gzip icoutils librsvg2-bin libtool perl rsync tar
* '''Ubuntu 18.04 (LTS)'''
 
:<pre>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-x11 libgraphicsmagick++1-dev libhdf5-serial-dev openjdk-8-jdk libsndfile1-dev llvm-dev lpr texinfo libgl1-mesa-dev libosmesa6-dev pstoedit portaudio19-dev libqhull-dev libqrupdate-dev libqscintilla2-dev libsuitesparse-dev texlive texlive-generic-recommended libxft-dev zlib1g-dev autoconf automake bison flex gperf gzip icoutils librsvg2-bin libtool perl rsync tar qtbase5-dev qttools5-dev qttools5-dev-tools libqscintilla2-qt5-dev</pre>
 
* '''Ubuntu 16.04 (LTS)'''
 
:<pre>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-x11 libgraphicsmagick++1-dev libhdf5-serial-dev openjdk-8-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 libqt4-opengl-dev libsuitesparse-dev texlive libxft-dev zlib1g-dev autoconf automake bison flex gperf gzip icoutils librsvg2-bin libtool perl rsync tar</pre>
 
* '''Debian 10'''
 
:<pre>sudo apt-get install gcc g++ gfortran make libblas-dev liblapack-dev libpcre3-dev libarpack2-dev libcurl4-gnutls-dev epstool libfftw3-dev fig2dev libfltk1.3-dev libfontconfig1-dev libfreetype6-dev libgl2ps-dev libglpk-dev libreadline-dev gnuplot libgraphicsmagick++1-dev libhdf5-dev openjdk-11-jdk libsndfile1-dev llvm-dev texinfo libgl1-mesa-dev libosmesa6-dev pstoedit portaudio19-dev libjack-jackd2-dev libqhull-dev libqrupdate-dev libqt5core5a qtbase5-dev qttools5-dev qttools5-dev-tools libqscintilla2-qt5-dev libsuitesparse-dev texlive texlive-latex-extra libxft-dev zlib1g-dev autoconf automake bison flex gperf gzip icoutils librsvg2-bin libtool perl rsync tar libsundials-dev git</pre>
 
* '''Debian 9'''
 
:<pre>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-8-jdk libsndfile1-dev llvm-dev texinfo libgl1-mesa-dev libosmesa6-dev pstoedit portaudio19-dev libjack-jackd2-dev libqhull-dev libqrupdate-dev libqscintilla2-dev libqt4-dev libqtcore4 libqtwebkit4 libqt4-network libqtgui4 libqt4-opengl-dev libsuitesparse-dev texlive libxft-dev zlib1g-dev autoconf automake bison flex gperf gzip icoutils librsvg2-bin libtool perl rsync tar</pre>
 
* '''Debian 8'''
 
:<pre>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 libgl1-mesa-dev libosmesa6-dev pstoedit portaudio19-dev libqhull-dev libqrupdate-dev libqscintilla2-dev libqt4-dev libqtcore4 libqtwebkit4 libqt4-network libqtgui4 libqt4-opengl-dev libsuitesparse-dev texlive libxft-dev zlib1g-dev autoconf automake bison flex gperf gzip icoutils librsvg2-bin libtool perl rsync tar</pre>




Line 75: Line 90:
=== Configuration ===
=== Configuration ===


As mentioned above, Octave can be compiled with the default settings using {{Codeline|./configure && make && make install}}. You can also tweak the setup using configure options. Some examples are given below for a Linux system.
Some Debian and Ubuntu specific configure tweaks are listed below:
 
==== 64 bit ====
 
To get [https://www.gnu.org/software/octave/doc/interpreter/Compiling-Octave-with-64_002dbit-Indexing.html 64-bit] indexing requires all linked libraries to support 64-bit variables. You can omit most of these except BLAS which gives a fatal error. This is remedied by compiling [http://www.openblas.net/ OpenBLAS] with edits to its Makefile.rule so that BINARY=64 INTERFACE64=1.
 
./configure LD_LIBRARY_PATH=/opt/OpenBLAS/lib CPPFLAGS=-I/opt/OpenBLAS/include LDFLAGS=-L/opt/OpenBLAS/lib --enable-64


==== Java ====
==== Java ====


Autodetection for java should work well on Debian-based systems. A specific Java version can be specified by passing {{codeline|JAVA_HOME}} to configure, for example
Autodetection for Java should work well on Debian-based systems. A specific Java version can be specified by passing {{codeline|JAVA_HOME}} to configure, for example


  ./configure JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
  ./configure JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
Line 97: Line 106:
The problem is that there are multiple versions of the hdf5 package.  Octave was written with the serial version in mind but it is likely to work with the others (OpenMPI and Mpich). Due to the naming scheme done in Debian, it may be required to specify the location of the libraries.  See bug {{bug|38928}} for details (starting with comment #19) but basically, use the following when running configure:
The problem is that there are multiple versions of the hdf5 package.  Octave was written with the serial version in mind but it is likely to work with the others (OpenMPI and Mpich). Due to the naming scheme done in Debian, it may be required to specify the location of the libraries.  See bug {{bug|38928}} for details (starting with comment #19) but basically, use the following when running configure:


  ./configure --with-hdf5-includedir=/usr/include/hdf5/serial --with-hdf5-libdir=/usr/lib/x86_64-linux-gnu/hdf5/serial
  ./configure --with-hdf5-includedir=/usr/include/hdf5/serial --with-hdf5-libdir=/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/hdf5/serial


On older versions of Debian and Ubuntu, where only one flavor of the HDF5 library could be installed at a time, you may need to build Octave against one of the MPI-enabled flavors. On these older systems, configuring Octave like this may work:
On older versions of Debian and Ubuntu, where only one flavor of the HDF5 library could be installed at a time, you may need to build Octave against one of the MPI-enabled flavors. On these older systems, configuring Octave like this may work:


  ./configure CPPFLAGS="-I/usr/include/mpi -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX"
  ./configure CPPFLAGS="-I/usr/include/mpi -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX"
==== Sundials ====
On recent Debian and Ubuntu releases whose Sundials version (in {{codeline|libsundials-dev}}) is 3.1, a configure flag needs to be passed for {{codeline|ode15i}} and {{codeline|ode15s}} to be compiled with support for sparse Jacobians (bug {{bug|55937}}), as follows:
./configure CPPFLAGS="-I/usr/include/suitesparse"


== See also ==
== See also ==
209

edits