Perl CPAN:生成Math::GSL失败,出现编译错误

Perl CPAN:生成Math::GSL失败,出现编译错误,perl,cpan,gsl,Perl,Cpan,Gsl,我正在尝试在OSX上使用cpan安装Math::GSL。我通过自制编译并安装了GSL本身,所以在这方面一切都很好。出于某种原因,编译器在尝试构建GSL perl模块时发出大量警告,最后在出现错误后死亡。我认为这是因为这个库应该用gcc构建,我已经在Gentoo上安装了它,但我不确定如何将cpan指向gcc 下面是错误的样子: $ cpanm --verbose Math::GSL ... (I skipped a few hundred lines to get to the relevant

我正在尝试在OSX上使用cpan安装Math::GSL。我通过自制编译并安装了GSL本身,所以在这方面一切都很好。出于某种原因,编译器在尝试构建GSL perl模块时发出大量警告,最后在出现错误后死亡。我认为这是因为这个库应该用gcc构建,我已经在Gentoo上安装了它,但我不确定如何将cpan指向gcc

下面是错误的样子:

$ cpanm --verbose Math::GSL
 ... (I skipped a few hundred lines to get to the relevant info)
Entering Math-GSL-0.27
Checking configure dependencies from META.json
Checking if you have Module::Build 0.38 ... Yes (0.4003)
Checking if you have ExtUtils::PkgConfig 1.03 ... Yes (1.14)
Checking if you have Module::Build 0.36 ... Yes (0.4003)
Running Build.PL
Configuring Math-GSL-0.27 ... Checking for GSL..
Found GSL 1.16 (via gsl-config) installed in /opt/brew/Cellar/gsl/1.16, CFLAGS=-I/opt/brew/Cellar/gsl/1.16/include, -L/opt/brew/Cellar/gsl/1.16/lib -lgsl -lgslcblas
Asking ExtUtils::PkgConfig with ENV{PKG_CONFIG_PATH}=/usr/pkgconfig:/usr/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/p    kgconfig:/usr/libdata/pkgconfig:/usr/local/libdata/pkgconfig:/opt/pkgconfig:

Checking if cc supports "-Wall"...yes
Checking if cc supports "-Wno-unused-function"...yes
Checking if cc supports "-Wno-unused-value"...yes
Checking if cc supports "-Wno-unused-function"...yes
Checking if cc supports "-Wno-unused-variable"...yes
Checking if cc supports "-g"...yes
Created MYMETA.yml and MYMETA.json
Creating new 'Build' script for 'Math-GSL' version '0.27'

Have a great day!
OK
Checking dependencies from MYMETA.json ...
Checking if you have ExtUtils::PkgConfig 1.03 ... Yes (1.14)
Checking if you have version 0.77 ... Yes (0.9902)
Checking if you have Test::Class 0.12 ... Yes (0.39)
Checking if you have Test::Most 0 ... Yes (0.31)
Checking if you have Scalar::Util 0 ... Yes (1.27)
Checking if you have Test::Exception 0.21 ... Yes (0.32)
Building and testing Math-GSL-0.27 ... Building Math-GSL
Process XS files version 1.15
xs/BLAS_wrap.1.15.c:3807:11: warning: variable 'arg2' is uninitialized when used here [-Wuninitialized]
      if (arg2) free(arg2);
          ^~~~
xs/BLAS_wrap.1.15.c:3727:17: note: initialize the variable 'arg2' to silence this warning
    double *arg2 ;
                ^
                 = NULL

 ... We get another 20 or so beautiful clang warnings after this one, and then this:

xs/FFT_wrap.1.15.c:8304:61: error: use of undeclared identifier 'forward'
    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(forward)));
                                                        ^
xs/FFT_wrap.1.15.c:937:80: note: expanded from macro 'SWIG_PERL_CALL_ARGS_1'
    #define SWIG_PERL_CALL_ARGS_1(arg1)                     (SWIG_PERL_OBJECT_CALL arg1)
                                                                           ^
/opt/perlbrew/perls/perl-5.18.1/lib/5.18.1/darwin-2level/CORE/sv.h:1917:22: note: expanded from macro 'sv_setsv'
        sv_setsv_flags(dsv, ssv, SV_GMAGIC|SV_DO_COW_SVSETSV)
                        ^
/opt/perlbrew/perls/perl-5.18.1/lib/5.18.1/darwin-2level/CORE/embed.h:644:59: note: expanded from macro 'sv_setsv_flags'
#define sv_setsv_flags(a,b,c)   Perl_sv_setsv_flags(aTHX_ a,b,c)
                                                        ^

... Another error after this, and then it dies.
有人知道如何解决这个问题吗?我正在运行PerlV5.18.1,它是用perlbrew for OS X 10.9构建的。我对整件事有一个要点