Thread: Darwin/MacOSX 10.1.1 newbie

Darwin/MacOSX 10.1.1 newbie

From
Nathan Wilson
Date:
I think I got through the compile successfully.  I had to modify the
src/makefiles/Makefile.darwin to add -flat_namespace and I removed
$(CFLAGS) from the %.so: %.o line since the flags were getting repeated.
Even so I to do one of the library links by hand.

I got the 'postmaster' process running.  But when I try to do the
'createdb' it fails with:

[localhost:~] postgres% createdb testdb
pqReadData() -- backend closed the channel unexpectedly.
        This probably means the backend terminated abnormally
        before or while processing the request.
connection to server was lost
createdb: database creation failed
[localhost:~] postgres% psql testdb
psql: FATAL 1:  Database "testdb" does not exist in the system catalog.

The log from postmaster says:

[localhost:~] postgres% /usr/local/pgsql/bin/postmaster -D
/usr/local/pgsql/data
DEBUG:  database system was shut down at 2001-11-17 07:50:23 PST
DEBUG:  CheckPoint record at (0, 1522656)
DEBUG:  Redo record at (0, 1522656); Undo record at (0, 0); Shutdown TRUE
DEBUG:  NextTransactionId: 615; NextOid: 18720
DEBUG:  database system is in production state
Server process (pid 13950) exited with status 11 at Sat Nov 17 08:04:43
2001
Terminating any active server processes...
Server processes were terminated at Sat Nov 17 08:04:43 2001
Reinitializing shared memory and semaphores
DEBUG:  database system was interrupted at 2001-11-17 07:51:03 PST
DEBUG:  CheckPoint record at (0, 1522656)
DEBUG:  Redo record at (0, 1522656); Undo record at (0, 0); Shutdown TRUE
DEBUG:  NextTransactionId: 615; NextOid: 18720
DEBUG:  database system was not properly shut down; automatic recovery in
progress...
DEBUG:  ReadRecord: record with zero len at (0, 1522720)
DEBUG:  redo is not required
DEBUG:  database system is in production state
FATAL 1:  Database "testdb" does not exist in the system catalog.

---------------

Oh one other thing, I created the postgres user using the standard System
Preferences panel rather than adduser since that does appear to exist
under MacOS 10.  Also I did change the ownership on /usr/local/pgsql/data
(I also tried it with chowning everything under /usr/local/pgsql).

The system is a PowerBook G3 Lombard running MacOS X 10.1.1 with the 10.1
dev tools.  I tried to find a mailing list archive, but wasn't successful.
I may just need a pointer to that.

I did get it up and running without a hitch under LinuxPPC on an old beige
233 PowerMac.  Looks great!

Thanks in advance,
-Nathan
velosa@cinenet.net



Re: Darwin/MacOSX 10.1.1 newbie

From
Tom Lane
Date:
Nathan Wilson <velosa@cinenet.net> writes:
> [localhost:~] postgres% createdb testdb
> pqReadData() -- backend closed the channel unexpectedly.

Apple broke the system() library function in 10.1, which causes
Postgres to crash during CREATE DATABASE :-(

There is a kluge solution for this in current sources.  Grab a
nightly snapshot tarball, or 7.2beta3 when it's out (should be
tomorrow).  All existing releases up to and including 7.2beta2
are vulnerable to the bug.

            regards, tom lane

Re: Darwin/MacOSX 10.1.1 newbie

From
"Henry B. Hotz"
Date:
At 8:23 AM -0800 11/17/01, Nathan Wilson wrote:
>I think I got through the compile successfully.  I had to modify the
>src/makefiles/Makefile.darwin to add -flat_namespace and I removed
>$(CFLAGS) from the %.so: %.o line since the flags were getting repeated.
>Even so I to do one of the library links by hand.

Did you have to do a --disable-mmap?  Or did they fix that from 10.1 to 10.1.1?
--
The opinions expressed in this message are mine,
not those of Caltech, JPL, NASA, or the US Government.
Henry.B.Hotz@jpl.nasa.gov, or hbhotz@oxy.edu

