install pysql on mac osx

Gerhard Häring gerhard.nospam at bigfoot.de
Mon Sep 10 20:58:30 CEST 2001


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10 Sep 2001 09:57:31 -0700, rdack <rdacker at pacbell.net> wrote:
>installed postgresql 7.1.3, python 2.1. now trying to install pypgsql.
>1.5.1
>all on os x 10.0x (how do i know os version#?) G4.
>starts out: doing 'python setup.py build' ok, but get
>
>"undefined or invalid # directive" in every file.
>
>goes along until:
>
>cc -bundle -undefined suppress build/temp.darwin-1.3-Power
>Macintosh-2.1/libpqmodule.o build/temp.darwin-1.3-Power
>Macintosh-2.1/pgboolean.o build/temp.darwin-1.3-Power
>Macintosh-2.1/pgint2object.o build/temp.darwin-1.3-Power
>Macintosh-2.1/pgint8object.o build/temp.darwin-1.3-Power
>Macintosh-2.1/pgversion.o build/temp.darwin-1.3-Power
>Macintosh-2.1/pglargeobject.o build/temp.darwin-1.3-Power
>Macintosh-2.1/pgnotify.o build/temp.darwin-1.3-Power
>Macintosh-2.1/pgconnection.o build/temp.darwin-1.3-Power
>Macintosh-2.1/pgresult.o build/temp.darwin-1.3-Power
>Macintosh-2.1/pymemstrdup.o -L/usr/local/pgsql/lib
>-R/usr/local/pgsql/lib -lpq -o build/lib.darwin-1.3-Power
>Macintosh-2.1/libpqmodule.so
>cc: unrecognized option `-R/usr/local/pgsql/lib'
>/usr/bin/ld: table of contents for archive:
>/usr/local/pgsql/lib/libpq.a is out of date; rerun ranlib(1) (can't
>load from it)
>error: command 'cc' failed with exit status 1
>
>looks like '-R' option is missing a space after it? what can i do?

The -R option is not the cause why the build failed. It comes from the
runtime_library_dirs option to distutils, which, unfortunately, currently
doesn't work with gcc. It's only needed if you link against a shared libpq
library and the shared lib isn't in the system loader's default search path
(usually /lib, /usr/lib and /usr/local/lib). There are several workarounds:

- - set LD_LIBRARY_PATH to the directory libpq can be found (/usr/local/pgsql/lib)
- - do a setup.py build, then copy the last gcc command (the one with the -R
  option), paste it to a terminal and insert a "-Xlinker " just before the -R.
  Run this modified command. Ugh!

However, your libpq seems to be a static library (libpq.a), so the entire -R
option shouldn't be needed and the gcc warning can be safely ignored.

>i see a 74k file "build/lib.darwin-1.3-Power Macintosh-2.1/PgSQL.py"
>but i can't believe it is build let alone installed.

No, when everything compiles correctly, there should be a
"build/lib.darwin-1.3-Power Macintosh-2.1/libpqmodule.so", too.

>/usr/bin/ld: table of contents for archive:
>/usr/local/pgsql/lib/libpq.a is out of date; rerun ranlib(1) (can't
>load from it)
>error: command 'cc' failed with exit status 1

This seems to be the real problem, but I don't have any idea what this means.
Have you re-run ranlib? Is your PostgreSQL installation ok?

You might also want to submit at Support Request at the Sourceforge project
page for PyPgSQL. Perhaps the main developer, Billy G. Allie knows more than
me.

Gerhard
- -- 
mail:   gerhard <at> bigfoot <dot> de       registered Linux user #64239
web:    http://www.cs.fhm.edu/~ifw00065/    public key at homepage
public key fingerprint: DEC1 1D02 5743 1159 CD20  A4B6 7B22 6575 86AB 43C0
reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.5 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7nQ1TeyJldYarQ8ARAsTgAJ9kS0xJeyPu3ef4r7gP1O0N2+IdEwCeJSp2
qU4Rw+V2Qh9tOtWiUGw9ScM=
=fLJk
-----END PGP SIGNATURE-----



More information about the Python-list mailing list