cpanでupdateすると以下のメッセージが出て、XML::LibXMLモジュールのアップデートに失敗する。"looking for -lxml2... no"や"looking for -llibxml2... libxml2, zlib, and/or the Math library (-lm) have not been found."といわれてインストールに失敗する。
CPAN.pm: Going to build S/SH/SHLOMIF/XML-LibXML-1.81.tar.gz enable native perl UTF8 running xml2-config... using fallback values for LIBS and INC options: LIBS='-L/usr/local/lib -L/usr/lib -lxml2 -lm' INC='-I/usr/local/include -I/usr/include' If this is wrong, Re-run as: $ /usr/bin/perl Makefile.PL LIBS='-L/path/to/lib' INC='-I/path/to/include' looking for -lxml2... no looking for -llibxml2... libxml2, zlib, and/or the Math library (-lm) have not been found. Try setting LIBS and INC values on the command line Or get libxml2 from http://xmlsoft.org/ If you install via RPMs, make sure you also install the -devel RPMs, as this is where the headers (.h files) are. Also, you may try to run perl Makefile.PL with the DEBUG=1 parameter to see the exact reason why the detection of libxml2 installation failed or why Makefile.PL was not able to compile a test program. no No 'Makefile' created SHLOMIF/XML-LibXML-1.81.tar.gz /usr/bin/perl Makefile.PL INSTALLDIRS=site -- NOT OK Running make test Make had some problems, won't test Running make install Make had some problems, won't install
まずは以下のように導入済みのパッケージからlibxml2.aを検索してみる。soはあるが、libxml2.aは存在しないことがわかる。
# dpkg --search libxml2 libxml2: /usr/share/doc/libxml2/changelog.gz libxml2: /usr/share/doc/libxml2/README libxml2-utils: /usr/share/doc/libxml2-utils/NEWS.gz libxml2: /usr/share/doc/libxml2/changelog.Debian.gz libxml2-utils: /usr/share/doc/libxml2-utils/README libxml2: /usr/lib/libxml2.so.2 libxml2-utils: /usr/share/doc/libxml2-utils/copyright libxml2-utils: /usr/share/doc/libxml2-utils/AUTHORS libxml2: /usr/share/doc/libxml2/NEWS.gz libxml2: /usr/share/doc/libxml2 libxml2: /usr/lib/libxml2.so.2.7.8 libxml2-utils: /usr/share/doc/libxml2-utils/TODO.gz libxml2: /usr/share/doc/libxml2/AUTHORS libxml2-utils: /usr/share/doc/libxml2-utils/changelog.Debian.gz libxml2: /usr/share/doc/libxml2/TODO.gz libxml2-utils: /usr/share/doc/libxml2-utils libxml2: /usr/share/doc/libxml2/copyright libxml2: /usr/share/doc/libxml2/README.Debian # dpkg --search libxml2.a dpkg: *libxml2.a* not found.
未導入のパッケージにlibxml2.aが含まれる場合には、webの検索インターフェイスをつかう。複数のパッケージ(libxml2-dev, ia32-libs-dev)がlibxml2.aというファイルを提供することがわかる。2つの違いはアーキテクチャの違いなので、i386を使っている場合はlibxml2-devを導入する。
# aptitude install libxml2-dev The following NEW packages will be installed: libxml2-dev 0 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 751 kB of archives. After unpacking 2,175 kB will be used. Get:1 http://ftp.jp.debian.org/debian/ squeeze/main libxml2-dev i386 2.7.8.dfsg-2+squeeze1 [751 kB] Fetched 751 kB in 0s (1,232 kB/s) Selecting previously deselected package libxml2-dev. (Reading database ... 68787 files and directories currently installed.) Unpacking libxml2-dev (from .../libxml2-dev_2.7.8.dfsg-2+squeeze1_i386.deb) ... Processing triggers for man-db ... Setting up libxml2-dev (2.7.8.dfsg-2+squeeze1) ...
この後、再度cpanでupdateを行うと以下のように成功していることが確認できる。
CPAN.pm: Going to build S/SH/SHLOMIF/XML-LibXML-1.81.tar.gz enable native perl UTF8 running xml2-config...Note: libxml2 2.7.8 was not tested with this XML::LibXML version. untested looking for -lxml2... yes Checking if your kit is complete... Looks good Writing Makefile for XML::LibXML Writing MYMETA.yml and MYMETA.json cp lib/XML/LibXML/ErrNo.pod blib/lib/XML/LibXML/ErrNo.pod cp lib/XML/LibXML/DOM.pod blib/lib/XML/LibXML/DOM.pod cp lib/XML/LibXML/SAX/Builder.pm blib/lib/XML/LibXML/SAX/Builder.pm cp lib/XML/LibXML/DocumentFragment.pod blib/lib/XML/LibXML/DocumentFragment.pod cp lib/XML/LibXML/XPathContext.pod blib/lib/XML/LibXML/XPathContext.pod cp lib/XML/LibXML/Reader.pm blib/lib/XML/LibXML/Reader.pm cp lib/XML/LibXML/InputCallback.pod blib/lib/XML/LibXML/InputCallback.pod cp lib/XML/LibXML/Namespace.pod blib/lib/XML/LibXML/Namespace.pod cp lib/XML/LibXML/SAX/Builder.pod blib/lib/XML/LibXML/SAX/Builder.pod cp lib/XML/LibXML/Document.pod blib/lib/XML/LibXML/Document.pod cp lib/XML/LibXML/Attr.pod blib/lib/XML/LibXML/Attr.pod cp lib/XML/LibXML/SAX/Generator.pm blib/lib/XML/LibXML/SAX/Generator.pm cp lib/XML/LibXML/CDATASection.pod blib/lib/XML/LibXML/CDATASection.pod cp LibXML.pod blib/lib/XML/LibXML.pod cp lib/XML/LibXML/Reader.pod blib/lib/XML/LibXML/Reader.pod cp lib/XML/LibXML/Common.pod blib/lib/XML/LibXML/Common.pod cp lib/XML/LibXML/RelaxNG.pod blib/lib/XML/LibXML/RelaxNG.pod cp lib/XML/LibXML/ErrNo.pm blib/lib/XML/LibXML/ErrNo.pm cp lib/XML/LibXML/PI.pod blib/lib/XML/LibXML/PI.pod cp lib/XML/LibXML/Error.pod blib/lib/XML/LibXML/Error.pod cp lib/XML/LibXML/Comment.pod blib/lib/XML/LibXML/Comment.pod cp lib/XML/LibXML/Dtd.pod blib/lib/XML/LibXML/Dtd.pod cp lib/XML/LibXML/Number.pm blib/lib/XML/LibXML/Number.pm cp lib/XML/LibXML/SAX.pm blib/lib/XML/LibXML/SAX.pm cp lib/XML/LibXML/Literal.pm blib/lib/XML/LibXML/Literal.pm cp lib/XML/LibXML/Node.pod blib/lib/XML/LibXML/Node.pod cp LibXML.pm blib/lib/XML/LibXML.pm cp lib/XML/LibXML/Parser.pod blib/lib/XML/LibXML/Parser.pod cp lib/XML/LibXML/XPathExpression.pod blib/lib/XML/LibXML/XPathExpression.pod cp lib/XML/LibXML/SAX/Parser.pm blib/lib/XML/LibXML/SAX/Parser.pm cp lib/XML/LibXML/Element.pod blib/lib/XML/LibXML/Element.pod cp lib/XML/LibXML/SAX.pod blib/lib/XML/LibXML/SAX.pod cp lib/XML/LibXML/Common.pm blib/lib/XML/LibXML/Common.pm cp lib/XML/LibXML/XPathContext.pm blib/lib/XML/LibXML/XPathContext.pm cp lib/XML/LibXML/Error.pm blib/lib/XML/LibXML/Error.pm cp lib/XML/LibXML/Text.pod blib/lib/XML/LibXML/Text.pod cp lib/XML/LibXML/Boolean.pm blib/lib/XML/LibXML/Boolean.pm cp lib/XML/LibXML/RegExp.pod blib/lib/XML/LibXML/RegExp.pod cp lib/XML/LibXML/Schema.pod blib/lib/XML/LibXML/Schema.pod cp lib/XML/LibXML/Pattern.pod blib/lib/XML/LibXML/Pattern.pod cp lib/XML/LibXML/NodeList.pm blib/lib/XML/LibXML/NodeList.pm cc -c -I/usr/include/libxml2 -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BIT S=64 -O2 -g -DVERSION=\"1.81\" -DXS_VERSION=\"1.81\" -fPIC "-I/usr/lib/perl/5.10/CORE" -DHAVE_UTF8 -DHAVE_BLANK Av_CharPtrPtr.c /usr/bin/perl /usr/local/share/perl/5.10.1/ExtUtils/xsubpp -typemap /usr/share/perl/5.10/ExtUtils/typemap -typemap typemap LibXML.xs > LibXML.xsc && mv LibXML.xsc LibXM L.c cc -c -I/usr/include/libxml2 -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BIT S=64 -O2 -g -DVERSION=\"1.81\" -DXS_VERSION=\"1.81\" -fPIC "-I/usr/lib/perl/5.10/CORE" -DHAVE_UTF8 -DHAVE_BLANK LibXML.c cc -c -I/usr/include/libxml2 -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BIT S=64 -O2 -g -DVERSION=\"1.81\" -DXS_VERSION=\"1.81\" -fPIC "-I/usr/lib/perl/5.10/CORE" -DHAVE_UTF8 -DHAVE_BLANK dom.c cc -c -I/usr/include/libxml2 -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BIT S=64 -O2 -g -DVERSION=\"1.81\" -DXS_VERSION=\"1.81\" -fPIC "-I/usr/lib/perl/5.10/CORE" -DHAVE_UTF8 -DHAVE_BLANK perl-libxml-mm.c cc -c -I/usr/include/libxml2 -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BIT S=64 -O2 -g -DVERSION=\"1.81\" -DXS_VERSION=\"1.81\" -fPIC "-I/usr/lib/perl/5.10/CORE" -DHAVE_UTF8 -DHAVE_BLANK perl-libxml-sax.c cc -c -I/usr/include/libxml2 -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BIT S=64 -O2 -g -DVERSION=\"1.81\" -DXS_VERSION=\"1.81\" -fPIC "-I/usr/lib/perl/5.10/CORE" -DHAVE_UTF8 -DHAVE_BLANK xpath.c Running Mkbootstrap for XML::LibXML () chmod 644 LibXML.bs rm -f blib/arch/auto/XML/LibXML/LibXML.so LD_RUN_PATH="/usr/lib" cc -shared -O2 -g -L/usr/local/lib -fstack-protector Av_CharPtrPtr.o LibXML.o dom.o perl-libxml-mm.o perl-libxml-sax.o xpath.o -o blib/arch/auto/ XML/LibXML/LibXML.so \ -lxml2 -lz \ chmod 755 blib/arch/auto/XML/LibXML/LibXML.so cp LibXML.bs blib/arch/auto/XML/LibXML/LibXML.bs chmod 644 blib/arch/auto/XML/LibXML/LibXML.bs Manifying blib/man3/XML::LibXML::DOM.3pm Manifying blib/man3/XML::LibXML::ErrNo.3pm Manifying blib/man3/XML::LibXML::DocumentFragment.3pm Manifying blib/man3/XML::LibXML::XPathContext.3pm Manifying blib/man3/XML::LibXML::InputCallback.3pm Manifying blib/man3/XML::LibXML::SAX::Builder.3pm Manifying blib/man3/XML::LibXML::Namespace.3pm Manifying blib/man3/XML::LibXML::Document.3pm Manifying blib/man3/XML::LibXML::Attr.3pm Manifying blib/man3/XML::LibXML::SAX::Generator.3pm Manifying blib/man3/XML::LibXML::CDATASection.3pm Manifying blib/man3/XML::LibXML.3pm Manifying blib/man3/XML::LibXML::Reader.3pm Manifying blib/man3/XML::LibXML::Common.3pm Manifying blib/man3/XML::LibXML::RelaxNG.3pm Manifying blib/man3/XML::LibXML::PI.3pm Manifying blib/man3/XML::LibXML::Error.3pm Manifying blib/man3/XML::LibXML::Dtd.3pm Manifying blib/man3/XML::LibXML::Comment.3pm Manifying blib/man3/XML::LibXML::Number.3pm Manifying blib/man3/XML::LibXML::Literal.3pm Manifying blib/man3/XML::LibXML::Node.3pm Manifying blib/man3/XML::LibXML::Parser.3pm Manifying blib/man3/XML::LibXML::XPathExpression.3pm Manifying blib/man3/XML::LibXML::Element.3pm Manifying blib/man3/XML::LibXML::SAX.3pm Manifying blib/man3/XML::LibXML::Text.3pm Manifying blib/man3/XML::LibXML::Boolean.3pm Manifying blib/man3/XML::LibXML::Schema.3pm Manifying blib/man3/XML::LibXML::RegExp.3pm Manifying blib/man3/XML::LibXML::NodeList.3pm Manifying blib/man3/XML::LibXML::Pattern.3pm SHLOMIF/XML-LibXML-1.81.tar.gz /usr/bin/make -- OK Running make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t # # # Compiled against libxml2 version: 20708 # Running libxml2 version: 20708 # t/01basic.t ......................... ok t/02parse.t ......................... ok t/03doc.t ........................... ok t/04node.t .......................... ok t/05text.t .......................... ok t/06elements.t ...................... ok t/07dtd.t ........................... ok t/08findnodes.t ..................... ok t/09xpath.t ......................... ok t/10ns.t ............................ ok t/11memory.t ........................ skipped: developers only (set MEMORY_TEST=1 to run these tests) t/12html.t .......................... ok t/13dtd.t ........................... ok t/14sax.t ........................... ok t/15nodelist.t ...................... ok t/16docnodes.t ...................... ok t/17callbacks.t ..................... ok t/18docfree.t ....................... ok t/19die_on_invalid_utf8_rt_58848.t .. ok t/19encoding.t ...................... ok t/20extras.t ........................ ok t/21catalog.t ....................... ok t/23rawfunctions.t .................. ok t/24c14n.t .......................... ok t/25relaxng.t ....................... ok t/26schema.t ........................ ok t/27new_callbacks_simple.t .......... ok t/28new_callbacks_multiple.t ........ ok t/29id.t ............................ ok t/30xpathcontext.t .................. ok t/31xpc_functions.t ................. ok t/32xpc_variables.t ................. ok t/40reader.t ........................ ok t/41xinclude.t ...................... ok t/42common.t ........................ ok t/43options.t ....................... ok t/44extent.t ........................ ok t/45regex.t ......................... ok t/46err_column.t .................... ok t/47load_xml_callbacks.t ............ ok t/48_rt55000.t ...................... ok t/48importing_nodes_IDs_rt_69520.t .. ok t/49_load_html.t .................... ok t/49global_extent.t ................. ok t/60error_prev_chain.t .............. ok t/60struct_error.t .................. ok t/61error.t ......................... ok t/80registryleak.t .................. ok t/90threads.t ....................... skipped: optional (set THREAD_TEST=1 to run these tests) t/pod.t ............................. ok All tests successful. Files=50, Tests=2351, 22 wallclock secs ( 1.91 usr 0.35 sys + 13.88 cusr 1.41 csys = 17.55 CPU) Result: PASS SHLOMIF/XML-LibXML-1.81.tar.gz /usr/bin/make test -- OK Running make install Prepending /root/.cpan/build/XML-LibXML-1.81-GBnTLv/blib/arch /root/.cpan/build/XML-LibXML-1.81-GBnTLv/blib/lib to PERL5LIB for 'install' Files found in blib/arch: installing files in blib/lib into architecture dependent library tree Installing /usr/local/lib/perl/5.10.1/auto/XML/LibXML/LibXML.so Installing /usr/local/lib/perl/5.10.1/auto/XML/LibXML/LibXML.bs Installing /usr/local/lib/perl/5.10.1/XML/LibXML.pod Installing /usr/local/lib/perl/5.10.1/XML/LibXML.pm Installing /usr/local/lib/perl/5.10.1/XML/LibXML/XPathContext.pm Installing /usr/local/lib/perl/5.10.1/XML/LibXML/RelaxNG.pod Installing /usr/local/lib/perl/5.10.1/XML/LibXML/NodeList.pm Installing /usr/local/lib/perl/5.10.1/XML/LibXML/Schema.pod Installing /usr/local/lib/perl/5.10.1/XML/LibXML/InputCallback.pod Installing /usr/local/lib/perl/5.10.1/XML/LibXML/Pattern.pod Installing /usr/local/lib/perl/5.10.1/XML/LibXML/Parser.pod Installing /usr/local/lib/perl/5.10.1/XML/LibXML/Error.pm Installing /usr/local/lib/perl/5.10.1/XML/LibXML/XPathContext.pod Installing /usr/local/lib/perl/5.10.1/XML/LibXML/DocumentFragment.pod Installing /usr/local/lib/perl/5.10.1/XML/LibXML/Namespace.pod Installing /usr/local/lib/perl/5.10.1/XML/LibXML/Text.pod Installing /usr/local/lib/perl/5.10.1/XML/LibXML/Reader.pod Installing /usr/local/lib/perl/5.10.1/XML/LibXML/ErrNo.pod Installing /usr/local/lib/perl/5.10.1/XML/LibXML/Document.pod Installing /usr/local/lib/perl/5.10.1/XML/LibXML/Dtd.pod Installing /usr/local/lib/perl/5.10.1/XML/LibXML/Comment.pod Installing /usr/local/lib/perl/5.10.1/XML/LibXML/RegExp.pod Installing /usr/local/lib/perl/5.10.1/XML/LibXML/Literal.pm Installing /usr/local/lib/perl/5.10.1/XML/LibXML/CDATASection.pod Installing /usr/local/lib/perl/5.10.1/XML/LibXML/XPathExpression.pod Installing /usr/local/lib/perl/5.10.1/XML/LibXML/Number.pm Installing /usr/local/lib/perl/5.10.1/XML/LibXML/SAX.pm Installing /usr/local/lib/perl/5.10.1/XML/LibXML/Attr.pod Installing /usr/local/lib/perl/5.10.1/XML/LibXML/SAX.pod Installing /usr/local/lib/perl/5.10.1/XML/LibXML/Reader.pm Installing /usr/local/lib/perl/5.10.1/XML/LibXML/Node.pod Installing /usr/local/lib/perl/5.10.1/XML/LibXML/Element.pod Installing /usr/local/lib/perl/5.10.1/XML/LibXML/Error.pod Installing /usr/local/lib/perl/5.10.1/XML/LibXML/Common.pod Installing /usr/local/lib/perl/5.10.1/XML/LibXML/Common.pm Installing /usr/local/lib/perl/5.10.1/XML/LibXML/ErrNo.pm Installing /usr/local/lib/perl/5.10.1/XML/LibXML/DOM.pod Installing /usr/local/lib/perl/5.10.1/XML/LibXML/Boolean.pm Installing /usr/local/lib/perl/5.10.1/XML/LibXML/PI.pod Installing /usr/local/lib/perl/5.10.1/XML/LibXML/SAX/Builder.pm Installing /usr/local/lib/perl/5.10.1/XML/LibXML/SAX/Parser.pm Installing /usr/local/lib/perl/5.10.1/XML/LibXML/SAX/Builder.pod Installing /usr/local/lib/perl/5.10.1/XML/LibXML/SAX/Generator.pm Installing /usr/local/man/man3/XML::LibXML::InputCallback.3pm Installing /usr/local/man/man3/XML::LibXML::XPathExpression.3pm Installing /usr/local/man/man3/XML::LibXML::Attr.3pm Installing /usr/local/man/man3/XML::LibXML::Pattern.3pm Installing /usr/local/man/man3/XML::LibXML::RegExp.3pm Installing /usr/local/man/man3/XML::LibXML::DocumentFragment.3pm Installing /usr/local/man/man3/XML::LibXML::Namespace.3pm Installing /usr/local/man/man3/XML::LibXML::SAX.3pm Installing /usr/local/man/man3/XML::LibXML::Document.3pm Installing /usr/local/man/man3/XML::LibXML::Comment.3pm Installing /usr/local/man/man3/XML::LibXML::Boolean.3pm Installing /usr/local/man/man3/XML::LibXML::Number.3pm Installing /usr/local/man/man3/XML::LibXML::RelaxNG.3pm Installing /usr/local/man/man3/XML::LibXML::PI.3pm Installing /usr/local/man/man3/XML::LibXML::Dtd.3pm Installing /usr/local/man/man3/XML::LibXML::DOM.3pm Installing /usr/local/man/man3/XML::LibXML.3pm Installing /usr/local/man/man3/XML::LibXML::Error.3pm Installing /usr/local/man/man3/XML::LibXML::Text.3pm Installing /usr/local/man/man3/XML::LibXML::CDATASection.3pm Installing /usr/local/man/man3/XML::LibXML::Literal.3pm Installing /usr/local/man/man3/XML::LibXML::XPathContext.3pm Installing /usr/local/man/man3/XML::LibXML::SAX::Generator.3pm Installing /usr/local/man/man3/XML::LibXML::Node.3pm Installing /usr/local/man/man3/XML::LibXML::NodeList.3pm Installing /usr/local/man/man3/XML::LibXML::SAX::Builder.3pm Installing /usr/local/man/man3/XML::LibXML::Reader.3pm Installing /usr/local/man/man3/XML::LibXML::Parser.3pm Installing /usr/local/man/man3/XML::LibXML::Schema.3pm Installing /usr/local/man/man3/XML::LibXML::ErrNo.3pm Installing /usr/local/man/man3/XML::LibXML::Element.3pm Installing /usr/local/man/man3/XML::LibXML::Common.3pm Appending installation info to /usr/lib/perl/5.10/perllocal.pod Please use 'update-perl-sax-parsers(8) to register this parser.' See /usr/share/doc/libxml-sax-perl/README.Debian.gz for more info. Please use 'update-perl-sax-parsers(8) to register this parser.' See /usr/share/doc/libxml-sax-perl/README.Debian.gz for more info. SHLOMIF/XML-LibXML-1.81.tar.gz /usr/bin/make install -- OK