2010-03-22 28 views
3

我試圖將Lingua::Lid安裝到unix系統上(ubuntu,最新版本)。當然,我是根。當我進入包裝使用perl Makefile.PL我得到這個愚蠢的錯誤安裝:如何安裝Perl的Lingua :: Lid?

[[email protected] 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";

變量$ BASE是聲明爲此:

$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"; 

當我運行這個欲以器語言,這裏是我的錯誤:

[[email protected] assign4]# ./perl_parser_1.pl

Can't locate Lingua/LinkParser.pm in @INC (@INC contains: /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 line 3.

我試圖從CPAN insalling此,仍不能正常工作。

+2

當您嘗試從CPAN安裝Lingua :: LinkParser時,您會得到什麼錯誤? – zigdon 2010-03-22 19:37:14

+1

根據CPAN測試人員,沒有通過測試。另外,還有Bug報告。所以,我懷疑user299306已經遇到了與其他問題相同的問題。 – toolic 2010-03-22 19:48:08

回答

4

這裏就是麻煩建設Lingua::LinkParser時開始:

LinkParser.xs:5:27: error: link-includes.h: No such file or directory

我認爲你需要安裝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.