DBD::Oracle on AIX 5.1
Dec 3, 2009 / By John Scoles
I finally had the opportunity the other day to try and install DBD::Oracle on an IBM AIX 5.1 box, and for once I have some good news to tell.
Anyone who has ever tried this will know of some of the troubles I speak of. When dealing with DBI and any DBD on a AIX box, you either must either be lucky enough to have the same compiler installed that built the version of Perl that comes with the box (I have never seen this happen); or you have to spend a great deal of time downloading and installing your own GCC and the building your own version of Perl.
Fortunately, all the hard work was done for me by other members of my team, and I was only a Johnny-come-lately to the whole process.
In our case, these are the steps that we followed:
- get a working version of GCC on the box
- rebuild and install your own version of Perl
- build and install DBI using your local version of Perl
All of the above worked without a major problem. It was only when we tried to build DBD::Oracle that we ran into a problem:
/me/my_perl/Perl Makefile.PL ... WARNING: You will may need to rebuild perl using the xlc_r compiler. The important thing is that perl and DBD::Oracle be built with the same compiler. You may also need to: ORACCENV='cc=xlc_r'; export ORACCENV Also see README.aix for gcc instructions and read about the -p option. WARNING: If you have problems you may need to rebuild perl with threading enabled. ...
That’s not much to worry about, as the Makefile will always produce this output on AIX, and we already did that. So onto the next part:
All goes well until . . .
... ld: 0706-005 Cannot find or open file: libgcc.a ld:open(): A file or directory in the path name does not exist. ld: 0706-005 Cannot find or open file: libgcc.a ld:open(): A file or directory in the path name does not exist. gcc: file path prefix `/usr/local/lib/gcc-lib/I:/oraclesw/oracle/product/8.1.7/lib/ksms.imp/2.9-aix43-010216/' never used make: 1254-004 The error code from the last command is 1. Stop. ...
After a number of false starts in setting differing environment settings, I finally had a look at where it was supposed to be getting this missing
libgcc.a. I found it where one would expect it—in
I also noticed in its config file that it was looking for some other files in
/lib, so I had a quick look in there with a
ls -al, and found a very large number of libraries that all seem to linked to other directories, including my own local install of Perl.
So I got a sysadmin to do this for me:
ln -s /lib/gcc-lib/powerpc-ibm-aix188.8.131.52/lib/libgcc.a libgcc.a
After that, I went back into my DBD::Oracle directory and did:
/me/my_perl/perl Makefile.PL ... # normal make stuff ...
make test ... Manifying blib/man1/ora_explain.1 Manifying blib/man3/DBD::Oracle.3 Manifying blib/man3/DBD::Oraperl.3 pythian@arthur_prod:DBD-Oracle-1.17>make test PERL_DL_NONLAZY=1 /home/pythian/perl/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/01base................ok ...
After that, it installed fine. Why, I know not. I am still looking into it, as the world of AIX is still foreign to me.
My best guess it that the OS limits what libraries can be “loaded” by a local user to ones that are found in
/lib. Setting up the symbolic link to the missing
libgcc.a did the trick.
Leave a Reply