Невозможно установить LWP::Simple (модуль Perl) в Solaris 11

Я бегу...

  • Перл 5.12
  • Солярис 11.1

... и я не могу установить LWP::Simple с помощью инструмента "cpan". Когда я пытаюсь это сделать, я получаю...

cpan[1]> install LWP::Simple
Reading '/root/.cpan/Metadata'
  Database was generated on Mon, 20 Jan 2014 11:17:02 GMT
Running install for module 'LWP::Simple'
Running make for G/GA/GAAS/libwww-perl-6.05.tar.gz
Checksum for /root/.cpan/sources/authors/id/G/GA/GAAS/libwww-perl-6.05.tar.gz ok
Scanning cache /root/.cpan/build for sizes
............................................................................DONE

  CPAN.pm: Building G/GA/GAAS/libwww-perl-6.05.tar.gz

Can't connect: IO::Socket::INET: connect: Invalid argument
The can-we-talk-to-ourself test failed.
Checking if your kit is complete...
Looks good
Warning: prerequisite HTML::Entities 0 not found.
Warning: prerequisite HTML::HeadParser 0 not found.
Writing Makefile for LWP
Could not read metadata file. Falling back to other methods to determine prerequisites
---- Unsatisfied dependencies detected during ----
----       GAAS/libwww-perl-6.05.tar.gz       ----
    HTML::Entities [requires]
    HTML::HeadParser [requires]
Running make test
  Delayed until after prerequisites
Running make install
  Delayed until after prerequisites
Running install for module 'HTML::Entities'
Running make for G/GA/GAAS/HTML-Parser-3.71.tar.gz
Checksum for /root/.cpan/sources/authors/id/G/GA/GAAS/HTML-Parser-3.71.tar.gz ok

  CPAN.pm: Building G/GA/GAAS/HTML-Parser-3.71.tar.gz

