Octave

From GHER

Jump to: navigation, search

Octave can be considered as an alternative to Matlab.

Wikibook about Octave : http://fr.wikibooks.org/wiki/Octave


Contents

Toolboxes

Some commands

help
for help
lookfor
keywords : find function according keywords
pcolor
(variable) : plot 'variable'
variable'
 : transpose variable
colorbar
display the color bar

Installation

From repository:

sudo apt-get install octave

From source (to get a newer version):


Installation troubles

  • when compiling octave with GotoBLAS2 (version 1.13), configure test may fail (core dump) ubnles variable GOTO_NUM_THREADS is defined. Set this variable to any value works.
  • crash dump on start up. OCTAVE_HOME may point to a different octave installation.
unset OCTAVE_HOME
  • Issue with OPeNBLAS:
** On entry to DLASD0 parameter number  9 had an illegal value
** On entry to DLASDA parameter number  2 had an illegal value

5 out of 6 test fails in scripts/sparse/svds.m. The problem is related to ARPACK. ARPACK include its own version of BLAS and LAPACK. However it should use openblas instead:

make FC=$FC FFLAGS=-fPIC \
  MAKE=/usr/bin/make \
  home="$PWD" \
  ARPACKLIB="$PWD/libarpack.a" \
  LAPACKLIB="-L/path/to -lopenblas" \
  BLASLIB="-L/path/to -lopenblas" \
  BLASdir="" \
  LAPACKdir="" \
  lib | tee make.log

Using MKL

It is possible to use octave with Intel MKL, even if octave is compiled with OpenBLAS (build as a shared library). Tested on nic4:

Loading modules:

$ module load intel/compiler/64/14.0/2013_sp1.1.106
$ module load intel/mkl/64/11.1/2013_sp1.1.106

Run with 1 or 8 threads:

MKL_NUM_THREADS=1 LD_PRELOAD="$MKL/libmkl_gf_lp64.so $MKL/libmkl_intel_thread.so $MKL/libmkl_core.so $INTEL_CC_HOME/compiler/lib/intel64/libiomp5.so " octave -q --eval 'A = randn(5000,5000); tic; B = A*A; toc'
Elapsed time is 12.2681 seconds.

MKL_NUM_THREADS=8 LD_PRELOAD="$MKL/libmkl_gf_lp64.so $MKL/libmkl_intel_thread.so $MKL/libmkl_core.so $INTEL_CC_HOME/compiler/lib/intel64/libiomp5.so " octave -q --eval 'A =  randn(5000,5000); tic; B = A*A; toc'
Elapsed time is 2.44973 seconds.


OpenBLAS with 1 thread is about the same as MKL with 1 thread. By setting OPENBLAS_NUM_THREADS one should be able to instruct OpenBLAS to use more than one thread (but it did not work for me).

Benchmarks

compilation with GotoBLAS2:

GOTO_NUM_THREADS=1  octave --eval 'A = randn(10000,10000); tic; B = A*A; toc'


BLAS run-time
GOTO_NUM_THREADS=1 180.541
GOTO_NUM_THREADS=2 92.6583
GOTO_NUM_THREADS=3 63.5869
ATLAS more than 17 min (?)

Introduction

Very short Matlab/Octave tutorial: a few examples of basic commands.


Troubles

fontconfig

If fontconfig is compiled from source, you might see this error:

Fontconfig error: Cannot load default config file

This issue is resolved in octave if you set the variable FONTCONFIG_FILE

export FONTCONFIG_FILE=/etc/fonts/fonts.conf

But other applications produce the warning:

Fontconfig warning: "/etc/fonts/conf.d/30-metric-aliases.conf", line 84: Having multiple <family> in <alias> isn't supported and may not work as expected
...
Personal tools