[TYPO3-english] Installing ImageMagick-4.2.9 on FreeBSD AMD64 (How-to)

Markus universe at truemetal.org
Sat Dec 20 12:36:14 CET 2008

Hi lists,

here is a quick how-to get the ImageMagick-4.2.9 package provided by
http://typo3.sunsite.dk/software/freebsd to run on FreeBSD AMD64 (in my
case 7.0-RELEASE). It was compiled on i386 (32bit), so the provided
binaries won't simply execute ouf of the box after unpacking (and they
neither won't on 32bit). Apologies if this info was already provided by
someone else (I couldn't find any info related to this).

1. Make sure the 32bit compatibility libraries are installed, e.g.:

ls /libexec/ld-elf32.so.1
ls /usr/lib32

If they aren't, install them via e.g. sysinstall:
sysinstall -> Index -> Distributions, Adding -> lib32

2. ImageMagick depends on libpng(.so.5) and some other libs, but the
installed 64bit ldd won't tell you about it because it's still a bit
buggy (patch does exist and will probably be fixed in the next FreeBSD
release), so you will get:

ldd /usr/local/non-ports/imagemagick-4.2.9/bin/convert.bin 
ldd: imagemagick-4.2.9/bin/convert.bin: can't read program header
ldd: imagemagick-4.2.9/bin/convert.bin: not a dynamic executable

As a workaround, just execute:

        libpng.so.5 => not found (0x0)
        libz.so.2 => not found (0x0)
        libm.so.2 => not found (0x0)
        libc.so.4 => not found (0x0)

Usually, ldd should tell us *where* convert.bin is looking for those
libs, but at this point it doesn't (for some reason). So we'll guess it
just a bit later.

3. Get libpng.so.5 and libpng.a from some FreeBSD 32bit/i386 (in my case
I used a 6.2-RELEASE) machine and copy it over. If you don't have it
installed there yet, just install it from ports

On the 32bit box use e.g. scp to copy libpng from /usr/local/lib to the
AMD64 machine into /usr/lib32:

scp /usr/local/lib/libpng* 64bitbox:/usr/lib32

4. Now, convert.bin can find and use the 32bit libpng, but it needs some
more libs (see above). Fortunately they are already provided by the
lib32 compat package, so we just create some symlinks in /usr/lib32 (we
guessed that path):

ln -s libz.so libz.so.2
ln -s libm.so libm.so.2
ln -s libc.so libc.so.4

But now, some more libs are required by the 32bit version of libpng.
Again we create symlinks in /usr/lib32:

ln -s libm.so libm.so.4
ln -s libz.so libz.so.3

5. That's it. convert.bin, combine.bin etc. are now running fine.

Version: @(#)ImageMagick 4.2.9 99/09/01 cristy at mystic.es.dupont.com
Copyright: Copyright 1999 E. I. du Pont de Nemours and Company

Funny enough, ldd now will tell us where it's looking for the libs. We
could have used that information before :-)

        libpng.so.5 => /usr/lib32/libpng.so.5 (0x2818e000)
        libz.so.2 => /usr/lib32/libz.so.2 (0x281b0000)
        libm.so.2 => /usr/lib32/libm.so.2 (0x281c2000)
        libc.so.4 => /usr/lib32/libc.so.4 (0x281d7000)

BTW, ImageMagick-4.2.9 (the binary from sunsite.dk) does need several
symlinks on i386/32bit as well, but they are more easy to figure out
(they sit in /lib).


More information about the TYPO3-english mailing list