Re: dynamic LD_LIBRARY_PATH

2014-04-16 Thread H.Merijn Brand
On Wed, 16 Apr 2014 17:06:19 +0200, H.Merijn Brand
h.m.br...@xs4all.nl wrote:

 I have a situation where the default location for Oracle ($ORACLE_HOME)
 is pointing to a complete Oracle-10g database environment. That setting
 includes $LD_LIBRARY_PATH (and on HP-UX $SHLIB_PATH)
 
 That environment is used for 3gl, 4gl and perl
 
 So far so good.
 
 Oracle's 10g libraries cause a crash when used in perl scripting when
 DBD::Oracle is used in the same script as Net::SSLeay (OpenSSL-1.0.1g)
 
 If I install Oracle Instant Client 12.1 (/pro/oracle/ic121) alongside
 Enterprise 10g (/pro/oracle/v102) and set ORACLE_HOME related environ
 to /pro/oracle/ic121 et all, DBD::Oracle-1.70 works, even with OpenSSL
 
 When I however work in the default 10g environment, DBD::Oracle cannot
 connect, as the LD_LIBRARY_PATH eventually loads libons.so from 10g
 
 Oracle decided to make *most* libraries have version numbers in the
 names, but did not do that for libons.so (libnnz12.so is obviously a
 different lib than libnnz10.so)
 
 I so far found no workaround in this deadlock, as I have only .so files
 and no .a files, so I cannot include the .so's in the generated build
 for Oracle.so
 
 What I now would like to do, is to change LD_LIBRARY_PATH and
 SHLIB_PATH *just before* the Oracle.so starts loading. That way, I can
 just put the shared libs that belong to DBD::Oracle next to Oracle.so
 
 if I change Oracle.pm to start with
 --8---
 BEGIN {
 use Config;
 (my $loc = $INC{DBD/Oracle.pm}) =~
   s{/DBD/Oracle.pm$}{/$Config{archname}/auto/DBD/Oracle};
 $ENV{LD_LIBRARY_PATH} = $oloc:$ENV{LD_LIBRARY_PATH};
 $ENV{SHLIB_PATH}  = $oloc:$ENV{SHLIB_PATH};
 }
 --8---
 
 I am still too late :( :(

even then I get conflicts with 10g:

$ env 
LD_LIBRARY_PATH=/pro/asql/o83R/lib/perl/5.14.2/IA64.ARCHREV_0-LP64-ld/auto/DBD/Oracle:/pro/oracle/ic12
 1/lib:$LD_LIBRARY_PATH 
SHLIB_PATH=/pro/asql/o83R/lib/perl/5.14.2/IA64.ARCHREV_0-LP64-ld/auto/DBD/Oracle:/pro/oracle/ic121/lib:$SHLIB_PATH
 qs
c f parm
/pro/asql/o83R/lib/perl/5.14.2/IA64.ARCHREV_0-LP64-ld/auto/DBD/Oracle at 
/pro/asql/o83R/lib/perl/5.14.2/DBD/Oracle.pm line 16.
DBI connect('','PROBEV',...) failed: ERROR OCIEnvNlsCreate. Check ORACLE_HOME 
(Linux) env var  or PATH (Windows) and or NLS settings, permissions, etc. at 
/pro/lib/perl5/site_perl/5.14.2/IA64.ARCHREV_0-LP64-ld/PROCURA/DBD.pm line 335.

 I found no commands on HP-UX that alter the embedded library path of
 existing libraries (then I could change that in a copy to the location
 of installation on installation and disable the use of LD_LIBRARY_PATH
 and SHLIB_PATH for those)
 
 Has anybody else encountered problems like this?
 
 Any workarounds?
 
 


-- 
H.Merijn Brand  http://tux.nl   Perl Monger  http://amsterdam.pm.org/
using perl5.00307 .. 5.19   porting perl5 on HP-UX, AIX, and openSUSE
http://mirrors.develooper.com/hpux/http://www.test-smoke.org/
http://qa.perl.org   http://www.goldmark.org/jeff/stupid-disclaimers/


Re: dynamic LD_LIBRARY_PATH

2014-04-16 Thread H.Merijn Brand
On Wed, 16 Apr 2014 17:06:19 +0200, H.Merijn Brand
h.m.br...@xs4all.nl wrote:

 if I change Oracle.pm to start with
 --8---
 BEGIN {
 use Config;
 (my $loc = $INC{DBD/Oracle.pm}) =~
   s{/DBD/Oracle.pm$}{/$Config{archname}/auto/DBD/Oracle};
 $ENV{LD_LIBRARY_PATH} = $oloc:$ENV{LD_LIBRARY_PATH};
 $ENV{SHLIB_PATH}  = $oloc:$ENV{SHLIB_PATH};
 }
 --8---
 
 I am still too late :( :(

Now readable (I hope)

even then I get conflicts with 10g:

$ export 
LDLP=/pro/asql/o83R/lib/perl/5.14.2/IA64.ARCHREV_0-LP64-ld/auto/DBD/Oracle:/pro/oracle/ic121/lib
$ env LD_LIBRARY_PATH=$LDLP:$LD_LIBRARY_PATH SHLIB_PATH=$LDLP:$SHLIB_PATH 
script.pl
connect('','USER',...) failed: ERROR OCIEnvNlsCreate. Check ORACLE_HOME (Linux) 
env var  or PATH (Windows) and or NLS settings, permissions, etc.
at /pro/lib/perl5/site_perl/5.14.2/IA64.ARCHREV_0-LP64-ld/PROCURA/DBD.pm
line 335.

-- 
H.Merijn Brand  http://tux.nl   Perl Monger  http://amsterdam.pm.org/
using perl5.00307 .. 5.19   porting perl5 on HP-UX, AIX, and openSUSE
http://mirrors.develooper.com/hpux/http://www.test-smoke.org/
http://qa.perl.org   http://www.goldmark.org/jeff/stupid-disclaimers/


Re: dynamic LD_LIBRARY_PATH

2014-04-16 Thread Jan Dubois
On Wed, Apr 16, 2014 at 10:33 AM, Jan Dubois j...@activestate.com wrote:
 It's been probably 15 years ago, but for a similar problem with

p4 tells me it was 12 years ago...

Cheers,
-Jan