在MacOSX 10.6上安装Perl的GD库。

10

我一直在尝试安装Perl的GD库,但一直没有成功。我已经尝试了互联网上能找到的所有方法,但都无济于事。我正在尝试获取需要GD包的Circos图形。

当我尝试通过CPAN安装它时,它会给我报错:

    Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/GD.t ........ 1/12 Can't load './blib/arch/auto/GD/GD.bundle' for module GD: dlopen(./blib/arch/auto/GD/GD.bundle, 2): Symbol not found: _jpeg_resync_to_restart
  Referenced from: /usr/lib/libgd.2.dylib
  Expected in: flat namespace
 in /usr/lib/libgd.2.dylib at /opt/local/lib/perl5/5.14.1/darwin-multi-2level/DynaLoader.pm line 194.
 at t/GD.t line 14
Compilation failed in require at t/GD.t line 14.
BEGIN failed--compilation aborted at t/GD.t line 14.
t/GD.t ........ Dubious, test returned 2 (wstat 512, 0x200)
Failed 12/12 subtests 
t/Polyline.t .. Can't load '/Users/zehira/.cpan/build/GD-2.46-mp3nuO/blib/arch/auto/GD/GD.bundle' for module GD: dlopen(/Users/zehira/.cpan/build/GD-2.46-mp3nuO/blib/arch/auto/GD/GD.bundle, 2): Symbol not found: _jpeg_resync_to_restart
  Referenced from: /usr/lib/libgd.2.dylib
  Expected in: flat namespace
 in /usr/lib/libgd.2.dylib at /opt/local/lib/perl5/5.14.1/darwin-multi-2level/DynaLoader.pm line 194.
 at /Users/zehira/.cpan/build/GD-2.46-mp3nuO/blib/lib/GD/Polyline.pm line 45
Compilation failed in require at /Users/zehira/.cpan/build/GD-2.46-mp3nuO/blib/lib/GD/Polyline.pm line 45.
BEGIN failed--compilation aborted at /Users/zehira/.cpan/build/GD-2.46-mp3nuO/blib/lib/GD/Polyline.pm line 45.
Compilation failed in require at t/Polyline.t line 10.
BEGIN failed--compilation aborted at t/Polyline.t line 10.
t/Polyline.t .. Dubious, test returned 2 (wstat 512, 0x200)
Failed 1/1 subtests 

Test Summary Report
-------------------
t/GD.t      (Wstat: 512 Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 2
  Parse errors: Bad plan.  You planned 12 tests but ran 1.
t/Polyline.t (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: Bad plan.  You planned 1 tests but ran 0.
Files=2, Tests=1,  0 wallclock secs ( 0.02 usr  0.01 sys +  0.04 cusr  0.01 csys =  0.08 CPU)
Result: FAIL
Failed 2/2 test programs. 1/1 subtests failed.
make: *** [test_dynamic] Error 2
  LDS/GD-2.46.tar.gz
  make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports LDS/GD-2.46.tar.gz
Running make install
  make test had returned bad status, won't install without force
Failed during this command:
 LDS/GD-2.46.tar.gz                           : make_test NO

我尝试使用 --enable-shared --enable-static 选项重新安装jpeg库,但也无济于事。我还安装了MacPorts版本的perl,以为可能是我搞乱了自带的mac perl安装。有人知道这可能是为什么吗?

(是的,我对终端和所有这些都比较陌生,仍在努力适应)

谢谢!

5个回答

11

我使用homebrew先安装了libgd,再安装cpan,这样问题就解决了。非常完美。

brew install libgd

cpan install GD

它不起作用:"ld:找不到-lpng16库" - ABCD

3

1

首先,我也是一个circos用户 :) 在win/linux/mac上为perl和circos所需的模块安装circos真的不简单。

根据我的实践,你最好从一开始就按照以下步骤进行:

  1. 安装perl(选择非常流行的新版本)
  2. 安装circos(参考http://circos.ca/software/installation/
  3. 安装circos所需的模块,但不包括GD:这很容易,只需下载并复制,或通过CPAN安装(参考http://www.rcbowen.com/imho/perl/modules.html
  4. 安装GD:GD是一个特殊的模块(不是平台无关的),您应该在您的操作系统上构建它,然后安装:http://www.sharedproteomics.com/forum/showthread.php?325-Installing-GD-on-Mac-OSX-10.6

看起来你的问题出在第三步!!!如果谷歌无法帮助你解决问题,另一种请求帮助的方式是使用circos的谷歌群组:http://groups.google.com/group/circos-data-visualization 在那里,Martin和其他circos用户将直接为您提供帮助。


0

-2
你需要 libgd。如果你使用的是 ubuntu,你可以通过以下方式获取它
sudo apt-get install libgd-gd2-perl

然后您可以按照circos安装说明中提到的正常流程进行操作。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接