.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "DBD::Oracle::Troubleshooting::Hpux 3pm" .TH DBD::Oracle::Troubleshooting::Hpux 3pm 2024-01-13 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME DBD::Oracle::Troubleshooting::Hpux \- Tips and Hints to Troubleshoot DBD::Oracle on HP\-UX .SH VERSION .IX Header "VERSION" version 1.83 .SH INTRODUCTION .IX Header "INTRODUCTION" Building a working dynamically linked version of the Oracle DBD driver on HP-UX (11.00) has been a challenge for many. For months after taking a new job, where HP-UX was the standard database server environment, I had only been able to build a statically linked version of Perl and the DBD-Oracle module on HP-UX 11.00. .PP Then Roger Foskett posted instructions for what turned out to be dynamic build. Rogers's post got me further than I had previously gotten. In fact, after resolving some undefined symbol errors, I succeeded where for I had previously despaired of finding the time to hack out the right incantation. .PP This document describes the combined knowledge of a number of folks who invested many hours discovering a working set of build options. The instructions in this file, which include building Perl from source, will produce a working dynamically linked DBD-Oracle that can be used with mod_perl and Apache. .PP See APPENDICES for exact build configurations used by me an others. .PP For HPUX 11 on Itanium see also http://www.nntp.perl.org/group/perl.dbi.users/23840 .SH "First things First: Introduction" .IX Header "First things First: Introduction" The reason you are even reading this file is because you want to connect to an Oracle database from your perl program using the DBD::Oracle DBI driver. So before you start, install (at least the Oracle client software) (SQL*Net, Pro*C, SQL*Plus) upon the machine you intend to install Perl/DBI/DBD\-Oracle. You \fBdo not\fR, I repeat, \fIdo not\fR need to build a database on this machine. .PP After you have installed the Oracle client software, \fBtest it!\fR. Make sure you can connect to the target database using SQL*Plus (or any other Oracle supplied tool). The (gory) details of the install are beyond the scope of this document, some information can be found in the section "Compiling on a Client Machine", or see your friendly Oracle DBA. .PP One final remark, 3 years after this was first written. This has been updated numerous times over the years. And some of the new build recipe's see simpler than some of the original instructions in this file. .PP I think one reason the recipe is getting simpler may be that the build hints, in the base perl build have gotten more right, as we have moved from perl 5.6.1 to the 5.8.8 (now the stable version). .PP Someday, if I ever find myself building on HP again I should probably update as many of these recipes (that I can test) by trying to remove more of the special case stuff I have in my build scripts now. Gram Ludlows's build for the default bundled C compiler shows that a lot of this may no longer be necessary. .PP On the other hand, it would be bad if we deleted information that others might need, so I err on the side of too much, in the hope that the person who really needs the information, will not have to look beyond this file. .PP .Vb 1 \& \-\- Lincoln .Ve .SH "Build your own Perl" .IX Header "Build your own Perl" HP's default Perl is no good (and antique). .PP By default, HP-UX 11.00 delivered Perl 5.00503 until September 2001. Others tell me that the default is a threaded GNUpro build of 5.6.1. This is not what I found on our systems, and it probably depends on which packages you install. In any case, this version of Perl delivered by HP will in all likelihood not work. Before you check, be sure to prevent the perl4 located in /usr/contrib/bin from being the first Perl version found in your \f(CW$PATH\fR. .PP As of application release September 2001, HP-UX 11.00 is shipped with Perl\-5.6.1 in /opt/perl. The first occurrence is on CD 5012\-7954. The build is a portable hppa\-1.1 multithread build that supports large files compiled with gcc\-2.9\-hppa\-991112. When you have a modern system with a hppa\-2.0 architecture (PA8xxx processor) and/or the HP C\-ANSI-C compiler consider building your own Perl, which will surely outperform this version. .PP If you are reading this, you have probably discovered that something did not work. To get a working version of the DBD-Oracle driver, we have to start with a Perl that as been built with the correct compiler flags and shared libraries. This means that you must build your own version of Perl from source. .PP The instructions below have been used for building a dynamically linked working DBD-Oracle driver that works with mod_perl and Apache. These instructions are based on Perl 5.6.0 and 5.6.1, and 5.8.0. To this author's knowledge, they have not be tested on earlier versions of Perl. .PP Note that is important to build a \fBnon\fR\-threaded Perl, but linked with \&\-lcl and \-lpthread. Since Oracle on HP uses libpthread, everything that dynamically loads it (such as DBD-Oracle) must be built/linked with '\-lpthread \-lcl'. (When used with Apache, it and any associated modules must also be built this way \- otherwise all it does is core dump when loading DBD::Oracle). .PP A good link that explains thread local storage problems is http://my1.itrc.hp.com/cm/QuestionAnswer/1,1150,0x0d0a6d96588ad4118fef0090279cd0f9!0,00.html .PP One more note, it would appear that the README.hpux in the Perl 5.8.0 directory, is somewhat out of date, but is up-to-date in versions 5.8.3 and up. H.Merijn Brand points out that Perl \fIis\fR 64bit compliant when the \-Duse64bitall flag is used to Configure. While Perl will be built in a pure LP64 environment via the +DD64 flag is used, the +DA2.0w flag is preferred on PA-RISC, and when an incantation can be concocted that eliminates the noisy warnings the produces at link time, this will probably become the default. Older 64bit versions of GCC, are known to be unable to build a good LP64 perl. And these flags will cause gcc to barf. On HP-UX 11i (11.11), gcc\-3.4.4 or gcc\-3.4.5 is preferred over gcc\-4.0.2 (or older gcc\-4 versions) as 64bit builds on PA-RISC with that versions of the compiler are unreliable. .SH Compilers .IX Header "Compilers" .SS "HP Softbench Compiler" .IX Subsection "HP Softbench Compiler" Both Roger Foskett, I and most others have been using the HP Softbench C compiler normally installed in: .PP .Vb 1 \& /opt/softbench/bin/cc. .Ve .PP While the DBD-Oracle \fIMakefile.PL\fR checks for some of the conditions which, when met, we know will produce a working build, there are many variations of Oracle installations and features. Not all of these can be tested by any one of us, if you discover a way to make a variation which did not previously work, please submit patches to the Makefile.PL to Tim Bunce, and patches to this README to me, and I will incorporate them into the next README. .PP The instructions herein, have compiled, linked cleanly, and tested cleanly using the HP softbench compiler, and Oracle 8.0.5 (32bit), and Oracle 8.1.6, 8.1.7 (64 bit). Oracle 8.1.5 will probably work as well. .PP Oracle 8.1.7.4 (32bit) with DBI\-1.35 and DBD\-Oracle\-1.13 has been proven to work on HP-UX 11.00 (64bit) with Perl 5.6.1, Perl 5.8.x using the guidelines in this document for both HP-C-ANSI-C and gcc\-3.2. Later versions have been proven to work as well. Current DBI\-1.42 and DBD\-Oracle\-1.16 have been proven to work. This Oracle 9.2 client (at least) should be used if you plan to do work with Unicode. See the DBD-Oracle POD/Man documentation. .SS "gcc Compiler" .IX Subsection "gcc Compiler" As of gcc\-3.4, perl\-5.8.3 and up should build out-of-the box when Configure is invoked with \-Dcc=gcc. Please read README.hpux carefully for the differences with HP C\-ANSI-C. Once built, tested and installed, both DBI and DBD-Oracle should be able to build against that perl without trouble. .PP In the past, Waldemar Zurowski and Michael Schuh sent useful information about builds of Perl with DBD-Oracle using gcc on HP-UX. Both were able to get working executables, and their explanations shed much light on the issues. .PP Waldemar's build is described in "Appendix A", and Michael's is described in "Appendix C". .PP While I have not reproduced either of these configurations, I believe the information is complete enough (particularly in the aggregate) to be helpful to others who might wish to replicate it. .SS "The ""default"" built in compiler 64bit build (/usr/bin/cc)" .IX Subsection "The ""default"" built in compiler 64bit build (/usr/bin/cc)" And now, at long last, we have a recipe for building perl and DBD-Oracle using the default bundled C compiler. Please see the "Appendix B" build instructions provided by Gram Ludlow, using the default /usr/bin/cc bundled compiler. Please note that perl itself will \fINOT\fR build using that compiler. .SS "Configure (doing it manually)" .IX Subsection "Configure (doing it manually)" Once you have downloaded and unpacked the Perl sources (version 5.8.8 assumed here), you must configure Perl. For those of you new to building Perl from source, the Configure program will ask you a series of questions about how to build Perl. You may supply default answers to the questions when you invoke the Configure program by command line flags. .PP We want to build a Perl that understands large files (over 2GB, which is the default for building perl on HP-UX), and that is incompatible with v5.005 Perl scripts (compiling with v5.005 compatibility causes mod_perl to complain about malloc pollution). At the command prompt type: .PP .Vb 2 \& cd perl\-5.8.8 \& sh ./Configure \-A prepend:libswanted=\*(Aqcl pthread \*(Aq \-des .Ve .PP or, if you need a 64bit build .PP .Vb 1 \& sh ./Configure \-A prepend:libswanted=\*(Aqcl pthread \*(Aq \-Duse64bitall \-des .Ve .PP Do not forget the trailing space inside the single quotes. This is also described by H.Merijn Brand in the README.hpux from the perl core distribution. .PP When asked: .PP .Vb 2 \& Any additional cc flags? \- Answer by prepending: I<+Z> to enable \& position independent code. \& \& For example: \& Any additional cc flags? [\-D_HP\-UX_SOURCE \-Aa] \-Ae +Z \-z .Ve .PP Though this should be the default in more recent perl versions. .PP Lastly, and this is optional, when asked: .PP .Vb 1 \& Do you want to install Perl as /usr/bin/perl? [y] n \& \& You may or may not want to install directly in /usr/bin/perl, \& many persons on HP install Perl in /opt/perl/bin/perl and \& put a symbolic link to /usr/bin/perl. Furthermore, you can supply \& the answer to this question by adding an additional switch to the \& invocation of Configure such as: Configure \-Dprefix=/opt/perl .Ve .PP After you have answered the above questions, accept the default values for all of the remaining questions. You may press for each remaining question, or you may enter "& \-d" (good idea) at the next question and the Configure will go into auto-pilot and use the Perl supplied defaults. .PP BTW: If you add \-lcl and \-lpthread to the end of the list it will not work. I wasted a day and a half trying to figure out why I had lost the recipe, before I realized that this was the problem. The symptom will be that .PP .Vb 1 \& make test .Ve .PP of Perl itself will fail to load dynamic libraries. .PP You can check in the generated 'config.sh' that the options you selected are correct. If not, modify config.sh and then re-run ./Configure with the '\-d' option to process the config.sh file. .PP Build & Install .PP .Vb 3 \& make \& make test \& make install .Ve .PP If you are going to build mod_perl and Apache it has been suggested that you modify Config.pm to the change the HP-UX ldflags & ccdlflags in \&\fI/your/install/prefix/lib/5.6.0/PA\-RISC2.0/Config.pm\fR as follows: .PP .Vb 3 \& ccdlflags=\*(Aq\*(Aq \& cccdlflags=\*(Aq+Z\*(Aq \& ldflags=\*(Aq \-L/usr/local/lib\*(Aq .Ve .PP This is not necessary if you are not using mod_perl and Apache. .SH "Build and Install DBI" .IX Header "Build and Install DBI" .Vb 5 \& cd DBI\-1.50 \& Perl Makefile.PL \& make \& make test \& make install .Ve .SH "Build and Install DBD\-Oracle\-1.07 and later" .IX Header "Build and Install DBD-Oracle-1.07 and later" It is critical to setup your Oracle environmental variables. Many people do this incorrectly and spend days trying to get a working version of DBD-Oracle. Below are examples of a local database and a remote database (i.e. the database is on a different machine than your Perl/DBI/DBD installation) environmental variable setup. .PP Example (local database): .PP .Vb 5 \& export ORACLE_USERID= \& export ORACLE_HOME= \& export ORACLE_SID= \& export SHLIB_PATH=$ORACLE_HOME/lib #for 32bit HP \& export LD_LIBRARY_PATH=$ORACLE_HOME/lib #for 64bit HP (I defined them both) .Ve .PP Note that HP-UX supports \fIboth\fR SHLIB_PATH \fIand\fR LD_LIBRARY_PATH for all libraries that need to be found, but that each library itself can enable or disable any of the two, and can also set preference for the order they are used, so please set them to the same value. .PP Example (remote database): .PP .Vb 5 \& export ORACLE_USERID= \& export ORACLE_HOME= \& export ORACLE_SID=@ \& export SHLIB_PATH=$ORACLE_HOME/lib #for 32bit HP \& export LD_LIBRARY_PATH=$ORACLE_HOME/lib #for 64bit HP (I defined them both) .Ve .PP The standard mantra now works out of the box on HP-UX: .PP .Vb 5 \& cd DBD\-Oracle\-1.07 # or more recent version \& perl Makefile.PL \& make \& make test \& make install # if all went smoothly .Ve .PP And with DBD\-1.14 and later the following can be used: .PP .Vb 5 \& cd DBD\-Oracle\-1.14 # or more recent version \& perl Makefile.PL \-l # uses a simple link to oracle\*(Aqs main library \& make \& make test \& make install # if all went smoothly .Ve .PP If you have trouble, see the "Trouble Shooting" instructions below, for hints of what might be wrong... and send me a note, describing your configuration, and what you did to fix it. .SH "Trouble Shooting" .IX Header "Trouble Shooting" .SS """Unresolved symbol""" .IX Subsection """Unresolved symbol""" In general, find the symbols, edit the Makefile, and make test. .PP You'll have to modify the recipe accordingly, in my case the symbol "LhtStrCreate" was unresolved. (Authors Note: thanks patch suggestions by Jay Strauss this situation which occurs with Oracle 8.1.6 should now be handled in Makefile.PL.) .PP 1) Find the symbols. .PP .Vb 3 \& a) The following ksh/bash code (courtesy of Roger) will search \& from $ORACLE_HOME and below for Symbols in files in lib directories. \& Save the following to a file called "findSymbol". \& \& >>>> CUT HERE <<<<< \& cd $ORACLE_HOME \& \& echo "\enThis takes a while, grepping a lot of stuff" \& echo " ignore the \e"no symbols\e" warnings\en" \& \& sym=$1; shift; \& libs="*.sl" \& \& for lib in $(find . \-name $libs \-print); do \& if nm \-p $lib | grep \-q $sym; then \& echo "found \e"$sym\e" in $lib" \& fi \& done \& >>>>> CUT HERE <<<< \& \& Note that on Itanium machines (HP\-UX 11.23), the shared libraries \& have a .so extension instead of the .sl HP\-UX uses on PA\-RISC. \& \& b) Run it (replace "LhtStrCreate" with your "Unresolved symbol"). \& For example, at my installation, findSymbols produced the \& following output: \& \& # chmod 755 findSymbols \& # ./findSymbol LhtStrCreate \& \& found "LhtStrCreate" in ./lib/libagtsh.sl \& found "LhtStrCreate" in ./lib/libclntsh.sl \& found "LhtStrCreate" in ./lib/libwtc8.sl .Ve .PP 2) Edit the Makefile .PP In the previous step your unresolved symbol was found in one or more library files. You will need to edit the OTHERLDFLAGS makefile macro, and add the missing libraries. .PP When you add those library files to OTHERLDFLAGS you must convert the name from the actual name to the notation that OTHERLDFLAGS uses. .PP .Vb 3 \& libclntsh.sl becomes => \-lclntsh \& libagtsh.sl becomes => \-lagtsh \& libwtc8.sl becomes => \-lwtc8 .Ve .PP That is, you replace the "lib" in the name to "\-l" and remove the ".sl" (or the .so). .PP You can edit the Makefile in 2 ways: .PP .Vb 1 \& a) Do this: \& \& perl \-pi \-e\*(Aqs/\eb(OTHERLDFLAGS.*$)/$1 \-lclntsh/\*(Aq Makefile \& \& b) Using vi, emacs... edit the file, find OTHERLDFLAGS, and add the \& above "\-l" entries to the end of the line. \& \& For example the line: \& OTHERLDFLAGS = \-L/opt/oracle/product/8.1.6/lib/... \-lqsmashr \& \& Becomes: \& OTHERLDFLAGS = \-L/opt/oracle/product/8.1.6/lib/... \-lqsmashr \-lclntsh .Ve .PP 3) make test .PP Perform a make test, if symbols are still unresolved repeat the editing of the Makefile and make test again. .SH DBD\-Oracle\-1.06 .IX Header "DBD-Oracle-1.06" You are strongly urged to upgrade. However here is what you may need to know to get it or work, if you insist on using an earlier version. .PP Check the output that above command produces, to verify that .PP .Vb 2 \& \-Wl,+n \& \-W1,+s .Ve .PP is b present. and that .PP .Vb 1 \& \-lqsmashr .Ve .PP \&\fBis\fR present. .PP If the version of Makefile.PL does not include the patch produced at the time of this document, then the above conditions will likely not be met. You can fix this as follows: .PP .Vb 1 \& perl \-pi \-e\*(Aqs/\-Wl,\e+[sn]//\*(Aq Makefile .Ve .SH "Building on a Oracle Client Machine" .IX Header "Building on a Oracle Client Machine" If you need to build or deliver the DBD-Oracle interface on or to a machine upon which the Oracle database has not been installed you need take the following into consideration: .IP "1) Oracle files are needed for DBD::Oracle to compile" 4 .IX Item "1) Oracle files are needed for DBD::Oracle to compile" .PD 0 .IP "2) Oracle files are needed for the compiled DBD to connect" 4 .IX Item "2) Oracle files are needed for the compiled DBD to connect" .IP "3) ORACLE_HOME environment variable must be set" 4 .IX Item "3) ORACLE_HOME environment variable must be set" .IP "4) SHLIB_PATH environment variable must be set" 4 .IX Item "4) SHLIB_PATH environment variable must be set" .PD .SS "Compiling on a Client Machine" .IX Subsection "Compiling on a Client Machine" This may seem obvious to some, but the Oracle software has to be present to compile and run DBD-Oracle. The best way to compile and install on a client machine, is to use the oracle installer to install the oracle (client) software locally. Install SQL*Net, Pro*C and SQL*Plus. After this some tests with SQL*Net (tnsping at a minimum) are an good idea. Make sure you can connect to your remote database, and everything works with Oracle before you start bashing your head into the wall trying to get DBD-Oracle to work. .PP If you do not have the Oracle installer handy, the following hack has been known to work: .PP Either open an NFS share from the oracle installation directory on the machine that has Oracle and point both of the above-mentioned env vars to that share, or alternatively copy the following four directories from your Oracle installation over to the machine on which you are compiling the DBD: .PP drwxr-xr-x 3 oracle dba 3072 Jul 3 09:36 lib drwxr-xr-x 13 oracle dba 512 Jul 3 09:38 network drwxr-xr-x 7 oracle dba 512 Jul 2 19:25 plsql drwxr-xr-x 12 oracle dba 512 Jul 3 09:38 rdbms .PP then point the above-mentioned env vars to the containing directory (good place to put them, if copying locally, might be /usr/lib/oracle, /usr/local/lib/oracle, or /opt/oracle/lib ) .PP In any case, the compiler needs to be able to find files in the above four directories from Oracle in order to get all the source code needed to compile properly. .SS "Required Runtime environment" .IX Subsection "Required Runtime environment" Again, use the Oracle installer to install the Oracle Client on the machine where your scripts will be running. If the Oracle installer is not available, the following hack should suffice: .PP For running the compiled DBD in Perl and connecting, you need only the files in the 'lib' folder mentioned above, either connecting to them through an NFS share on the Oracle machine, or having copied them directly onto the local machine, say, in /usr/lib/oracle . Make sure the env variable for ORACLE_HOME = /usr/lib/oracle and LD_LIBRARY_PATH includes /usr/lib/oracle . You can set the env var in your perl script by typing .PP .Vb 1 \& $ENV{ORACLE_HOME} = \*(Aq/usr/lib/oracle\*(Aq; .Ve .SH "Apache and mod_perl" .IX Header "Apache and mod_perl" \&\fBNota Bene:\fR these instructions are now more than a year and a half old, you may have to tinker. .PP If you are not building this version of Perl for Apache you can go on to build what ever other modules you require. The following instructions describe how these modules were built with the Perl/DBD\-Oracle built above: The following is what worked for Roger Foskett: .SH "Apache Web server" .IX Header "Apache Web server" .Vb 11 \& cd apache_1.3.14/ \& LDFLAGS_SHLIB_EXPORT="" \e \& LDFLAGS="\-lm \-lpthread \-lcl" \e \& CC=/usr/bin/cc \e \& CFLAGS="\-D_LARGEFILE_SOURCE \-D_FILE_OFFSET_BITS=64" \e \& ./configure \e \& \-\-prefix=/opt/www/apache \e \& \-\-enable\-shared=max \e \& \-\-disable\-rule=EXPAT \e \& \-\-enable\-module=info \e \& \-\-enable\-rule=SHARED_CORE .Ve .PP The Expat XML parser is disabled as it conflicts with the Perl XML-Parser module causing core dumps. \-lcl is needed to ensure that Apache does not coredump complaining about thread local storage .PP .Vb 2 \& make \& make install .Ve .PP Once installed, ensure that the generated httpd.conf is properly configured, change the relevant lines to below (the default user/group caused problems on HP (the user 'www' may need to be created) .PP .Vb 3 \& User www \& Group other \& port 80 .Ve .SS mod_perl .IX Subsection "mod_perl" .Vb 8 \& cd mod_perl\-1.24_01/ \& perl Makefile.PL \e \& NO_HTTPD=1 \e \& USE_APXS=1 \e \& WITH_APXS=/opt/www/apache/bin/apxs \e \& EVERYTHING=1 \& make \& make install .Ve .SS "htdig intranet search engine" .IX Subsection "htdig intranet search engine" .Vb 6 \& cd htdig\-3.1.5/ \& CC=\*(Aqcc\*(Aq CPP=\*(AqaCC\*(Aq \e \& ./configure \e \& \-\-prefix=/opt/www/htdig \e \& \-\-with\-cgi\-bin\-dir=/opt/www/htdig/cgi\-bin \e \& \-\-with\-image\-dir=/opt/www/htdig/images .Ve .SH CONTRIBUTORS .IX Header "CONTRIBUTORS" The following folks contributed to this document: .PP .Vb 11 \& Lincoln A. Baxter \& H.Merijn Brand \& Jay Strauss \& Roger Foskett \& Weiguo Sun \& Tony Foiani \& Hugh J. Hitchcock \& Heiko Herms \& Waldemar Zurowski \& Michael Schuh \& Gram M. Ludlow .Ve .PP And probably others unknown to me. .SH AUTHOR .IX Header "AUTHOR" .Vb 2 \& Lincoln A. Baxter \& H.Merijn Brand .Ve .SH APPENDICES .IX Header "APPENDICES" .SS "Appendix A" .IX Subsection "Appendix A" (gcc build info from Waldemar Zurowski) .PP This is pretty much verbatim the build information I received from Waldemar Zurowski on building Perl and DBD-Oracle using gcc on HP. Note that this build was on a PA\-RISC1.1 machine. .PP \fIHost\fR .IX Subsection "Host" .PP .Vb 1 \& HP\-UX hostname B.11.11 U 9000/800 XXXXXXXXX unlimited\-user license .Ve .PP \fIOracle\fR .IX Subsection "Oracle" .PP .Vb 1 \& Oracle 8.1.7 .Ve .PP \fIParameters to build Perl\fR .IX Subsection "Parameters to build Perl" .PP .Vb 4 \& ./Configure \-des \-Uinstallusrbinperl \-Uusethreads \-Uuseithreads \& \-Duselargefiles \-Dcc=gcc \-Darchname=PA\-RISC1.1 \-Dprefix=/opt/perl\-non\-thread \& \-Dlibs=\*(Aq\-lcl \-lpthread \-L${ORACLE_HOME}/JRE/lib/PA_RISC/native_threads \& \-ljava \-lnsl \-lnm \-lndbm \-ldld \-lm \-lc \-lndir \-lcrypt \-lsec\*(Aq .Ve .PP \&\-L${ORACLE_HOME}/JRE/lib/PA_RISC/native_threads \-ljava, was added because DBD::Oracle wants to link with it (probably due to Oracle's own build rules picked up by Makefile.PL) .PP Set environment variable LDOPTS to '+s' (see \fBld\fR\|(1)). This holds extra parameters to HP-UX's ld command, as I don't use GNU ld (does anybody?). This allows you to build an executable, which when run would search for dynamic linked libraries using SHLIB_PATH (for 32\-bit executable) and LD_LIBRARY_PATH (for 64\-bit executable). Obviously LDOPTS is needed only when building Perl _and_ DBI + DBD::Oracle. .PP Then, after building Perl + DBI + DBD::Oracle and moving it into production environment it was enough to add to SHLIB_PATH ${ORACLE_HOME}/lib and ${ORACLE_HOME}/JRE/lib/PA_RISC/native_threads, for example: .PP SHLIB_PATH=${ORACLE_HOME}/lib:${ORACLE_HOME}/JRE/lib/PA_RISC/native_threads: \&\f(CW$SHLIB_PATH\fR .PP Please note output of ldd command: .PP .Vb 11 \& $ ldd \-s ./perl \& [...] \& find library=/home/ora817/JRE/lib/PA_RISC/native_threads/libjava.sl; \& required by ./perl \& search path=/home/ora817/lib:/home/ora817/JRE/lib/PA_RISC/native_threads \& (SHLIB_PATH) \& trying path=/home/ora817/lib/libjava.sl \& trying path=/home/ora817/JRE/lib/PA_RISC/native_threads/libjava.sl \& /home/ora817/JRE/lib/PA_RISC/native_threads/libjava.sl => \& /home/ora817/JRE/lib/PA_RISC/native_threads/libjava.sl \& [...] .Ve .PP All of this mess is necessary because of weakness of shl_load(3X), explained in this document and in some discussion forums at HP.com site. I have learned, that HP issued patch PHSS_24304 for HP-UX 11.11 and PHSS_24303 for HP-UX 11.00, which introduced variable LD_PRELOAD. I haven't tried it yet, but it seems promising that it would allow you to completely avoid building your own Perl binary, as it would be enough to set LD_PRELOAD to libjava.sl (for example) and all \&'Cannot load XXXlibrary' during building of DBD::Oracle should be gone. .PP The documentation says, that setting this variable should have the same effect as linking binary with this library. Also please note, that this variable is used only when binary is not setuid nor setgid binary (for obvious security reasons). .PP It seems, that the best way to find out if you already have this patch applied, is to check if 'man 5 dld.sl' says anything about LD_PRELOAD environment variable. .PP Best regards, .PP Waldemar Zurowski .PP Authors Note: Search for references to LD_PRELOAD else where in this document. Using LD_PRELOAD is probably a fragile solution at best. Better to do what Waldemar actually did, which is to include libjava in the extra link options. .SS "Appendix B" .IX Subsection "Appendix B" (64 bit build with /usr/bin/cc \-\- bundled C compiler) .PP Gram M. Ludlow writes: .PP I recently had a problem with Oracle 9 64\-bit on HPUX 11i. We have another application that required SH_LIBRARY_PATH to point to the 64\-bit libraries, which "broke" the Oraperl module. So I did some research and successfully recompiled and re-installed with the most recent versions of everything (perl, DBI, DBD) that works with 64\-bit shared libraries. This is the error we were getting (basically) "/usr/lib/dld.sl: Bad magic number for shared library: /ora1/app/oracle/product/9.2.0.1.0/lib32" .PP Here is my step-by-step instructions, pretty much what you have but streamlined for this particular case. .PP Required software: .PP .Vb 5 \& HPUX 11.11 (11i) PA\-RISC \& perl 5.8.4 source \& DBI\-1.42 source \& DBD\-Oracle\-1.16 source \& Oracle 9.2.0.1.0 installation .Ve .IP "Step 1: Compiling Perl" 4 .IX Item "Step 1: Compiling Perl" This compiles PERL using the default HPUX cc compiler. The important things to note here are the configure parameters. the only non-default option to take is to add "+z" to the additional cc flags step. .Sp .Vb 4 \& gunzip perl\-5.8.4.tar.gz \& tar \-xf perl\-5.8.4.tar \& cd perl\-5.8.4 \& ./Configure \-Ubincompat5005 \-Duselargefiles \-A prepend:libswanted=\*(Aqcl pthread \*(Aq \-Duse64bitall .Ve .Sp Any additional cc flags? Add +z to beginning of list, include all other options. .Sp .Vb 1 \& make; make test .Ve .Sp 98% of tests should succeed. If less, something is wrong. .IP "Step 2: DBI" 4 .IX Item "Step 2: DBI" .Vb 6 \& gunzip DBI\-1.42.tar.gz \& tar \-xvf DBI\-1.42.tar \& cd DBI\-1.42 \& perl Makefile.PL \& make;make test \& make install .Ve .IP "Step 3: Install DBD-Oracle" 4 .IX Item "Step 3: Install DBD-Oracle" First, set the following environment variables specific you your Oracle installation: .Sp .Vb 3 \& export ORACLE_USERID=user/pass \& export ORACLE_HOME=/oracle/product/9.2.0.1.0 \& export ORACLE_SID=orap1 .Ve .Sp Then unpack and build: .Sp .Vb 6 \& gunzip DBD\-Oracle\-1.16.tar.gz \& tar \-xvf DBD\-Oracle\-1.16.tar \& cd DBD\-Oracle\-1.16 \& perl Makefile.PL \-l \& make;make test \& make install .Ve .PP Note from H.Merijn Brand: In more recent perl distributions using HP C\-ANSI-C should "just work" (TM), provided your C compiler can be found and used, your database is up and running, and your environment variables are set as noted. Example is for a 64bit build, as Oracle ships Oracle 9 and up for HP-UX only in 64bit builds. .PP .Vb 6 \& gzip \-d .IP \(bu 4 John Scoles .IP \(bu 4 Yanick Champoux .IP \(bu 4 Martin J. Evans .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2022, 2021, 2019, 2014, 2013, 2012, 2011, 2010 by Tim Bunce. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.