help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Compiling octave specifying path to GraphicsMagick library


From: Mike Miller
Subject: Re: Compiling octave specifying path to GraphicsMagick library
Date: Sun, 1 Apr 2012 09:15:45 -0400

On Sun, Apr 01, 2012 at 11:34:15AM +0100, Carnë Draug wrote:
> On 23 March 2012 13:26, John W. Eaton <address@hidden> wrote:
> > On 23-Mar-2012, Carnë Draug wrote:
> > | I can't find the option to specify the path for the GraphicsMagick
> > | library when compiling octave. I've looked at ./configure --help but
> > | there is only the --with-magick option which only lets me choose
> > | between GraphicsMagick and ImageMagick but not define the directory
> > | for the library. I have tried (guessing) --with-magick-libdir and
> > | --with-magick-includedir but no success.
> >
> > Use CPPFLAGS=-I/some/dir to add the directory where the header files
> > are found and LDFLAGS=-L/some/dir to add the directory where the
> > library is found.
>
> I tried this but it's still not working. I thought it was a problem
> with GraphicsMagick but after talking to their devs it looks like the
> problem is still with building Octave.
>
> Even by setting those flags, after compiling Octave (3.6.1 by the way)
> checking octave_config_info I noticed that it was still using the
> system /usr/include/GraphicsMagick. This was despite that configure
> was using the "right" GraphicsMagick for the tests. However, looking
> into the Makefile being generated I noticed this MAGICK_CPPFLAGS =
> -I/usr/include/GraphicsMagick. I manually edited the Makefile
> MAGICK_CPPFLAGS and MAGICK_LDFLAGS and that seemed to work. However,
> the octave_config_info is still mentioning MAGICK_CPPFLAGS =
> -I/usr/include/GraphicsMagick, not the ones I changed.
>
> I no longer get the warning about being limited to 8bit images (so
> it's using the right GraphicsMagick) but I get the following error
>
> error: imread: invalid image file: Magick++ exception: Magick: No
> decode delegate for this image format () reported by
> magick/constitute.c:8279 (ReadImage)
>
> But GraphicsMagick does open the images no problem (I've tried it
> outside octave with "gm display").
>
> Does anyone has any idea of what I'm doing wrong?

Yes, I still think PKG_CONFIG_PATH is the right way to go, have you
tried it yet?  I agree with John that CPPFLAGS and LDFLAGS do work
generally for any custom libraries that are not installed where the
system expects them, and I use them all the time, but for this case it
doesn't work.

I suspect you are now compiling against the system GraphicsMagick header
files and linking with your custom GraphicsMagick library.  Just a
guess, but that would be a bad thing :)

In the Makefile, MAGICK_CPPFLAGS comes to the left of CPPFLAGS, so it
will take precedence over any paths you put into CPPFLAGS.
MAGICK_CPPFLAGS is populated with the result of

pkg-config --cflags GraphicsMagick++

which for me is "-I/usr/include/GraphicsMagick".  MAGICK_LIBS comes from

pkg-config --libs GraphicsMagick++

which doesn't include any path, because the libs are already in
/usr/lib.  Therefore, your LDFLAGS is causing it to link with your
private version of GraphicsMagick.

The only way to override what configure finds for MAGICK_* is to tell
pkg-config where to look with PKG_CONFIG_PATH.

-- 
mike


reply via email to

[Prev in Thread] Current Thread [Next in Thread]