Macos 在OSX上安装Perl Math::GMP

Macos 在OSX上安装Perl Math::GMP,macos,perl,gmp,osx-elcapitan,Macos,Perl,Gmp,Osx Elcapitan,我正在尝试在OS X El Capitan上安装Perl包Math::GMP 我有一台计算机可以正常工作,但另一台计算机出现以下问题: Perl模块Math::GMP需要用于GMP的C库,因此我已经完成了brew安装GMP 本文件包括以下文件: /usr/local/include/gmp.h 但软件包安装仍然失败,声称我没有安装gmp: $ sudo perl -MCPAN -e shell cpan[1]> install Math::GMP Reading '/Users/chao

我正在尝试在OS X El Capitan上安装Perl包Math::GMP

我有一台计算机可以正常工作,但另一台计算机出现以下问题:

Perl模块Math::GMP需要用于GMP的C库,因此我已经完成了
brew安装GMP

本文件包括以下文件:

/usr/local/include/gmp.h
但软件包安装仍然失败,声称我没有安装gmp:

$ sudo perl -MCPAN -e shell
cpan[1]> install Math::GMP
Reading '/Users/chaosadmin/.cpan/Metadata'
Database was generated on Sat, 14 Nov 2015 09:17:02 GMT
Running install for module 'Math::GMP'
Checksum for /Users/me/.cpan/sources/authors/id/S/SH/SHLOMIF/Math-GMP-2.11.tar.gz ok
Scanning cache /Users/me/.cpan/build for sizes
............................................................................DONE
'YAML' not installed, will not store persistent state
Configuring S/SH/SHLOMIF/Math-GMP-2.11.tar.gz with Makefile.PL
Can't link/include C library 'gmp.h', 'gmp', aborting.
No 'Makefile' created  SHLOMIF/Math-GMP-2.11.tar.gz
  /usr/bin/perl Makefile.PL -- NOT OK
Failed during this command:
 SHLOMIF/Math-GMP-2.11.tar.gz                 : writemakefile NO -- No 'Makefile' created
显而易见的是:
无法链接/包含C库'gmp.h','gmp',正在中止。

但是我肯定在
/usr/local/include/gmp.h
我不确定为什么它不能安装在这台OS X El Capitan机器上(它在我的另一台机器上运行良好)

在我使用的CPAN外壳中:

look Math::GMP
并将Makefile.PL更新为调试:

check_lib_or_exit(
    header => 'gmp.h',
    lib => 'gmp',
    debug => 'true'
);
在运行
perl Makefile.PL

# /usr/bin/cc -arch i386 -arch x86_64 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -arch i386 -arch x86_64 -fstack-protector assertlibD4RJzZEa.c -o assertlibwGFzIVsM
assertlibD4RJzZEa.c:1:10: fatal error: 'gmp.h' file not found
在Centos上包括:

只需安装这个:yum安装gmp*-y

祝你好运:)

在Centos:

只需安装这个:yum安装gmp*-y


祝你好运:)

很可能,/usr/local不在编译器查找内容的默认位置列表中。在cpan提示符处使用
look
函数获取包含未打包模块的外壳,查看文档中是否有关于将开关切换到
Makefile.PL
以告诉它在哪里可以找到gmp的内容。好的-我能够为Makefile.PL中失败的行添加“debug”“true”-但仍然没有为我修复它。安装或自述中没有任何关于如何处理此问题的内容。很可能,/usr/local不在编译器查找内容的默认位置列表中。在cpan提示符处使用
look
函数获取包含未打包模块的外壳,并查看文档中是否有关于将开关切换到
Makefile.PL
以告诉它在哪里可以找到gmp的内容。好的-我能够为Makefile.PL中失败的行添加“debug”“true”-但仍然没有为我修复它。安装或自述中没有任何关于如何处理此问题的内容。这似乎与原始版本无关问题是关于mac OS的。这似乎无关紧要,因为最初的问题是关于mac OS的。