在Mac OS X 10.7上安装CitrusPerl中的Event :: Lib

时间:2013-02-08 18:33:14

标签: perl cpan perl-module libevent

我正在开发一个需要Event :: Lib的Perl项目。我在MacOS 10.7上,正在运行Citrus Perl而不是系统Perl。我从源代码安装了libevent,编译得很好。但是,当我去安装Event :: Lib时,我遇到了一些错误:

cp Lib/Event/Lib.pm blib/lib/Event/Lib.pm
Skip blib/lib/Event/Lib.pm (unchanged)
/Users/username/code/CitrusPerl/bin/perl /Users/username/code/CitrusPerl/lib/ExtUtils/xsubpp  -typemap /Users/username/code/CitrusPerl/lib/ExtUtils/typemap -typemap typemap  Lib.xs > Lib.xsc && mv Lib.xsc Lib.c
gcc -c  -I/usr/local/include -fno-common -DPERL_DARWIN -no-cpp-precomp -arch i386 -B/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/gcc -B/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/lib/gcc -isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks -mmacosx-version-min=10.6 -DUSE_SITECUSTOMIZE -Duselargefiles -DPERL_RELOCATABLE_INCPUSH -fno-merge-constants -fno-strict-aliasing -pipe -fstack-protector  -O3   -DVERSION=\"1.03\" -DXS_VERSION=\"1.03\"  "-I/Users/username/code/CitrusPerl/lib/CORE"  -DHAVE_CONFIG_H  Lib.c
Lib.xs: In function ‘boot_Event__Lib’:
Lib.xs:275: error: ‘LOG_LEVEL’ undeclared (first use in this function)
Lib.xs:275: error: (Each undeclared identifier is reported only once
Lib.xs:275: error: for each function it appears in.)
make: *** [Lib.o] Error 1

有没有人对下一步尝试有什么想法?

编辑:在尝试了一些'o conf'选项之后:

cpan[1]> o conf makepl_arg "INC=-I/usr/local/include LIBS=-L/usr/local/lib -levent"                                                             
    makepl_arg         [INC=-I/usr/local/include LIBS=-L/usr/local/lib -levent]
Your /Users/username/code/CitrusPerl/vendor/lib/CPAN/Config.pm file
is not writable. I will attempt to write your configuration to
/Users/username/.cpan/CPAN/MyConfig.pm instead.

Old configuration file /Users/username/.cpan/CPAN/MyConfig.pm
    moved to /Users/username/.cpan/CPAN/MyConfig.pm.bak
commit: wrote '/Users/username/.cpan/CPAN/MyConfig.pm'

cpan[2]> install Event::Lib                                                                                                                     
Reading '/Users/username/code/CitrusPerl/cpan/Metadata'
  Database was generated on Thu, 07 Feb 2013 21:53:02 GMT
Fetching with LWP:
http://www.perl.org/CPAN/authors/01mailrc.txt.gz
Reading '/Users/username/code/CitrusPerl/cpan/sources/authors/01mailrc.txt.gz'
............................................................................DONE
Fetching with LWP:
http://www.perl.org/CPAN/modules/02packages.details.txt.gz
Reading '/Users/username/code/CitrusPerl/cpan/sources/modules/02packages.details.txt.gz'
  Database was generated on Thu, 14 Feb 2013 15:41:03 GMT
............................................................................DONE
Fetching with LWP:
http://www.perl.org/CPAN/modules/03modlist.data.gz
Reading '/Users/username/code/CitrusPerl/cpan/sources/modules/03modlist.data.gz'
............................................................................DONE
Writing /Users/username/code/CitrusPerl/cpan/Metadata
Running install for module 'Event::Lib'
Running make for V/VP/VPARSEVAL/Event-Lib-1.03.tar.gz
Fetching with LWP:
http://www.perl.org/CPAN/authors/id/V/VP/VPARSEVAL/Event-Lib-1.03.tar.gz
Checksum for /Users/username/code/CitrusPerl/cpan/sources/authors/id/V/VP/VPARSEVAL/Event-Lib-1.03.tar.gz ok
Scanning cache /Users/username/code/CitrusPerl/cpan/build for sizes
............................................................................DONE

  CPAN.pm: Building V/VP/VPARSEVAL/Event-Lib-1.03.tar.gz

Checking existance of libevent...ld: warning: directory not found for option '-L/sw/lib'
ld: warning: directory not found for option '-L/opt/local/lib'
yes
Checking capabilities...
  event_set_log_callback...no
  event_priority_init...no
Additional defines:  

Checking if your kit is complete...
Looks good
Writing Makefile for Event::Lib
Writing MYMETA.yml and MYMETA.json
cp Lib/Event/Lib.pm blib/lib/Event/Lib.pm
Skip blib/lib/Event/Lib.pm (unchanged)
/Users/username/code/CitrusPerl/bin/perl /Users/username/code/CitrusPerl/lib/ExtUtils/xsubpp  -typemap /Users/username/code/CitrusPerl/lib/ExtUtils/typemap -typemap typemap  Lib.xs > Lib.xsc && mv Lib.xsc Lib.c
gcc -c  -I/usr/local/include -fno-common -DPERL_DARWIN -no-cpp-precomp -arch i386 -B/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/gcc -B/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/lib/gcc -isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks -mmacosx-version-min=10.6 -DUSE_SITECUSTOMIZE -Duselargefiles -DPERL_RELOCATABLE_INCPUSH -fno-merge-constants -fno-strict-aliasing -pipe -fstack-protector  -O3   -DVERSION=\"1.03\" -DXS_VERSION=\"1.03\"  "-I/Users/username/code/CitrusPerl/lib/CORE"  -DHAVE_CONFIG_H  Lib.c
Lib.xs: In function ‘boot_Event__Lib’:
Lib.xs:275: error: ‘LOG_LEVEL’ undeclared (first use in this function)
Lib.xs:275: error: (Each undeclared identifier is reported only once
Lib.xs:275: error: for each function it appears in.)
make: *** [Lib.o] Error 1
  VPARSEVAL/Event-Lib-1.03.tar.gz
  /usr/bin/make -- NOT OK
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Failed during this command:
 VPARSEVAL/Event-Lib-1.03.tar.gz              : make NO

1 个答案:

答案 0 :(得分:0)

我能够在大约10分钟的时间内完成这项工作。

然后:

  • brew install libevent
  • perlbrew install perl-5.16.0
  • perlbrew switch perl-5.16.0
  • perl -MCPAN -e'install Event :: Lib'

我认为以上是提供适当开发环境的最佳实用工具,您可以切换; IE你可以切换飞的Perl版本。此外,它们不会影响您的原生系统。无论如何,如果您决定不使用前面提到的,您的特定错误看起来是关于丢失的头文件。我断言libevent头确实在/ usr / local / include。

祝你好运。