Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Tk-804.036 build failure

by ibm1620 (Hermit)
on Jun 29, 2023 at 02:55 UTC ( [id://11153199]=note: print w/replies, xml ) Need Help??


in reply to Tk-804.036 build failure

I used cpanm to install Perl Tk 804.036 on my 2013 Mac running MacOS 10.15.7 and perl 5.30.3, and got the same result. I'm going to try gnosti's suggestion and use gcc. Note that /usr/bin/gcc is really clang. I used homebrew to install a true gcc-13.1.0 (the entire build took 1.5 hrs!) and will try tomorrow to figure out how to build Tk with gcc.

Does anyone know if such a build would be compatible with my clang-built perl, or would I also need to recompile perl with gcc?

Replies are listed 'Best First'.
Re^2: Tk-804.036 build failure
by gnosti (Chaplain) on Jun 29, 2023 at 09:51 UTC
    In the same naive spirit, I would offer that using the same compiler for building perl and its extensions seems more likely to succeed. If I could reason about symbols and libraries and memory addresses, I would be able to explain why. I know in some ways it isn't especially complicated, but you do need to learn how to reason about it, which is possible only through actually debugging experience, at least for myself.

    Tk isn't especially easy to compile. Since so many perl modules are available through Debian, it's a suitable development environment in that it gets you a compiled Tk for free. When I compile Tk for myself, under whichever perl version, I always have to force it to install as there is always a failing test. I just believe and pray I won't touch that code because I never bothered to try and figure it out. Up to now I've been a rather pedestrian user. No nuclear reactors depend on my code!

    I'm aware there's another Tk interface for perl, Tkx. I've never touched it, but understand it is closer to Tcl/Tk than the more perlish Tk. Perhaps Tkx will compile and work for your app under clang.

Re^2: Tk-804.036 build failure
by ibm1620 (Hermit) on Jun 29, 2023 at 14:16 UTC
    No joy after compiling both perl-5.30.3 and Tk 804.036 with gcc 13.1.0. Tk install appears to fail the same tests, although now there's no mention of a SEGV, and perl gets stuck in a CPU loop.
    "/Users/chap/perl5/perlbrew/perls/perl-5.30.3/bin/perl" "-I../t" "-MTk +Test" "-e" "checked_test_harness('../xt', 0, '../blib/lib', '../blib/ +arch')" t/*.t t/basic.t .. Failed 4/5 subtests t/crash.t ..
    FWIW, I was able to install Perl Tk just fine on M1 MacBook Air running MacOS 13.4.1 (Ventura), in both perl-5.36.1 and perl-5.38.0-RC2.

      For clarity, you could run this test in verbose mode and investigate failures. prove -v PNG/t/basic.t

        Thank you, marto. I ran prove as recommended:
        chap@Retsina:...rk/1688073614.30084/Tk-804.036$ pwd /Users/chap/.cpanm/work/1688073614.30084/Tk-804.036 chap@Retsina:...rk/1688073614.30084/Tk-804.036$ prove -v PNG/t/basic.t PNG/t/basic.t .. 1..5 ok 1 - use Tk::PNG; Failed 4/5 subtests Test Summary Report ------------------- PNG/t/basic.t (Wstat: 11 Tests: 1 Failed: 0) Non-zero wait status: 11 Parse errors: Bad plan. You planned 5 tests but ran 1. Files=1, Tests=1, 0 wallclock secs ( 0.03 usr 0.01 sys + 0.16 cusr + 0.02 csys = 0.22 CPU) Result: FAIL
        I am by now well out of my depth, so I can't dig any further into this :-). I'm inclined not to suspect the clang compiler, since it fails in the same test for either compiler.

        I did install perl-5.30.3 on M1 MacOS 13.4.1, and successfully ran cpanm Tk.

        To OP: is installing a more recent version of Perl an option?

        To install Tk I had to use "cpanm --notest Tk", which doesn't download the tests. And for some reason I'm unable to download the PNG directory from https://metacpan.org/release/SREZIC/Tk-804.036/source. (All I get is HTML code). If I'm on the right track, how does one download that PNG directory?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2025-07-07 22:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.