I compiled Perl 5.10.1 under OS X 10.5. It was compiled as a 32-bit program. I have since upgraded to OS X 10.6. My version of Perl 5.10.1 continues to work fine, but I just tried to compile JSON::XS and got errors like the following:
Can't load '/Users/cowens/.cpan/build/JSON-XS-2.26-clO6XX/blib/arch/auto/JSON/XS/XS.bundle' for module JSON::XS: dlopen(/Users/cowens/.cpan/build/JSON-XS-2.26-clO6XX/blib/arch/auto/JSON/XS/XS.bundle, 2): no suitable image found. Did find: /Users/cowens/.cpan/build/JSON-XS-2.26-clO6XX/blib/arch/auto/JSON/XS/XS.bundle: mach-o, but wrong architecture at /Users/cowens/local/lib/perl5/5.10.1/darwin-thread-multi-2level/DynaLoader.pm line 204.
A quick look at /Users/cowens/.cpan/build/JSON-XS-2.26-clO6XX/blib/arch/auto/JSON/XS/XS.bundle
shows that it is indeed a 64-bit library:
/Users/cowens/.cpan/build/JSON-XS-2.26-clO6XX/blib/arch/auto/JSON/XS/XS.bundle: Mach-O 64-bit bundle x86_64
Since this is most likely the culprit, I want to try compiling the module as 32-bit. I assume there is some environment variable (like CCFLAGS
) I can set to force it to compile as a 32-bit library instead of a 64-bit library.
The alternative seems to be to recompile Perl and all of my modules (something I am not sure I want to do).