Installing ImageMagic @ Suse 10

I like the Debian apt-get package mechanism, it simply works (Posting the statement
$sudo apt-get install imagemagick
would finalize this post.  In Suse however…). Recently I had to install on a Suse 10 (SLES) linux system. Although I had root access, I lack the knowledge/experience how to get the repositories of the configurations to get YAST install whatever I need.

Still, my installation of Alfresco Share had to get up and running, so I prepared to compile ImageMagic myself. See my post about Installing SWFTools @ Suse 10 as well.

I assume you can find the command line and you have privileges like root; you have to have access YAST and install applications.

The main steps are easy

  1. Prepare
  2. Download the ImageMagic source
  3. Compile and install the package
  4. Create some symbolic links to make things work (with Alfresco)

1. Prepare

You need to have a gcc compiler in order to compile packages. Use YAST to install the compiler and the dependencies it needs (being root):
# yast -i gcc
2. Download the ImageMagic source

I downloaded the most recent stable distribution from a mirror close to me. See the ImageMagic website for a list of mirrors, or get it directly from their site (http://www.imagemagick.org/). I got mine from

ftp://ftp.nluug.nl/pub/ImageMagick/ImageMagick-6.6.1-4.tar.gz

and stored the tarball in /opt. Unpack the tarball

$ tar -xvf ImageMagick-6.6.1-4.tar.gz

A new directory will be created containing all source files.

3. Compile and install the package

This sounds more nerdy than it actually is. Navigate into the directory ImageMagick-6.6.1-4 (or any newer version number available). Execute the following commands, and verify they completed successfully: (remind, the ./ in the first command is mandatory!)

$ ./configure
$ make

Run the followingt command as root:

# make install
Now the ImageMagick application is installed into your Suse 10 system. Congratulations!
4. Create some symbolic links to make things work
However…
If you execture the convert command, it complains:
# convert
convert: error while loading shared libraries: libMagickCore.so.3: cannot open shared object file: No such file or directory
The system cannot find a library. First validate where convert is actually installed
# whereis convert
convert: /usr/local/bin/convert
Navigate into/usr/local/bin
# cd usr/local/bin
Find out what libraries are acually called, and where they are expected to be found, using the ldd statement:
# ldd convert
linux-gate.so.1 =>  (0xbfffe000)
libMagickCore.so.3 => not found
libMagickWand.so.3 => not found
libbz2.so.1 => /lib/libbz2.so.1 (0x40025000)
libpthread.so.0 => /lib/libpthread.so.0 (0x40036000)
libdl.so.2 => /lib/libdl.so.2 (0x4004b000)
libm.so.6 => /lib/libm.so.6 (0x40050000)
libc.so.6 => /lib/libc.so.6 (0x40075000)
/lib/ld-linux.so.2 (0x40000000)
The system is not capable of finding libMagicCore.so.3 and libMagicWand.so.3. Lets find out where they do exist:
# whereis  libMagickCore.so.3
libMagickCore.so: /usr/local/lib/libMagickCore.so /usr/local/lib/libMagickCore.so.3
# whereis  libMagickWand.so.3
libMagickWand.so: /usr/local/lib/libMagickWand.so /usr/local/lib/libMagickWand.so.3
That’s where they are, in /usr/local/lib… Lets add this to the LD_LIBRARY_PATH environment variable. First check if this variable already exist (e.g. appending or overwriting?):
# env |grep LD_LIBRARY_PATH
Most likely, you will see it does not already exist, so add it (valid for the current session only):
# export LD_LIBRARY_PATH=/usr/local/lib
Let’s try again if the convert command succeeds:
# convert
Now you will see more verbosing output than will fit your window. You can also try the following to generate the ImageMagic logo:
# convert logo: logo.gif
The trick I did not manage yet is how to set the LD_LIBRARY_PATH for all users/applications. I tried to add it to the .profile file of the user running Alfresco, but Alfresco still could not find the same library that we fixed by adding the LD_LIBRARAY_PATH. I am open for a good suggestion!
My alternative is to create some symbolic links into /usr/lib pointing at the libraries as installed in /usr/local/lib: (beware, be root)
# cd /usr/lib/
# ln -s /usr/local/lib/libMagickCore.so.3
# ln -s /usr/local/lib/libMagickWand.so.3
Create  the folders ImageMagic/bin into your %Alfresco_home% (I installed Alfresco into /opt/alfresco, so I created /opt/alfresco/ImageMagic/bin. Navigate to this ImageMagic/bin directory and create a symbolic link to the convert command (find out where this command lives using whereis convert):
# ln -s /usr/local/bin/convert
Restart Alfresco, and validate that there are no more errors starting/finding ImageMagic!
Related posing: Installing SWFTools @ Suse 10

Advertisements

3 Responses to “Installing ImageMagic @ Suse 10”


  1. 1 Tony Miller April 27, 2010 at 16:36

    Since you’re talking about Linux (I know RedHat/Fedora more than SLES), the easiest way to manipulate the dynamic library search paths is with ldconfig:

    http://www.oreillynet.com/linux/cmd/cmd.csp?path=l/ldconfig

    Put /usr/local/lib in the search path, run ldconfig as root, then every user and program will have the path in the shared library search path. It eliminates having to set LD_LIBRARY_PATH.

  2. 2 Patrick Bossard August 3, 2010 at 11:31

    You should also use the ‘ldconfig’ command line after your ‘make install’ statement.

    It worked fine for me.

    # ldd /usr/local/bin/convert
    linux-vdso.so.1 => (0x00007fffffffe000)
    libMagickCore.so.3 => not found
    libMagickWand.so.3 => not found
    libjasper.so.1 => /usr/lib/libjasper.so.1 (0x00007f0c073cf000)
    libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0x00007f0c071ad000)
    libpng12.so.0 => /usr/lib/libpng12.so.0 (0x00007f0c06f88000)
    libz.so.1 => /usr/lib/libz.so.1 (0x00007f0c06d71000)
    libpthread.so.0 => /lib/libpthread.so.0 (0x00007f0c06b55000)
    libdl.so.2 => /lib/libdl.so.2 (0x00007f0c06951000)
    libgomp.so.1 => /usr/lib/libgomp.so.1 (0x00007f0c06749000)
    libm.so.6 => /lib/libm.so.6 (0x00007f0c064c6000)
    libc.so.6 => /lib/libc.so.6 (0x00007f0c06173000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f0c07628000)
    librt.so.1 => /lib/librt.so.1 (0x00007f0c05f6a000)

    # ldconfig
    # convert -version
    Version: ImageMagick 6.6.2-6 2010-08-03 Q16 http://www.imagemagick.org
    Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC
    Features: OpenMP

    # ldd /usr/local/bin/convert
    linux-vdso.so.1 => (0x00007f71a7ede000)
    libMagickCore.so.3 => /usr/local/lib/libMagickCore.so.3 (0x00007f71a7794000)
    libMagickWand.so.3 => /usr/local/lib/libMagickWand.so.3 (0x00007f71a74a8000)
    libjasper.so.1 => /usr/lib/libjasper.so.1 (0x00007f71a724f000)
    libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0x00007f71a702d000)
    libpng12.so.0 => /usr/lib/libpng12.so.0 (0x00007f71a6e08000)
    libz.so.1 => /usr/lib/libz.so.1 (0x00007f71a6bf1000)
    libpthread.so.0 => /lib/libpthread.so.0 (0x00007f71a69d5000)
    libdl.so.2 => /lib/libdl.so.2 (0x00007f71a67d1000)
    libgomp.so.1 => /usr/lib/libgomp.so.1 (0x00007f71a65c9000)
    libm.so.6 => /lib/libm.so.6 (0x00007f71a6346000)
    libc.so.6 => /lib/libc.so.6 (0x00007f71a5ff3000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f71a7cc4000)
    librt.so.1 => /lib/librt.so.1 (0x00007f71a5dea000)

  3. 3 Julian Cook September 29, 2010 at 19:11

    This post of yours has saved me HOURS of figuring out this problem. Thank you so MUCH!
    Julian


Comments are currently closed.