Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Installing PerlMagick

by webchalkboard (Scribe)
on Apr 06, 2005 at 14:29 UTC ( [id://445313]=perlquestion: print w/replies, xml ) Need Help??

webchalkboard has asked for the wisdom of the Perl Monks concerning the following question:

Hi Perl Monks,

I've managed to install ImageMagick 6.2.1. but i'm having trouble installing PerlMagick, the Perl extension that links up with Imagemagick. Does anyone here have any experience using this?

If so can you please explain what this bit of the README.txt file is going on about? It says.

Next, edit Makefile.PL and change LIBS and INC to include the appropri +ate path information to the required libMagick library. You will also +need library search paths (-L) to JPEG, PNG, TIFF, etc. libraries if th +ey were included with your installed version of ImageMagick. If an extensi +on library is built as a shared library but not installed in the syst +em's default library search path, you may need to add run-path informat +ion (often -R or -rpath) corresponding to the equivalent library searc +h path option so that the library can be located at run-time.

Can someone tell me what I need to do? I've found what it specifies the LIBS and INC and they currently look like this:

# Header search specfication and preprocessor flags 'INC' => '-I../ -I.. -I/usr/include/freetype2 -I/usr/X11R6/i +nclude -I/usr/X11R6/include/X11 -I/usr/include/libxml2', # Library specification 'LIBS' => ['-L/usr/local/lib -lMagick -L/usr/X11R6/lib -lfree +type -lz -L/usr/lib -llcms -ltiff -lfreetype -ljpeg -lpng -ldpstk -ld +ps -lXext -lXt -lSM -lICE -lX11 -lbz2 -lxml2 -lz -lpthread -lm -lpthr +ead'],

The base directory that i'm installing this all in is /home/tdf/

Oh the only other thing to note is that i've managed to install ImageMagick using a pre-built binary, however I can't find PerlMagick prebuilt, so I have downloaded the source for ImageMagick which also includes the source for PerlMagick, and i'm trying to install that version. I've made sure it's all the same version though, i.e. 6.2.1.

I have a horrible feeling I have probably just included far too much information in this post and I doubt anyone is still reading so I will stop writing now and hope someone can point me in the right direction.

Cheers,
Tom

Learning without thought is labor lost; thought without learning is perilous. - Confucius
WebChalkboard.com | For the love of art...

Replies are listed 'Best First'.
Re: Installing PerlMagick
by cfreak (Chaplain) on Apr 06, 2005 at 16:39 UTC

    I've had tons of hassles with PerlMagick, I believe (at least the last time I tried it) I had to comment out some of the libraries in the Makefile.PL because the compile switches weren't turning them off correctly. I've also found the Imager module to be much easier to install and just as effective.

      That's cool thanks i'll check that module out. I'm fed up with PerlMagick, i've tried installing it from source a couple of times now, but still it fails on 28 of the tests. And is giving me errors...

      Does Imager still require that I have ImageMagick installed?

      Cheers

      Tom

      Learning without thought is labor lost; thought without learning is perilous. - Confucius
      WebChalkboard.com | For the love of art...

        *Runs to look at it real fast*

        It appears to use its own library. You will need to make sure to have libraries for the different image types installed though, but you should have them if you managed to get ImageMagick installed you should have most of them. Just be careful if you install from CPAN to have them first, because it will compile anyway without support for libs it couldn't find. (CPAN speeds past the nice little screen that tells you what you've got support for :) )

Re: Installing PerlMagick
by polettix (Vicar) on Apr 06, 2005 at 14:42 UTC
    Have you simply tried to compile the PerlMagick package? If you got a prebuilt distribution, chances are that the libraries you should provide the path for are those which already populate INC and LIBS - so you have to do nothing.

    If you encounter problems, look for the ImageMagick stuff (libraries in "lib" directories, header files in "include" directories), probably under /usr or /usr/local. I would also suggest to look at the "pre-built binary" (is it a tgz file?), usually source distributions tend to put things into /usr/local by default, while compiled packages have a bias for /usr.

    Flavio (perl -e "print(scalar(reverse('ti.xittelop@oivalf')))")

    Don't fool yourself.
