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: Mon, 2 Apr 2012 07:18:40 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

On Mon, Apr 02, 2012 at 09:57:16AM +0100, Carnë Draug wrote:
> On 1 April 2012 14:15, Mike Miller <address@hidden> wrote:
> > 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 did but I had problems with it. When running configure, one of the
> tests fail (the one about "checking for Magick::ColorRGB in
> Magick++.h"). When I talked with the GraphicsMagick devs, they told
> me:
> 
> > It looks like the GraphicsMagick libraries have been included, but all of
> > the libraries that the GraphicsMagick libraries depend on are not included.
> >
> > Do you have any idea how Octave picks up the configuration required by
> > GraphicsMagick?
> >
> > For example, it might try to execute 'GraphicsMagick++-config' (which would
> > be /home/carandraug/.bin/gm/bin/GraphicsMagick++-config in your install) to
> > obtain its configuration.  Perhaps it expects that this script will be in
> > your executable search path.
> 
> I have tried to change $PATH to include it and all "which
> GraphicsMagick++-config", "pkg-config --cflags GraphicsMagick++" and
> "pkg-config --libs GraphicsMagick++" show the right paths
> 
> $ which GraphicsMagick++-config
> /home/carandraug/.bin/gm/bin/GraphicsMagick++-config
> $ pkg-config --cflags GraphicsMagick++
> -I/home/carandraug/.bin/gm/include/GraphicsMagick
> $ pkg-config --libs GraphicsMagick++
> -L/home/carandraug/.bin/gm/lib -lGraphicsMagick++ -lGraphicsMagick
> 
> However, configure still fails. I have pastebin the errors I get on
> config.log here http://pastebin.com/TVZWA0ew .

I can tell from your config.log that configure is only finding the
static library libGraphicsMagick.a, when you built it did you disable
shared libraries?  That would be why it can't find it's dependencies.
When octave tests it, it is assuming "pkg-config --libs" will print all
libraries it needs, or that the shared library will have any dependency
libs listed so they get pulled in automatically.  This doesn't work for
static libraries.  I'm not sure what the right approach would be to make
it work for a static build, so I'd say build GraphicsMagick with shared
libraries enabled.  You'll then need to set LD_LIBRARY_PATH in your
environment to include /home/carandraug/.bin/gm/lib.

-- 
mike


reply via email to

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