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

Re^2: Mac::Carbon et.c on Mac OS X 10.8

by kwalker (Novice)
on Feb 23, 2013 at 02:07 UTC ( #1020267=note: print w/replies, xml ) Need Help??

in reply to Re: Mac::Carbon et.c on Mac OS X 10.8
in thread Mac::Carbon et.c on Mac OS X 10.8

Thanks, that's helpful.

Before posting here I had already tried rebuilding Mac::Glue (as suggested in the first response to my original question), but without any luck. I was planning on next building my own perl, but then I began to suspect that the problem was more fundamental and could not be fixed by tweaking the build parameters.

Perl (v5.12.4) claims to be bi-architectural:

[kw|~] file /usr/bin/perl /usr/bin/perl: Mach-O universal binary with 2 architectures /usr/bin/perl (for architecture i386): Mach-O executable i386 /usr/bin/perl (for architecture x86_64): Mach-O 64-bit executable x +86_64
The module I want to use is 32-bit i386:
[kw|~] lipo -info /System/Library/Perl/Extras/5.12/darwin-thread-multi +-2level/auto/MacPerl/MacPerl.bundle Non-fat file: /System/Library/Perl/Extras/5.12/darwin-thread-multi-2le +vel/auto/MacPerl/MacPerl.bundle is architecture: i386
But things fail anyway:
[kw|~] perl -ce 'use Mac::Glue' Can't load '/System/Library/Perl/Extras/5.12/darwin-thread-multi-2leve +l/auto/MacPerl/MacPerl.bundle' for module MacPerl: dlopen(/System/Lib +rary/Perl/Extras/5.12/darwin-thread-multi-2level/auto/MacPerl/MacPerl +.bundle, 1): no suitable image found. Did find: /System/Library/Perl/Extras/5.12/darwin-thread-multi-2level/auto/M +acPerl/MacPerl.bundle: mach-o, but wrong architecture at /System/Libr +ary/Perl/5.12/darwin-thread-multi-2level/ line 204. at /System/Library/Perl/Extras/5.12/Mac/Glue/ line 21 Compilation failed in require at /System/Library/Perl/Extras/5.12/Mac/ +Glue/ line 21. BEGIN failed--compilation aborted at /System/Library/Perl/Extras/5.12/ +Mac/Glue/ line 21. Compilation failed in require at /System/Library/Perl/Extras/5.12/Mac/ line 7. BEGIN failed--compilation aborted at /System/Library/Perl/Extras/5.12/ +Mac/ line 7. Compilation failed in require at -e line 1. BEGIN failed--compilation aborted at -e line 1.
I'm guessing that I'm out of luck, since the OS is 64-bit and Mac::Glue will only build as 32-bit (since it depends on the Carbon API). But I'm a novice on these architecture compatibility issues, so if someone wants to authoritatively confirm that I'm out of luck I would appreciate it.

Replies are listed 'Best First'.
Re^3: Mac::Carbon et.c on Mac OS X 10.8
by luis.roca (Deacon) on Feb 23, 2013 at 04:13 UTC

    The short answer would be no.

    From perlmacosx (specifically that last paragraph)

    Support for 64-bit addressing is experimental: some aspects of Perl ma +y be omitted or buggy. Note the messages output by Configure for fur +ther information. Please use "perlbug" to submit a problem report in th +e event that you encounter difficulties. When building 64-bit modules, it is your responsiblity to ensure t +hat linked external libraries and frameworks provide 64-bit support: i +f they do not, module building may appear to succeed, but attempts to use + the module will result in run-time dynamic linking errors, and subsequ +ent test failures. You can use "file" to discover the architectures supported by a library: $ file libgdbm.3.0.0.dylib libgdbm.3.0.0.dylib: Mach-O fat file with 2 architectures libgdbm.3.0.0.dylib (for architecture ppc): Mach-O dynami +cally linked shared library ppc libgdbm.3.0.0.dylib (for architecture ppc64): Mach-O 64-bit + dynamically linked shared library ppc64 Note that this issue precludes the building of many Macintosh-spec +ific CPAN modules ("Mac::*"), as the required Apple frameworks do not p +rovide PPC64 support. Similarly, downloads from Fink or Darwinports are unlikely to provide 64-bit support; the libraries must be rebuilt +from source with the appropriate compiler and linker flags. For further information, see Apple's *64-Bit Transition Guide* at < +orting /index.html>.

    That last link no longer works and redirects you to a menu. Here's the updated page if you're interested:

    "...the adversities born of well-placed thoughts should be considered mercies rather than misfortunes." Don Quixote

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1020267]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (9)
As of 2018-06-18 21:50 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (110 votes). Check out past polls.