Octave imread function

I installed the latest Octave on an Ubuntu 14.04 machine. However, when I tried to run the 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 anyone suggest how to solve it?

Thanks!

+7
octave
source share
2 answers

After these steps, I worked for me [Author: Christopher KronstrΓΆm (hymyly)]:

Install the developer packages needed to create an octave.

 sudo apt-get build-dep octave 

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

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

Build it. It took me about an hour.

 cd octave-3.8.2 dpkg-buildpackage 

Or run it from the assembly directory:

 ./run-octave 

... or most preferably set it on top of the official octave:

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

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

+3
source share

How did you install Octave? The error assumes that you are missing the GraphicsMagick C ++ interface ( libgraphicsmagick++3 package), but

  • If you installed Octave from Ubuntu's package manager, you shouldn't have had this problem; * If you compiled it yourself, Octave should have completely disabled imread, and you would have a completely different error message.

So, I assume that you yourself create it either with

  • your own assembly of GraphicsMagick ++, which no longer loads, you may need to add your path to the path of the dynamic linker (either at /etc/ld.so.conf.d./graphicsmagick or define LD_LIBRARY_PATH );

  • libraries from the package manager that have since been accidentally deleted (since you did not install Octave from the repositories, your package manager will not know that libgraphicsmagick ++ is installed for any reason).

In any case, the solution is easy. Install Octave from Ubuntu Package Manager. One of the main reasons package managers exist is to avoid such problems, i.e. Missing dependencies.

0
source share

All Articles