Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

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/DynaLoader.pm line 204. at /System/Library/Perl/Extras/5.12/Mac/Glue/Common.pm line 21 Compilation failed in require at /System/Library/Perl/Extras/5.12/Mac/ +Glue/Common.pm line 21. BEGIN failed--compilation aborted at /System/Library/Perl/Extras/5.12/ +Mac/Glue/Common.pm line 21. Compilation failed in require at /System/Library/Perl/Extras/5.12/Mac/ +Glue.pm line 7. BEGIN failed--compilation aborted at /System/Library/Perl/Extras/5.12/ +Mac/Glue.pm 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 <http://developer.apple.com/documentation/Darwin/Conceptual/64bitP +orting /index.html>.

    That last link no longer works and redirects you to a menu. Here's the updated page if you're interested: http://developer.apple.com/library/mac/#documentation/Darwin/Conceptual/64bitPorting/intro/intro.html


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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2018-01-17 01:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How did you see in the new year?










    Results (194 votes). Check out past polls.

    Notices?