Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Trouble exporting LD_LIBRARY_PATH

0 views
Skip to first unread message

Shah

unread,
Sep 29, 2005, 10:49:52 PM9/29/05
to dbi-...@perl.org
Setting: Perl 5.8.2 on Solaris 9

We need to set these 2 environment variables from Perl:

$ENV{DB2INSTANCE} = 'db2inst3';
$ENV{LD_LIBRARY_PATH} = '/export/home/db2inst3/sqllib/lib';

We even tried enclosing them in a BEGIN block, but we're getting:

install_driver(DB2) failed: Can't load
'/usr/iw-home/iw-perl/site/lib/auto/DBD/DB2/DB2.so' for module DBD:DB2:
ld.so.1: /usr/iw-home/iw-perl/bin/perl: fatal: libdb2.so.1: open failed: No
such file or directory at /usr/iw-home/iw-perl/lib/DynaLoader.pm line 229.
at (eval 6) line 3
Compilation failed in require at (eval 6) line 3.
Perhaps a required shared library or dll isn't installed where expected
at /usr/iw-home/custom/lib/dbAccess.pm line 62

In dbAccess.pm. just before issuing DBI->connect, we've added some logging
information, which shows:

key: |LD_LIBRARY_PATH| value: |/export/home/db2inst3/sqllib/lib|
key: |DB2INSTANCE| value: |db2inst3|

Issuing LD_LIBRARY_PATH=/export/home/db2inst3/sqllib/lib from the command
line results in the same error (at least some of the time), but the log
shows that LD_LIBRARY_PATH is correctly set.

However, issuing export LD_LIBRARY_PATH=/export/home/db2inst3/sqllib/lib
from the command line and running our test script works every time. So how
do we export those environment variables from Perl?

Incidentally, last week the following was causing trouble:

$ENV{'DB2INSTANCE'} = 'db2inst3';
$ENV{'LD_LIBRARY_PATH'} = '/export/home/db2inst3/sqllib/lib';

Note the single-quotes on the left side. Removing them worked (last week).
But not today. Double-quotes or no quotes ain't making a difference.

Looks like things stopped working without any changes to the Perl code. The
PATH changed, I think, but setting it to nothing didn't help. Incidentally,
which binary should be referring to LD_LIBRARY_PATH and loading libdb2.so.1?
Although, why would simply exporting LD_LIBRARY_PATH from the command line
make our test script work?

Any ideas?

Thanks,

S.


pe...@renee-baecker.de

unread,
Sep 30, 2005, 6:53:54 AM9/30/05
to Shah, dbi-...@perl.org
It seems that your DBD::DB2-installation does not work. Reinstall
DBD::DB2 via
perl -MCPAN -le "install DBD::DB2"

regards,
Renée

Am 30.09.2005 um 04:49 Uhr haben Sie geschrieben:

Ron Reidy

unread,
Sep 30, 2005, 10:20:13 AM9/30/05
to Shah, dbi-...@perl.org
Your library path needs to include $ORACLE_HOME/lib at a minimum.
--
Ron Reidy
Lead DBA
Array BioPharma, Inc.

However, issuing export LD_LIBRARY_PATH=/export/home/db2inst3/sqllib/lib

Any ideas?

Thanks,

S.

This electronic message transmission is a PRIVATE communication which contains
information which may be confidential or privileged. The information is intended
to be for the use of the individual or entity named above. If you are not the
intended recipient, please be aware that any disclosure, copying, distribution
or use of the contents of this information is prohibited. Please notify the
sender of the delivery error by replying to this message, or notify us by
telephone (877-633-2436, ext. 0), and then delete it from your system.

Ron Reidy

unread,
Sep 30, 2005, 10:22:20 AM9/30/05
to Reidy, Ron, Shah, dbi-...@perl.org
Ignore this - It is way too early after a long night of patching and I
have Oracle on the brain.

My apologies.

Tim Bunce

unread,
Sep 30, 2005, 11:19:38 AM9/30/05
to Shah, dbi-...@perl.org
On Thu, Sep 29, 2005 at 07:49:52PM -0700, Shah wrote:
> Setting: Perl 5.8.2 on Solaris 9
>
> We need to set these 2 environment variables from Perl:
>
> $ENV{DB2INSTANCE} = 'db2inst3';
> $ENV{LD_LIBRARY_PATH} = '/export/home/db2inst3/sqllib/lib';
>
> We even tried enclosing them in a BEGIN block, but we're getting:

LD_LIBRARY_PATH needs to be set before the process starts.

Tim.

0 new messages