VMWare vSphere API를 테스트하기 위해 오랜만에 리눅스 시스템에서 Perl 관련 작업을 수행하였습니다.
에고고.. 역시 한번에 수월하게 이루어지는 게 없네요..
혹시 소중한 시간을 버리시는 분들이 없도록 과정을 적어봅니다.....
도움이 되시면 좋겠습니다...
패키지 받아서 설치하는 과정은 모두들 잘 아실테니 Skip 하고....
# 준비 : VMware-vSphere-Perl-SDK-4.1.0-254719.i386.tar.gz(Perl SDK 리눅스 버전)
Makefile 생성을 위해서 "Perl MakeFile.PL" 합니다....
역시 몇몇 모듈들이 없다고 나오네.. ^^;;
정확한 에러 메시지 화면은 캡춰를 못했습니다..
일단 Makefile.PL 안에서 우선적으로 요구되는 다음 패키지 항목 중 제 시스템에는 일부 패키지가 없다고 나오네요...
# 요구되는 Perl 모듈 :
'Crypt::SSLeay' => '0.51',
'Data::Dumper' => '2.102',
'Class::MethodMaker' => '2.08',
'XML::LibXML' => '1.58',
'LWP' => '5.8.05',
'UUID' => '0.03',
'SOAP::Lite' => '0.67'},
Not Found Crypt::SSLeay 0.51
Not Found Class::MethodMaker 2.08
Not Found XML::LibXML 1.58
Not Found UUID 0.03
Not Found SOAP::Lite 0.67
물론, 해당 패키지 없이도 설치과정은 이루어집니다.
하지만 설치후에 Perl 실행하면서 또 다시 해당 패키지 설치를 요구합니다..
자... 설치하러 갑시다~
이론이론...
CPAN 에서 계속 timeout 이 발생하면서 패키지 설치가 진행되질 않네요.. T-T
원인은 설정되어 있는 CPAN 서버가 응답이 없어서...
저와 같은 경우나 내부 Proxy 설정과 같은 이유 때문에 CPAN 을 이용하실 수 없을 때 설정파일을 바꾸시면 됩니다.
1. 접속이 가능한 CPAN 서버를 찾는다.
다음 CPAN 사이트 목록 중에서 "Republic of Korea" 중 접속이 가능한 URL 선택
다음 CPAN 사이트 목록 중에서 "Republic of Korea" 중 접속이 가능한 URL 선택
http://www.cpan.org/SITES.html#Asia
저는 "http://mirror.yongbok.net/CPAN/" 로 선택하였습니다.
2. CPAN 설정값에 새로운 URLList 를 설정하고 Commit 한다.
# 설정 확인하기
cpan> o conf
cpan> o conf
CPAN::Config options from /usr/lib/perl5/5.8.8/CPAN/Config.pm:
... 중간생략....
urllist
http://ftp.kaist.ac.kr/pub/CPAN/
# 설정 추가하기
cpan> o conf urllist push http://mirror.yongbok.net/CPAN/
# 설정변경 커밋하기
(설정을 변경한 후 commit 하지 않으면 설정이 영구적으로 변경되지 않습니다)
# 설정 추가하기
cpan> o conf urllist push http://mirror.yongbok.net/CPAN/
# 설정변경 커밋하기
(설정을 변경한 후 commit 하지 않으면 설정이 영구적으로 변경되지 않습니다)
cpan> o conf commit
commit: wrote /usr/lib/perl5/5.8.8/CPAN/Config.pm
자.... 이제 패키지를 하나씩 설치해봅니다...
착착... 잘 설치되는 데~~~
역시 또 장애물이 발생하는 군요...
XML::LibXML 모듈을 설치하는 과정에서 다음과 같은 오류가 발생하는군요...
검색을 하다보니 이런 경우는 빈번하게 발생하는 것 같습니다.
해결책은 "libxml2 를 설치하는 것"입니다... ^^
[참고사이트]
http://www.question-defense.com/2010/01/27/perl-cpan-install-xmllibxmlcommon-error-libxml2-not-found
저도 위의 참고사이트에서 제시해준 대로 "yum install libxml2-devel" 를 통해 문제를 해결했습니다.
|
01 |
running xml2-config... |
02 |
using fallback values for LIBS and INC |
03 |
options: |
04 |
LIBS= '-L/usr/local/lib -L/usr/lib -lxml2 -lm' |
05 |
INC= '-I/usr/local/include -I/usr/include' |
06 |
If this is wrong, Re-run as: |
07 |
$ /usr/bin/perl Makefile.PL LIBS= '-L/path/to/lib' INC= '-I/path/to/include' |
08 |
|
09 |
looking for -lxml2... no |
10 |
looking for -llibxml2... no |
11 |
libxml2 not found |
12 |
Try setting LIBS and INC values on the command line |
13 |
Or get libxml2 from |
14 |
|
15 |
http://xmlsoft.org/ |
16 |
|
17 |
If you install via RPMs, make sure you also install the -devel |
18 |
RPMs, as this is where the headers (.h files) are. |
19 |
|
20 |
Also, you may try to run perl Makefile.PL with the DEBUG=1 parameter |
21 |
to see the exact reason why the detection of libxml2 installation |
22 |
failed or why Makefile.PL was not able to compile a test program. |
23 |
make : *** No targets specified and no makefile found. Stop. |
24 |
/usr/bin/ make -- NOT OK |
25 |
Running make test |
26 |
Can't test without successful make |
27 |
Running make install |
28 |
make had returned bad status, install seems impossible |
29 |
|
30 |
cpan> |
이제 모든 필요한 모듈은 설치를 완료.... 컴파일과 인스톨까지 모두 완료하였습니다.. ^^;;
이제 VMware vSphere SDK for Perl 테스트하러 갑니다~~