Perl用cpan安装GD模块

时间:2013-07-03 08:14:47

标签: perl gd cpan

当我尝试通过命令sudo cpanm GD安装CD时,这是日志文件:

cpanm (App::cpanminus) 1.6922 on perl 5.012003 built for darwin-thread-multi-2level
Work directory is /Users/Gizak/.cpanm/work/1372838444.1200
You have make /usr/bin/make
You have LWP 6.04
You have /usr/bin/tar: bsdtar 2.8.3 - libarchive 2.8.3
You have /usr/bin/unzip
Searching GD on cpanmetadb ...
--> Working on GD
Fetching http://www.cpan.org/authors/id/L/LD/LDS/GD-2.50.tar.gz
-> OK
Unpacking GD-2.50.tar.gz
Entering GD-2.50
Checking configure dependencies from META.json
Checking if you have ExtUtils::MakeMaker 0 ... Yes (6.56)
Configuring GD-2.50
Running Makefile.PL
Notice: Type perl Makefile.PL -h for command-line option summary.

Configuring for libgd version 2.0.35.
Checking for stray libgd header files...none found.

Included Features:          GD_XPM GD_JPEG GD_FONTCONFIG GD_FREETYPE GD_PNG GD_GIF GD_GIFANIM GD_OPENPOLYGON GD_UNCLOSEDPOLY GD_ANIMGIF GD_FTCIRCLE VERSION_33
GD library used from:       /opt/local
Checking if your kit is complete...
Looks good
Writing Makefile for GD
-> OK
Finding PREREQ from Makefile ...
Checking if you have Math::Trig 0 ... Yes (1.2)
Building and testing GD-2.50
/usr/bin/perl GD/Image.pm.PLS GD/Image.pm
Extracting Image.pm (with variable substitutions)
cp GD/Polyline.pm blib/lib/GD/Polyline.pm
cp qd.pl blib/lib/qd.pl
cp GD/Image.pm blib/lib/GD/Image.pm
cp GD.pm blib/lib/GD.pm
AutoSplitting blib/lib/GD.pm (blib/lib/auto/GD)
cp GD/Simple.pm blib/lib/GD/Simple.pm
cp GD/Polygon.pm blib/lib/GD/Polygon.pm
cp GD/Group.pm blib/lib/GD/Group.pm
/usr/bin/perl /System/Library/Perl/5.12/ExtUtils/xsubpp  -typemap /System/Library/Perl/5.12/ExtUtils/typemap -typemap typemap  GD.xs > GD.xsc && mv GD.xsc GD.c
llvm-gcc-4.2 -c  -I/opt/local/include -arch x86_64 -arch i386 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -I/usr/local/include -Wformat=0 -Os   -DVERSION=\"2.50\" -DXS_VERSION=\"2.50\"  "-I/System/Library/Perl/5.12/darwin-thread-multi-2level/CORE"  -DHAVE_JPEG -DHAVE_FT -DHAVE_XPM -DHAVE_GIF -DHAVE_PNG -DHAVE_ANIMGIF -DVERSION_33 -DHAVE_UNCLOSEDPOLY -DHAVE_FONTCONFIG -DHAVE_FTCIRCLE GD.c
Running Mkbootstrap for GD ()
chmod 644 GD.bs
rm -f blib/arch/auto/GD/GD.bundle
LD_RUN_PATH="/opt/local/lib" llvm-gcc-4.2 -mmacosx-version-min=10.7  -arch x86_64 -arch i386 -bundle -undefined dynamic_lookup -L/usr/local/lib -fstack-protector GD.o  -o blib/arch/auto/GD/GD.bundle  \
       -L/opt/local/lib -L/opt/local/lib -L/opt/local/lib -L/opt/local/lib -L/opt/local/lib -lXpm -lX11 -ljpeg -lfontconfig -lfreetype -lpng -lz -liconv -lgd   \

ld: warning: ignoring file /opt/local/lib/libXpm.dylib, file was built for unsupported file format ( 0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (i386): /opt/local/lib/libXpm.dylib
ld: warning: ignoring file /opt/local/lib/libX11.dylib, file was built for unsupported file format ( 0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (i386): /opt/local/lib/libX11.dylib
ld: warning: ignoring file /opt/local/lib/libjpeg.dylib, file was built for unsupported file format ( 0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (i386): /opt/local/lib/libjpeg.dylib
ld: warning: ignoring file /opt/local/lib/libfontconfig.dylib, file was built for unsupported file format ( 0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (i386): /opt/local/lib/libfontconfig.dylib
ld: warning: ignoring file /opt/local/lib/libfreetype.dylib, file was built for unsupported file format ( 0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (i386): /opt/local/lib/libfreetype.dylib
ld: warning: ignoring file /opt/local/lib/libpng.dylib, file was built for unsupported file format ( 0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (i386): /opt/local/lib/libpng.dylib
ld: warning: ignoring file /opt/local/lib/libz.dylib, file was built for unsupported file format ( 0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (i386): /opt/local/lib/libz.dylib
ld: warning: ignoring file /opt/local/lib/libiconv.dylib, file was built for unsupported file format ( 0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (i386): /opt/local/lib/libiconv.dylib
ld: warning: ignoring file /opt/local/lib/libgd.dylib, file was built for unsupported file format ( 0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (i386): /opt/local/lib/libgd.dylib
chmod 755 blib/arch/auto/GD/GD.bundle
cp GD.bs blib/arch/auto/GD/GD.bs
chmod 644 blib/arch/auto/GD/GD.bs
/usr/bin/perl "-Iblib/arch" "-Iblib/lib" bdf_scripts/bdf2gdfont.PLS bdf_scripts/bdf2gdfont.pl
Extracting bdf2gdfont.pl (with variable substitutions)
cp bdf_scripts/bdf2gdfont.pl blib/script/bdf2gdfont.pl
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/bdf2gdfont.pl
Manifying blib/man1/bdf2gdfont.pl.1
Manifying blib/man3/GD::Polyline.3pm
Manifying blib/man3/GD::Image.3pm
Manifying blib/man3/GD::Simple.3pm
Manifying blib/man3/GD.3pm
Manifying blib/man3/GD::Polygon.3pm
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
Testing using png support.
t/GD.t ........ 
Failed 1/12 subtests 
    (less 1 skipped subtest: 10 okay)
t/Polyline.t .. ok

Test Summary Report
-------------------
t/GD.t      (Wstat: 0 Tests: 12 Failed: 1)
  Failed test:  10
Files=2, Tests=13,  0 wallclock secs ( 0.01 usr  0.01 sys +  0.11 cusr  0.01 csys =  0.14 CPU)
Result: FAIL
Failed 1/2 test programs. 1/13 subtests failed.
make: *** [test_dynamic] Error 255
-> FAIL Installing GD failed. See /Users/Gizak/.cpanm/work/1372838444.1200/build.log for details. Retry with --force to force install it.

有任何提示可以帮助我找到问题吗?

3 个答案:

答案 0 :(得分:1)

对不起,这似乎是一个问题, 架构问题,问题似乎在v2.46 bug report

答案 1 :(得分:-1)

您安装了libgd2-xpm-dev吗?

sudo apt-get install libgd2-xpm-dev

GD需要开发版)才能找到C头文件。

答案 2 :(得分:-1)

brew install libgd

sudo cpan

>安装GD