JPL installed on HP-UX 11.00

[email protected] ("Sheely, Kevin D") Fri, 19 Nov 1999 10:43:28 -0800
Newsgroups perl.jpl
Message-ID <71676651AAABD011A1DD00805FBEB420030F61A7@xch-blv-01.ca.boeing.com>
Here are some rough notes that I made when attempting to get JPL to install on our HP-UX 11.00 system.   I think it is fairly similar to our 10.20 install.  This was done using the HP ansi C compiler and with perl version 5.005_03  and java 1.1.7  .  I got JPL from CPAN out of perl5.005_54.tar.gz   .

Also,  a while back there was some talk about a JPL web page .   I think it would be a good idea to have a place to put stuff like installation hints .   We could also include examples, tutorials, download instructions,  mailing list info and links to any other JPL information.  Here are a few of the links I have.   Are there more links?  Is anyone working on a web page?   I'd be willing to throw something simple together just to get things started.  Brian Jepson had mentioned before that perl.org would probably let us put something there.  Comments?  

 
JPL now open source 
http://www.perl.com/pub/1998/12/jpl-announce.html 

Notes from C/NET on JPL
http://www.builder.com/Programming/Perl/ss01.html
 
Excerpts from JPL chapter in Resource Kit
http://www.oreilly.com/catalog/prkunix/excerpt/UGch03.html
 
Order Perl Resource Kit from O'Reilly 
http://www.oreilly.com/catalog/prkunix/

Perl Resource Kit - Amazon.com  
http://www.amazon.com/exec/obidos/ASIN/1565923707/r/002-0167248-7066666

Instruction to get JPL from CVS
http://users.ids.net/~bjepson/jpl/cvs.html 


-------------------------------------------------------------------------------------------------------------------------
HP-UX 11.00 Install notes
Please consult chapter 3 in the Perl Resource Kit , Perl Utilities Guide for
general instructions on how to install JPL  at http://www.oreilly.com/catalog/prkunix/excerpt/UGch03.html
 
Below are the changes that are needed to get the install script to work on HP-UX.
These changes are using "shl_load" for the shared library rather than "dlopen" .
In the future this should probably be changed to use "dlopen" .  I couldn't get "dlopen" to
work so I resorted back to "shl_load".  

Build perl to use a shared library and the system malloc.  You also need to
change some of the flags used in building perl so they are present in config.sh.
Here are some of the pertinent flag settings from our config.sh :

cccdlflags='+z'
ccdlflags='-Wl,-E -Wl,-B,deferred '
ccflags='-D_HPUX_SOURCE -Ae'
cppflags='-D_HPUX_SOURCE -Ae'

Also, I had to create a directory /opt/java/include/hpux and copied the
files from /opt/java/include/hp-ux into it.  This will probably vary 
depending on installation.  It depends on what is returned from perl
by $^O  (the os name).

:::::::::::::::::Here is our perl -V output:::::::::::::
Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
  Platform:
    osname=hpux, osvers=11.00, archname=PA-RISC1.1
    uname='hp-ux tblv024 b.11.00 e 9000819 1248842331 8-user license '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='cc', optimize='-O', gccversion=
    cppflags='-D_HPUX_SOURCE -Ae -I/usr/local/include'
    ccflags ='-D_HPUX_SOURCE -Ae -I/usr/local/include'
    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
    alignbytes=8, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='ld', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib/pa1.1 /lib /usr/lib /usr/ccs/lib
    libs=-lnsl -lnm -lndbm -ldb -lmalloc -ldld -lm -lc -lndir -lcrypt
    libc=/lib/libc.sl, 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 -L/usr/local/lib'


Characteristics of this binary (from libperl): 
  Built under hpux
  Compiled at Nov 12 1999 08:50:09
  @INC:
    /opt/perl5/lib/5.00503/PA-RISC1.1
    /opt/perl5/lib/5.00503
    /opt/perl5/lib/site_perl/5.005/PA-RISC1.1
    /opt/perl5/lib/site_perl/5.005
    .


--------------------------------------------------------------------------------
---------- Changes to install-jpl ----------------------------------------------

  Need to check where JPLPERL is set and make sure it is correctly identifying your version
  of perl.  I ended up stripping off the version check and just making it
  'JPLPERL=perl' .
  
  Need to create an environment variable SHLIB_PATH with the same settings as
  LD_LIBRARY_PATH.  
  After 'export LD_LIBRARY_PATH' add the line
  'export SHLIB_PATH=$LD_LIBRARY_PATH'
  After this is done, you need to scan for 'LD_LIBRARY_PATH' in the file and 
  add a line that performs the same action for 'SHLIB_PATH' (Ex: each setenv
  command).
  
  * Note: it make possibly work to just change 'LD_LIBRARY_PATH' to 'SHLIB_PATH'
  in the entire file, haven't tried this yet.
  

