perl - 我如何安装 Perl 的 Lingua::Lid?

标签 perl cpan

我正在尝试安装 Lingua::Lid到 unix 系统(ubuntu,最新版本)。我当然是根。当我使用 perl Makefile.PL 进入安装包时,我得到了这个愚蠢的错误:

[root@csisl27 Lingua-Lid-0.01]# perl Makefile.PL
/opt/ls//lib does not exist at Makefile.PL line 48.

我试过第 48 行的路径,没有任何变化,这是第 48-50 行的样子:

Line 48: die "$BASE/lib does not exist"     unless -d "$BASE/lib";
Line 49: die "$BASE/include does not exist" unless -d "$BASE/include";
Line 50: die "lid.h is missing in $BASE/include" unless -e "$BASE/includ/lid.h";

The variable $BASE is declared as this:

$BASE = "/opt/ls/"         if ($^O eq "linux" or $^O eq "solaris");
$BASE = "/usr/local/"      if ($^O eq "freebsd");
$BASE = $ENV{LID_BASE_DIR} if (defined $ENV{LID_BASE_DIR});

现在我尝试编写的 Perl 程序看起来像这样(只是我的基础):

 #!/usr/bin/perl
 use Lingua::LinkParser;
 use strict;
 print "Hello world!\n";

当我尝试使用 Lingua 运行它时,这是我的错误:

[root@csisl27 assign4]# ./perl_parser_1.pl

无法在@INC 中找到 Lingua/LinkParser.pm(@INC 包含:/usr/lib/perl5/site_perl/5.10.0/x86_64-linux-thread-multi/usr/lib/perl5/site_perl/5.10.0/usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi/usr/lib/perl5/vendor_perl/5.10.0/usr/lib/perl5/5.10.0/x86_64- linux-thread-multi/usr/lib/perl5/5.10.0/usr/lib/perl5/site_perl/usr/lib/perl5/vendor_perl .) at ./perl_parser_1.pl line 3. BEGIN failed--compilation aborted at ./perl_parser_1.pl 第 3 行。

我尝试从 cpan 安装它,但仍然无法正常工作。

最佳答案

这就是构建 Lingua::LinkParser 时问题的开始:

LinkParser.xs:5:27: 错误:link-includes.h: 没有那个文件或目录

我认为你需要安装 Link Grammar第一的。

如果您查看 Makefile.PL发行版自带的,可以看到如下评论:

# 'LIBS' => "-L/dbrian/link-grammar-4.4.3/link-grammar/.libs/ -llink-grammar", 
# 'INC' => "-I/dbrian/link-grammar-4.4.3/link-grammar/"

这意味着(非常间接地)你要么没有 Link Grammar安装在您的系统上或安装在非标准位置。如果未安装,请先安装。如果已安装,请为 INCLIBS 指定正确的位置。

README 所述:

Before you build this package, it is highly recommended that you install the link parser package with make install, which will put the libs, headers, and dictionary files in standard locations. This build no longer prompts for package directories, so if you want to build with non-standard locations, you'll need to edit Makefile.PL to make that happen. In particular, pay attention to the INCLUDE parameter.

关于perl - 我如何安装 Perl 的 Lingua::Lid?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2495074/

相关文章:

perl - 为什么一些核心 Perl 模块也可以在 CPAN 上使用?

perl - 为什么新版本的模块没有出现在 CPAN 中?

perl - 在资源有限的设备上加速 CPAN 的技巧是什么?

perl - 没有规则来制作目标 '/usr/lib/clucene_dll.o' ,需要 'CLuceneWrap.so'

windows - 运行 cgi 程序时 Apache 服务是否有连接/内存限制?

linux - Perl 和 Linux? : Make a log reader script run daily and weekly (automatic)

perl - Bash/shell 错误运行 perl -e 'use [module]' : Can't find string terminator "' "anywhere before EOF at -e line 1

xml - 如何使用 perl/LibXML 在 DOCTYPE 中创建 ENTITY 引用

perl - 如何在 Debian etch 上安装 Image::Magick?

perl - 2 个 perl 安装。 (v5.18.2) 和 (v5.10.1) 我只想要一个