Micah P. Dombrowski / Aug 28 2019

Octave Environment

You can use this environment by remixing the Octave template.

Setup

Build the Octave Environment

List the distro's octave dependencies.

apt-cache depends octave | grep Depends | sed "s/.*ends:\ //" | tr '\n' ' '

Install build tools and dependencies (removed liboctave, octave-common, and <libglu1> from above).

wget -q -O nextjournal-conda-python_3.6.8_all.deb \
  https://nextjournal.com/data/Qmcy5rjq2jui3VTvyfktPMrLASs4vWJSGAKpz3PTzXQhho
apt-get -qq update
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends \
  build-essential gfortran cmake automake libtool libltdl-dev pkg-config \
  libhdf5-100 libgraphicsmagick++-q16-12 libumfpack5 libqrupdate1 \
  libarpack2 libblas3 liblapack3 \
  gnuplot gnuplot-nox ghostscript libcairo2 libpango1.0-0 \
  libamd2 libbz2-1.0 libc6 libccolamd2 libcholmod3 libcolamd2 libcxsparse3 libfftw3-double3 libfftw3-single3 libfltk-gl1.3 libfltk1.3 libgcc1 libgl1 libglpk40 libglu1-mesa libosmesa6 libportaudio2 libqhull7 libqscintilla2-qt5-13 libqt5core5a libqt5gui5 libqt5network5 libqt5opengl5 libqt5printsupport5 libqt5widgets5 libsndfile1 libstdc++6 libsuitesparseconfig5 libx11-6 zlib1g texinfo \
  ./nextjournal-conda-python_3.6.8_all.deb
apt-get clean
rm -r /var/lib/apt/lists/* # Clear package list so it isn't stale

Download and extract compiled octave from build notebook.

cd /opt
wget -q -O octave-bin-${OCTAVE_VERSION}.tar.xz \
  https://nextjournal.com/data/QmdPquM8BrARr38vd8M9AZEFo4vaeXyZouMXNq1XRRat9E
tar -Jxf octave-bin-${OCTAVE_VERSION}.tar.xz
ln -sf octave-${OCTAVE_VERSION} octave
echo "/opt/octave/lib/octave/${OCTAVE_VERSION}" > /etc/ld.so.conf.d/octave.conf
ldconfig
rm octave-bin-${OCTAVE_VERSION}.tar.xz

Install Jupyter and the Octave kernel.

pip install --upgrade jupyter jupyter_client octave-kernel

Check.

du -hsx /
octave --no-gui --version 2>/dev/null | grep version
jupyter kernelspec list

Test

5+7
ans
x = 0:pi/100:2*pi;
y = sin(x);
plot(x,y)