Page 1 of 1

ImageMagick cannot find its shared library, libMagick.so

Posted: 2014-02-27T14:40:45-07:00
by LedZeppelin
I compiled imagemagick/perlmagick and installed it however when I try to import perlmagick I get the following error

Code: Select all

$ perl -e "use Image::Magick"
Can't load '/website/lib/perl5/vendor_perl/5.14.2/x86_64-linux-thread-multi/auto/Image/Magick/Magick.so' for module Image::Magick: libMagickCore.so.4: cannot open shared object file: No such file or directory at /website/lib/perl5/5.14.2/x86_64-linux-thread-multi/DynaLoader.pm line 190.
 at -e line 1.
Compilation failed in require at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
&Image::Magick::constant not defined. The required ImageMagick libraries are not installed or not installed properly.
END failed--call queue aborted at -e line 1.
I did some poking around and it turns out libMagickCore.so.4 cannot be found

Code: Select all

$ ldd /website/lib/perl5/vendor_perl/5.14.2/x86_64-linux-thread-multi/auto/Image/Magick/Magick.so
	linux-vdso.so.1 =>  (0x00007fffe69ff000)
	libMagickCore.so.4 => not found
	libperl.so.5.14 => /usr/lib/libperl.so.5.14 (0x00007f7ef282c000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f7ef252f000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7ef216f000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f7ef1f6b000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f7ef1d4d000)
	libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007f7ef1b14000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f7ef2e0f000)
Running either of the two commands manually resolves this issue

Code: Select all

$ sudo ldconfig /website/lib
$ sudo cp /website/lib/libMagickCore.so.4 /lib/x86_64-linux-gnu/
Is there an option I can pass to the configure step to tell perlmagick to look for libMagickCore.so.4 in /website/lib once it is installed?

Here is what my configure step looks like now

Code: Select all

MagickDocumentPath="/website/share/doc/imagemagick"  ./configure \
--prefix=/website \
--sysconfdir=/etc \
--mandir=/website/share/man \
--infodir=/website/share/info \
--with-modules \
--with-gs-font-dir=/usr/share/fonts/type1/gsfonts \
--with-magick-plus-plus \
--with-djvu \
--enable-shared \
--without-dps \
--without-fpx \
--with-perl=/website/bin/perl \
--with-perl-options='INSTALLDIRS=vendor'
Additional System Info:

Code: Select all

$ uname -a
Linux apt-repo-server 3.2.0-23-generic #36-Ubuntu SMP Tue Apr 10 20:39:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 12.04 LTS
Release:	12.04
Codename:	precise
References:
http://www.imagemagick.org/script/advan ... lation.php