Hello there,
This post is a little different of I’m using to write, but yet very useful for us engineers! It’s about how to compile octave to be able to load 16 or 32 bits colour images. First of all, what’s Octave?
Octave is a gnu version of Matlab (and it almost compatible with it. Actually most of commands are identical, so migrating for Matlab to Octave should not be very hard. The official site is here!
Ok, what’s the problem? The problem is that Octave uses GraphicsMagick (an image processing program) and by default it comes configured in 8bits in Ubuntu. So, we need to recompile GraphicsMagick to use 16 or 32 bits and then recompile Octave with the new GraphicsMagick. I’m using Ubuntu 12.04, Octave-3.6.3 and GraphicsMagick-1.3.12.
Here you are the steps:
1) Download all packages needed.
sudo apt-get install g++ gcc gfortran make libblas-dev liblapack-dev libpcre3-dev libreadline-dev libarpack2-dev libcurl4-gnutls-dev libfftw3-dev libfltk-dev libfontconfig1-dev libfreetype6-dev libglpk-dev libgraphicsmagick++-dev gnuplot libhdf5-serial-dev libgl-dev libqhull-dev libqrupdate-dev libsuitesparse-dev texinfo zlib1g-dev libgraphicsmagick++1-dev libgraphicsmagick++3
2) Download GraphicsMagick sourcefrom Ubuntu repository
wget https://launchpad.net/ubuntu/precise/+source/graphicsmagick/1.3.12-1.1build1/+files/graphicsmagick_1.3.12.orig.tar.gz
3) Configure and install GraphicsMagick.If you want 16 bits set –with-quantum-depth=16!
tar zxvf graphicsmagick_1.3.12.orig.tar.gz cd GraphicsMagick-1.3.12 ./configure --with-quantum-depth=32 --enable-shared --disable-static --with-magick-plus-plus=yes make sudo make install
4) Set GraphicsMagick libs path
export PATH=$PATH:/usr/local/lib
5) Download Octave
wget ftp://ftp.gnu.org/gnu/octave/octave-3.6.3.tar.gz
6) Configure and install Octave
tar zxvf octave-3.6.3.tar.gz cd octave-3.6.3 ./configure --prefix=/usr/local/octave --with-blas="-L/usr/lib -lblas" --with-lapack="-L/usr/lib -llapack" --with-fftw3f-libdir=/usr/local/fftw/lib --with-fftw3-includedir=/usr/local/fftw/include --without-curl --enable-shared --disable-static make sudo make install
Here some links that can help you if you have any problems:
GraphicsMagick wiki
Discussed in forum
*** UPDATE Octave 4***
As Octave 4 now has a GUI based in QT, some additional libs must be installed:
sudo apt-get install gnuplot texi2html icoutils gperf flex libbison-dev libqhull-dev libglpk-dev libcurl4-gnutls-dev libfltk1.3-dev librsvg2-dev libqrupdate-dev libgl2ps-dev libarpack2-dev libqscintilla2-dev libreadline-dev libncurses5-dev libhdf5-dev llvm-dev libqt4-dev default-jdk texinfo libfftw3-dev libgraphicsmagick++-dev libjasper-dev libfreeimage-dev transfig epstool librsvg2-bin libcurlpp-dev libosmesa6 libglapi-mesa libosmesa6-dev libxft-dev
Download, configure and install
wget ftp://ftp.gnu.org/gnu/octave/octave-4.0.0.tar.gz tar zxvf octave-4.0.0.tar.gz cd octave-4.0.0 ./configure --prefix=/usr/local/octave --with-blas="-L/usr/lib -lblas" --with-lapack="-L/usr/lib -llapack" --with-fftw3f-libdir=/usr/local/fftw/lib --with-fftw3-includedir=/usr/local/fftw/include --enable-shared --disable-static make -j 8 sudo make install
Bye
Marcelo
Leave a Reply