Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Octave imread function

Tags:

octave

I installed latest Octave on Ubuntu 14.04 machine. However, when I tried to run imread command, it showed the following error message:

octave:12> imread('newfile.png')
error: imread: invalid image file: /usr/lib/x86_64-linux-gnu/octave/3.8.1/oct/x86_64-pc-linux-gnu/__magick_read__.oct: failed to load: /usr/lib/x86_64-linux-gnu/octave/3.8.1/oct/x86_64-pc-linux-gnu/__magick_read__.oct: undefined symbol: _ZN6Magick5ColorC1Ehhh
error: called from:
error:   /usr/share/octave/3.8.1/m/image/private/__imread__.m at line 181, column 7
error:   /usr/share/octave/3.8.1/m/image/private/imageIO.m at line 66, column 26
error:   /usr/share/octave/3.8.1/m/image/imread.m at line 107, column 30

Can someone please suggest how to solve it?

Thanks!

like image 650
leon Avatar asked Jul 30 '14 20:07

leon


1 Answers

Following these steps worked for me [Author: Christoffer Cronström (hymyly)]:

Install the dev packages needed to build octave.

sudo apt-get build-dep octave

Get the official source package. Do this in a clean directory, because it will get polluted.

cd ~/some/suitable/directory
apt-get source octave

Build it. This took roughly an hour for me.

cd octave-3.8.2
dpkg-buildpackage

Either run it from the build directory:

./run-octave

...or most preferably install it over the official octave:

cd ..
sudo dpkg --install octave_3.8.2-4_amd64.deb

From: https://bugs.launchpad.net/ubuntu/+source/octave/+bug/1372202

like image 157
user27221 Avatar answered Nov 18 '22 04:11

user27221