XML::LibXML - problem installing the module on a fresh macOS BigSur

624 views Asked by At

I've been successfully using XML::LibXML module for a while on macOS.

Now I am trying to install it on a new machine with macOS BigSur:

  • perl Makefile.PL
  • make
  • make test
  • make install

However, in "make test" I get multiple errors of the kind:

t/00-report-prereqs.t .............................. ok
t/01basic.t ........................................ 
Can't load '/Users/lockit/Desktop/TESTS_Irina/XML-LibXML-2.0204/blib/arch/auto/XML/LibXML/LibXML.bundle'
for module XML::LibXML: dlopen(/Users/lockit/Desktop/TESTS_Irina/XML-LibXML-2.0204/blib/arch/auto/XML/LibXML/LibXML.bundle, 0x0002): 
symbol '_xmlFree' not found, expected in flat namespace by 
'/Users/lockit/Desktop/TESTS_Irina/XML-LibXML-2.0204/blib/arch/auto/XML/LibXML/LibXML.bundle' 
at /System/Library/Perl/5.28/darwin-thread-multi-2level/DynaLoader.pm line 197.
at /Users/lockit/Desktop/TESTS_Irina/XML-LibXML-2.0204/blib/lib/XML/LibXML.pm line 156.
BEGIN failed--compilation aborted 
at /Users/lockit/Desktop/TESTS_Irina/XML-LibXML-2.0204/blib/lib/XML/LibXML.pm line 156.

Compilation failed in require at t/01basic.t line 6.

And the module cannot be installed.

Any hints what I am missing and how to fix?

Thanks, Irina

2

There are 2 answers

2
Dave Cross On

Have you read the README for the module? It includes the following:

DEPENDENCIES
============
Prior to installation you MUST have installed the libxml2 library. You can get the latest libxml2 version from

http://xmlsoft.org/

Without libxml2 installed this module will neither build nor run.

Also XML::LibXML requires the following packages:
o XML::SAX - base class for SAX parsers
o XML::NamespaceSupport - namespace support for SAX parsers

These packages are required. If one is missing some tests will fail.

Again, libxml2 is required to make XML::LibXML work. The library is not just required to build XML::LibXML, it has to be accessible during run-time as well. Because of this you need to make sure libxml2 is installed properly. To test this, run the xmllint program on your system. xmllint is shipped with libxml2 and therefore should be available. For building the module you will also need the header file for libxml2, which in binary (.rpm,.deb) etc. distributions usually dwell in a package named libxml2-devel or similar.

So you need to have libxml2 (and its development header files) installed on your system.

0
user3206362 On

Looks like it's an issue with Apple's dynamic linker as described here:

https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/issues/381.

I installed the suggested ExtUtils-MakeMaker-7.58 module and this solved the initial issue.

However, now there is a new error on make: "/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- LibXML.bs blib/arch/auto/XML/LibXML/LibXML.bs 644 cc -c -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -g -pipe -fno-strict-aliasing -fstack-protector-strong -DPERL_USE_SAFE_PUTENV -Wno-error=implicit-function-declaration -Os -DVERSION="2.0206" -DXS_VERSION="2.0206" "-I/System/Library/Perl/5.28/darwin-thread-multi-2level/CORE" -DHAVE_UTF8 Av_CharPtrPtr.c Av_CharPtrPtr.c:6:10: fatal error: 'EXTERN.h' file not found #include "EXTERN.h"

Any clue?