Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Problem Installing Perl-Tk on macOS Monterey (12.6) with Apple M1 chip

by bliako (Monsignor)
on Oct 05, 2022 at 07:40 UTC ( [id://11147254]=note: print w/replies, xml ) Need Help??


in reply to Problem Installing Perl-Tk on macOS Monterey (12.6) with Apple M1 chip

Firstly, check to see if perlbrew's perl is the one being used (as well as cpan) and not system perl: which perl; which cpan.

Secondly, check to see if the modules you installed via perlbrew's cpan/cpanm do install in their proper locations and that the correct modules are loaded (where "incorrect" modules are those loaded from system perl's INC places). Useful here is the @INC : perl -e 'print "@INC"'

Thirdly, the other interference from system perl+tk would be that their binary libraries (.so, .dylib) are loaded instead of perlbrew's perl+tk. You can check/affect that with the env vars: LD_LIBRARY_PATH and DYLD_LIBRARY_PATH and, better, sieve through the output of strace perl (consequently: strace /Library/Developer/CommandLineTools/usr/bin/make  all-am (note: I am not sure if this command will recursively strace all the calls inside the Makefile).

I think with the above you can detect where libraries and modules are loaded from, and, therefore, eliminate the possibility of "interference" from system perl+tk.

Using an older macOS is a bless and a curse: the newer (13.+) are locking the system with the so-called SIP with a really annoying effect: (DY)LD_LIBRARY_PATH env vars are *forbidden* (by the cupertino directorate) to be passed to executables, so this DYLD_LIBRARY_PATH=my-good-tk-libraries make all-am will have no effect and still be looking in /usr/lib first. The curse of course is that nothing works and the one daring to use older hardware feels like a leper, not least by the various forums' support.

bw, bliako

Replies are listed 'Best First'.
Re^2: Problem Installing Perl-Tk on macOS Monterey (12.6) with Apple M1 chip
by cmv (Chaplain) on Oct 05, 2022 at 14:47 UTC
    In the original post, you can see that I call the correct cpan using the perlbrew cpan full path name, which was built using the perlbrew perl, so I expected that all to work correctly.

    However, running which perl; which cpan from my command line shows me the system commands being found first. I will try fixing this so that perlbrew commands are in my environment first and see if that helps.

    Also, checking where the modules were installed shows the following:

    /opt/homebrew/Cellar/perl/5.36.0/bin/perl -e 'print "@INC"' /opt/homebrew/opt/perl/lib/perl5/site_perl/5.36/darwin-thread-multi-2l +evel /opt/homebrew/opt/perl/lib/perl5/site_perl/5.36 /opt/homebrew/op +t/perl/lib/perl5/5.36/darwin-thread-multi-2level /opt/homebrew/opt/pe +rl/lib/perl5/5.36 /opt/homebrew/lib/perl5/site_perl/5.36/darwin-threa +d-multi-2level /opt/homebrew/lib/perl5/site_perl/5.36

    There are no environment variables in my shell for LD_LIBRARY_PATH or DYLD_LIBRARY_PATH but maybe cpan adds them somehow?

    I will try using strace and see if the output indicates if the old system tcl-tk libraries are being used and post the results here.

Log In?
Username:
Password:

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

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

    No recent polls found