我正在尝试安装 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安装在您的系统上或安装在非标准位置。如果未安装,请先安装。如果已安装,请为 INC
和 LIBS
指定正确的位置。
如 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 theINCLUDE
parameter.
关于perl - 我如何安装 Perl 的 Lingua::Lid?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2495074/