Re: Darwin/MacOSX 10.1.1 newbie

From
Tom Lane
Date:
"Henry B. Hotz" <hotz@jpl.nasa.gov> writes:
> Did you have to do a --disable-mmap?  Or did they fix that from 10.1 to 10.1.1?

CVS tip builds and passes regression out-of-the-box for me, on OSX 10.1.
(7.2b2 and before did not, because of a problem with the system()
library function.)

I have not installed 10.1.1 yet.  If anyone has found that there's a
problem with post-7.2b2 sources on 10.1.1, *please* let us know ASAP.

            regards, tom lane

Darwin/MacOSX 10.1.1 configure issues with b3

From
"Henry B. Hotz"
Date:
A lot of these issues may not be Postgres, but here are the problems
I ran into in the configure stage with the b3 version.

Can't use kerberos 5 "error: library com_err is required for Kerberos
5"  There is such a library and a man page for such a routine.  If
you create a 3-line dummey program to reference com_err() and use
-lcom_err then you get some funny unresolved external reference by
way of the kerberos 5 framework (which I never asked for).  I'm not
sure if this is a real problem in Apple's framework mechanism or a
funny in the way configure and I are checking for the existence of
the routine.

Can't use openssl because there is no ssl.h file.  This is an old
10.0 bug that I would have hoped was fixed by now.  It does mean I
can't test the openssl integration until I re-fix it though.

Can't use tk.  I loaded the alpha release of the native Aqua Tk port.
It gets me a Wish Shell.app, not a /usr/bin/wish.  This seems
reasonable, but how do we get Postgres to use it?  Can Postgres use
it?

The Tcl header files are in two different non-standard places.  I had
to sudo ln -s to get links all in one directory since it appears you
can only have one --with-includes configure option.  At least the 8.4
alpha includes the headers since the 8.3 with 10.0 didn't.
--
The opinions expressed in this message are mine,
not those of Caltech, JPL, NASA, or the US Government.
Henry.B.Hotz@jpl.nasa.gov, or hbhotz@oxy.edu

Re: Darwin/MacOSX 10.1.1 configure issues with b3

From
Tom Lane
Date:
"Henry B. Hotz" <hotz@jpl.nasa.gov> writes:
> Can't use tk.  I loaded the alpha release of the native Aqua Tk port.
> It gets me a Wish Shell.app, not a /usr/bin/wish.  This seems
> reasonable, but how do we get Postgres to use it?  Can Postgres use
> it?

Hmm, AFAIK we only care about libtk, not wish; but possibly configure
is looking for wish as a proxy for determining whether tk is installed.
Feel free to propose a different test.

> The Tcl header files are in two different non-standard places.  I had
> to sudo ln -s to get links all in one directory since it appears you
> can only have one --with-includes configure option.

    configure --with-includes="path1:path2:pathN"

I believe this is documented.

            regards, tom lane

Re: Darwin/MacOSX 10.1.1 configure issues with b3

From
"Henry B. Hotz"
Date:
At 3:36 PM -0500 11/30/01, Tom Lane wrote:
>"Henry B. Hotz" <hotz@jpl.nasa.gov> writes:
>>  Can't use tk.  I loaded the alpha release of the native Aqua Tk port.
>>  It gets me a Wish Shell.app, not a /usr/bin/wish.  This seems
>>  reasonable, but how do we get Postgres to use it?  Can Postgres use
>>  it?
>
>Hmm, AFAIK we only care about libtk, not wish; but possibly configure
>is looking for wish as a proxy for determining whether tk is installed.
>Feel free to propose a different test.

Well, if we want the library we should test for the library.  Based
on simplistic poking around I would propose "does it work to do cc
tkt.c -ltk -ltcl" where tkt.c contains:

#include <tk.h>
int main(int argc, char **argv)
{
    Tcl_Interp i;

    Tk_InitImageArgs(&i, argc, &argv);
}

I'll try faking it out when I get a chance.  Maybe a ln -s
/Application/... /usr/local/bin/wish.

