Page 1 of 1

./configure cannot find certain .so file

Posted: Tue Nov 17, 2009 8:40 am
by Kreshna Aryaguna Nurzaman
I'm compiling PostGIS with the following command:
./configure --with-pgconfig=/usr/local/pgsql/bin/pg_config --with-geosconfig=/usr/local/bin/geos-config


Yet I keep getting this error message:
configure: error: could not find libgeos_c - you may need to specify the directory of a geos-config file using --with-geosconfig


The problem is: libgeos_c.so does indeed exist in the /usr/local/lib/. Also, geos-config points to the right direction. Here is the first four lines of geos-config:
#!/bin/sh
prefix=/usr/local
exec_prefix=${prefix}
libdir=/usr/local/lib


Furthermore, I have checked /etc/ld.so.conf, and /usr/local/lib exists in the file:
include ld.so.conf.d/*.conf
/usr/local/lib
/usr/local/BerkeleyDB.4.7/lib

I also have run ldconfig ad nauseam.

By the way, I'm using PostGIS 1.4.0 and Geos 3.1.1. My linux version is CentOS release 4.2 (Final). What happens?

Re: ./configure cannot find certain .so file

Posted: Tue Nov 17, 2009 9:20 am
by notfred
Kreshna Aryaguna Nurzaman wrote:
--with-geosconfig=/usr/local/bin/geos-config
you may need to specify the directory of a geos-config file using --with-geosconfig

Looks like it wants the directory and you are giving it the actual file.

Re: ./configure cannot find certain .so file

Posted: Tue Nov 17, 2009 9:14 pm
by Kreshna Aryaguna Nurzaman
notfred wrote:
Kreshna Aryaguna Nurzaman wrote:
--with-geosconfig=/usr/local/bin/geos-config
you may need to specify the directory of a geos-config file using --with-geosconfig

Looks like it wants the directory and you are giving it the actual file.

I have tried giving it the directory too, but still no dice. :(

Re: ./configure cannot find certain .so file

Posted: Tue Nov 17, 2009 9:31 pm
by bthylafh
Have you tried running ldconfig to refresh your system's idea of which libraries exist?

Re: ./configure cannot find certain .so file

Posted: Wed Nov 18, 2009 12:21 am
by Kreshna Aryaguna Nurzaman
bthylafh wrote:
Have you tried running ldconfig to refresh your system's idea of which libraries exist?

Yes, ad nauseam :( And /usr/local/lib/ folder, where libgeos_c.so resides, is already there in the /etc/ld.so.conf. I've also tried ldconfig -v and it didn't help either.

However, someone from postGIS mailing list told me to compile the sofware with LDFLAGS=-lstdc++.
LDFLAGS=-lstdc++ ./configure --with-pgconfig=/usr/local/pgsql/bin/pg_config --with-geosconfig=/usr/local/bin/geos-config

I tried, and then the whole compilation process went smoothly.

I still don't understand though: why? Why does it need LDFLAGS? What does it mean?

Re: ./configure cannot find certain .so file

Posted: Wed Nov 18, 2009 12:25 am
by bthylafh
Not sure, but my spidey sense tells me that the program's Makefile (or configure script) is broken. At any rate, there should have been a stanza in your Makefile that included those libs.

LDFLAGS is a set of arguments that get passed to your linker (ld) once compilation is done.

File a bug report?

Re: ./configure cannot find certain .so file

Posted: Wed Nov 18, 2009 12:30 am
by just brew it!
Well, the LDFLAGS is forcing the linker to search the Standard C++ library in addition to any other libraries it may be searching. The fact that this application apparently needs something in the Standard C++ library but doesn't search it by default may be an indication that the Makefile is busted (as bthylafh indicated).

Re: ./configure cannot find certain .so file

Posted: Wed Nov 18, 2009 6:22 pm
by Nitrodist

Re: ./configure cannot find certain .so file

Posted: Thu Nov 19, 2009 4:44 pm
by Nitrodist
Well? Was the issue resolved?

Re: ./configure cannot find certain .so file

Posted: Thu Nov 19, 2009 5:47 pm
by just brew it!
Nitrodist wrote:
Well? Was the issue resolved?

Umm...

The OP said it was resolved, both in this thread and the one you linked.