On 2/8/07, Wholey, Joseph (GTI) <[EMAIL PROTECTED]> wrote:


Jonathan,

...and finally, are you aware of a version that points to the 64 bit
libraries.  If not... no big deal... I'll just hack it.  And your help and
responsiveness has been incredible.  Better than paid support.



Nope - I'm not aware of it (DBD::DB2 isn't my code).   Maybe you should
check the very latest version...

   http://search.cpan.org/src/IBMTORDB2/DBD-DB2-1.0/Makefile.PL

Looks like it is in there...You can do that just as well as I can, can't
you?

Use the latest version of the code.  It often helps.

(Actually, we can debate whether the test is truly correct - it would work
for you because you are using a 64-bit Perl and therefore want the 64-bit
libraries, but if you had a 32-bit Perl, it would still see the 64-bit
libraries and use those, despite the 32-bittiness of Perl.)



Regards, Joe

 -----Original Message-----
*From:* Jonathan Leffler [mailto:[EMAIL PROTECTED]
*Sent:* Thursday, February 08, 2007 2:38 PM
*To:* Wholey, Joseph (GTI)
*Cc:* DBD::DB2 Maintenance Team; DBI Users Mailing List
*Subject:* Re: perl DBD and DBI for 64 bit perl



On 2/8/07, Wholey, Joseph (GTI) <[EMAIL PROTECTED]> wrote:
>
>  You are correct... it is a 32 bit file.... bear with me...I'm a little
> confused by this statement:
>
> "You need to distinguish between the database server (which I think your
> evidence below shows is the case) and the client software used to connect to
> it."  The server in question, is the database server.
>


The parenthetical remark in my sentence wasn't complete - apologies.  If
you ignore that, then I said that you simply need to be aware that the
application program (eg Perl + DBI + DBD::DB2) uses a client library to
connect to the database server.  It does not include the database server
code in the client program.  And that means that the client program can have
a different bittiness from the server.  What the parenthetical remark should
have been is "(and I think your evidence below shows that the server is a
64-bit server)".


  Anyway, moving forward, how do I force the compilation of the modules to
> go to point to the db2 64bit libraries?  Do I need to modify the
> Makefile.pl script?  Is there an easier way?
>
> Note:  the *.1 files are links.
> [EMAIL PROTECTED] lib]# locate libdb2.so
> /opt/IBM/db2/V8.1/lib/libdb2.so.1
> /opt/IBM/db2/V8.1/lib/libdb2.so
> /opt/IBM/db2/V8.1/lib64/libdb2.so.1
> /opt/IBM/db2/V8.1/lib64/libdb2.so
>


This is the valuable information...You have the 64-bit libraries; you just
need to persuade Perl to use them.

I don't have the source for DBD::DB2 0.78 on my machine - but I looked at
0.76 instead.  In Makefile.PL, there is code to the effect:

# libraries required to build DBD::DB2 driver
if( $os eq 'MSWin32' || $os eq 'MSWin64' || $os eq 'os2' )
{
  $sysliblist = qq(-L"$DB2/lib" db2cli db2api);
  my @libpaths = split /;/, $ENV{'LIB'};
  my $libpath;
  while( @libpaths )
  {
    ( $libpath = shift(@libpaths) ) =~ s/"//g;  # Remove quotes
    $libpath =~ s:\\:/:g;

    if( $libpath && $sysliblist !~ /-L"$libpath"/i )
    {
      $sysliblist .= qq( -L"$libpath");
    }
  }
}
else
{
  $sysliblist = "-L$DB2/lib -ldb2";
}


This needs to be modified, I believe, so the last else clause takes into
account the possibility of a 64-bit Perl.  There are various configuration
items that could be used to identify 64-bit Perl:

$Config{use64bitint}
$Config{use64bitall}
$Config{intsize} == 8
$Config{ptrsize} == 8

So, if some suitable values of these are set, you should change
$sysliblist to use -L$DB2/lib64

elsif ($Config{ptrsize} == 8)
{
   $sysliblist = "-L$DB2/lib -ldb2";
}

With this hacked into Makefile.PL, there's a chance you'll build
correctly.


DBD::DB2 Maintenance Team - please note this suggested change; validate
and fix for the next release of DBD::DB2.  Thanks!



  Thanks again...
