Dey, Sutapa wrote:

Hi All,

 

I am trying to build/enable plperl support for postgres.

 

1. The system info is :

# uname -a

HP-UX unknown B.11.23 U 9000/800 1178464650 unlimited-user license

 

2. The steps I followed:

a)      In postgres user’s .profile file I had set :

export LD_LIBRARY_PATH=/opt/pgsql/lib/:/opt/pgsql/vsm-lib:/usr/lib:/opt/pgsql/lib/hpux32

export libdir=/opt/pgsql/lib

b)      I linked the libperl.sl from the perl library “/usr/local/perl5/lib/5.8.3/PA-RISC2.0/CORE/libperl.sl” to:

/opt/iexpress/postgresql/lib/libperl.sl

/opt/iexpress/postgresql/lib/hpux32/libperl.sl

 

c)      In the postgres “src” directory,  I set the environment variables (export CC=”cc –v”, LDOPTS="+nodefaultrpath")

d)     ./configure --prefix=/opt/iexpress/postgresql --with-perl --enable-integer-datetimes --with-openssl --libdir=/opt/iexpress/postgresql/lib/hpux32 --without-readline --without-zlib --without-docdir

e)      /usr/local/bin/gmake -f /opt/pgsql/src/postgresql-8.2.4/GNUmakefile all

f)       /usr/local/bin/gmake -f /opt/pgsql/src/postgresql-8.2.4/GNUmakefile install

 

3. After these steps when I try to create plperl language with postgres

   $ /opt/iexpress/postgresql/bin/createlang --echo --dbname=vsm --username=postgres plperl

 

   SELECT oid FROM pg_catalog.pg_language WHERE lanname = 'plperl';

  CREATE LANGUAGE "plperl";

   createlang: language installation failed: ERROR:  could not access file "$libdir/plperl": No such file or directory

 


first, let me say, I don't know squat about HPUX, just Unix in general...

assuming the postgres server is running as a daemon launched by some sort of system service manager, chances are VERY good its not running the .profile and isn't seeing that LD_LIBRARY_PATH.  you could add this same thing to the launcher script that loads the postmaster daemon....

however, at least in most newer unix systems, using LD_LIBRARY_PATH is deprecated, you want to link the programs so they KNOW where they are expecting to find their libaries and aren't dependent on additional custom settings of environment variables at runtime...  often this is done with the --rpath option to the linker...  perhaps step E could be prefixed with...

LDFLAGS = --rpath /opt/iexpress/postgresql/lib/ --rpath /opt/pgsql/lib/hpux32 --rpath /opt/pgsql/vsm-lib \
   
/usr/local/bin/gmake -f /opt/pgsql/src/postgresql-8.2.4/GNUmakefile all