Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Perl 5.14 GD problem on CentOS

by lsr (Novice)
on Mar 26, 2012 at 00:45 UTC ( #961564=perlquestion: print w/replies, xml ) Need Help??
lsr has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to install Image::Resize on a centos webserver.

# perl -V Summary of my perl5 (revision 5 version 14 subversion 2) configuration +: Platform: osname=linux, osvers=2.6.18-274.7.1.el5.028stab095.1, archname=i68 +6-linux-thread-multi uname='linux 2.6.18-274.7.1.el5.028stab095.1 #1 smp mon + oct 24 20:49:24 msd 2011 i686 i686 i386 gnulinux ' config_args='-de -Dusethreads' hint=recommended, useposix=true, d_sigaction=define useithreads=define, usemultiplicity=define useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=und +ef use64bitint=undef, use64bitall=undef, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing + -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_ +FILE_OFFSET_BITS=64', optimize='-O2', cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -f +stack-protector -I/usr/local/include' ccversion='', gccversion='4.1.2 20080704 (Red Hat 4.1.2-51)', gcco +sandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=1 +2 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', + lseeksize=8 alignbytes=4, prototype=define Linker and Libraries: ld='cc', ldflags =' -fstack-protector -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc libc=/lib/, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.5' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib -fstac +k-protector' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP PERL_PRESERVE_IVUV USE_ITHREADS USE_LARGE_FILE +S USE_PERLIO USE_PERL_ATOF USE_REENTRANT_API Built under linux Compiled at Mar 8 2012 16:01:46 @INC: /usr/local/lib/perl5/site_perl/5.14.2/i686-linux-thread-multi /usr/local/lib/perl5/site_perl/5.14.2 /usr/local/lib/perl5/5.14.2/i686-linux-thread-multi /usr/local/lib/perl5/5.14.2 /usr/local/lib/perl5/site_perl/5.8.8 /usr/local/lib/perl5/site_perl

GD tells me it is installed...

# cpan GD CPAN: Storable loaded ok (v2.30) Going to read '/root/.cpan/Metadata' Database was generated on Sun, 25 Mar 2012 04:10:47 GMT CPAN: Module::CoreList loaded ok (v2.49_02) GD is up to date (2.46).

But I don't seem to be able to use it.

# perl -MGD -e 'print "qwe";' Not a CODE reference at /usr/local/lib/perl5/5.14.2/i686-linux-thread- +multi/ line 213. END failed--call queue aborted at /usr/local/lib/perl5/site_perl/5.14. +2/i686-linux-thread-multi/ line 213. Compilation failed in require. BEGIN failed--compilation aborted.

It seems like a problem others have encountered but I can't decipher an obvious solution to the problem.

Can anyone offer advice? Thank you in advance.

Edit: I found a solution by reinstalling GD declaring CCFLAGS after the make command.

I moved the file and the tried to install GD again.

# cpan GD

Then when it failed, when to the .cpan/build directory where the GD package was and ran the following:

# perl Makefile.PM # make CCFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" # make test # make install

And it installed. I hope that can help someone else.

Replies are listed 'Best First'.
Re: Perl 5.14 GD problem on CentOS
by Anonymous Monk on Dec 30, 2012 at 04:38 UTC
    Great, had the same problem in a Ubuntu 12.04 virtual machine and the CCFLAGS solved it for me.
      Thank you very much! It is help me :)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://961564]
Approved by ww
Front-paged by Corion
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2018-02-22 18:26 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (297 votes). Check out past polls.