Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: XML::LibXML setup of library paths

by jcb (Deacon)
on Nov 13, 2019 at 04:22 UTC ( #11108609=note: print w/replies, xml ) Need Help??


in reply to XML::LibXML setup of library paths

The problem is that you are on a Macintosh. Your version of MacOS X ships with libxml2 20800 and finds that first when loading libxml2, likely because it is already loaded somewhere in another process. Your failures here are due to the compiler finding version 20904, but the dynamic loader supplying 20800.

There should be some way to get the system to actually load the newer version of libxml2 from a "keg" but that is your problem here — the compiler is using the new version, but the dynamic loader is using the older version that presumably Apple shipped.

Replies are listed 'Best First'.
Re^2: XML::LibXML setup of library paths
by Anonymous Monk on Nov 13, 2019 at 11:38 UTC
    There should be some way to get the system to actually load the newer version of libxml2 from a "keg"

    Thank you for explaining the situation. I barely grasp the problem, let alone the solution. I find people on other sites fixing similar sounding issues with the command:

    brew link --force libxml2
    
    I tried it to see what happens:
    brew link --dry-run libxml2
    Would link:
    /usr/local/bin/xml2-config
    /usr/local/bin/xmlcatalog
    /usr/local/bin/xmllint
    /usr/local/include/libxml2
    /usr/local/share/aclocal/libxml.m4
    /usr/local/share/doc/libxml2-2.9.7
    /usr/local/share/gtk-doc/html/libxml2
    /usr/local/share/man/man1/xml2-config.1
    /usr/local/share/man/man1/xmlcatalog.1
    /usr/local/share/man/man1/xmllint.1
    /usr/local/share/man/man3/libxml.3
    /usr/local/lib/cmake/libxml2
    /usr/local/lib/libxml2.2.dylib
    /usr/local/lib/libxml2.a
    /usr/local/lib/libxml2.dylib
    /usr/local/lib/pkgconfig/libxml-2.0.pc
    /usr/local/lib/python2.7/site-packages/drv_libxml2.py
    /usr/local/lib/python2.7/site-packages/libxml2.py
    /usr/local/lib/python2.7/site-packages/libxml2_python-2.9.7-py2.7.egg-info
    /usr/local/lib/python2.7/site-packages/libxml2mod.so
    /usr/local/lib/xml2Conf.sh
    
    If you need to have this software first in your PATH instead consider running:
      echo 'export PATH="/usr/local/opt/libxml2/bin:$PATH"' >> ~/.bash_profile
    
    /usr/local/include/libxml2 looks interesting because I don't have it and can't find those links when looking for some of them. But I do have /usr/bin/xmllint already:
    xmllint --version
    xmllint: using libxml version 20904
    
    I don't know what forcing that link will do to the system, what it will break, how to unforce...
Re^2: XML::LibXML setup of library paths
by Anonymous Monk on Nov 14, 2019 at 01:46 UTC
    I have 3 versions, cause the first 2 are identical, except for date (/opt is 2012 and /usr is 2018)
    locate xmlversion.h
    
    /opt/local/include/libxml2/libxml/xmlversion.h
    /usr/include/libxml2/libxml/xmlversion.h
    /usr/local/Cellar/libxml2/2.9.4_2/include/libxml2/libxml/xmlversion.h
    /usr/local/Cellar/libxml2/2.9.7/include/libxml2/libxml/xmlversion.h
    

      Those first two are the ancient version Apple ships as part of Mac OS X. I do not know how to get Mac OS X to actually load the newer versions. Maybe add the directory containing a "libxml" .dylib to LD_LIBRARY_PATH whenever running your new perl extension?

Re^2: XML::LibXML setup of library paths
by Anonymous Monk on Nov 13, 2019 at 14:23 UTC
    The problem is that you are on a Macintosh.

    no thats not the problem

      >> The problem is that you are on a Macintosh.

      > no thats not the problem

      I have mixed feelings, mostly good, but saw this yesterday from cpan:

      Configuring BSD-Sysctl-0.11 ... OS unsupported (darwin). Here's a nickel, go buy yourself a real OS.

        So… like… Windows 8?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11108609]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2019-12-12 19:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?