>  > The Tcl header files are in two different non-standard places.  I had
>>  to sudo ln -s to get links all in one directory since it appears you
>>  can only have one --with-includes configure option.
>
>    configure --with-includes="path1:path2:pathN"
>
>I believe this is documented.

*sigh*  Oh, probably.  Postgres is a big program with justifiably big
documentation.  I've done the the install a few times so I *think* I
don't need to look at the documentation beyond ./configure --help.

Thanks for the tip anyway.
--
The opinions expressed in this message are mine,
not those of Caltech, JPL, NASA, or the US Government.
Henry.B.Hotz@jpl.nasa.gov, or hbhotz@oxy.edu

Re: Darwin/MacOSX 10.1.1 configure issues with b3

From
Peter Eisentraut
Date:
Henry B. Hotz writes:

> Can't use tk.  I loaded the alpha release of the native Aqua Tk port.
> It gets me a Wish Shell.app, not a /usr/bin/wish.  This seems
> reasonable, but how do we get Postgres to use it?  Can Postgres use
> it?

'wish' is used for PgAccess.  We only need the command name to put it into
a shell script (which is what pgaccess is) so different names should work
if the call conventions are the same.  You might want to try to configure
thus:

WISH='Wish Shell.app' ./configure ....

This doesn't affect pgtksh though, it's only that they're lumped together
under --with-tk.

> The Tcl header files are in two different non-standard places.  I had
> to sudo ln -s to get links all in one directory since it appears you
> can only have one --with-includes configure option.  At least the 8.4
> alpha includes the headers since the 8.3 with 10.0 didn't.

The tclConfig.sh file, which is the approved way of detecting Tcl-related
configuration information, doesn't provide any means to find out the
location of the header files, which makes for trouble on quite a few
operating systems.

--
Peter Eisentraut   peter_e@gmx.net


Re: Darwin/MacOSX 10.1.1 configure issues with 7.2b3

From
"Henry B. Hotz"
Date:
At 12:41 PM +0100 12/2/01, Peter Eisentraut wrote:
>Henry B. Hotz writes:
>
>>  Can't use tk.  I loaded the alpha release of the native Aqua Tk port.
>>  It gets me a Wish Shell.app, not a /usr/bin/wish.  This seems
>>  reasonable, but how do we get Postgres to use it?  Can Postgres use
>>  it?
>
>'wish' is used for PgAccess.  We only need the command name to put it into
>a shell script (which is what pgaccess is) so different names should work
>if the call conventions are the same.  You might want to try to configure
>thus:
>
>WISH='Wish Shell.app' ./configure ....
>
>This doesn't affect pgtksh though, it's only that they're lumped together
>under --with-tk.

I did a ln -s /Applications/Wish\ Shell.app/Contents/MacOS/Wish\
Shell /usr/local/bin/wish, and I linked tclConfig.sh to tkConfig.sh.
That got it past the configure step.  If you really need wish then
this probably wouldn't work.  I know there is an easy way to start a
GUI app from the command line and someone needs to create a shell
wrapper for the purpose.

It still failed to compile due to needing some X11 header file even
though this is specifically not an X11 tk port.  This is a tk issue
not a Postgres issue.

After loading the openssl .h files I was able to get it to configure
as follows:
--with-includes=<tcl header dirs>
--with-tcl  --without-tk  --with-tclconfig=<tcl public header dir>
--with-perl
--with-krb4=/usr/local  (I have kth-krb installed for AFS support,
krb5 native doesn't work)
--with-CXX
--enable-syslog

It passes all the regression tests.

Note that I can't actually try out the kerberos support without
paying $30/month for a postgres account including AFS space and the
whole ball of wax.  I just wanted to see if it would compile since
the krb5 native option didn't work.  I'm still not sure if this is a
MacOSX linker issue or some funny in the way Postgres looks at
kerberos.
--
The opinions expressed in this message are mine,
not those of Caltech, JPL, NASA, or the US Government.
Henry.B.Hotz@jpl.nasa.gov, or hbhotz@oxy.edu