Problems running 'liquid-rescale' (MacPorts version of IM)

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
pipitas
Posts: 168
Joined: 2012-07-15T14:06:46-07:00
Authentication code: 15

Problems running 'liquid-rescale' (MacPorts version of IM)

Post by pipitas »

This is a Mac OSX Lion system, using a MacPorts installation of ImageMagick:

Code: Select all

Version: ImageMagick 6.7.8-3 2012-07-30 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features:  OpenCL HDRI  
Running a command that should do liquid-rescale, I'm getting this error:

Code: Select all

convert long.jpg -liquid-rescale 290x310\! liquid.jpg

dyld: lazy symbol binding failed: Symbol not found: _lqr_pixel_get_rgbcol
  Referenced from: /opt/local/lib/liblqr-1.0.dylib
  Expected in: flat namespace

dyld: Symbol not found: _lqr_pixel_get_rgbcol
  Referenced from: /opt/local/lib/liblqr-1.0.dylib
  Expected in: flat namespace

Trace/BPT trap: 5
I have only very limited (user level, not developer level) understanding of what this could mean, and no idea how I could possibly resolve it.

Looking for the dynamic library dependencies with otool (similar to `ldd` on Linux) yields this output:

Code: Select all

otool -L /opt/local/bin/convert | grep lqr
	/opt/local/lib/liblqr-1.0.dylib (compatibility version 4.0.0, current version 4.1.0)
