perlbrew and Image::Magick

Chisel chisel at
Wed Apr 6 22:38:48 BST 2011

I don't know if it's perlbrew specific, or just a good way to encounter the
problem but I'm stumped.

I'm seeing the same thing with a 5.12.2 and 5.12.3 brewed perl; everything's
under Ubuntu or Linux Mint.

If anyone has any ideas or suggestions to what I've done wrong, or how to
Make It Work I'd really appreciate them.

Suggestions to 'use something else' will be more helpful if I know what the
'something else' should be.

I'd need drop-in or not-to-hard-to-write replacements for:

 * Catalyst::Plugin::Upload::Image::Magick
 * Catalyst::Plugin::Upload::Image::Magick::Thumbnail

I'm mostly using is_image() and scaling features.

I've pasted lots of technical stuff below so people can see what I've done
so far.



➔ cpanm Image::Magick
--> Working on Image::Magick
Fetching OK
Configuring PerlMagick-6.67 ... OK
Building and testing PerlMagick-6.67 ... FAIL

➔ more /home/chisel/.cpanm/build.log
cpanm (App::cpanminus) 1.4004 on perl 5.012002 built for x86_64-linux
Work directory is /home/chisel/.cpanm/work/1302124855.30513
You have make /usr/bin/make
You have LWP 5.837
You have /bin/tar: tar (GNU tar) 1.25
Copyright © 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.
You have /usr/bin/unzip
Searching Image::Magick on cpanmetadb ...
--> Working on Image::Magick
-> OK
Unpacking PerlMagick-6.67.tar.gz
Entering PerlMagick-6.67
META.yml not found or unparsable. Fetching META.yml from
Configuring PerlMagick-6.67
Running Makefile.PL
Checking if your kit is complete...
Looks good
Note (probably harmless): No library found for -lm
Writing Makefile for Image::Magick
-> OK
Finding PREREQ from Makefile ...
Building and testing PerlMagick-6.67
cp blib/lib/Image/
AutoSplitting blib/lib/Image/ (blib/lib/auto/Image/Magick)
pp  -typemap
Magick.xs > Magick.xsc && mv Magick.x
sc Magick.c
cc -c  -I/usr/include/ImageMagick -I../ -I.. -I"/usr/include/ImageMagick"
-I/usr/include/ImageMagick -fopenmp -fopenmp -g
-O2 -Wall -pthread -fno-strict-aliasing -pipe -fstack-protector
S=64 -O2   -DVERSION=\"6.6.7\" -DXS_VERSION=\"6.6.7\" -fPIC
4-linux/CORE"  -D_LARGE_FILES=1 -DHAVE_CONFIG_H Magick.c
Magick.xs: In function ‘XS_Image__Magick_Smush’:
Magick.xs:13519:5: warning: implicit declaration of function ‘SmushImages’
Magick.xs:13519:10: warning: assignment makes pointer from integer without a
Running Mkbootstrap for Image::Magick ()
chmod 644
rm -f blib/arch/auto/Image/Magick/
LD_RUN_PATH="/usr/lib" cc  -L../magick/.libs -lMagickCore -shared -O2
-L/usr/local/lib -fstack-protector Magick.o  -o blib/
arch/auto/Image/Magick/     \
       -lMagickCore -lperl      \

/usr/bin/ld: cannot find -lperl
collect2: ld returned 1 exit status
make: *** [blib/arch/auto/Image/Magick/] Error 1
-> FAIL Installing Image::Magick failed. See /home/chisel/.cpanm/build.log
for details.

[2003][chisel at metropolis:PerlMagick-6.67-EzIQo2]➔ LD_RUN_PATH="/usr/lib" cc
-L../magick/.libs -lMagickCore -shared -O2 -L/usr/local/lib
-fstack-protector Magick.o  -o blib/arch/auto/Image/Magick/
-lMagickCore -lperl -L/home/chiz/perl5/perlbrew/build/perl-5.12.2
/usr/bin/ld: /home/chiz/perl5/perlbrew/build/perl-5.12.2/libperl.a(op.o):
relocation R_X86_64_32S against `PL_sv_yes' can not be used when making a
shared object; recompile with -fPIC
/home/chiz/perl5/perlbrew/build/perl-5.12.2/libperl.a: could not read
symbols: Bad value
collect2: ld returned 1 exit status

➔ perl -V
Summary of my perl5 (revision 5 version 12 subversion 2) configuration:

    osname=linux, osvers=2.6.35-22-generic, archname=x86_64-linux
    uname='linux metropolis 2.6.35-22-generic #34-ubuntu smp sun oct 10
09:26:05 utc 2010 x86_64 gnulinux '
    config_args='-de -Dprefix=/home/chiz/perl5/perlbrew/perls/perl-5.12.2'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
    cc='cc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    cppflags='-fno-strict-aliasing -pipe -fstack-protector
    ccversion='', gccversion='4.4.5', gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t',
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -fstack-protector -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib /lib64 /usr/lib64
    libs=-lnsl -ldl -lm -lcrypt -lutil -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
    libc=/lib/, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib

Characteristics of this binary (from libperl):
                        USE_64_BIT_INT USE_LARGE_FILES USE_PERLIO
  Built under linux
  Compiled at Oct 16 2010 23:56:59



e: chisel at

More information about the mailing list