Checking if your kit is complete...
Looks good
Processing hints file hints/solaris.pl
Writing Makefile for HTML::Parser
cp lib/HTML/PullParser.pm blib/lib/HTML/PullParser.pm
cp Parser.pm blib/lib/HTML/Parser.pm
cp lib/HTML/Entities.pm blib/lib/HTML/Entities.pm
cp lib/HTML/LinkExtor.pm blib/lib/HTML/LinkExtor.pm
cp lib/HTML/TokeParser.pm blib/lib/HTML/TokeParser.pm
cp lib/HTML/HeadParser.pm blib/lib/HTML/HeadParser.pm
cp lib/HTML/Filter.pm blib/lib/HTML/Filter.pm
/usr/perl5/5.12/bin/perl mkhctype >hctype.h
/usr/perl5/5.12/bin/perl mkpfunc >pfunc.h
/usr/perl5/5.12/bin/perl /usr/perl5/5.12/lib/ExtUtils/xsubpp  -typemap /usr/perl5/5.12/lib/ExtUtils/typemap -typemap typemap  Parser.xs > Parser.xsc && mv Parser.xsc Parser.c
cc -c    -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPERL_USE_SAFE_PUTENV -xO4    -DVERSION=\"3.71\"  -DXS_VERSION=\"3.71\" -KPIC "-I/usr/perl5/5.12/lib/sun4-solaris-64int/CORE"  -DMARKED_SECTION Parser.c
sh: line 1: cc: not found
*** Error code 127
make: Fatal error: Command failed for target `Parser.o'
  GAAS/HTML-Parser-3.71.tar.gz
  /usr/bin/make -- NOT OK
'YAML' not installed, will not store persistent state
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Running install for module 'HTML::HeadParser'
Running make for G/GA/GAAS/HTML-Parser-3.71.tar.gz
  Has already been unwrapped into directory /root/.cpan/build/HTML-Parser-3.71-gMF8Mw
Could not make: Unknown error
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Running make for G/GA/GAAS/libwww-perl-6.05.tar.gz
  Has already been unwrapped into directory /root/.cpan/build/libwww-perl-6.05-HwKLBD

  CPAN.pm: Building G/GA/GAAS/libwww-perl-6.05.tar.gz

Warning: Prerequisite 'HTML::Entities => 0' for 'GAAS/libwww-perl-6.05.tar.gz' failed when processing 'GAAS/HTML-Parser-3.71.tar.gz' with 'make => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'HTML::HeadParser => 0' for 'GAAS/libwww-perl-6.05.tar.gz' failed when processing 'GAAS/HTML-Parser-3.71.tar.gz' with 'make => NO'. Continuing, but chances to succeed are limited.
cp lib/LWP/RobotUA.pm blib/lib/LWP/RobotUA.pm
cp lib/LWP/Debug.pm blib/lib/LWP/Debug.pm
cp lib/LWP/Authen/Ntlm.pm blib/lib/LWP/Authen/Ntlm.pm
cp lib/LWP.pm blib/lib/LWP.pm
cp lib/LWP/Protocol.pm blib/lib/LWP/Protocol.pm
cp lib/LWP/ConnCache.pm blib/lib/LWP/ConnCache.pm
cp lwptut.pod blib/lib/lwptut.pod
cp lib/LWP/Protocol/ftp.pm blib/lib/LWP/Protocol/ftp.pm
cp lib/LWP/Authen/Digest.pm blib/lib/LWP/Authen/Digest.pm
cp lib/LWP/Protocol/gopher.pm blib/lib/LWP/Protocol/gopher.pm
cp lib/LWP/Protocol/cpan.pm blib/lib/LWP/Protocol/cpan.pm
cp lwpcook.pod blib/lib/lwpcook.pod
cp lib/LWP/Protocol/file.pm blib/lib/LWP/Protocol/file.pm
cp lib/LWP/Protocol/GHTTP.pm blib/lib/LWP/Protocol/GHTTP.pm
cp lib/LWP/DebugFile.pm blib/lib/LWP/DebugFile.pm
cp lib/LWP/Protocol/data.pm blib/lib/LWP/Protocol/data.pm
cp lib/LWP/Protocol/nogo.pm blib/lib/LWP/Protocol/nogo.pm
cp lib/LWP/Authen/Basic.pm blib/lib/LWP/Authen/Basic.pm
cp lib/LWP/Protocol/nntp.pm blib/lib/LWP/Protocol/nntp.pm
cp lib/LWP/UserAgent.pm blib/lib/LWP/UserAgent.pm
cp lib/LWP/Simple.pm blib/lib/LWP/Simple.pm
cp lib/LWP/Protocol/loopback.pm blib/lib/LWP/Protocol/loopback.pm
cp lib/LWP/Protocol/mailto.pm blib/lib/LWP/Protocol/mailto.pm
cp lib/LWP/Protocol/http.pm blib/lib/LWP/Protocol/http.pm
cp lib/LWP/MemberMixin.pm blib/lib/LWP/MemberMixin.pm
cp bin/lwp-dump blib/script/lwp-dump
/usr/perl5/5.12/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/lwp-dump
cp bin/lwp-mirror blib/script/lwp-mirror
/usr/perl5/5.12/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/lwp-mirror
cp bin/lwp-download blib/script/lwp-download
/usr/perl5/5.12/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/lwp-download
cp bin/lwp-request blib/script/lwp-request
/usr/perl5/5.12/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/lwp-request
Manifying blib/man1/lwp-dump.1
Manifying blib/man1/lwp-mirror.1
Manifying blib/man1/lwp-download.1
Manifying blib/man1/lwp-request.1
Manifying blib/man3/LWP::RobotUA.3
Manifying blib/man3/LWP::Debug.3
Manifying blib/man3/lwpcook.3
Manifying blib/man3/LWP::Authen::Ntlm.3
Manifying blib/man3/LWP.3
Manifying blib/man3/LWP::ConnCache.3
Manifying blib/man3/LWP::Protocol.3
Manifying blib/man3/lwptut.3
Manifying blib/man3/LWP::Simple.3
Manifying blib/man3/LWP::UserAgent.3
Manifying blib/man3/LWP::MemberMixin.3
  GAAS/libwww-perl-6.05.tar.gz
  /usr/bin/make -- OK
Running make test
/usr/perl5/5.12/bin/perl t/TEST 0
base/protocols.t ...... ok
base/ua.t ............. 1/35 # Failed test 13 in base/ua.t at line 56
#  base/ua.t line 56 is: ok($res->header("Content-Style-Type", "text/css"));
# Failed test 14 in base/ua.t at line 57
#  base/ua.t line 57 is: ok($res->header("Content-Script-Type", "text/javascript"));
base/ua.t ............. Failed 2/35 subtests
robot/ua-get.t ........ skipped: Can't talk to ourself (misconfigured system)
robot/ua.t ............ skipped: Can't talk to ourself (misconfigured system)
local/autoload-get.t .. Failed 1/1 subtests
local/autoload.t ...... 1/1 # Failed test 1 in local/autoload.t at line 22
#  local/autoload.t line 22 is: ok($response->is_success);
local/autoload.t ...... Failed 1/1 subtests
local/get.t ........... ok
local/http.t .......... skipped: Can't talk to ourself (misconfigured system)
local/protosub.t ...... ok

Test Summary Report
-------------------
base/ua.t           (Wstat: 0 Tests: 35 Failed: 2)
  Failed tests:  13-14
local/autoload-get.t (Wstat: 0 Tests: 1 Failed: 1)
  Failed test:  1
local/autoload.t    (Wstat: 0 Tests: 1 Failed: 1)
  Failed test:  1
Files=9, Tests=51,  4 wallclock secs ( 0.27 usr  0.09 sys +  3.04 cusr  0.34 csys =  3.74 CPU)
Result: FAIL
Failed 3/9 test programs. 4/51 subtests failed.
*** Error code 255
make: Fatal error: Command failed for target `test'
  GAAS/libwww-perl-6.05.tar.gz
