Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: XML::LibXML fails install on macOS Big Sur

by Skalef (Initiate)
on Jan 12, 2021 at 15:14 UTC ( [id://11126798]=note: print w/replies, xml ) Need Help??


in reply to Re: XML::LibXML fails install on macOS Big Sur
in thread XML::LibXML fails install on macOS Big Sur

Hi,

this is my first post ;-)

I'm a reader for nearly 20 years now, perhaps i can help today ;-)

Anyhow, the problem originates from the fact, that BigSur provides a native

XML Library and therefore the cc compiler will always favor the local libxml which differs from the version homebrew is providing.

homebrew version: '20904'

Big sur version: '20910'

How you can get it working: (Assuming you have perl-5.3.32 homebrew package installed)

1.) install the gcc homebrew package !

2.) Extract the source

3.) perl Makefile.PL

4.) Edit the Makefile

Change these lines:

Change the CC binary

 CC = gcc

Change the LD binary

 LD = gcc

Change the LDDFLAGS to:

LDDLFLAGS = -L/usr/local/opt/libxml2/lib -L/usr/local/lib/perl5/5.32.0 +/darwin-thread-multi-2level/CORE -mmacosx-version-min=10.15 -bundle - +fstack-protector- strong -lxml2 -lperl

Change the LDFLAGS to

LDFLAGS = -L/usr/local/opt/libxml2/lib -L/usr/local/lib/perl5/5.32.0/darwin-thread-multi-2level/CORE -mmacosx-version-min=10.15 -fstack-protector-strong -lxml2 -lperl

Change the INC Path to

INC = -I/usr/local/opt/libxml2/include

Change the PASSTHROUGH INC

PASTHRU_INC='-I/usr/local/opt/libxml2/include $(PASTHRU_INC)'

Then build:

make

Check using otool:

$otool -L blib/arch/auto/XML/LibXML/LibXML.bundle blib/arch/auto/XML/LibXML/LibXML.bundle: /usr/local/opt/libxml2/lib/libxml2.2.dylib (compatibility version +12.0.0, current version 12.10.0) /usr/local/opt/perl/lib/perl5/5.32.0/darwin-thread-multi-2level/CO +RE/libperl.dylib (compatibility version 5.32.0, current version 5.32. +0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current v +ersion 1292.60.1) /usr/local/lib/gcc/10/libgcc_s.1.dylib (compatibility version 1.0. +0, current version 1.0.0)
make test

(3 tests will fail because the tests favor the native libs, so don't mind

 make install

Best regards

Franz

Replies are listed 'Best First'.
Re^3: XML::LibXML fails install on macOS Big Sur
by stevieb (Canon) on Jan 12, 2021 at 16:11 UTC

    Welcome to the Monastery!

    This is rather impressive for a first post. Great job, and nice to have you aboard!

      Thx for the flowers,

      but see it as a workaround until the XS bindings have been updated to the newer version of XML::LibXML.

      Apple plugs all the system libs into libSystem so CC will always favor the builtin libs.

      Kind regards Franz

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-03-28 14:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found