I grabbed the source & compiled to install imagemagick & perl magick in my home dir, configured like this:
Code: Select all
./configure --prefix=/home/me/lib/imagemagick --with-perl-options=PREFIX=/home/me/lib/perl
However, perl magick did not work. When use Image::Magick ; was invoked in a perl script, it would crash, complaining
Code: Select all
Can't load '/home/me/lib/perl/lib/perl5/site_perl/5.8.7//x86_64-linux/auto/Image/Magick/Magick.so' for module Image::Magick: libMagick.so.10: cannot open shared object file: No such file or directory at /usr/lib/perl5/5.8.7/x86_64-linux/DynaLoader.pm line 230. at test.pl line 8
I ran ldd on Magick.so and found it did not know where libMagick.so.10 was located (its actually in /home/me/lib/imagemagick/lib).
When I set the environmental variable LD_LIBRARY_PATH to point to the directory where libMagick.so.10 resides, Magick.so can find it, & perlmagick is able to run.
However, this is not possible to do within the perl program itself (I have tried, but it doesn't work and apparently can't, at least according to reasearch I did--see http://www.thescripts.com/forum/thread49850.html ). This is bad, because now I can't get my web-based programs to work.
So my questions are:
1) shouldn't Magick.so already know where the libMagick.so.10 file is, since they were both installed from the same source durring the same compile? Why does Magick.so need to have LD_LIBRARY_PATH at all?
2) How can I get imagemagick & perlmagick to work properly without having to rely in that environmental variable.... because if I need that variable, I can't run it from the web server, which will make all my web apps that want to use perl magick useless.
3) I don't completely understand the little report I got when configuring Image Magick but it seems to say that the /home/me/lib/imagemagick/lib directory whould already be in the LD PATH (see LDFLAGS below)
I know this should work, I have done it before on other servers but I am flummoxed now.
Perhaps I need to recompile with different options? I would like to avoid recompiling perl if possible.
Please help me with your wisdom.
This is the configuration report from when I installed Image Magick:
Code: Select all
ImageMagick is configured as follows. Please verify that this configuration matches your expectations. Host system type : x86_64-unknown-linux-gnu Option Value ------------------------------------------------------------------------- Shared libraries --enable-shared=yes yes Static libraries --enable-static=yes yes Module support --with-modules=yes yes GNU ld --with-gnu-ld=yes yes Quantum depth --with-quantum-depth=16 16 Delegate Configuration: BZLIB --with-bzlib=yes yes DPS --with-dps=yes no (failed tests) FlashPIX --with-fpx=no no FontConfig --with-fontconfig=no no FreeType --with-freetype=yes yes GhostPCL None pcl6 (unknown) Ghostscript None gs (7.07) Ghostscript fonts --with-gs-font-dir=default /usr/share/fonts/default/Type1/ Ghostscript lib --with-gslib=yes no (failed tests) Graphviz --with-gvc=yes no JBIG --with-jbig=yes no JPEG v1 --with-jpeg=yes yes JPEG-2000 --with-jp2=yes no LCMS --with-lcms=yes no Magick++ --with-magick-plus-plus=yes no (failed tests) PERL --with-perl=yes /usr/local/bin/perl PNG --with-png=yes yes RSVG --with-rsvg=no no TIFF --with-tiff=yes yes Windows fonts --with-windows-font-dir= none WMF --with-wmf=yes yes X11 --with-x= no XML --with-xml=yes yes ZLIB --with-zlib=yes yes X11 Configuration: Not using X11. Options used to compile and link: PREFIX = /home/me/lib/imagemagick/ EXEC-PREFIX = /home/me/lib/imagemagick/ VERSION = 6.3.1 CC = gcc CFLAGS = -g -O2 -Wall -W -pthread CPPFLAGS = -I/home/me/lib/imagemagick//include PCFLAGS = DEFS = -DHAVE_CONFIG_H LDFLAGS = -L/home/me/lib/imagemagick//lib -L/usr/lib64 -Wl,--rpath -Wl,/usr/lib64 -lfreetype -lz -L/usr/lib LIBS = -lMagick -ltiff -lfreetype -ljpeg -lbz2 -lz -lpthread -lm -lpthread CXX = g++ CXXFLAGS = -g -O2 -Wall -W -pthread