[GRASSLIST:663] configure with postgres on OS X

Hi,

I'm trying to install GRASS 5.0.2 on OS X (10.2.6) with postgresql support and I can't figure out what the --with-postgres-libs argument is looking for. I've tried looking through the configure script but my shell programming isn't good enough to work it out.

I've tried:

./configure --with-postgres-includes=/usr/local/pgsql/include --with-postgres-libs=/usr/local/pgsql/lib

and

./configure --with-postgres-includes=/usr/local/pgsql/include --with-postgres-libs=/usr/local/lib

The includes are found without any problem. I have PostGreSQL v. 7.3.3 installed.

Thanks,
David

David Orme wrote:

I'm trying to install GRASS 5.0.2 on OS X (10.2.6) with postgresql
support and I can't figure out what the --with-postgres-libs argument
is looking for.

It is typically the directory containing libpq (the PostgreSQL client
library), e.g. libpq.a or libpq.dylib.

I've tried looking through the configure script but my
shell programming isn't good enough to work it out.

I've tried:

./configure --with-postgres-includes=/usr/local/pgsql/include
--with-postgres-libs=/usr/local/pgsql/lib

and

./configure --with-postgres-includes=/usr/local/pgsql/include
--with-postgres-libs=/usr/local/lib

These look normal, although I don't know where libpq is.

However, note that the configure check isn't "does this file exist?",
but "does linking against this library succeed?".

Even if the library is present and you provide the correct path, many
other factors could cause linking to fail. Look in the config.log
file, after the line:

configure:8974: checking for location of PostgreSQL library

Any error messages which result from linking should follow.

--
Glynn Clements <glynn.clements@virgin.net>

Thanks for the help - I now, of course, have a follow up...

The postgres library is: /usr/local/psql/lib/pqsql.a

The config.log shows a problem with compiling a test file with gcc

configure:8974: checking for location of PostgreSQL library
configure:9003: checking for PQsetdbLogin in -lpq
configure:9020: gcc -o conftest -g -O2 -L/usr/local/lib conftest.c -lpq 1>&5

There are four variants of the last line, all of which fail, using combinations of -lcrypto and -lssl.

My gcc version is:

Reading specs from /usr/libexec/gcc/darwin/ppc/3.1/specs
Thread model: posix
Apple Computer, Inc. GCC version 1175, based on gcc version 3.1 20020420 (prerelease)

Any suggestions?

Thanks in advance,
David

On Wednesday, July 9, 2003, at 02:39 pm, Glynn Clements wrote:

David Orme wrote:

I'm trying to install GRASS 5.0.2 on OS X (10.2.6) with postgresql
support and I can't figure out what the --with-postgres-libs argument
is looking for.

It is typically the directory containing libpq (the PostgreSQL client
library), e.g. libpq.a or libpq.dylib.

I've tried looking through the configure script but my
shell programming isn't good enough to work it out.

I've tried:

./configure --with-postgres-includes=/usr/local/pgsql/include
--with-postgres-libs=/usr/local/pgsql/lib

and

./configure --with-postgres-includes=/usr/local/pgsql/include
--with-postgres-libs=/usr/local/lib

These look normal, although I don't know where libpq is.

However, note that the configure check isn't "does this file exist?",
but "does linking against this library succeed?".

Even if the library is present and you provide the correct path, many
other factors could cause linking to fail. Look in the config.log
file, after the line:

configure:8974: checking for location of PostgreSQL library

Any error messages which result from linking should follow.

--
Glynn Clements <glynn.clements@virgin.net>

On Wednesday, July 9, 2003, at 01:49 AM, David Orme wrote:

Hi,

I'm trying to install GRASS 5.0.2 on OS X (10.2.6) with postgresql support and I can't figure out what the --with-postgres-libs argument is looking for. I've tried looking through the configure script but my shell programming isn't good enough to work it out.

I've tried:

./configure --with-postgres-includes=/usr/local/pgsql/include --with-postgres-libs=/usr/local/pgsql/lib

and

./configure --with-postgres-includes=/usr/local/pgsql/include --with-postgres-libs=/usr/local/lib

The includes are found without any problem. I have PostGreSQL v. 7.3.3 installed.

Thanks,
David

Use locate to find the file libpq.a. On my machine it is located in /sw/lib, but I'm using Fink. Give that directory to configure.

Dave

David Orme wrote:

The postgres library is: /usr/local/psql/lib/pqsql.a

In which case, the correct switch would be:

  --with-postgres-libs=/usr/local/psql/lib

The config.log shows a problem with compiling a test file with gcc

> configure:8974: checking for location of PostgreSQL library
> configure:9003: checking for PQsetdbLogin in -lpq
> configure:9020: gcc -o conftest -g -O2 -L/usr/local/lib conftest.c
> -lpq 1>&5

The last line above is the linking command; the line(s) immediately
after this (i.e. the error messages) are the ones which are relevant.

However, in this case, the error is likely to be that it simply
couldn't find libpq because it wasn't looking in /usr/local/psql/lib.

--
Glynn Clements <glynn.clements@virgin.net>

Hi,

For future information, the config.log showed:

configure:9128: gcc -o conftest -g -O2 -L/usr/local/pgsql/lib conftest.c -lpq -lcrypt -lssl -lcrypto 1>&5
ld: table of contents for archive: /usr/local/pgsql/lib/libpq.a is out of date; rerun ranlib(1) (can't load from it)

I backed up libpq.a and then used ranlib on it and now the configure script runs (well, past the postgres configure anyway!)

Thanks for all your help

David