Thread: Postgres 7.1RC1 on Solaris 7

Postgres 7.1RC1 on Solaris 7

From
Ahmed Moustafa
Date:
Hi,

I downloaded Postgres 7.1RC1 from
ftp://ftp.postgresql.org/pub/dev/postgresql-7.1RC1.tar.gz. When I did
./configure, I got a error with the test program. I could not figure out
the problem. Would you take a look at the config.log
(http://www.photo.net/users/ahmed/config.log) and tell me the problem
is, please?

Your help will be appreciated so much.

Ahmed Moustafa

Attachment

Re: Postgres 7.1RC1 on Solaris 7

From
Peter Eisentraut
Date:
Ahmed Moustafa writes:

> Hi,
>
> I downloaded Postgres 7.1RC1 from
> ftp://ftp.postgresql.org/pub/dev/postgresql-7.1RC1.tar.gz. When I did
> ./configure, I got a error with the test program. I could not figure out
> the problem. Would you take a look at the config.log
> (http://www.photo.net/users/ahmed/config.log) and tell me the problem
> is, please?

In configure, line 6846, can you replace the 'return 0;' by 'exit(0);'?
It's a long shot, but I don't see any other possibility.

--
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/


Re: Postgres 7.1RC1 on Solaris 7

From
Tom Lane
Date:
Peter Eisentraut <peter_e@gmx.net> writes:
> Ahmed Moustafa writes:
>> I downloaded Postgres 7.1RC1 from
>> ftp://ftp.postgresql.org/pub/dev/postgresql-7.1RC1.tar.gz. When I did
>> ./configure, I got a error with the test program. I could not figure out
>> the problem. Would you take a look at the config.log
>> (http://www.photo.net/users/ahmed/config.log) and tell me the problem
>> is, please?

> In configure, line 6846, can you replace the 'return 0;' by 'exit(0);'?
> It's a long shot, but I don't see any other possibility.

I am suspicious that it's a library linking issue.  Unfortunately,
configure unhelpfully /dev/null's the stderr output obtained while
trying to execute the test program.  (Peter, shouldn't we suggest to
the autoconf boys that that output ought to go into config.log?)

Please try running the same test scenario by hand so we can see what is
printed:

echo "int main() { return 0; }"  >conftest.c
gcc -o conftest conftest.c -lz -lresolv -lgen -lnsl -lsocket -ldl -lm
./conftest

It might also be useful to see what "ldd conftest" produces.

            regards, tom lane

Re: Postgres 7.1RC1 on Solaris 7

From
Peter Eisentraut
Date:
Ahmed Moustafa writes:

> bash-2.03# echo "int main() { return 0; }"  >conftest.c
> bash-2.03# gcc -o conftest conftest.c -lz -lresolv -lgen -lnsl -lsocket -ldl
> -lm
> bash-2.03# ./conftest
> ld.so.1: ./conftest: fatal: libz.so: open failed: No such file or directory

You need to set the LD_LIBRARY_PATH environment variable to include the
location where libz is installed, e.g.,

LD_LIBRARY_PATH=/usr/local/lib
export LD_LIBRARY_PATH

... or whichever method to configure the dynamic linker you prefer.  I'll
update FAQ_Solaris about this.

--
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/


Re: Postgres 7.1RC1 on Solaris 7

From
Peter Eisentraut
Date:
Tom Lane writes:

> (Peter, shouldn't we suggest to the autoconf boys that that output
> ought to go into config.log?)

It seems your request has already been heard.  In general, the config.log
files from Autoconf 2.50 are a *lot* better, e.g., they actually include
the result of the test.  Should be released soon.  (They've been saying so
at least as long as PostgreSQL anyway.)

--
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/


Re: Postgres 7.1RC1 on Solaris 7

From
Ahmed Moustafa
Date:
Hi Peter,

I did the test by hand and here is the output:

bash-2.03# echo "int main() { return 0; }"  >conftest.c
bash-2.03# gcc -o conftest conftest.c -lz -lresolv -lgen -lnsl -lsocket -ldl
-lm
bash-2.03# ./conftest
ld.so.1: ./conftest: fatal: libz.so: open failed: No such file or directory
Killed
bash-2.03# ldd conftest
        libz.so =>       (file not found)
        libresolv.so.2 =>        /usr/lib/libresolv.so.2
        libgen.so.1 =>   /usr/lib/libgen.so.1
        libnsl.so.1 =>   /usr/lib/libnsl.so.1
        libsocket.so.1 =>        /usr/lib/libsocket.so.1
        libdl.so.1 =>    /usr/lib/libdl.so.1
        libm.so.1 =>     /usr/lib/libm.so.1
        libc.so.1 =>     /usr/lib/libc.so.1
        libmp.so.2 =>    /usr/lib/libmp.so.2
        /usr/platform/SUNW,Ultra-5_10/lib/libc_psr.so.1
bash-2.03#

So, how can I fix the problem, please?

Best Regards,

Ahmed

Tom Lane wrote:

> Peter Eisentraut <peter_e@gmx.net> writes:
> > Ahmed Moustafa writes:
> >> I downloaded Postgres 7.1RC1 from
> >> ftp://ftp.postgresql.org/pub/dev/postgresql-7.1RC1.tar.gz. When I did
> >> ./configure, I got a error with the test program. I could not figure out
> >> the problem. Would you take a look at the config.log
> >> (http://www.photo.net/users/ahmed/config.log) and tell me the problem
> >> is, please?
>
> > In configure, line 6846, can you replace the 'return 0;' by 'exit(0);'?
> > It's a long shot, but I don't see any other possibility.
>
> I am suspicious that it's a library linking issue.  Unfortunately,
> configure unhelpfully /dev/null's the stderr output obtained while
> trying to execute the test program.  (Peter, shouldn't we suggest to
> the autoconf boys that that output ought to go into config.log?)
>
> Please try running the same test scenario by hand so we can see what is
> printed:
>
> echo "int main() { return 0; }"  >conftest.c
> gcc -o conftest conftest.c -lz -lresolv -lgen -lnsl -lsocket -ldl -lm
> ./conftest
>
> It might also be useful to see what "ldd conftest" produces.
>
>                         regards, tom lane

Attachment

Re: Postgres 7.1RC1 on Solaris 7

From
Ahmed Moustafa
Date:
Hi Peter,

Changing line 6846 gave me the same error message.

Ahmed

Peter Eisentraut wrote:

> Ahmed Moustafa writes:
>
> > Hi,
> >
> > I downloaded Postgres 7.1RC1 from
> > ftp://ftp.postgresql.org/pub/dev/postgresql-7.1RC1.tar.gz. When I did
> > ./configure, I got a error with the test program. I could not figure out
> > the problem. Would you take a look at the config.log
> > (http://www.photo.net/users/ahmed/config.log) and tell me the problem
> > is, please?
>
> In configure, line 6846, can you replace the 'return 0;' by 'exit(0);'?
> It's a long shot, but I don't see any other possibility.
>
> --
> Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/

Attachment

Re: Postgres 7.1RC1 on Solaris 7

From
Ahmed Moustafa
Date:
Hi Tom,

I did the test by hand and here is the output:

bash-2.03# echo "int main() { return 0; }"  >conftest.c
bash-2.03# gcc -o conftest conftest.c -lz -lresolv -lgen -lnsl -lsocket -ldl
-lm
bash-2.03# ./conftest
ld.so.1: ./conftest: fatal: libz.so: open failed: No such file or directory
Killed
bash-2.03# ldd conftest
        libz.so =>       (file not found)
        libresolv.so.2 =>        /usr/lib/libresolv.so.2
        libgen.so.1 =>   /usr/lib/libgen.so.1
        libnsl.so.1 =>   /usr/lib/libnsl.so.1
        libsocket.so.1 =>        /usr/lib/libsocket.so.1
        libdl.so.1 =>    /usr/lib/libdl.so.1
        libm.so.1 =>     /usr/lib/libm.so.1
        libc.so.1 =>     /usr/lib/libc.so.1
        libmp.so.2 =>    /usr/lib/libmp.so.2
        /usr/platform/SUNW,Ultra-5_10/lib/libc_psr.so.1
bash-2.03#

So, how can I fix the problem, please?

Best Regards,

Ahmed



Tom Lane wrote:

> Peter Eisentraut <peter_e@gmx.net> writes:
> > Ahmed Moustafa writes:
> >> I downloaded Postgres 7.1RC1 from
> >> ftp://ftp.postgresql.org/pub/dev/postgresql-7.1RC1.tar.gz. When I did
> >> ./configure, I got a error with the test program. I could not figure out
> >> the problem. Would you take a look at the config.log
> >> (http://www.photo.net/users/ahmed/config.log) and tell me the problem
> >> is, please?
>
> > In configure, line 6846, can you replace the 'return 0;' by 'exit(0);'?
> > It's a long shot, but I don't see any other possibility.
>
> I am suspicious that it's a library linking issue.  Unfortunately,
> configure unhelpfully /dev/null's the stderr output obtained while
> trying to execute the test program.  (Peter, shouldn't we suggest to
> the autoconf boys that that output ought to go into config.log?)
>
> Please try running the same test scenario by hand so we can see what is
> printed:
>
> echo "int main() { return 0; }"  >conftest.c
> gcc -o conftest conftest.c -lz -lresolv -lgen -lnsl -lsocket -ldl -lm
> ./conftest
>
> It might also be useful to see what "ldd conftest" produces.
>
>                         regards, tom lane

Attachment

Re: Postgres 7.1RC1 on Solaris 7

From
Ahmed Moustafa
Date:
Thanks a lot. Adding /usr/local/lib to the LD_LIBRARY_PATH solved the problem. But
now Webmin gives this error

"The PostgreSQL database on your system is version , but Webmin only supports
versions 6.5 and above."

Although, it was working with version 7.0.3. Is it Webmin's problem?

Again, thanks a lot for your help.



Peter Eisentraut wrote:

> Ahmed Moustafa writes:
>
> > bash-2.03# echo "int main() { return 0; }"  >conftest.c
> > bash-2.03# gcc -o conftest conftest.c -lz -lresolv -lgen -lnsl -lsocket -ldl
> > -lm
> > bash-2.03# ./conftest
> > ld.so.1: ./conftest: fatal: libz.so: open failed: No such file or directory
>
> You need to set the LD_LIBRARY_PATH environment variable to include the
> location where libz is installed, e.g.,
>
> LD_LIBRARY_PATH=/usr/local/lib
> export LD_LIBRARY_PATH
>
> ... or whichever method to configure the dynamic linker you prefer.  I'll
> update FAQ_Solaris about this.
>
> --
> Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/

Attachment

Re: Postgres 7.1RC1 on Solaris 7

From
David George
Date:
Ahmed Moustafa wrote:

> Hi Tom,
>
> I did the test by hand and here is the output:
>
> bash-2.03# echo "int main() { return 0; }"  >conftest.c
> bash-2.03# gcc -o conftest conftest.c -lz -lresolv -lgen -lnsl -lsocket -ldl
> -lm
> bash-2.03# ./conftest
> ld.so.1: ./conftest: fatal: libz.so: open failed: No such file or directory
> Killed
> bash-2.03# ldd conftest
>         libz.so =>       (file not found)

Are you sure you have zlib?  Solaris 7 doesn't come with it.  Try doing a 'find /
-name libz.a -print'.  If it doesn't find anything you will need to download
zlib-1.1.3 from  ftp://ftp.freesoftware.com/pub/infozip/zlib/zlib-1.1.3.tar.gz

Hope this helps.

--
David


Re: Postgres 7.1RC1 on Solaris 7

From
Tom Lane
Date:
David George <david@onyxsoft.com> writes:
> Ahmed Moustafa wrote:
>> I did the test by hand and here is the output:
>>
>> bash-2.03# echo "int main() { return 0; }"  >conftest.c
>> bash-2.03# gcc -o conftest conftest.c -lz -lresolv -lgen -lnsl -lsocket -ldl
>> -lm
>> bash-2.03# ./conftest
>> ld.so.1: ./conftest: fatal: libz.so: open failed: No such file or directory
>> Killed
>> bash-2.03# ldd conftest
>> libz.so =>       (file not found)

> Are you sure you have zlib?  Solaris 7 doesn't come with it.

configure had found zlib earlier in its run, so it's on his machine
somewhere.  The problem here is inconsistency between the library search
path used when creating an executable and the search path used by the
dynamic loader at run time.  (gcc's habit of searching /usr/local/lib
by default can be nasty on a platform whose dynamic loader doesn't also
have that convention...)

            regards, tom lane

Re: Postgres 7.1RC1 on Solaris 7

From
Ahmed Moustafa
Date:
I got another problem. Here is my /etc/init.d/postgres

#------------------------------------------------------------------------------------

#!/bin/sh
# PostgreSQL

case "$1" in
'start')
 su - postgres -c "/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data start"
 ;;
'stop')
 su - postgres -c "/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data stop"
 ;;
*)
 echo "Usage: $0 { start | stop }"
 ;;
esac
exit 0

#------------------------------------------------------------------------------------

When I do "/etc/init.d/postgres start" as a root, I get:

ld.so.1: /usr/local/pgsql/bin/postmaster: fatal: libz.so: open failed: No such file
or directory
548 Killed
postmaster successfully started

And, when I do "psql testdb" as postgres, I get:
psql: connectDBStart() -- connect() failed: No such file or directory
        Is the postmaster running locally
        and accepting connections on Unix socket '/tmp/.s.PGSQL.5432'?

But, when I do "/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data start" as
postgres, everything works fine.

Also, the "env" gives same for both root and postgres:
PWD=/export/home/postgres
TZ=US/Pacific
HZ=100
HOSTNAME=my_host_name
LD_LIBRARY_PATH=/usr/lib/:/usr/local/lib:/usr/local/pgsql/lib
MANPATH=:/usr/local/pgsql/man
MACHTYPE=sparc-sun-solaris2.7
WAS_DIR=/opt/WebSphere/AppServer
DISPLAY=10.209.70.125:0.0
LOGNAME=postgres
SHLVL=1
SHELL=/usr/local/bin/bash
HOSTTYPE=sparc
CVSROOT=/usr/local/cvsroot
OSTYPE=solaris2.7
HOME=/export/home/postgres
TERM=vt100
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/X/bin:/usr/ccs/bin:/usr/local/pgsql/bin

_=/bin/env

What could be the problem, please?

Your help is appreciated so much.

Ahmed

Tom Lane wrote:

> David George <david@onyxsoft.com> writes:
> > Ahmed Moustafa wrote:
> >> I did the test by hand and here is the output:
> >>
> >> bash-2.03# echo "int main() { return 0; }"  >conftest.c
> >> bash-2.03# gcc -o conftest conftest.c -lz -lresolv -lgen -lnsl -lsocket -ldl
> >> -lm
> >> bash-2.03# ./conftest
> >> ld.so.1: ./conftest: fatal: libz.so: open failed: No such file or directory
> >> Killed
> >> bash-2.03# ldd conftest
> >> libz.so =>       (file not found)
>
> > Are you sure you have zlib?  Solaris 7 doesn't come with it.
>
> configure had found zlib earlier in its run, so it's on his machine
> somewhere.  The problem here is inconsistency between the library search
> path used when creating an executable and the search path used by the
> dynamic loader at run time.  (gcc's habit of searching /usr/local/lib
> by default can be nasty on a platform whose dynamic loader doesn't also
> have that convention...)
>
>                         regards, tom lane

Attachment

Re: Postgres 7.1RC1 on Solaris 7

From
Tom Lane
Date:
Ahmed Moustafa <ahmed.moustafa@bigfoot.com> writes:
> When I do "/etc/init.d/postgres start" as a root, I get:

> ld.so.1: /usr/local/pgsql/bin/postmaster: fatal: libz.so: open failed: No such file
> or directory

I should think the answer would be fairly obvious: LD_LIBRARY_PATH isn't
set in your root environment.

            regards, tom lane

RE: Postgres 7.1RC1 on Solaris 7

From
"Ahmed Moustafa"
Date:
Tom,

I set LD_LIBRARY_PATH in root's .profile  and I still get the same error. Do
I need to set somewhere else, please?

Best Regards,

Ahmed




-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
Sent: Wednesday, April 04, 2001 5:44 PM
To: Ahmed Moustafa
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Postgres 7.1RC1 on Solaris 7


Ahmed Moustafa <ahmed.moustafa@bigfoot.com> writes:
> When I do "/etc/init.d/postgres start" as a root, I get:

> ld.so.1: /usr/local/pgsql/bin/postmaster: fatal: libz.so: open failed: No
such file
> or directory

I should think the answer would be fairly obvious: LD_LIBRARY_PATH isn't
set in your root environment.

            regards, tom lane

Attachment

Re: Postgres 7.1RC1 on Solaris 7

From
Martín Marqués
Date:
On Friday 06 April 2001 06:20, Ahmed Moustafa wrote:
> Tom,
>
> I set LD_LIBRARY_PATH in root's .profile  and I still get the same error.
> Do I need to set somewhere else, please?

I had the same problem. It's because Solaris isn't reading the .bashrc,
.profile or what ever. Solution: ln -s /usr/local/lib/libz.so /usr/lib/libz.so

Saludos... :-)

--
El mejor sistema operativo es aquel que te da de comer.
Cuida tu dieta.
-----------------------------------------------------------------
Martin Marques                  |        mmarques@unl.edu.ar
Programador, Administrador      |       Centro de Telematica
                       Universidad Nacional
                            del Litoral
-----------------------------------------------------------------

Re: Postgres 7.1RC1 on Solaris 7

From
Justin Clift
Date:
Hi,

It doesn't seem to have been mentioned that the preferable way to
compile PostgreSQL on Solaris is to unset your LD_LIBRARY_PATH and set
an LD_RUN_PATH instead.

That is right isn't it?

Regards and best wishes,

Justin Clift

Ahmed Moustafa wrote:
>
> Hi Tom,
>
> I did the test by hand and here is the output:
>
> bash-2.03# echo "int main() { return 0; }"  >conftest.c
> bash-2.03# gcc -o conftest conftest.c -lz -lresolv -lgen -lnsl -lsocket -ldl
> -lm
> bash-2.03# ./conftest
> ld.so.1: ./conftest: fatal: libz.so: open failed: No such file or directory
> Killed
> bash-2.03# ldd conftest
>         libz.so =>       (file not found)
>         libresolv.so.2 =>        /usr/lib/libresolv.so.2
>         libgen.so.1 =>   /usr/lib/libgen.so.1
>         libnsl.so.1 =>   /usr/lib/libnsl.so.1
>         libsocket.so.1 =>        /usr/lib/libsocket.so.1
>         libdl.so.1 =>    /usr/lib/libdl.so.1
>         libm.so.1 =>     /usr/lib/libm.so.1
>         libc.so.1 =>     /usr/lib/libc.so.1
>         libmp.so.2 =>    /usr/lib/libmp.so.2
>         /usr/platform/SUNW,Ultra-5_10/lib/libc_psr.so.1
> bash-2.03#
>
> So, how can I fix the problem, please?
>
> Best Regards,
>
> Ahmed
>
> Tom Lane wrote:
>
> > Peter Eisentraut <peter_e@gmx.net> writes:
> > > Ahmed Moustafa writes:
> > >> I downloaded Postgres 7.1RC1 from
> > >> ftp://ftp.postgresql.org/pub/dev/postgresql-7.1RC1.tar.gz. When I did
> > >> ./configure, I got a error with the test program. I could not figure out
> > >> the problem. Would you take a look at the config.log
> > >> (http://www.photo.net/users/ahmed/config.log) and tell me the problem
> > >> is, please?
> >
> > > In configure, line 6846, can you replace the 'return 0;' by 'exit(0);'?
> > > It's a long shot, but I don't see any other possibility.
> >
> > I am suspicious that it's a library linking issue.  Unfortunately,
> > configure unhelpfully /dev/null's the stderr output obtained while
> > trying to execute the test program.  (Peter, shouldn't we suggest to
> > the autoconf boys that that output ought to go into config.log?)
> >
> > Please try running the same test scenario by hand so we can see what is
> > printed:
> >
> > echo "int main() { return 0; }"  >conftest.c
> > gcc -o conftest conftest.c -lz -lresolv -lgen -lnsl -lsocket -ldl -lm
> > ./conftest
> >
> > It might also be useful to see what "ldd conftest" produces.
> >
> >                         regards, tom lane
>
>   ------------------------------------------------------------------------
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

--
"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."
     - Indira Gandhi

RE: Postgres 7.1RC1 on Solaris 7

From
"Ahmed Moustafa"
Date:
Martín,

The problem was solved by explicitly defining LD_LIBRARY_PATH in the command
line i.e.


su - postgres -c "export
LD_LIBRARY_PATH=/usr/lib/:/usr/local/lib:/usr/local/pgsql/lib ;
/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data start"


Best Regards,

Ahmed


-----Original Message-----
From: Martín Marqués [mailto:martin@bugs.unl.edu.ar]
Sent: Friday, April 06, 2001 9:22 AM
To: Ahmed Moustafa; Tom Lane
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Postgres 7.1RC1 on Solaris 7


On Friday 06 April 2001 06:20, Ahmed Moustafa wrote:
> Tom,
>
> I set LD_LIBRARY_PATH in root's .profile  and I still get the same error.
> Do I need to set somewhere else, please?

I had the same problem. It's because Solaris isn't reading the .bashrc,
.profile or what ever. Solution: ln -s /usr/local/lib/libz.so
/usr/lib/libz.so

Saludos... :-)

--
El mejor sistema operativo es aquel que te da de comer.
Cuida tu dieta.
-----------------------------------------------------------------
Martin Marques                  |        mmarques@unl.edu.ar
Programador, Administrador      |       Centro de Telematica
                       Universidad Nacional
                            del Litoral
-----------------------------------------------------------------

Attachment

Re: Postgres 7.1RC1 on Solaris 7

From
Peter Eisentraut
Date:
Justin Clift writes:

> It doesn't seem to have been mentioned that the preferable way to
> compile PostgreSQL on Solaris is to unset your LD_LIBRARY_PATH and set
> an LD_RUN_PATH instead.
>
> That is right isn't it?

Not really.  You don't need to set either of these variables.  In the
problem that was posted LD_LIBRARY_PATH was necessary to find a
non-PostgreSQL library.  This is a system administration issue, which any
other source package (that uses the library in question) would run into.

--
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/