Re: DBD::Oracle 1.72 fail

2014-04-16 Thread H.Merijn Brand
On Tue, 15 Apr 2014 13:38:38 +0200, H.Merijn Brand
h.m.br...@xs4all.nl wrote:

 Builds fail on Linux with OIC-12.1

tl;dr; if you are not interested in porting DBD::Oracle

I have now installed/gathered the available stuff for HP-UX Itanium
64bit, moved all into the required locations and tried to build
DBD::Oracle

Using rpm's on Linux is straightforward, and all works immediately
after that. On HP-UX, one has to move the files a bit after extracting
the following zips:

 instantclient-basic-hpux.ia64-12.1.0.1.0.zip
 instantclient-jdbc-hpux.ia64-12.1.0.1.0.zip
 instantclient-odbc-hpux.ia64-12.1.0.1.0.zip
 instantclient-sdk-hpux.ia64-12.1.0.1.0.zip
 instantclient-sqlplus-hpux.ia64-12.1.0.1.0.zip
 instantclient-tools-hpux.ia64-12.1.0.1.0.zip
 instantclient-precomp-hpux.ia64-12.1.0.1.0.zip

I added tnsping from the 10.2 database product (and the two required
messgae files). The Instant Client seems to work:

DBD-Oracle-1.72-2g6rU8 511  tnsping $TWO_TASK

TNS Ping Utility for HPUX: Version 10.2.0.1.0 - Production on 16-APR-2014 
10:38:17

Copyright (c) 1997, 2005, Oracle.  All rights reserved.

Used parameter files:
/pro/oracle/ic121/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact ( DESCRIPTION = ( ADDRESS_LIST = ( ADDRESS = ( HOST = 
dbo)( PORT = 1521)( PROTOCOL = TCP))) ( CONNECT_DATA = ( SERVICE_NAME = 
xxx0123)))
OK (210 msec)

DBD-Oracle-1.72-2g6rU8 512  sqlplus $ORACLE_USERID

SQL*Plus: Release 12.1.0.1.0 Production on Wed Apr 16 10:40:49 2014

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL

So far so good. I had to read Makefile.PL to check what it expects
where, as all those zips install in different locations. The final
SUCCESS for that stage results in

DBD-Oracle-1.72-2g6rU8 520  perl Makefile.PL
Using DBI 1.631 (for perl 5.014002 on IA64.ARCHREV_0-LP64-ld) installed in 
/pro/lib/perl5/site_perl/5.14.2/IA64.ARCHREV_0-LP64-ld/auto/DBI/

Configuring DBD::Oracle for perl 5.014002 on hpux (IA64.ARCHREV_0-LP64-ld)

Remember to actually *READ* the README file! Especially if you have any 
problems.

Installing on a hpux, Ver#11.31
Using Oracle in /pro/oracle/ic121
DEFINE _SQLPLUS_RELEASE = 1201000100 (CHAR)
Oracle version 12.1.0.1 (12.1)
Looks like an Instant Client installation, okay
Your LD_LIBRARY_PATH/SHLIB_PATH env var is set to 
'/pro/oracle/ic121/lib:/pro/local/lib:/usr/local/ssl/lib:/pro/pgsql/lib:/usr/local/lib:/usr/lib/hpux64:/usr/lib:/pro/pgsql/lib:/etc/opt/resmon/lib:/opt/gnome/lib:/usr/local/ia64/lib/hpux64'
WARNING: Your LD_LIBRARY_PATH/SHLIB_PATH env var doesn't include 
'/pro/oracle/ic121' but probably needs to.
Oracle sysliblist:
Found header files in /pro/oracle/ic121/sdk/include.

client_version=12.1


DEFINE= -DUTF8_SUPPORT -DORA_OCI_VERSION=\12.1.0.1\ -DORA_OCI_102 
-DORA_OCI_112

WARNING: If you have trouble, see README.hpux.txt...
you may have to build your own perl, or go hunting for libraries
WARNING: If you have trouble, try perl Makefile.PL -l

Checking for functioning wait.ph


System: perl5.014002 hp-ux x2 b.11.31 u ia64 2977233888 unlimited-user license
Compiler:   cc +O2 +Onolimit  -Ae -DPERL_DONT_CREATE_GVSV +Z -z -D_HPUX_SOURCE 
-Wl,+vnocompatwarnings +DD64 -I/pro/local/include -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64
Linker: /usr/bin/ld
Sysliblist:
Linking with -lclntsh.


WARNING: If you have problems you may need to rebuild perl with threading 
enabled.
LD_RUN_PATH=/pro/oracle/ic121
Using DBD::Oracle 1.72.
Using DBD::Oracle 1.72.
Using DBI 1.631 (for perl 5.014002 on IA64.ARCHREV_0-LP64-ld) installed in 
/pro/lib/perl5/site_perl/5.14.2/IA64.ARCHREV_0-LP64-ld/auto/DBI/
Generating a Unix-style Makefile
Writing Makefile for DBD::Oracle
Writing MYMETA.yml and MYMETA.json

***  If you have problems...
 read all the log printed above, and the README and README.help.txt files.
 (Of course, you have read README by now anyway, haven't you?)


Next, building …

cc -c  -I/pro/oracle/ic121/sdk/include 
-I/pro/lib/perl5/site_perl/5.14.2/IA64.ARCHREV_0-LP64-ld/auto/DBI -Ae 
-DPERL_DONT_CREATE_GVSV +Z -z -D_HPUX_SOURCE -Wl,+vnocompatwarnings +DD64 
-I/pro/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 +O2 +Onolimit   
-DVERSION=\1.72\ -DXS_VERSION=\1.72\ +Z 
-I/pro/lib/perl5/5.14.2/IA64.ARCHREV_0-LP64-ld/CORE  -DUTF8_SUPPORT 
-DORA_OCI_VERSION=\12.1.0.1\ -DORA_OCI_102 -DORA_OCI_112 dbdimp.c
/pro/lib/perl5/5.14.2/IA64.ARCHREV_0-LP64-ld/CORE/regexp.h, line 329: warning 
#2111-D:
  statement is unreachable
  return ?;   /* Unknown */
  ^

dbdimp.c, line 736: warning #2181-D: argument is incompatible with
  corresponding format string conversion
  strlen(uid),
  ^

dbdimp.c, line 738: warning #2181-D: argument is incompatible with
  corresponding format 

dynamic LD_LIBRARY_PATH

2014-04-16 Thread H.Merijn Brand
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 :( :(

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:

 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