Help installing Octave (linux-generic)

Last modified: Mon Oct 10 20:18:58 EDT 2016


These instructions were last validated on 2016-10-10 with gcc 6.2.0 for the versions of software indicated below on 64-bit Slackware Linux 14.2.

You will need the Fortran compiler that is an optional install with GCC.

Lapack 3.6.1 (released 2016-06-18)


Download the lapack-3.6.1.tgz file to /tmp but don't unpack.  It's handled by the Atlas build process now.

Atlas 3.10.3 (released 2016-07-28)


The build process for Atlas runs benchmarks to try to determine the best way to compile something for your hardware.  It refuses to run if cpufreq is configured to vary CPU frequencies; it complains "It appears you have cpu throttling enabled, which makes timings unreliable and an ATLAS install nonsensical."  To make it happy, do cpufreq-set -c X -g performance for each CPU number X.

for cpunum in `seq 0 7`; do
  echo Revving CPU ${cpunum}
  cpufreq-set -c ${cpunum} -g performance

The installation guide recommends the use of –DPentiumCPS=[CPU frequency in MHz] on x86 hardware.  Alternatives can be found in ATLAS/tune/sysinfo/ATL_walltime.c.

Configure options that are not self-explanatory:

The special configuration for Octave is to add the –fPIC compiler switch, but not to build or install shared libs.  The shared libs don't include "full LAPACK," which breaks the Octave build (at least, it did the last time I tried it, which was Atlas 3.8.4 and Octave 3.4.3).

The configure script does not simply use the gcc that is in the path but will search out and use an incorrect version if it can.  Make sure that only one version is installed.

64-bit, 8-thread, 4.0 GHz CPU

Don't use make –j.  The build process uses it automatically where applicable.

mkdir foo
cd foo
../ATLAS/configure -b 64 -t 8 -D c -DPentiumCPS=4000 -Fa alg -fPIC \
  --prefix=/usr/local/atlas-3.10.3 \
make                    # with plenty of ignored errors
make check              # optional, all pass
make ptcheck            # optional, all pass
make lapack_test_al_ab  # optional, lots of failures
make install            # more ignored errors

You get:

bash-4.2$ l /usr/local/atlas-3.10.3/lib
total 28112
drwxr-xr-x 2 root root     4096 Oct 10 19:14 .
drwxr-xr-x 4 root root     4096 Oct 10 19:14 ..
-rw-r--r-- 1 root root 15187358 Oct 10 19:14 libatlas.a
-rw-r--r-- 1 root root   493420 Oct 10 19:14 libcblas.a
-rw-r--r-- 1 root root   582176 Oct 10 19:14 libf77blas.a
-rw-r--r-- 1 root root 11427224 Oct 10 19:14 liblapack.a
-rw-r--r-- 1 root root   494002 Oct 10 19:14 libptcblas.a
-rw-r--r-- 1 root root   582572 Oct 10 19:14 libptf77blas.a

The libpt* libraries are the threaded ones that go away if –t 0 is specified.

Fltk 1.3.3 (released 2014-11-03)


Fltk is for optional native graphics in Octave.  It will build against Nvidia's GL libs if they are present.

./configure --prefix=/usr/local/fltk-1.3.3 CFLAGS="-fPIC" CXXFLAGS="-fPIC"
make  # -j 8 if 8 cores
make install

For ~/.bash_profile:

export PATH=/usr/local/fltk-1.3.3/bin:${PATH}
export MANPATH=/usr/local/fltk-1.3.3/share/man:${MANPATH}
export CMAKE_PREFIX_PATH=/usr/local/fltk-1.3.3:${CMAKE_PREFIX_PATH}

Octave 4.0.3 (released 2016-07-02)

Plus patches to fix FTBFS with GCC 6:  from Debian

Any errors output by configure can be highly misleading.  You must read the log to find out what actually happened.

The build process tries to read /usr/lib64/  If gcc is installed somewhere else a temporary symlink must be created.

Configure finds the serial Atlas libraries automatically, but not the threaded ones.  Supply the ––with-blas option shown below if the threaded libraries were built.

./configure --prefix=/usr/local/octave-4.0.3                    \
  --with-fltk-prefix=/usr/local/fltk-1.3.3                      \
  --with-blas="-lptcblas -lptf77blas -latlas" `: IF APPLICABLE` \
  CPPFLAGS="-I/usr/local/atlas-3.10.3/include"                  \
make          # -j 8 if 8 cores
make check    # optional, all pass except known bugs
make install

Many optional dependencies were skipped, as indicated by lots of configure WARNING messages.

For ~/.bash_profile:

export PATH=/usr/local/octave-4.0.3/bin:${PATH}
export MANPATH=/usr/local/octave-4.0.3/share/man:${MANPATH}
export INFOPATH=/usr/local/octave-4.0.3/share/info:${INFOPATH}

Extra packages can be obtained from and installed by doing pkg install whatever.tar.gz from the Octave prompt (as root).