Thread: SHARED LIBRARY IS NOT CREATED:Postgres could not create support for plperl
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=3D/opt/pgsql/lib/:/opt/pgsql/vsm-lib:/usr/lib:/opt/p= gsql/lib/hpux32 export libdir=3D/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=3D"cc -v", LDOPTS=3D"+nodefaultrpath") d) ./configure --prefix=3D/opt/iexpress/postgresql --with-perl --enable= -integer-datetimes --with-openssl --libdir=3D/opt/iexpress/postgresql/lib/h= pux32 --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/GNUmakefil= e install 3. After these steps when I try to create plperl language with postgres $ /opt/iexpress/postgresql/bin/createlang --echo --dbname=3Dvsm --userna= me=3Dpostgres plperl SELECT oid FROM pg_catalog.pg_language WHERE lanname =3D 'plperl'; CREATE LANGUAGE "plperl"; createlang: language installation failed: ERROR: could not access file = "$libdir/plperl": No such file or directory Please help. May be I am missing something in the configure options. Regards, Sutapa
Re: SHARED LIBRARY IS NOT CREATED:Postgres could not create support for plperl
From
John R Pierce
Date:
Dey, Sutapa wrote: <blockquote cite="mid:D264563FEECCAD4FBDE4B92D3863256A4B4909EBD9@GVW0440EXB.americas.hpqcorp.net" type="cite"> <!-- /* Font Definitions */ @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4;} @font-face {font-family:"Book Antiqua"; panose-1:2 4 6 2 5 3 5 3 3 4;} @font-face {font-family:Consolas; panose-1:2 11 6 9 2 2 4 3 2 4;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0in; margin-bottom:.0001pt; font-size:11.0pt; font-family:"Calibri","sans-serif";} a:link, span.MsoHyperlink {mso-style-priority:99; color:blue; text-decoration:underline;} a:visited, span.MsoHyperlinkFollowed {mso-style-priority:99; color:purple; text-decoration:underline;} p.MsoPlainText, li.MsoPlainText, div.MsoPlainText {mso-style-priority:99; mso-style-link:"Plain Text Char"; margin:0in; margin-bottom:.0001pt; font-size:10.5pt; font-family:Consolas;} span.PlainTextChar {mso-style-name:"Plain Text Char"; mso-style-priority:99; mso-style-link:"Plain Text"; font-family:Consolas;} .MsoChpDefault {mso-style-type:export-only;} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.0in 1.0in 1.0in;} div.Section1 {page:Section1;} /* List Definitions */ @list l0 {mso-list-id:1804539877; mso-list-type:hybrid; mso-list-template-ids:-1030557180 67698711 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l0:level1 {mso-level-number-format:alpha-lower; mso-level-text:"%1\)"; mso-level-tab-stop:none; mso-level-number-position:left; margin-left:48.0pt; text-indent:-.25in;} @list l0:level2 {mso-level-tab-stop:1.0in; mso-level-number-position:left; text-indent:-.25in;} @list l0:level3 {mso-level-tab-stop:1.5in; mso-level-number-position:left; text-indent:-.25in;} @list l0:level4 {mso-level-tab-stop:2.0in; mso-level-number-position:left; text-indent:-.25in;} @list l0:level5 {mso-level-tab-stop:2.5in; mso-level-number-position:left; text-indent:-.25in;} @list l0:level6 {mso-level-tab-stop:3.0in; mso-level-number-position:left; text-indent:-.25in;} @list l0:level7 {mso-level-tab-stop:3.5in; mso-level-number-position:left; text-indent:-.25in;} @list l0:level8 {mso-level-tab-stop:4.0in; mso-level-number-position:left; text-indent:-.25in;} @list l0:level9 {mso-level-tab-stop:4.5in; mso-level-number-position:left; text-indent:-.25in;} ol {margin-bottom:0in;} ul {margin-bottom:0in;} --> <span style="font-size: 11pt; font-family: "Book Antiqua","serif";">Hi All, <span style="font-size: 11pt; font-family: "Book Antiqua","serif";"> <span style="font-size: 11pt; font-family: "Book Antiqua","serif";">I am trying to build/enable plperl support for postgres. <span style="font-size: 11pt; font-family: "Book Antiqua","serif";"> <span style="font-size: 11pt; font-family: "Book Antiqua","serif";">1. The system info is : <span style="font-size: 11pt; font-family: "Book Antiqua","serif";"># uname -a <span style="font-size: 11pt; font-family: "Book Antiqua","serif";">HP-UX unknown B.11.23 U 9000/800 1178464650 unlimited-user license <span style="font-size: 11pt; font-family: "Book Antiqua","serif";"> <span style="font-size: 11pt; font-family: "Book Antiqua","serif";">2. The steps I followed: <p class="MsoPlainText" style="margin-left: 48pt; text-indent: -0.25in;"><span style="font-size: 11pt; font-family: "Book Antiqua","serif";"><span style="">a)<span style="font-family: "Times New Roman"; font-style: normal; font-variant: normal; font-weight: normal; font-size:7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"> <span style="font-size: 11pt; font-family: "Book Antiqua","serif";">In postgres user’s .profile file I had set : <span style="font-size: 11pt; font-family: "Book Antiqua","serif";">export LD_LIBRARY_PATH=/opt/pgsql/lib/:/opt/pgsql/vsm-lib:/usr/lib:<span style="font-size: 11pt; font-family: "Book Antiqua","serif";">/opt/pgsql/lib/hpux32 <span style="font-size: 11pt; font-family: "Book Antiqua","serif";">export libdir=/opt/pgsql/lib <p class="MsoPlainText" style="margin-left: 48pt; text-indent: -0.25in;"><span style="font-size: 11pt; font-family: "Book Antiqua","serif";"><span style="">b)<span style="font-family: "Times New Roman"; font-style: normal; font-variant: normal; font-weight: normal; font-size:7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"> <span style="font-size: 11pt; font-family: "Book Antiqua","serif";">I linked the libperl.sl from the perl library “/usr/local/perl5/lib/5.8.3/PA-RISC2.0/CORE/libperl.sl” to: <span style="font-size: 11pt; font-family: "Book Antiqua","serif";">/opt/iexpress/postgresql/lib/libperl.sl <span style="font-size: 11pt; font-family: "Book Antiqua","serif";">/opt/iexpress/postgresql/lib/hpux32/libperl.sl <span style="font-size: 11pt; font-family: "Book Antiqua","serif";"> <p class="MsoPlainText" style="margin-left: 48pt; text-indent: -0.25in;"><span style="font-size: 11pt; font-family: "Book Antiqua","serif";"><span style="">c)<span style="font-family: "Times New Roman"; font-style: normal; font-variant: normal; font-weight: normal; font-size:7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"> <span style="font-size: 11pt; font-family: "Book Antiqua","serif";">In the postgres “src” directory, I set the environment variables (export CC=”cc –v”, LDOPTS="+nodefaultrpath") <p class="MsoPlainText" style="margin-left: 48pt; text-indent: -0.25in;"><span style="font-size: 11pt; font-family: "Book Antiqua","serif";"><span style="">d)<span style="font-family: "Times New Roman"; font-style: normal; font-variant: normal; font-weight: normal; font-size:7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"> <span style="font-size: 11pt; font-family: "Book Antiqua","serif";">./configure --prefix=/opt/iexpress/postgresql --with-perl --enable-integer-datetimes --with-openssl --libdir=/opt/iexpress/postgresql/lib/hpux32 --without-readline --without-zlib --without-docdir <p class="MsoPlainText" style="margin-left: 48pt; text-indent: -0.25in;"><span style="font-size: 11pt; font-family: "Book Antiqua","serif";"><span style="">e)<span style="font-family: "Times New Roman"; font-style: normal; font-variant: normal; font-weight: normal; font-size:7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"> <span style="font-size: 11pt; font-family: "Book Antiqua","serif";">/usr/local/bin/gmake -f /opt/pgsql/src/postgresql-8.2.4/GNUmakefile all <p class="MsoPlainText" style="margin-left: 48pt; text-indent: -0.25in;"><span style="font-size: 11pt; font-family: "Book Antiqua","serif";"><span style="">f)<span style="font-family: "Times New Roman"; font-style: normal; font-variant: normal; font-weight: normal; font-size:7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"> <span style="font-size: 11pt; font-family: "Book Antiqua","serif";">/usr/local/bin/gmake -f /opt/pgsql/src/postgresql-8.2.4/GNUmakefile install <span style="font-size: 11pt; font-family: "Book Antiqua","serif";"> <span style="font-size: 11pt; font-family: "Book Antiqua","serif";">3. After these steps when I try to create plperl language with postgres <span style="font-size: 11pt; font-family: "Book Antiqua","serif";"> $ /opt/iexpress/postgresql/bin/createlang --echo --dbname=vsm --username=postgres plperl <span style="font-size: 11pt; font-family: "Book Antiqua","serif";"> <span style="font-size: 11pt; font-family: "Book Antiqua","serif";"> SELECT oid FROM pg_catalog.pg_language WHERE lanname = 'plperl'; <span style="font-size: 11pt; font-family: "Book Antiqua","serif";"> CREATE LANGUAGE "plperl"; <span style="font-size: 11pt; font-family: "Book Antiqua","serif";"> createlang: language installation failed: ERROR: could not access file "$libdir/plperl": No such file or directory <span style="font-size: 11pt; font-family: "Book Antiqua","serif";"> 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 <span style="font-size: 11pt; font-family: "Book Antiqua","serif";">/opt/iexpress/postgresql/lib/ --rpath <span style="font-size: 11pt; font-family: "Book Antiqua","serif";">/opt/pgsql/lib/hpux32 --rpath <span style="font-size: 11pt; font-family: "Book Antiqua","serif";">/opt/pgsql/vsm-lib \ <span style="font-size: 11pt; font-family: "Book Antiqua","serif";">/usr/local/bin/gmake -f /opt/pgsql/src/postgresql-8.2.4/GNUmakefile all