Any ideas what could be the issue? Do I need to compile IM locally (and ditch MacPorts) to get a working liquid-rescale?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Problems running 'liquid-rescale' (MacPorts version of I

Post by fmw42 »

I am on IM 6.7.8.8 Q16 Mac OSX Snow Leopard and it works fine for me.

Did MacPorts install include dependencies to the liquidrescale library and did Macports install with lqr enabled?

What does

convert -list configure

show for the line starting with DELEGATES. Does it include lqr?


What I have done, is to install all my needed delegates from MacPorts and then manually install from source for IM. To do that you need to modify the ./configure as follows, with the CPPFLAGS and LDFLAGS set for /opt from MacPorts install of the delegates. Note I have turned off openmp, opencl and no pango, just from my preferences.

./configure CPPFLAGS='-I/opt/local/include' LDFLAGS='-L/opt/local/lib' \
--enable-delegate-build --enable-shared --disable-static --disable-opencl \
--with-modules --with-quantum-depth=16 --with-gslib --without-wmf \
--disable-silent-rules --disable-dependency-tracking --disable-openmp --without-pango \
--with-gs-font-dir=/opt/local/share/ghostscript/fonts/ --with-lqr

make clean
make
sudo make install
pipitas
Posts: 168
Joined: 2012-07-15T14:06:46-07:00
Authentication code: 15

Re: Problems running 'liquid-rescale' (MacPorts version of I

Post by pipitas »

fmw42 wrote:I am on IM 6.7.8.8 Q16 Mac OSX Snow Leopard and it works fine for me.
Did MacPorts install include dependencies to the liquidrescale library and did Macports install with lqr enabled?

What does

convert -list configure

show for the line starting with DELEGATES. Does it include lqr?

What I have done, is to install all my needed delegates from MacPorts and then manually install from source for IM. To do that you need to modify the ./configure as follows, with the CPPFLAGS and LDFLAGS set for /opt from MacPorts install of the delegates. Note I have turned off openmp, opencl and no pango, just from my preferences.

./configure CPPFLAGS='-I/opt/local/include' LDFLAGS='-L/opt/local/lib' \
--enable-delegate-build --enable-shared --disable-static --disable-opencl \
--with-modules --with-quantum-depth=16 --with-gslib --without-wmf \
--disable-silent-rules --disable-dependency-tracking --disable-openmp --without-pango \
--with-gs-font-dir=/opt/local/share/ghostscript/fonts/ --with-lqr

make clean
make
sudo make install
When you use MacPorts, you can have different flavors of ImageMagick:

Code: Select all

pip@mbp:~$  port variants imagemagick
ImageMagick has the variants:
   graphviz: Support Graphviz
   hdri: Support High Dynamic Range Imaging using OpenEXR
   jbig: Support JBIG
   jpeg2: Support JPEG-2000 using JasPer
   lqr: Support Liquid Rescale (experimental)
   mpeg: Support MPEG-1 and MPEG-2 video
   no_plus_plus: Do not install Magick++
   no_x11
   pango: Support Pango
   perl: Install PerlMagick
[+]q16: Use 16 bits per pixel quantum
     * conflicts with q32 q8
   q32: Use 32 bits per pixel quantum
     * conflicts with q16 q8
   q8: Use 8 bits per pixel quantum
     * conflicts with q16 q32
   rsvg: Support SVG using librsvg
   universal: Build for multiple architectures
   wmf: Support the Windows Metafile Format
If you want HDRI and LQR, your installation command is:

Code: Select all

sudo port install imagemagick +hdri+lqr
You can have different versions installed (but only 1 activated at a time), and you can query which they are:

Code: Select all

pip@mbp:~$  port installed imagemagick
The following ports are currently installed:
  ImageMagick @6.7.7-2_0+q16
  ImageMagick @6.7.8-0_0+graphviz+hdri+jbig+jpeg2+lqr+q16+rsvg+wmf
  ImageMagick @6.7.8-0_0+q16
  ImageMagick @6.7.8-3_0+graphviz+hdri+jbig+jpeg2+lqr+mpeg+pango+perl+q16+rsvg+wmf (active)
  ImageMagick @6.7.8-3_0+graphviz+hdri+jbig+jpeg2+lqr+mpeg+pango+perl+q8+rsvg+wmf
  ImageMagick @6.7.8-3_0+graphviz+hdri+jbig+jpeg2+lqr+q16+rsvg+wmf
  ImageMagick @6.7.8-3_0+graphviz+hdri+jbig+jpeg2+lqr+q8+rsvg+wmf
So yes, my delegates include lqr:

Code: Select all

pip@mbp:~$  convert -list configure | grep DELEG
DELEGATES     bzlib djvu fftw fontconfig freetype gs gvc jbig jpeg jng jp2 lcms2 lqr lzma mpeg openexr pango png rsvg tiff x11 xml wmf zlib
I can't remember if MacPorts installed the LQR dependency automatically, but in any case it's there:

Code: Select all

pip@mbp:~$  port installed liblqr
The following ports are currently installed:
  liblqr @1-0.4.1_0 (active)
On Linux I would use 'ldd' to list the dynamic dependencies of an executable, on Mac 'otool -L' does the same job:

Code: Select all

pip@mbp:~$  otool -L /opt/local/bin/convert | grep lqr
	/opt/local/lib/liblqr-1.0.dylib (compatibility version 4.0.0, current version 4.1.0)
So, on the surface it all looks like it's OK.

The error message about 'symbol not found' seems to suggest to me that the MacPorts build is somehow faulty then... I will build IM now myself. Thanks for letting us know your ./configure line.. comes in handy now.
pipitas
Posts: 168
Joined: 2012-07-15T14:06:46-07:00
Authentication code: 15

Re: Problems running 'liquid-rescale' (MacPorts version of I

Post by pipitas »

pipitas wrote:The error message about 'symbol not found' seems to suggest to me that the MacPorts build is somehow faulty then... I will build IM now myself. Thanks for letting us know your ./configure line.. comes in handy now.
Ok, the handmade ImageMagick still doesn't work with liquid-rescale. I used the exactly same ./configure commandline as was suggested by fwm42. And it's still the same error message for me as the 'official' MacPorts version produced:

Error message:

Code: Select all

pip@mbp:~$  convert WPTgp.jpg -liquid-rescale 290x310\! liquid.jpg

dyld: lazy symbol binding failed: Symbol not found: _lqr_pixel_get_rgbcol
  Referenced from: /opt/local/lib/liblqr-1.0.dylib
  Expected in: flat namespace

dyld: Symbol not found: _lqr_pixel_get_rgbcol
  Referenced from: /opt/local/lib/liblqr-1.0.dylib
  Expected in: flat namespace

Trace/BPT trap: 5
convert -list configure:

Code: Select all

pip@mbp:~$  convert -list configure

Path: /usr/local2/lib/ImageMagick-6.7.8/config/configure.xml

Name          Value
-------------------------------------------------------------------------------
CC            gcc -std=gnu99 -std=gnu99
CFLAGS        -I/opt/local/include/lqr-1 -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include -g -O2 -Wall -D_THREAD_SAFE -pthread
CODER_PATH    /usr/local2/lib/ImageMagick-6.7.8/modules-Q16/coders
CONFIGURE     ./configure  'CPPFLAGS=-I/opt/local/include' 'LDFLAGS=-L/opt/local/lib' '--prefix=/usr/local2' '--enable-delegate-build' '--enable-shared' '--disable-static' '--disable-opencl' '--with-modules' '--with-quantum-depth=16' '--with-gslib' '--without-wmf' '--disable-silent-rules' '--disable-dependency-tracking' '--disable-openmp' '--without-pango' '--with-gs-font-dir=/opt/local/share/ghostscript/fonts/' '--with-lqr'
CONFIGURE_PATH /usr/local2/etc/ImageMagick/
COPYRIGHT     Copyright (C) 1999-2012 ImageMagick Studio LLC
CPPFLAGS      -I/usr/local2/include/ImageMagick
CXX           g++
CXXFLAGS      -g -O2 -D_THREAD_SAFE -pthread
DEFS          -DHAVE_CONFIG_H
DELEGATES     bzlib djvu fftw fontconfig freetype gs jbig jpeg jng jp2 lcms2 lqr lzma mpeg openexr png rsvg tiff x11 xml zlib
DISTCHECK_CONFIG_FLAGS 'CPPFLAGS=-I/opt/local/include' 'LDFLAGS=-L/opt/local/lib' --disable-deprecated --with-quantum-depth=16 --with-umem=no --with-autotrace=no --with-fontpath= --with-gs-font-dir=/opt/local/share/ghostscript/fonts/ --with-gvc=no --with-pango=no --with-wmf=no --with-perl=no
DOCUMENTATION_PATH /usr/local2/share/doc/ImageMagick-6.7.8
EXEC-PREFIX   /usr/local2
EXECUTABLE_PATH /usr/local2/bin
FEATURES      
FILTER_PATH   /usr/local2/lib/ImageMagick-6.7.8/modules-Q16/filters
HOST          x86_64-apple-darwin11.4.0
INCLUDE_PATH  /usr/local2/include/ImageMagick
LDFLAGS       -L/usr/local2/lib -L/opt/local/lib -L/Users/pip/Downloads/ImageMagick-6.7.8-8/magick/.libs -L/Users/pip/Downloads/ImageMagick-6.7.8-8/magick -L/Users/pip/Downloads/ImageMagick-6.7.8-8/wand/.libs -L/Users/pip/Downloads/ImageMagick-6.7.8-8/wand -L/opt/local/lib -R/opt/local/lib -L/opt/local/lib -L/opt/local/lib
LIB_VERSION   0x678
LIB_VERSION_NUMBER 6,7,8,8
LIBRARY_PATH  /usr/local2/lib/ImageMagick-6.7.8
LIBS          -lMagickCore -llcms2 -ltiff -lfreetype -ljpeg -L/opt/local/lib -llqr-1 -lglib-2.0 -lintl -lfftw3 -L/opt/local/lib -lfontconfig -lXext -lSM -lICE -lX11 -lXt -L/opt/local/lib -llzma -lbz2 -lz -lm -lpthread -lltdl
NAME          ImageMagick
PCFLAGS       
PREFIX        /usr/local2
QuantumDepth  16
RELEASE_DATE  2012-08-10
SHARE_PATH    /usr/local2/share/ImageMagick-6.7.8
SVN_REVISION  8845
TARGET_CPU    x86_64
TARGET_OS     darwin11.4.0
TARGET_VENDOR apple
VERSION       6.7.8
WEBSITE       http://www.imagemagick.org

Path: [built-in]

Name          Value
-------------------------------------------------------------------------------
NAME          ImageMagick
ImageMagick version:

Code: Select all

pip@mbp:~$ convert -version
  Version: ImageMagick 6.7.8-8 2012-08-10 Q16 http://www.imagemagick.org
  
  Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
  Features:


So could it be a problem with that specific version of liblqr? I would be interested to see what other users whose liquid rescaling works well on Mac do get used by their own convert commands:

liblqr Version:

Code: Select all

pip@mbp:~$  otool -L /usr/local2/bin/convert | grep lqr

	/opt/local/lib/liblqr-1.0.dylib (compatibility version 4.0.0, current version 4.1.0)
Last edited by pipitas on 2012-08-12T12:41:31-07:00, edited 1 time in total.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Problems running 'liquid-rescale' (MacPorts version of I

Post by fmw42 »

You cannot use my ./config unless you install all delegates in /opt using MacPorts and install IM manually in /usr/local/bin or /usr/bin.

My lqr came from liblqr-1-0.4.1_0.darwin_10.x86_64.tbz2
pipitas
Posts: 168
Joined: 2012-07-15T14:06:46-07:00
Authentication code: 15

Re: Problems running 'liquid-rescale' (MacPorts version of I

Post by pipitas »

fmw42 wrote:You cannot use my ./config unless you install all delegates in /opt using MacPorts and install IM manually in /usr/local/bin or /usr/bin.
OK, I forgot: I added '--prefix=/usr/local2' to the configure line. Also, I have everything else in /opt/local/ (where MacPorts usually installs stuff)

I also tested with various other combinations of '--with-XXX' and '--enable-YYY' activated but it's the same thing every time.
My lqr came from liblqr-1-0.4.1_0.darwin_10.x86_64.tbz2
So your liblqr is also self-compiled? (Mine is the MacPorts version...)

Could you please tell me your result for

Code: Select all

otool -L /usr/local/bin/convert | grep lqr
? Thanks.

In my (amateurish) eyes the error message (and the other commands I used) indicate that it's not the problem to find liblqr (as you seem to assume) -- it's that the found liblqr somehow doesn't "fit" to ImageMagick, because IM looks for a symbol that's not there. Admittedly I pondered to also compile liblqr -- but when I saw that the most recent version is from 2009 and exactly the same that MacPorts gives me, I didn't do so.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Problems running 'liquid-rescale' (MacPorts version of I

Post by fmw42 »

otool -L /usr/local2/bin/convert | grep lqr
I have never used otool before. Learn something new each day.


On my system:

otool -L /usr/local/bin/convert | grep "lqr"

/opt/local/lib/liblqr-1.0.dylib (compatibility version 4.0.0, current version 4.1.0)

P.S. I am running SnowLeopard and not Lion. I do not know if that makes any difference.
pipitas
Posts: 168
Joined: 2012-07-15T14:06:46-07:00
Authentication code: 15

Re: Problems running 'liquid-rescale' (MacPorts version of I

Post by pipitas »

fmw42 wrote:otool -L /usr/local/bin/convert | grep "lqr"

/opt/local/lib/liblqr-1.0.dylib (compatibility version 4.0.0, current version 4.1.0)

P.S. I am running SnowLeopard and not Lion. I do not know if that makes any difference.
Ok, this looks to me like your liblqr is also from MacPorts (not self-compiled), and exactly the same as mine.

Yeah, the difference may lie in SnowLeopard vs. Lion then. Maybe Lion changed its way of symbol resolving which now triggers a bug for this particular case....
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Problems running 'liquid-rescale' (MacPorts version of I

Post by fmw42 »

Do you still have --with-lqr in your ./configure file?

I am out of ideas. Perhaps Magick can test lqr on his Mac, presumably Lion?
pipitas
Posts: 168
Joined: 2012-07-15T14:06:46-07:00
Authentication code: 15

Re: Problems running 'liquid-rescale' (MacPorts version of I

Post by pipitas »

fmw42 wrote:Do you still have --with-lqr in your ./configure file?

I am out of ideas. Perhaps Magick can test lqr on his Mac, presumably Lion?
Yes:

Code: Select all

pip@mbp:~/ImageMagick-6.7.8-8$  head config.log 
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by ImageMagick configure 6.7.8-8, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ ./configure CPPFLAGS=-I/opt/local/include LDFLAGS=-L/opt/local/lib --prefix=/usr/local2 --enable-delegate-build --enable-shared --disable-static --disable-opencl --with-modules --with-quantum-depth=16 --with-gslib --without-wmf --disable-silent-rules --disable-dependency-tracking --disable-openmp --without-pango --with-gs-font-dir=/opt/local/share/ghostscript/fonts/ --with-lqr
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Problems running 'liquid-rescale' (MacPorts version of I

Post by fmw42 »

That command only tells you what it is trying to achieve and not what is actually used.

type

convert -list configure

look at the line starting with DELEGATES. See if lqr is listed there. If not, then it did not get installed correctly or IM could not find it.
pipitas
Posts: 168
Joined: 2012-07-15T14:06:46-07:00
Authentication code: 15

Re: Problems running 'liquid-rescale' (MacPorts version of I

Post by pipitas »

fmw42 wrote:That command only tells you what it is trying to achieve and not what is actually used.

type

convert -list configure

look at the line starting with DELEGATES. See if lqr is listed there. If not, then it did not get installed correctly or IM could not find it.
It's still there (just like in my first quoting of the DELEGATES line, above)

Code: Select all

pip@mbp:~$ /usr/local2/bin/convert -list configure | grep DELEG
DELEGATES     bzlib djvu fftw fontconfig freetype gs jbig jpeg jng jp2 lcms2 lqr lzma mpeg openexr png rsvg tiff x11 xml zlib
                                                                             ^^^
And as I said before, if it wouldn't be there, you could expect a different error message:

Code: Select all

DelegateLibrarySupportNotBuiltIn
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Problems running 'liquid-rescale' (MacPorts version of I

Post by fmw42 »

Sorry, just double checking. I am at a loss to help further. Perhaps Magick will see this post. Or repost on the bugs forum if you think there is a bug in IM and not MacPorts.
pipitas
Posts: 168
Joined: 2012-07-15T14:06:46-07:00
Authentication code: 15

Re: Problems running 'liquid-rescale' (MacPorts version of I

Post by pipitas »

fmw42 wrote:Sorry, just double checking. I am at a loss to help further. Perhaps Magick will see this post. Or repost on the bugs forum if you think there is a bug in IM and not MacPorts.
Thanks a lot for your support. Now that I know there's a bugs forum, I'll address it there...
Post Reply