--------------------------------------------------------------------------------
---------- Changes in the PerlInterpreter directory  ---------------------------
  
  In Makefile.PL:
    change '.so' to '.sl'
    add '-c +u4' to FLAGS
    change $libs to '-lc -lm -ldld -lperl'
    change LIBS=$libs to LIBS=-L\$(PERLARCHDIR)/CORE $libs
    
    Add a variable to identify where you can find DynaLoader.c
    On our system this was:
    DYNALOADER=/opt/perl5.005_03/ext/DynaLoader  ** Note this is hard coded
    
    Then change how libPerlInterpreter.sl is built to :
     
    libPerlInterpreter.sl: PerlInterpreter.c PerlInterpreter.h
        $(CC) $(FLAGS) $(INCL) PerlInterpreter.c \
        $(CC) $(FLAGS) $(INCL) -I$(DYNALOADER) $(DYNALOADER)/DynaLoader.c \
        -o DynaLoader.o
        ld -b -E $(LIBS) -o libPerlInterpreter.sl PerlInterpreter.o \
        DynaLoader.o
	
  In PerlInterpreter.c :
    change 'dlopen' to 'shl_load' .
    change 'libperl.so" to "libperl.sl"
    change the 'RT' flags to 'BIND_IMMEDIATE|BIND_VERBOSE|DYNAMIC_PATH' 
    add a '0' as the 3rd parameter to shl_load .
    change 'dlfcn.h' to 'dl.h'
    change call to 'dlerror' to just a call to 'perror("Could not load...")'
    
--------------------------------------------------------------------------------    
---------- Changes in the JNI directory ----------------------------------------

  In Makefile.PL:
    Take out the -R references off the LIBS => line, it should just read as :
    LIBS        => ["-L$jpl/lib/$ARCHNAME -lperl -lPerlInterpreter"],
    
  In JNI.xs:
    Change the 2 calls to 'dlopen' to 'shl_load'
    Change the RTD flags to 'BIND_IMMEDIATE|BIND_VERBOSE'
    Add a 0 as third parameter to shl_load
    Change libjava.so to libjava.sl 
    Change 'dlfcn.h' to 'dl.h'
 
--------------------------------------------------------------------------------
---------- Changes in the Sample directory -------------------------------------

  In Makefile.PL:
    Change setting of PERL if needed.  Our system has PERL=perl .
    Change LIBS to '-lc -lm -ldld -lperl'
    Add '-c +u4' to FLAGS
    Change '.so' to '.sl'
    After 'LIBS = $libs' , add the lines:
    SEARCHPERLPATH = -L\$(PERLARCHDIR)/CORE -L\$(JPL_HOME)/lib/\$(ARCHNAME) \\
                -l:libPerlInterpreter.sl -l:libperl.sl
    
    Change the build of the sl file to :
    
    lib$(WHAT).sl: $(WHAT).c $(JPL_HOME)/lib/$(ARCHNAME)/libPerlInterpreter.sl
        $(CC) $(FLAGS) $(INCL) $(WHAT).c \
        $(PERLARCHDIR)/CORE/libperl.sl \
        $(JPL_HOME)/lib/$(ARCHNAME)/libPerlInterpreter.sl \
        $(LIBS)
        ld -b -o lib$(WHAT).sl $(WHAT).o $(SEARCHPERLPATH)
	
    Change the build of the debug sl file to:
    
    lib$(WHAT)_g.sl: $(WHAT).c $(JPL_HOME)/lib/$(ARCHNAME)/libPerlInterpreter_g.sl
        $(CC) -g $(FLAGS) $(INCL) $(WHAT).c \
        $(PERLARCHDIR)/CORE/libperl.sl \
        $(JPL_HOME)/lib/$(ARCHNAME)/libPerlInterpreter_g.sl \
        $(LIBS)
        ld -b -o lib$(WHAT)_g.sl $(WHAT)_g.o $(SEARCHPERLPATH)

  You should be able to use the Sample Makefile.PL as a makefile in
  any examples.
 -------------------------------------------------------------------------
 After all these changes are made , you should be able to invoke 'install-jpl'
 and have it run all the way through the Sample.  After that, perform the
 'setvars' before trying examples.


Kevin D. Sheely              425-957-5678
P.O. Box 24346  M/S  7M-HC
Seattle, WA 98124                     425-957-5060  fax

[email protected]