2 dependencies missing (HTML::HeadParser,HTML::Entities); additionally test harness failed
  /usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports GAAS/libwww-perl-6.05.tar.gz
Running make install
  make test had returned bad status, won't install without force
Failed during this command:
 GAAS/HTML-Parser-3.71.tar.gz                 : make NO
 GAAS/libwww-perl-6.05.tar.gz                 : make_test NO 2 dependencies missing (HTML::HeadParser,HTML::Entities); additionally test harness failed

cpan[2]>

Что дает?

Я понимаю, что этому могут способствовать некоторые неудачи.

Заранее спасибо, Гэри


person Gary N.    schedule 20.01.2014    source источник


Ответы (3)


Посмотрите на свое первое сообщение об ошибке:

cc -c    -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPERL_USE_SAFE_PUTENV -xO4    -DVERSION=\"3.71\"  -DXS_VERSION=\"3.71\" -KPIC "-I/usr/perl5/5.12/lib/sun4-solaris-64int/CORE"  -DMARKED_SECTION Parser.c
sh: line 1: cc: not found
*** Error code 127

Некоторые части HTML::Parser, который является обязательным условием для LWP::Simple, написаны на C и требуют компилятора c, который у вас не установлен.

person Guntram Blohm    schedule 20.01.2014
comment
Ах... ты прав. У меня установлен gcc. Как мне указать Perl (или, возможно, инструмент cpan) использовать это вместо cc? - person Gary N.; 21.01.2014
comment
Это не так просто, потому что cpan использует настройки компилятора, используемые для компиляции самого Perl. Если вы просто замените модули другим компилятором, не перекомпилируя сам Perl, вы можете столкнуться со странными проблемами с 32 битами против 64 и так далее. Лучше всего загрузить Solaris Studio с сайта oracle.com/technetwork/server-storage. /solarisstudio/downloads/ и установите cc. - person Guntram Blohm; 21.01.2014
comment
perlgcc оболочка пытается настроить флаги компилятора для работы с gcc вместо Studio cc. - person alanc; 09.02.2014

Наткнулся на этот пост, когда у меня была похожая проблема с openindiana и компиляцией lwp. Оболочка в приведенном ниже блоге фактически решила все мои проблемы, которые я только что добавил в /usr/bin/cc, и мне очень повезло. Надеюсь, это поможет любому, у кого есть проблема.

http://blog.zorinaq.com/?e=30

In case the blog ever goes away here is the python code wrapper

   #!/usr/bin/python
    # cc(1) wrapper to build CPAN Perl modules with GCC on OpenSolaris. -mrb
    import os, sys
    path = '/usr/bin/gcc'
    args = []
    i = 0
    while i < len(sys.argv):
       if i == 0:
               args.append(path)
       elif sys.argv[i] == '-KPIC':
               args.append('-fPIC')
       elif sys.argv[i] == '-xO3':
               args.append('-O3')
       elif sys.argv[i] == '-xspace':
               pass
       elif sys.argv[i] == '-xildoff':
               pass
       else:
               args.append(sys.argv[i])
       i += 1
os.execv(path, args)

person Mark W    schedule 12.03.2014

Если вы хотите собрать модули CPAN для установки в поддерживаемом дереве perl, вам необходимо использовать Solaris Studio 12.1 (для Solaris 11 и 11.1). Вы можете скачать это с URL-адреса, который упомянул Гунтрам.

person James McPherson    schedule 04.02.2014