Octave for Debian systems
For Debian, and Debian based distributions such as Ubuntu, specific solutions.
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.
sudo apt-get install octave
octave package that installs GNU Octave, other pieces of it are split over multiple packages. These are
octave-htmldoc for the documentation;
liboctave-dev for the octave development header files and mkoctfile, which are required to install Octave Forge packages; and
octave-dbg for the debugging symbols.
For Debian stable users, there may also be newer packages available in backports, so don't forget to check there.
The GNU Octave Team on Launchpad maintain a Personal Package Archive (PPA) providing a binary packages of the latest stable versions of Octave for all versions of Ubuntu. To set up your system to install these packages
sudo apt-add-repository ppa:octave/stable sudo apt-get update sudo apt-get install octave
Compiling from source
The only tricky part is to install the dependencies. Once that is solved, installing from source should be as easy as
./configure && make && make install. See the manual for the configure options.
Note that different Debian and Ubuntu versions may have slightly different package names but their differences should be pretty small, mostly limited to version numbers.
The easy way (but possibly incomplete)
The easy way to install most of the necessary dependencies is to
sudo apt-get build-dep octave. This will install all packages necessary to build and prepare a Debian package for the octave version available on your system repositories. However:
- will install unnecessary packages related to the building of a Debian package;
- may miss some new dependencies;
- may install packages that are no longer octave dependencies.
The even easier way
The MXE-octave package provides a way to compile Octave for different platforms. Dependencies and certain flags are handled automatically.
The right way
The best way is to select and install all the dependencies as listed in the INSTALL.OCTAVE file. The following are their package names in Debian repositories (they will have their own dependencies which your package maintainer will solve automatically). If you are building development versions, you'll require some more packages as listed on etc/HACKING and INSTALL. Many of them will already be installed on your system. Install the dependencies by typing
sudo apt-get install
followed by the package names of the table below.
Packages marked with * in the table above are virtual packages (you'll have to pick one of the displayed versions).
With current Debian versions you may get the following when building from source:
HDF5 library not found. Octave will not be able to save or load HDF5 data files.
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 is required to specify the location of the libraries. See bug #38928 for details but basically, use the following when running configure:
./configure CPPFLAGS=-I/usr/include/hdf5/serial LDFLAGS=-L/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/hdf5/serial
64-bit support (EXPERIMENTAL)
In order to use large Arrays, it is required to configure Octave with
This requires modification and recompilation of dependency packages from the Debian repository, namely OpenBLAS.
The instructions are taken from the Debian openblas source package. To create a custom OpenBLAS package, optimized only for your specific machine, proceeds as follows.
Install the build dependencies:
sudo aptitude build-dep openblas sudo aptitude install devscripts
Get the sources of the package:
apt-get source openblas
Compile the package:
Edit the file
debian/rules and add at the end of line 6
BINARY=64 INTERFACE64=1 to the variable
fakeroot debian/rules custom
It should produce a package that you can install with:
sudo dpkg -i ../libopenblas-base_<DEBVERSION>.deb sudo dpkg -i ../libopenblas-dev_<DEBVERSION>.deb