Re: Installing PerlMagick
by webchalkboard (Scribe) on Apr 06, 2005 at 15:06 UTC

    Yeah tried just compiling and I got a lot of error messages which looked like this:

    Magick.c: In function `XS_Image__Magick_Animate': Magick.c:1978: warning: unused variable `ref' Magick.c:1973: warning: unused variable `ix' Magick.c: In function `XS_Image__Magick_Append': Magick.c:2052: warning: unused variable `ref' Magick.c:2047: warning: unused variable `ix' Magick.c: In function `XS_Image__Magick_Average': Magick.c:2183: warning: unused variable `ref' Magick.c:2178: warning: unused variable `ix'

    Then the last one looked like this

    gcc -L/usr/local/lib -shared -L/usr/local/lib Magick.o -o blib/arch/ +auto/Image/Magick/Magick.so -L/usr/local/lib -L/u sr/X11R6/lib -lfreetype -lz -L/usr/lib -ltiff -lfreetype -ljpeg -lpng +-ldpstk -ldps -lXext -lXt -lSM -lICE -lX11 -lbz2 -l xml2 -lz -lpthread -lm -lpthread /usr/bin/ld: cannot find -lbz2 collect2: ld returned 1 exit status make: *** [blib/arch/auto/Image/Magick/Magick.so] Error 1

    So I think it failed at the end because it couldnt find a library file... do you think I need to change where is says.

    -L/usr/lib -ltiff -lfreetype -ljpeg -lpng -ldpstk -ldps -lXext -lXt -l +SM -lICE -lX11 -lbz2 -l xml2 -lz -lpthread -lm -lpthread

    To be something more like

    -L/home/tdf/ImageMagick/lib -ltiff -lfreetype -ljpeg -lpng -ldpstk -ld +ps -lXext -lXt -lSM -lICE -lX11 -lbz2 -l xml2 -lz -lpthread -lm -lpthread

    ?

    Learning without thought is labor lost; thought without learning is perilous. - Confucius
    WebChalkboard.com | For the love of art...
      +-ldpstk -ldps -lXext -lXt -lSM -lICE -lX11 -lbz2 -l xml2 -lz -lpthread -lm -lpthread /usr/bin/ld: cannot find -lbz2 collect2: ld returned 1 exit status make: *** [blib/arch/auto/Image/Magick/Magick.so] Error 1
      It looks like it's trying to find a library to unpack bz2 compressed archives. Look for something like libbz2.so somewhere in your library areas. I know in FreeBSD5 they use BZ2 for packages et al, and they used to use normal .tgz tarballs. What is your OS and version?
Re: Installing PerlMagick
by fauria (Deacon) on Apr 06, 2005 at 15:11 UTC
    Hi,

    Have you tried: perl -MCPAN -e 'install Image::Magick'?
Re: Installing PerlMagick
by webchalkboard (Scribe) on Apr 06, 2005 at 15:28 UTC

    I have now and that returns a lot of nasty looking error messages.

    Magick.xs:9371: error: syntax error before ')' token Magick.xs:9385: error: dereferencing pointer to incomplete type Magick.xs:9393: error: dereferencing pointer to incomplete type Magick.xs:9393: error: `MagickTrue' undeclared (first use in this func +tion) Magick.xs:9396: warning: implicit declaration of function `WriteImage' Magick.xs:9396: error: dereferencing pointer to incomplete type Magick.xs:9397: error: `ErrorException' undeclared (first use in this +function) Magick.xs:9399: warning: implicit declaration of function `GetImageExc +eption' Magick.xs:9401: error: dereferencing pointer to incomplete type Magick.xs:9408: error: `UndefinedException' undeclared (first use in t +his function) Magick.xs:9408: warning: unused variable `message' Magick.xs:9335: warning: unused variable `filename' Magick.c:9045: warning: unused variable `ref' Magick.c:9040: warning: unused variable `ix' Magick.xs: In function `boot_Image__Magick': Magick.xs:1938: warning: implicit declaration of function `InitializeM +agick' Magick.xs:1939: warning: implicit declaration of function `SetWarningH +andler' Magick.xs:1940: warning: implicit declaration of function `SetErrorHan +dler' make: *** [Magick.o] Error 1 /usr/bin/make -- NOT OK Running make test Can't test without successful make Running make install make had returned bad status, install seems impossible
    Learning without thought is labor lost; thought without learning is perilous. - Confucius
    WebChalkboard.com | For the love of art...
Re: Installing PerlMagick
by webchalkboard (Scribe) on Apr 07, 2005 at 09:52 UTC

      I have managed to solve my own problem. I took code from the cpan page for creating thumbnails and it included a filter $thumb->filter(type=>'autolevels'); Removing this line sorted my problem.

      Learning without thought is labor lost; thought without learning is perilous. - Confucius
      WebChalkboard.com | For the love of art...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://445313]
Approved by RazorbladeBidet
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2024-04-16 10:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found