Getting DBD::Informix running on Mac OS X 10.7 (lion)

Throwing this out there and adding it to the Google-fu mix.

According to the internets, DBD::Informix has issues on Lion. Many different solutions are offered, but this is what worked for me.

Download the “Client SDK” from the IBM site.

The problem: trying to build with out of the box everything, throws up:

    lipo: /var/tmp//cc56iZs2.out and /var/tmp//ccKfcTb1.out have the same 
    architectures (x86_64) and can't be in the same fat output file

Solutions:

Upgrade XCode. I was on 4.1, one-click in the app store and a wait got me to 4.3.

Was your perl compiled with ‘-m64′? Stock mac perl wasn’t. So I brewed a new perl:

    perlbrew install perl-5.12.4 -D'-m64'

According to the gcc manual, -m64 is:

    Generate code for a 32-bit or 64-bit environment.  The 32-bit environment sets
    int, long and pointer to 32 bits and generates code that runs on any i386 system.            
    The 64-bit environment sets int to 32 bits and long and pointer to 64 bits and
    generates code for AMD's x86-64 architecture. For darwin only the -m64 option
    turns off the -fno-pic and -mdynamic-no-pic options.

Switch to that perl and a ‘perl -V’ should give you:

    cc='cc -m64', ccflags ='-fno-common -DPERL_DARWIN -no-cpp-precomp
    -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include',

This article also had some suggestions involving Devel::Patchperl which I didn’t use.

[Bloglines] [del.icio.us] [Digg] [Facebook] [Google] [Reddit] [Windows Live] [Yahoo!] [Email]

Related Posts:

One Response to “Getting DBD::Informix running on Mac OS X 10.7 (lion)”

  1. cms says:

    I think you’ve maybe mis-pasted the (confusing) gcc man page there.

    That paragraph is the description of a -m option, which is only with two states -m32 , or -m64. So only the bits of the description that pertain to the ’64 bit environment’ are relevant if you’ve set 64.

    I think, although I’m hardly an expert, that this setting is for switching off legacy mode for 64 bit builds for the x86-64 architecture, which gets you ‘true’ 64-bit mode

    Where this gets more confusing to me is that the Apple supplied perl binaries ( they ship both 5.10 and 5.12 in Lion for whatever reason, with a magical select wrapper ) go to great pains to document their switchable 32/64-bittedness. Presumably this is legacy-64 bit-mode then.

    I think your approach is the least confusing path, perl -V doesn’t lie. This sort of mess is why the clever people warned us against closed vendor binary blobs in the first place, of course. I thought IBM was supposed to be the open source company.

Leave a Reply