Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

two versions of libxml2 causing module to fail install

by chexmix (Hermit)
on Aug 13, 2013 at 15:38 UTC ( [id://1049301] : perlquestion . print w/replies, xml ) Need Help??

chexmix has asked for the wisdom of the Perl Monks concerning the following question:

Good Day, Monks --

I am attempting to install the module XML::LibXML in my work environment, and it keeps failing because the version of it (Perl itself?) was compiled against is different from the one in the runtime environment.

Here is the failure text:

# Failed test 'LIBXML__VERSION == LIBXML_RUNTIME_VERSION' # at t/01basic.t line 18. # got: '20706' # expected: '20900' # DO NOT REPORT THIS FAILURE: Your setup of library paths is incorrect +! # # # Compiled against libxml2 version: 20706 # Running libxml2 version: 20900

2.7.6 is what is resident in /usr/lib64 ... 2.9.0 is in /usr/local/lib. I queried our systems folks about this and they asked me whether I could remove /usr/local/lib from my runtime environment.

I tried removing /usr/local/lib from the LD_LIBRARY_PATH environment variable, but that seems to have not done the trick -- I get the same error. Is there another way to do this, e.g. hide /usr/local/lib?

Now that I've typed this I realize it isn't exactly a Perl question! It's more of a systems question.

I thought briefly that I should reinstall Perl in case this 2.9.0 version of libxml2 was installed since I put the Perl in place the first time ... but ... I'm doing this on a 64bit machine: shouldn't Perl default to compiling against the 64bit library (I'm a bit out of my element)?

If there is no way around this I guess I can use --force to get the module installed, but I always hesitate to do so although I have never suffered any deleterious effects.



Replies are listed 'Best First'.
Re: two versions of libxml2 causing module to fail install
by tobyink (Canon) on Aug 13, 2013 at 15:58 UTC

    "the version of it (Perl itself?) was compiled against [...] I thought briefly that I should reinstall Perl"

    Perl itself does not link to libxml2, so there's no reason to reinstall Perl.

    The XML::LibXML Makefile.PL accepts some options for providing the paths to the libxml2 library. You could try installing like e.g.:

    Makefile.PL LIBS=/usr/local/lib INC=/usr/local/include make make test sudo make install
    package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name
      Thanks for the tips ... I set the make_arg conf variable in the CPAN shell to "LIBS=/usr/lib64" and that seems to have done the trick. /GB
        Sorry to resurrect this ... but the trick that worked before seems to no longer work. I am flummoxed.

        The same versions of libxml2 are involved here. Not sure where or how the /usr/local/lib copy of libxml2 is getting pulled in. I have both set the make_arg variable AND removed /usr/local/lib from LD_LIBRARY_PATH.

        Foo. I don't mind some fun sleuthing, but don't really have the time for it now. I will report back with what I find.

Re: two versions of libxml2 causing module to fail install
by Anonymous Monk on Aug 13, 2013 at 15:45 UTC