Read README.hpux (I've attached a recent one along with some other stuff).
Plus maybe http://www.google.com/search?as_epq=DBD%3A%3AOracle%3A+Exec+format+error Tim. On Tue, May 07, 2002 at 08:01:10AM -0400, Christopher G Tantalo wrote: > Hello everyone. I am just signed up to this list cause we have a problem with > DBI and the DBD:Oracle package. At this company, the admins, DBA's and us > programmers are all in separate groups, so it is hard to get things done. I > finally broke them down to install perl and a bunch of modules. I did not > oversee the installations, and now there is a problem. I am just trying to do a > simple program to see if they have the DBI/DBD stuff installed correctly with > the following: > #!/usr/local/bin/perl > use DBI; > > my $dbh1 = DBI->connect("dbi:Oracle:nssdev8","","") > or die "Cant connect to db: $DBI::errstr\n"; > > exit; > > And this is the error I get: > > $ ./dbtest2.pl > /usr/lib/dld.sl: Can't shl_load() a library containing Thread Local Storage: > /usr/lib/libpthread.1 > /usr/lib/dld.sl: Exec format error > install_driver(Oracle) failed: Can't load > '/opt/perl5/lib/site_perl/5.6.1/PA-RISC1.1/auto/DBD/Oracle/Oracle.sl' for module > DBD::Oracle: Exec format error at /opt/perl5/lib/5.6.1/PA-RISC1.1/DynaLoader.pm > line 206. > at (eval 1) line 3 > Compilation failed in require at (eval 1) line 3. > Perhaps a required shared library or dll isn't installed where expected > at ./dbtest2.pl line 5 > > Anyone have any insights as to what to do to fix this? They admin says that the > installation happened fine, but i suspect there might be warnings or some module > he did not install. Any help would be greatly appreciated. > Thanks in advance, > Chris > -- > ------------------------------- > Just Your Friendly Neighborhood > _SPIDEY_ >
=head1 INTRODUCTION Building a working dynamically linked version of the Oracle DBD driver on HPUX (11.00) has been a challenge for many. For months after taking a new job, where HPUX was the standard server environment, I had only been able to build a statically linked version of perl and the DBD-Oracle module on HPUX 11.00. Then Roger Foskett posted instructions for what turned out to be dynamic build. Rogers's post got me farther 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. This F<README.hpux> 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 sources, will produce a working dynamically linked DBD-Oracle that can be used with mod_perl and Apache. Both Roger Foskett and I have been using the HP softbench c compiler normally installed in: /opt/softbench/bin/cc. F<Makefile.PL> has been modified to check for some of the conditions which, when met, we know will produce a working build. However, 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 previous work, please submit patches to Makefile.PL to Tim Bunce, and patches to this README to Tim Bunce or me. 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. See appendices for my exact build configuration. =head1 First things First The reason you are even reading this file is because you want to connect to an Oracle database from your perl program. So before you start, install the Oracle client software (SQL*Net, Pro*C, SQL*Plus) upon the machine you intend to install Perl/DBI/DBD-Oracle. You DO NOT, I repeat, DO NOT need to install the Oracle database server on this machine. After you have installed the client software, TEST it: make sure you can connect to the target database using sqlplus (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" later in this document, or see your Oracle DBA. =head1 Build perl =head2 HP's default perl (probably no good) By default, HPUX 11.00 delivers perl 5.00503. This version of perl will probably not work. If you are reading this, you have probably discovered that something did not work. To get good 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. =head2 Build and Install the right Perl Generally, in order to get a version of the DBD-Oracle driver that works on HPUX you need to build your own version of perl from sources. These instructions have been used to 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. To this author's knowledge, they have not be tested on earlier versions of perl. It is important to build a B<non>-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 these must also be built this way - otherwise all it does is core dump when loading DBD::Oracle). A good link that explains thread local storage problems is http://my1.itrc.hp.com/cm/QuestionAnswer/1,1150,0x0d0a6d96588ad4118fef0090279cd0f9!0,00.html =head2 Configure Once you have downloaded and unpacked the perl sources (version 5.6.0 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. We want to build a Perl that understands large files (over 2GB), 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: cd Perl-5.6.0/ ./Configure -Ubincompat5005 -Duselargefiles As described in section "Building the right Perl", there are some modifications you must make during the Configure process When asked the question: What libraries to use? - Answer by prepending (i.e. at the beginning): -lcl -lpthread For example: What libraries to use? [-lnsl -lnm -lndbm -lmalloc -ldld -lm -lc -lndir -lcrypt -lsec] -lcl -lpthread -lnsl -lnm -lndbm -lmalloc -ldld -lm -lc -lndir -lcrypt -lsec When asked: Any additional cc flags? - Answer by prepending: +z For example: Any additional cc flags? [-D_HPUX_SOURCE -Aa] +z -D_HPUX_SOURCE -Aa Lastly, and this is optional, when asked: 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<version>/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 invokation of Configure such as: Configure -Dprefix=/opt/perl After you have answered the above questions, accept the default values for all of the remaining questions. You may press <Enter> 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. 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 make test of perl itself will fail to load dynamic libraries. 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. =item Build & Install make make test make install If you are going to build mod_perl and Apache it as beed suggested that you modify Config.pm to the change the HPUX ldflags & ccdlflags in F</your/install/prefix/lib/5.6.0/PA-RISC2.0/Config.pm> as follows: ccdlflags='' cccdlflags='+z' ldflags=' -L/usr/local/lib' This is not necessary if you are not using mod_perl and Apache. =head1 Build and Install DBI cd DBI-1.18/ perl Makefile.PL make make test make install =head1 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. Example (local database): export ORACLE_USERID=<validuser/validpasswd> export ORACLE_HOME=<path to oracle> export ORACLE_SID=<a valid instance> export ORACLE_USERID=<validuser/validpasswd> export SHLIB_PATH=$ORACLE_HOME/lib Example (remote database): export ORACLE_USERID=<validuser/validpasswd> export ORACLE_HOME=<path to oracle> export ORACLE_SID=<a valid instance>@<valid tnsnames.ora entry> export ORACLE_USERID=<validuser/validpasswd> export SHLIB_PATH=$ORACLE_HOME/lib The standard mantra now works out of the box on HPUX: cd DBD-1.07/ #or more recent version perl Makefile.PL make make test make install # if all went smoothly If you have trouble, go though the instructions below, for hints of what might be wrong... and send me a note, describing your configuration, and what you did to fix it. =head1 Trouble Shooting =head2 "Unresolved symbol" In general, find the symbols, edit the Makefile, and make test. You'll have to modify the recipe accordingly, in my case the symbol "LhtStrCreate" was unresolved. 1) Find the symbols. 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 "\nThis takes a while, grepping a lot of stuff" echo " ignore the \"no symbols\" warnings\n" sym=$1; shift; libs="*.sl" for lib in $(find . -name $libs -print); do if nm -p $lib | grep -q $sym; then echo "found \"$sym\" in $lib" fi done >>>>> CUT HERE <<<< 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 2) Edit the Makefile 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. When you add those library files to OTHERLDFLAGS you must convert the name from the actual name to the notation that OTHERLDFLAGS uses. libclntsh.sl becomes => -lclntsh libagtsh.sl becomes => -lagtsh libwtc8.sl becomes => -lwtc8 That is, you replace the "lib" in the name to "-l" and remove the ".sl" You can edit the Makefile in 2 ways: a) Do this: cat Makefile | sed 's/\(OTHERLDFLAGS.*$\)/\1 -lclntsh/' > Makefile.tmp mv Makefile.tmp 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 3) make test Perform a make test, if symbols are still unresolved repeat the editing of the Makefile and make test again. =head1 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. Check the output that above command produces, to verify that -Wl,+n -W1,+s is b<NOT> present. and that -lqsmashr B<is> present. If the version of Makefile.PL does not include the patch produced at the time of this README.hpux, then the above conditions will likely not be met. You can fix this as follows: cat Makefile | sed 's/-Wl,+[sn]//' > Makefile.tmp mv Makefile.tmp Makefile =head1 Building on a Oracle Client Machine If you need to build or deliver the DBD-Oracle interface on or to a machine on which Oracle has not been installed you need take into consideration the following: =over =item 1) Oracle files are needed for DBD::Oracle to compile =item 2) Oracle files are needed for the compiled DBD to connect =item 3) ORACLE_HOME environment variable must be set =item 4) SHLIB_PATH environment variable must be set =back =head2 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 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. If you do not have the Oracle installer handy, the follow hack has been know to work: 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: 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 then point the above-mentioned env vars to the containing directory (good place to put them, if copying locally, is /usr/lib/oracle) 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. =head2 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: 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 $ENV{'ORACLE_HOME'} = '/usr/lib/oracle'; =head1 Apache and mod_perl 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: =head1 Apache Web server cd apache_1.3.14/ LDFLAGS_SHLIB_EXPORT="" \ LDFLAGS="-lm -lpthread -lcl" \ CC=/usr/bin/cc \ CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" \ ./configure \ --prefix=/opt/www/apache \ --enable-shared=max \ --disable-rule=EXPAT \ --enable-module=info \ --enable-rule=SHARED_CORE 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 make make install Once installed, ensure that the generated httpd.conf is properly configured, change the relvant lines to below (the default user/group caused problems on HP (the user 'www' may need to be created) User www Group other port 80 =head2 mod_perl cd mod_perl-1.24_01/ perl Makefile.PL \ NO_HTTPD=1 \ USE_APXS=1 \ WITH_APXS=/opt/www/apache/bin/apxs \ EVERYTHING=1 make make install =head2 htdig intranet search engine cd htdig-3.1.5/ CC='cc' CPP='aCC' \ ./configure \ --prefix=/opt/www/htdig \ --with-cgi-bin-dir=/opt/www/htdig/cgi-bin \ --with-image-dir=/opt/www/htdig/images =head1 CONTRIBUTORS The following folks contributed to this README: Lincoln A. Baxter <[EMAIL PROTECTED] or [EMAIL PROTECTED]> Jay Strauss <[EMAIL PROTECTED]> Roger Foskett <[EMAIL PROTECTED]> Weiguo Sun <[EMAIL PROTECTED]> Tony Foiani <[EMAIL PROTECTED]> Hugh J. Hitchcock <[EMAIL PROTECTED]> Heiko Herms <[EMAIL PROTECTED]> And probably others unknown to me. =head1 AUTHOR Lincoln A. Baxter IT Solutions Delivery, Fleet Credit Card Services [EMAIL PROTECTED] or [EMAIL PROTECTED] Office: 215.444.7973 =head1 Appendix A (Miscellaneous links which might be usefull) Thanks to Tony Foiani for these references: =head2 http://marc.theaimsgroup.com/?l=perl-dbi&m=96040350416305&w=2 This link discusses older version of the DBI/DBD interface, so most of the code examples are probably no longer relevant. This was written by Jeff Okamoto at HP (the author of the README.hpux in the perl sources). And has some useful insights. =head2 http://www.sas.com/service/techsup/unotes/SN/001/001875.html This is a not from from the SAS support people documenting the LhtStrInsert() and LhtStrCreate() undefined symbols errors, and how to fix them in the Oracle makefiles. =head2 http://www.mail-archive.com/dbi-users%40isc.org/msg13967.html My employers web sniffer does not allow me browser this link (www.mail) in the URL. So I have no idea how helpful this might be. It might even be a link to my own posts. =head1 Appendix B (Perl Configuration Dumps) The following to sections provide full dumps of perl -V for three versions of perl that were successfully built and linked on HPUX 11.00. =head2 Lincoln Baxter's DBD-Oracle-1.07 Configuration Platform: osname=hpux, osvers=11.00, archname=PA-RISC2.0 uname='hp-ux dhdb108 b.11.00 u 9000800 612309363 unlimited-user license ' config_args='' hint=previous, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef Compiler: cc='cc', ccflags ='-D_HPUX_SOURCE -Aa -I/usr/local/include -DDEBUGGING -z', optimize='-O', cppflags='-D_HPUX_SOURCE -Aa -I/usr/local/include -DDEBUGGING -z' ccversion='', gccversion='', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321 d_longlong=undef, longlongsize=, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=4 alignbytes=8, usemymalloc=y, prototype=define Linker and Libraries: ld='ld', ldflags =' -Wl,+vnocompatwarnings -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib libs=-lcl -lpthread -lnsl -lnm -lndbm -ldld -lm -lc -lndir -lcrypt -lsec perllibs=-lcl -lpthread -lnsl -lnm -ldld -lm -lc -lndir -lcrypt -lsec libc=, so=sl, useshrplib=false, libperl=libperl.a Dynamic Linking: dlsrc=dl_hpux.xs, dlext=sl, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-B,deferred ' cccdlflags='+z', lddlflags='-b +vnocompatwarnings -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: DEBUGGING USE_LARGE_FILES Built under hpux Compiled at Jul 15 2001 16:01:33 @INC: /home/baxtlinc/perl/lib /opt/perl/5.6.1-fccs-01/lib/5.6.1/PA-RISC2.0 /opt/perl/5.6.1-fccs-01/lib/5.6.1 /opt/perl/5.6.1-fccs-01/lib/site_perl/5.6.1/PA-RISC2.0 /opt/perl/5.6.1-fccs-01/lib/site_perl/5.6.1 /opt/perl/5.6.1-fccs-01/lib/site_perl =head2 Lincoln Baxter's DBD-Oracle-1.06 Configuration Platform: osname=hpux, osvers=11.00, archname=PA-RISC2.0 uname='hp-ux dhdb108 b.11.00 u 9000800 612309363 unlimited-user license ' config_args='-Dprefix=/temp_data/baxtlinc/perl -Ubincompat5005' hint=previous, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=undef d_sfio=undef uselargefiles=define use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef Compiler: cc='cc', optimize='-O', gccversion= cppflags='-D_HPUX_SOURCE -I/usr/local/include +z -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Ae' ccflags ='-D_HPUX_SOURCE -I/usr/local/include +z -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Ae' stdchar='unsigned char', d_stdstdio=define, usevfork=false intsize=4, longsize=4, ptrsize=4, doublesize=8 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, usemymalloc=y, prototype=define Linker and Libraries: ld='ld', ldflags =' -Wl,+vnocompatwarnings' libpth=/lib /usr/lib /usr/ccs/lib libs=-lnsl -lnm -lndbm -ldld -lm -lc -lndir -lcrypt -lsec -lcl -lpthread libc=, so=sl, useshrplib=true, libperl=libperl.sl Dynamic Linking: dlsrc=dl_hpux.xs, dlext=sl, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-B,deferred ' cccdlflags='+z', lddlflags='-b +vnocompatwarnings' Characteristics of this binary (from libperl): Compile-time options: USE_LARGE_FILES Built under hpux Compiled at Jan 9 2001 17:36:00 @INC: /temp_data/baxtlinc/perl/lib/5.6.0/PA-RISC2.0 /temp_data/baxtlinc/perl/lib/5.6.0 /temp_data/baxtlinc/perl/lib/site_perl/5.6.0/PA-RISC2.0 /temp_data/baxtlinc/perl/lib/site_perl/5.6.0 /temp_data/baxtlinc/perl/lib/site_perl . =head2 Roger Foskett's Configuration (works with Apache and mod_perl) Platform: osname=hpux, osvers=11.00, archname=PA-RISC2.0 uname='hp-ux titan b.11.00 u 9000800 103901567 unlimited-user license ' config_args='-Ubincompat5005' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=undef d_sfio=undef uselargefiles=define use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef Compiler: cc='cc', optimize='-O', gccversion= cppflags='-D_HPUX_SOURCE -Aa -I/usr/local/include' ccflags =' +z -D_HPUX_SOURCE -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Ae ' stdchar='unsigned char', d_stdstdio=define, usevfork=false intsize=4, longsize=4, ptrsize=4, doublesize=8 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, usemymalloc=y, prototype=define Linker and Libraries: ld='ld', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib libs=-lnsl -lnm -lndbm -lgdbm -ldld -lm -lc -lndir -lcrypt -lsec -lcl -lpthread libc=/lib/libc.sl, so=sl, useshrplib=false, libperl=libperl.a Dynamic Linking: dlsrc=dl_hpux.xs, dlext=sl, d_dlsymun=undef, ccdlflags=' ' cccdlflags='+z', lddlflags=' -b +vnocompatwarnings -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: USE_LARGE_FILES Built under hpux Compiled at Dec 19 2000 19:17:00 @INC: /opt/www/perl5/lib/5.6.0/PA-RISC2.0 /opt/www/perl5/lib/5.6.0 /opt/www/perl5/lib/site_perl/5.6.0/PA-RISC2.0 /opt/www/perl5/lib/site_perl/5.6.0 /opt/www/perl5/lib/site_perl . Roger also provides a link to some threads containing some of his DBD-Oracle and HPUX11 trials... L<http://www.geocrawler.com/search/?config=183&words=Roger+Foskett> =head1 Appendix C (Why Dynamic Linking) Some one posted to the DBI email list the following question: What are the advantages of building a dynamically linked version? Being able to use threads? Or something besides that? The answer is there are too many to count, but here are several big ones: =item 1 Much smaller executables Only the code referenced gets loaded... this means faster execution times, and less machine resources (VM) used) =item 2 Modular addition and updating of modules. This is HUGE. One does not relink B<EVERYTHING, EVERY time> one changes or updates a module. =item 3 It eliminates Dynaloader warning (multiply defined). This occurs with the static build when perl is run with -w. I fixed this by removing -w from my #! lines, converting the the pragam "use warnings;". However, it was annoying, since all my scripts had -w in the #! line. =item 4 Its the default build Since almost every OS now supports dynamic linking, I believe that static linking is NOT getting the same level of vetting it maybe used to. Dynamicly linking is what you get by default, so its way better tested. =item 5 Its required for Apache and mod_perl.
>From [EMAIL PROTECTED] Tue Apr 9 15:55:14 2002 Received: from localhost (localhost [127.0.0.1]) by dansat.data-plan.com (8.11.6/8.11.6) with ESMTP id g39EtDK44264 for <timbo@localhost>; Tue, 9 Apr 2002 15:55:13 +0100 (BST) (envelope-from [EMAIL PROTECTED]) Received: from pop3.mail.demon.net [194.217.242.58] by localhost with POP3 (fetchmail-5.8.5) for timbo@localhost (single-drop); Tue, 09 Apr 2002 15:55:13 +0100 (BST) Received: from punt-1.mail.demon.net by mailstore for [EMAIL PROTECTED] id 1018363477:10:09202:8; Tue, 09 Apr 2002 14:44:37 GMT Received: from wormwood.pobox.com ([208.210.125.20]) by punt-1.mail.demon.net id aa1008045; 9 Apr 2002 14:44 GMT Received: from wormwood.pobox.com (localhost.pobox.com [127.0.0.1]) by wormwood.pobox.com (Postfix) with ESMTP id DD7FE72AC4 for <[EMAIL PROTECTED]>; Tue, 9 Apr 2002 10:43:32 -0400 (EDT) Delivered-To: [EMAIL PROTECTED] Received: from kpexpub01.fleetcc.com (unknown [205.143.103.104]) by wormwood.pobox.com (Postfix) with ESMTP id D5A2F72AC6 for <[EMAIL PROTECTED]>; Tue, 9 Apr 2002 10:43:31 -0400 (EDT) Received: by KPEXPUB01 with Internet Mail Service (5.5.2653.19) id <226APN3N>; Tue, 9 Apr 2002 10:43:29 -0400 Message-ID: <B1FA93A1B9A9D31189EC00508B6140CD065A1243@KPEXS08> From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: :Oracle 1.12 (Oracle 8.1.7) on HPUX 11.11 Date: Tue, 9 Apr 2002 10:41:27 -0400 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-2" Status: RO X-Status: A Content-Length: 3827 Lines: 102 So, if I read this right, you have saved the world (by providing enough detail to describe a successful gcc build of DBD-Oracle on HP-UX). I will be adding this to the README.hpux with my next rewrite, giving you credit OF COURSE. Thank you very much Tim, please give me a couple weeks notice before the next version is released. I will try to get to this sooner than later, and if so will distribute to the list ahead of time. In any case, I think this info is useful enough that it deserves getting into the next release. Lincoln -----Original Message----- From: Waldemar Zurowski [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 09, 2002 5:59 AM To: [EMAIL PROTECTED] Subject: Re: :Oracle 1.12 (Oracle 8.1.7) on HPUX 11.11 On Mon, 8 Apr 2002 15:58:57 -0400 [EMAIL PROTECTED] wrote: > I will add this to the README.hpux file. > Did you export LD_OPTS, at runtime or at build time? Huh? So You are one of the manager of README.hpux? I didn't noticed. Here is what I have done in detail. Our built configuration: 1) Host information: HP-UX hostname B.11.11 U 9000/800 XXXXXXXXX unlimited-user license 2) Oracle 8.1.7 3) Parameters to build perl: ../Configure -des -Uinstallusrbinperl -Uusethreads -Uuseithreads -Duselargefiles -Dcc=gcc -Darchname=PA-RISC1.1 -Dprefix=/opt/perl-non-thread -Dlibs='-lcl -lpthread -L${ORACLE_HOME}/JRE/lib/PA_RISC/native_threads -ljava -lnsl -lnm -lndbm -ldld -lm -lc -lndir -lcrypt -lsec' Please note, that I added -L${ORACLE_HOME}/JRE/lib/PA_RISC/native_threads -ljava, just because DBD::Oracle wants to link with it (perhaps due to Oracle's own build' rules picked up by Makefile.PL - I wasn't hunting for that too much) 4) I set environment variable LDOPTS to '+s' (see ld(1)). This holds extra parameters to HPUX' ld command, as I don't use GNU ld (anybody does?). This allows to build 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. Then, after building perl + DBI + DBD::Oracle and moving it into production enviroment it was enough to add to SHLIB_PATH ${ORACLE_HOME}/lib and ${ORACLE_HOME}/JRE/lib/PA_RISC/native_threads, for example: SHLIB_PATH=${ORACLE_HOME}/lib:${ORACLE_HOME}/JRE/lib/PA_RISC/native_threads: $SHLIB_PATH Please note output of ldd command: $ 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 [...] All of this mess is necessary because of weakness of shl_load(3X), explained in current README.hpux and in some discuss 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 it is promising to completely avoid of building 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. 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). 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. Best regards, Waldemar urowski
>From [EMAIL PROTECTED] Mon Mar 18 12:34:41 2002 Received: from localhost (localhost [127.0.0.1]) by dansat.data-plan.com (8.11.6/8.11.6) with ESMTP id g2ICYeU31606 for <timbo@localhost>; Mon, 18 Mar 2002 12:34:40 GMT (envelope-from [EMAIL PROTECTED]) Received: from pop3.mail.demon.net [194.217.242.58] by localhost with POP3 (fetchmail-5.8.5) for timbo@localhost (single-drop); Mon, 18 Mar 2002 12:34:40 +0000 (GMT) Received: from punt-2.mail.demon.net by mailstore for [EMAIL PROTECTED] id 1016454151:20:05776:22; Mon, 18 Mar 2002 12:22:31 GMT Received: from smtpzilla1.xs4all.nl ([194.109.127.137]) by punt-2.mail.demon.net id aa2129952; 18 Mar 2002 12:22 GMT Received: from procura.nl (procura.xs4all.nl [213.84.163.145]) by smtpzilla1.xs4all.nl (8.12.0/8.12.0) with SMTP id g2ICMFa4030944 for <[EMAIL PROTECTED]>; Mon, 18 Mar 2002 13:22:16 +0100 (CET) Received: from PC09 ([192.0.1.19]) by procura.nl with SMTP (Mailtraq/2.0.0.1241) id PRCR600517FE30 for [EMAIL PROTECTED]; Mon, 18 Mar 2002 13:21:49 +0100 Date: Mon, 18 Mar 2002 13:21:49 +0100 From: "H.Merijn Brand" <[EMAIL PROTECTED]> To: Tim Bunce <[EMAIL PROTECTED]> Subject: DBD-Oracle-1.12 / HP-UX X-Mailer-Plugin: Cliche Inserter for Becky!2 Ver.0.03 Rev.0 Message-Id: <[EMAIL PROTECTED]> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.00.08 X-Hops: 1 Status: RO X-Status: A Content-Length: 6492 Lines: 183 Some README.hpux changes. We still use 7.4.3.1 on HP-UX (for which you have seemed to rejected my notes for the README), but if we move to 8.*, I'll review the README.hpux again (if you like) --- README.hpux Mon Jul 16 23:18:11 2001 +++ README.hpux.new Thu Mar 7 18:13:01 2002 @@ -1,10 +1,10 @@ =head1 INTRODUCTION Building a working dynamically linked version of the Oracle DBD driver -on HPUX (11.00) has been a challenge for many. For months after taking a -new job, where HPUX was the standard server environment, I had only been +on HP-UX (11.00) has been a challenge for many. For months after taking a +new job, where HP-UX was the standard server environment, I had only been able to build a staticly linked version of perl and the DBD-Oracle -module on HPUX 11.00. +module on HP-UX 11.00. Then Roger Foskett posted instructions for what turned out to be dynamic build. Rogers's post got me farther than I had previously gotten. In fact, @@ -42,9 +42,9 @@ =head1 Build perl -=head2 HP's default perl (probably no good) +=head2 HP's default perl (threaded GNUpro build) -By default, HPUX 11.00 delivers perl 5.00503. This version of perl will +By default, HP-UX 11.00 delivers perl 5.6.1. This version of perl will probably not work. If you are reading this, you have probably discovered that something did not work. To get good version of the DBD-Oracle driver, we have to start with a perl that as been built with @@ -53,7 +53,7 @@ =head2 Building the right perl Generally, in order to get a version of the DBD-Oracle driver that -works on HPUX you need to build your own version of perl from +works on HP-UX you need to build your own version of perl from sources. These instructions have been used to building a dynamically linked @@ -75,13 +75,13 @@ =item Configure Once you have downloaded and unpacked the perl sources -(version 5.6.0 assumed here) +(version 5.6.1 assumed here) - cd Perl-5.6.0/ + cd Perl-5.6.1/ ./Configure -Ubincompat5005 #important that there is no malloc polution -You should configure perl to understand largefiles... basically you can accept the -defaults for all options except: +You should configure perl to understand largefiles... basically you can +accept the defaults for all options except: Additional libraries: add -lcl -lpthread #FIRST in the list ccflags: add '+z' @@ -112,7 +112,7 @@ make install If you are going to build mod_perl and Apache it as beed suggested that you modify -Config.pm to the change the HPUX ldflags & ccdlflags in +Config.pm to the change the HP-UX ldflags & ccdlflags in F</your/install/prefix/lib/5.6.0/PA-RISC2.0/Config.pm> as follows: ccdlflags='' @@ -124,7 +124,7 @@ =head1 Build and Install DBI - cd DBI-1.14/ + cd DBI-1.21/ perl Makefile.PL make make test @@ -132,7 +132,7 @@ =head1 DBD-Oraclea-1.07 and later -The standard mantra now works out of the box on HPUX: +The standard mantra now works out of the box on HP-UX: cd DBD-1.07/ #or more recent version @@ -170,22 +170,21 @@ of this README.hpux, then the above conditions will likely not be met. You can fix this as follows: - cat Makefile | sed 's/-Wl,+[sn]//' > Makefile.tmp - mv Makefile.tmp Makefile + perl -pi -e 's/-Wl,\+[sn]//' Makefile -You can add -lqsmashr (assuming $ORACLE_HOME/lib/libqsmashr.sl exists) to the link -command, as follows +You can add -lqsmashr (assuming $ORACLE_HOME/lib/libqsmashr.sl exists) to the +link command, as follows - cat Makefile | sed 's/\(OTHERLDFLAGS=.*$\)/\1 -lqsmashr/' > Makefile.tmp - mv Makefile.tmp Makefile + perl -pi -e 's/(OTHERLDFLAGS=.*$)/$1 -lqsmashr/' Makefile Oracle version 8.1.6 and (maybe 8.1.5) (and probably later) versions, use the +Wl,+n +Wl,+s -linker options which causes ld to complain about these as unknown options. This -is probably because Oracle is linking with the cc command, and we are linking with -ld. Oracle also fails to include libqsmashr which defines the Symbol LhrStrInsert(). +linker options which causes ld to complain about these as unknown options. +This is probably because Oracle is linking with the cc command, and we are +linking with ld. Oracle also fails to include libqsmashr which defines the +Symbol LhrStrInsert(). If you are using Oracle 8.0.5, check for, and remove if found, the linker options: @@ -214,7 +213,7 @@ it into a little symbol hunting ksh/bash function: #cd to where you want to look - #find_symbol Symbol ['libnamewildcard' as in '*.sl'] + #find_symbol Symbol ['libnamewildcard' as in '*.sl'] #based on a code fragment suggested by Roger Foskett function find_symbol { sym=$1; shift; @@ -232,10 +231,10 @@ set -u } -To use this I cd'd to $ORACLE_HOME and searched for the definitions of the undefined -symbol as follows: +To use this I cd'd to $ORACLE_HOME and searched for the definitions of the +undefined symbol as follows: - find_symbol LhtStrInsert '*.sl' + find_symbol LhtStrInsert '*.sl' Once you have run make test successfully, you can install your build in your perl tree: @@ -266,8 +265,8 @@ --enable-rule=SHARED_CORE 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 +XML-Parser module causing core dumps. -lcl is needed to ensure that Apache +does not coredump complaining about thread local storage make make install @@ -345,7 +344,7 @@ The following to sections provide full dumps of perl -V for three versions of perl that were successfully built and linked on -HPUX 11.00. +HP-UX 11.00. =head2 Lincoln Baxter's DBD-Oracle-1.07 Configuration @@ -475,7 +474,7 @@ Roger also provides a link to some threads containing some of his -DBD-Oracle and HPUX11 trials... +DBD-Oracle and HP-UX 11 trials... L<http://www.geocrawler.com/search/?config=183&words=Roger+Foskett> @@ -515,5 +514,5 @@ =item 5 Its required for Apache and mod_perl. - +=cut -- H.Merijn Brand Amsterdam Perl Mongers (http://amsterdam.pm.org/) using perl-5.6.1, 5.7.2 & 631 on HP-UX 10.20 & 11.00, AIX 4.2, AIX 4.3, WinNT 4, Win2K pro & WinCE 2.11. Smoking perl CORE: [EMAIL PROTECTED] http:[EMAIL PROTECTED]/ [EMAIL PROTECTED] send smoke reports to: [EMAIL PROTECTED], QA: http://qa.perl.org
>From [EMAIL PROTECTED] Mon Feb 25 22:29:05 2002 Received: from localhost (localhost [127.0.0.1]) by dansat.data-plan.com (8.11.6/8.11.6) with ESMTP id g1PMT4U13660 for <timbo@localhost>; Mon, 25 Feb 2002 22:29:04 GMT (envelope-from [EMAIL PROTECTED]) Received: from pop3.mail.demon.net [194.217.242.23] by localhost with POP3 (fetchmail-5.8.5) for timbo@localhost (single-drop); Mon, 25 Feb 2002 22:29:04 +0000 (GMT) Received: from punt-1.mail.demon.net by mailstore for [EMAIL PROTECTED] id 1014673616:10:06738:57; Mon, 25 Feb 2002 21:46:56 GMT Received: from wormwood.pobox.com ([208.210.125.20]) by punt-1.mail.demon.net id aa1006725; 25 Feb 2002 21:46 GMT Received: from wormwood.pobox.com (localhost.pobox.com [127.0.0.1]) by wormwood.pobox.com (Postfix) with ESMTP id 4548972742 for <[EMAIL PROTECTED]>; Mon, 25 Feb 2002 16:46:11 -0500 (EST) Delivered-To: [EMAIL PROTECTED] Received: from smtp013.mail.yahoo.com (smtp013.mail.yahoo.com [216.136.173.57]) by wormwood.pobox.com (Postfix) with SMTP id 284867281C for <[EMAIL PROTECTED]>; Mon, 25 Feb 2002 16:46:05 -0500 (EST) Received: from jjstrauss (AUTH poptime) at node-d8e9127e.powerinter.net (HELO a30) (216.233.18.126) by smtp.mail.vip.sc5.yahoo.com with SMTP; 25 Feb 2002 21:46:03 -0000 Message-ID: <010d01c1be45$e5943200$6505a8c0@a30> From: "Jay Strauss" <[EMAIL PROTECTED]> To: "Tim Bunce" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> References: <8F7E4BBE4270D511BE550002A5751A3915B4AF@GBTPM201> <001a01c1be0b$43cfe3e0$6405a8c0@homeoffice> <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> Subject: Um, I think this is wrong Date: Mon, 25 Feb 2002 15:39:35 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Status: RO Content-Length: 625 Lines: 27 I think I made a mistake, Shouldn't > Example (remote database): > > export ORACLE_USERID=<validuser/validpasswd> > export ORACLE_HOME=<path to oracle> > export ORACLE_SID=<a valid instance>@<valid tnsnames.ora entry> > export ORACLE_USERID=<validuser/validpasswd> > export SHLIB_PATH=$ORACLE_HOME/lib > be: export [EMAIL PROTECTED] or export ORACLE_SID=@<valid tnsnames.ora entry> I don't have a machine to test upon. Jay _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com >From [EMAIL PROTECTED] Fri May 3 10:03:25 2002 Received: from localhost (localhost [127.0.0.1]) by dansat.data-plan.com (8.11.6/8.11.6) with ESMTP id g4393PR48562 for <timbo@localhost>; Fri, 3 May 2002 10:03:25 +0100 (BST) (envelope-from [EMAIL PROTECTED]) Received: from pop3.mail.demon.net [194.217.242.22] by localhost with POP3 (fetchmail-5.8.5) for timbo@localhost (single-drop); Fri, 03 May 2002 10:03:25 +0100 (BST) Received: from punt-2.mail.demon.net by mailstore for [EMAIL PROTECTED] id 1020414061:20:23102:18; Fri, 03 May 2002 08:21:01 GMT Received: from cali-1.pobox.com ([64.71.166.114]) by punt-2.mail.demon.net id aa2022866; 3 May 2002 8:20 GMT Received: from cali-1.pobox.com (localhost.localdomain [127.0.0.1]) by cali-1.pobox.com (Postfix) with ESMTP id 45D243E743 for <[EMAIL PROTECTED]>; Fri, 3 May 2002 04:19:41 -0400 (EDT) Delivered-To: [EMAIL PROTECTED] Received: from onion.perl.org (onion.valueclick.com [209.85.157.220]) by cali-1.pobox.com (Postfix) with SMTP id 1D9083E73B for <[EMAIL PROTECTED]>; Fri, 3 May 2002 04:19:41 -0400 (EDT) Received: (qmail 39145 invoked by uid 1005); 3 May 2002 08:19:08 -0000 Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Precedence: bulk List-Post: <mailto:[EMAIL PROTECTED]> List-Help: <mailto:[EMAIL PROTECTED]> List-Unsubscribe: <mailto:[EMAIL PROTECTED]> List-Subscribe: <mailto:[EMAIL PROTECTED]> Delivered-To: mailing list [EMAIL PROTECTED] Delivered-To: moderator for [EMAIL PROTECTED] Received: (qmail 97895 invoked by uid 76); 3 May 2002 06:02:09 -0000 Date: Fri, 3 May 2002 11:30:40 +0530 (IST) From: "Ranjith.A.V" <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Cc: "Stevenson, Jonathan" <[EMAIL PROTECTED]> Subject: RE: Error on make for DBD-Oracle 1.12 on HPUX 11.0 Message-ID: <[EMAIL PROTECTED]> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Status: RO Content-Length: 2564 Lines: 64 hi Jonathan, Don't use 'export LD_PRELOAD'. When you set this dld.sl will preload libjava.sl for all the application, and there is a known problem with LD_PRELOAD which is documented in dld.sl man page. ---- Note: Using LD_PRELOAD can cause a core dump when used with applications which mix shared and archived libraries, especially when both the shared library and the application are built with aC++ or use libc. ---- Hence use LD_PRELOAD only for the application u want to run. for eg. bash-2.01$ LD_PRELOAD=/lab1/u01/app/oracle/product/8.1.6/JRE/lib/PA_RISC/ native_threads/libjava.sl make test thanks, Ranjith. Hi Lincoln, Thanks for your help with this. We now have a working installation, although we still do have some issues to resolve still. The problem seems to be the libjava.sl library. Running the make test step generated this message: Can't shl_load() a library containing Thread Local Storage. We have got round this by setting the LD_PRELOAD to point to the library - $ORACLE_HOME/JRE/lib/PA_RISC/native_threads/libjava.sl. The make test passes OK, and make install works. My DBI test script is able to do some basic stuff, so presumably it is OK. There are some problems remaining with it, though. You have to set the LD_PRELOAD variable before running any perl against Oracle (as I guess the library does not get built into the DBD). We have also noticed that if you set LD_PRELOAD as above, then run swlist, the system coredumps (swlist works normally without this set). This worries me, as it may cause other commands to coredump, so we will need to try to extensively roadtest this before we can move into production. The libjava.sl library is only required for an advanced authentication module that we do not use, so we are hoping that we can remove this from our Oracle installation, and get around the problem this way. We did manage to install DBD on one of our boxes before Xmas without this problem, so we know that it can be done, we have just lost the recipe that we need. If anyone has any suggestions that we could try, we would be grateful. It is also worth noting that this error was what hung us up trying to get gcc to work, so with this option, we may be able to push forward on this. We will give it a go on another box, and post if we get any joy from this. I have included the recipe that we have used below. This does produce a working build, we are just a little concerned about the side effects. Cheers, Jon -- @ 91-80-2051073 (off) 91-80-6583830 (res)