>
> Regards, Joe
>
>  -----Original Message-----
> *From:* Jonathan Leffler [mailto:[EMAIL PROTECTED]
> *Sent:* Thursday, February 08, 2007 1:14 PM
> *To:* Wholey, Joseph (GTI)
> *Cc:* DBD::DB2 Maintenance Team; DBI Users Mailing List
> *Subject:* Re: perl DBD and DBI for 64 bit perl
>
>
>
> On 2/8/07, Wholey, Joseph (GTI) <[EMAIL PROTECTED] > wrote:
> >
> >  OK... we're making progress... that is a 64 bit db2... maybe there is
> > a problem with their libraries.  Anyway, what from that error I'd sent you
> > indicates that it's going against a 32 bit db2 lib?  btw... I really
> > appreciate your help on this.
> >
>
>
> You need to distinguish between the database server (which I think your
> evidence below shows is the case) and the client software used to connect to
> it.
>
> The evidence from your build suggests that the client software installed
> in /opt/IBM/db2/V8.1/lib
> (the libdb2.so file in there) is a 32-bit library.  You can confirm that
> by running the 'file' command on it.
>
> For example:
>
> Anubis JL: cd /usr/lib
> Anubis JL: file libc.so
> libc.so:        ELF 32-bit MSB dynamic lib SPARC Version 1, dynamically
> linked, not stripped
> Anubis JL: cd sparcv9
> Anubis JL: file libc.so
> libc.so:        ELF 64-bit MSB dynamic lib SPARCV9 Version 1,
> dynamically linked, not stripped
> Anubis JL:
>
> Assuming that this is the problem, you will either need to install the
> 64-bit client software - probably in a separate location so you don't break
> the existing code that uses the 32-bit software (though I'm not sure how
> easily you can do that with DB2) - or you have to use a 32-bit Perl and
> 32-bit DBI to build a 32-bit DBD::DB2 using the 32-bit DB2 client libraries.
>
>
> If this is not the problem, then we need to understand why GCC is
> refusing to play with the libdb2.so library in  /opt/IBM/...
>
>
>   rpcjq-mphqa1cjs101;/rpcjqhome/rpcjq>exit
> > [EMAIL PROTECTED] DBD_DBI]# su - rpcjq
> > mphqa1cjs101
> >
> > ############################################################
> > *** db2instance ---> rpcjq
> > *** db2dbdft    ---> DBRPCJ
> > *** schema      ---> RPCJQ
> > *** UNIX ID     ---> rpcjq
> > ############################################################
> >
> > rpcjq-mphqa1cjs101;/rpcjqhome/rpcjq>db2level
> > DB21085I  Instance "rpcjq" uses "64" bits and DB2 code release
> > "SQL08025" with
> > level identifier "03060106".
> > Informational tokens are "DB2 v8.1.3.112", "s060429", "MI00159", and
> > FixPak
> > "12".
> > Product is installed at "/opt/IBM/db2/V8.1".
> >
> >
> >  -----Original Message-----
> > *From:* Jonathan Leffler [mailto:[EMAIL PROTECTED]
> > *Sent:* Thursday, February 08, 2007 11:30 AM
> > *To:* Wholey, Joseph (GTI)
> > *Cc:* dbi-users@perl.org
> > *Subject:* Re: perl DBD and DBI for 64 bit perl
> >
> >
> > On 2/8/07, Wholey, Joseph (GTI) <[EMAIL PROTECTED]> wrote:
> >
> >      I'm really in a pinch here:
> > >
> > > Here's the error I get when I try to compile the DBD:.  Can you help
> > > me out here.  Below you'll find my level of Perl and the dbd and dbi
> > > versions I'm attempting to install.
> > >
> > > gcc  -shared DB2.o dbdimp.o   -o blib/arch/auto/DBD/DB2/DB2.so
> > > -L/opt/IBM/db2/V8.1/lib -ldb2
> > > /usr/bin/ld: skipping incompatible /opt/IBM/db2/V8.1/lib/libdb2.so
> > > when searching for -ldb2
> > >
> >
> >
> > Well, it looks like the DB2 client software you have is probably a
> > 32-bit version, so GCC is quite correctly not linking your 64-bit DBD::DB2
> > module with the 32-bit DB2 client software -- it wouldn't work even if it
> > tried.
> >
> > You have two options:
> > * Find, install, use a 64-bit DB2 client library.
> > * Recompile Perl, DBI and then DBD::DB2 as 32-bit code to use the
> > 32-bit DB2 client.
> >
> > Both would work - which is better for you depends on whether you can
> > find a 64-bit DB2 client library.
> >
> >
> >   /usr/bin/ld: cannot find -ldb2
> > > collect2: ld returned 1 exit status
> > > make: *** [blib/arch/auto/DBD/DB2/DB2.so] Error 1
> > > [EMAIL PROTECTED] DBD-DB2-0.78]#
> > >
> > >
> > > Here are the versions I'm trying to compile as well as the perl
> > > version.
> > >
> > > DBI-1.51
> > > DBD-DB2-0.78
> > >
> > > [EMAIL PROTECTED] DBD-DB2-0.78]# perl -v
> > >
> > > This is perl, v5.8.5 built for x86_64-linux-thread-multi
> > >
> >

--
Jonathan Leffler <[EMAIL PROTECTED]>  #include <disclaimer.h>
Guardian of DBD::Informix - v2005.02 - http://dbi.perl.org
"I don't suffer from insanity - I enjoy every minute of it."

 ------------------------------
 If you are not an intended recipient of this e-mail, please notify the
sender, delete it and do not read, act upon, print, disclose, copy, retain
or redistribute it. Click here <http://www.ml.com/email_terms/>for
important additional terms relating to this e-mail.
http://www.ml.com/email_terms/
 ------------------------------




--
Jonathan Leffler <[EMAIL PROTECTED]>  #include <disclaimer.h>
Guardian of DBD::Informix - v2005.02 - http://dbi.perl.org
"I don't suffer from insanity - I enjoy every minute of it."

Reply via email to