LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Cannot find certain .so file, but it *exists* in /usr/local/lib/ (https://www.linuxquestions.org/questions/linux-software-2/cannot-find-certain-so-file-but-it-%2Aexists%2A-in-usr-local-lib-769659/)

Kreshna 11-17-2009 07:08 AM

Cannot find certain .so file, but it *exists* in /usr/local/lib/
 
I'm compiling PostGIS with the following command:
Code:

./configure --with-pgconfig=/usr/local/pgsql/bin/pg_config --with-geosconfig=/usr/local/bin/geos-config
Yet I keep getting this error message:
Code:

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:
Code:

#!/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:
Code:

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?

MensaWater 11-17-2009 08:29 AM

The error message says "libgeos_c" not "libgeos_c.so". You might want to view the configure file to see for which file it is actually testing. It may simply be a typo in the configure file that you can manually edit.

knudfl 11-17-2009 07:54 PM

Postgis 1.4.0 : No problems, when /usr/local/lib/
is in the LD_LIBRARY_PATH. In CentOS4 : no.

Suggest : export LD_LIBRARY_PATH=/usr/local/lib/
or add /usr/local/lib/ to /etc/ld.so.conf

.. or ..
# yum search geos geos-devel
.. the epel repo has version 2.2.3
.. rpmforge.repo : 3.1.0

.. or : cd geos-3.1.1/
# make uninstall && exit
./configure --prefix=/usr/
.....

Kreshna 11-18-2009 11:33 PM

Quote:

Originally Posted by knudfl (Post 3760688)
Postgis 1.4.0 : No problems, when /usr/local/lib/
is in the LD_LIBRARY_PATH. In CentOS4 : no.

Suggest : export LD_LIBRARY_PATH=/usr/local/lib/
or add /usr/local/lib/ to /etc/ld.so.conf

.. or ..
# yum search geos geos-devel
.. the epel repo has version 2.2.3
.. rpmforge.repo : 3.1.0

.. or : cd geos-3.1.1/
# make uninstall && exit
./configure --prefix=/usr/
.....

Well I eventually managed to successfully compile postgis by using LDFLAGS=-lstdc++ ./configure. A helpful poster in postgis mailing list told me so, and I just followed his instruction. And everything compiled fine.

Yet I don't really have an idea what does it mean. Someone at TechReport said that LDFLAGS is forcing the linker to search the Standard C++ library in addition to any other libraries, but that's all he said. (sorry, I'm a noob)

(1) Is libgeos_c a standard C++ library? Probably it explains why ./configure failed to find the file, despite I have ran ldconfig ad nauseam.

(2) What is the drawback of using Standard C++ library? (LDFLAGS=-lstdc++)

(3) Is there any problem I have to anticipate in the future? I mean, during runtime?

(4) I will compile MapServer next week, which, by the way, need geos-3.1.1 as well. I have to specify --with-geosconfig=/usr/local/bin/geos-config again in ./configure. Will this problem persists? Should I use LDFLAGS=-lstdc++ ./configure again? Should I use LD_LIBRARY_PATH? But I read in Google that using LD_LIBRARY_PATH is asking for trouble, is that true?

[5](5)[/b]
Quote:

Originally Posted by knudfl (Post 3760688)
Suggest : export LD_LIBRARY_PATH=/usr/local/lib/
or add /usr/local/lib/ to /etc/ld.so.conf

]
I have added /usr/local/lib to /etc/ld.so.conf, and I have run ldconfig many times. Why did it fail?

knudfl 11-19-2009 12:05 PM

Hard to say, why exactly it isn't working on CentOS4 only,
and I'm not going to install a later version of postgreql(-devel)
to find out.
..... .. :) ..
.....

When configure asks for "name" it never says "name".so

Asked for lgeos_c or libgeos_c it means libgeos_c.so
There is no file or library by name libgeos_c present.
The library "Real Name" is ' libgeos_c.so.1.5.0 '.
The " so name " is ' libgeos_c.so.1 '.
The file ' libgeos_c.so ' is a symlink to libgeos_c.so.1.5.0
used at compile / linking time only.
http://tldp.org/HOWTO/Program-Librar...libraries.html
3.1.1
.....

'libgeos_c.Xx', please see ' /geos-3.1.1/source/.libs '
( hidden file ).
.....


All times are GMT -5. The time now is 10:52 PM.