正在尝试在Ubuntu11.10上安装PostGIS 2.0.0。我基本上遵循了这里的OSGeo说明:http://trac.osgeo.org/postgis/wiki/UsersWikiPostGIS20Ubuntu1110src。我构建了GEOS 3.3.3。如果我在终端中键入geos-config --version,将返回3.3.3。
我可以毫无问题地运行./configure和make。./configure以:
PostGIS is now configured for x86_64-unknown-linux-gnu
-------------- Compiler Info -------------
C compiler: gcc -g -O2
C++ compiler: g++ -g -O2
-------------- Dependencies --------------
GEOS config: /usr/local/bin/geos-config
GEOS version: 3.3.3
GDAL config: /usr/local/bin/gdal-config
GDAL version: 1.9.0
PostgreSQL config: /usr/bin/pg_config
PostgreSQL version: PostgreSQL 9.1.3
PROJ4 version: 47
Libxml2 config: /usr/bin/xml2-config
Libxml2 version: 2.7.8
JSON-C support: no
PostGIS debug level: 0
Perl: /usr/bin/perl
--------------- Extensions ---------------
PostGIS Raster: enabled
PostGIS Topology: enabled
-------- Documentation Generation --------
xsltproc: /usr/bin/xsltproc
xsl style sheets:
dblatex:
convert:
mathml2.dtd: http://www.w3.org/Math/DTD/mathml2/mathml2.dtd 一切看起来都很好,对吧?但这里有个问题。当我运行make test时,构建失败,最后显示以下内容:
Creating spatial db postgis_reg
createlang: language "plpgsql" is already installed in database "postgis_reg"
Preparing spatial db postgis_reg
Something went wrong during db initialization (core module).
For details, check /tmp/pgis_reg/regress_log
make[1]: *** [check] Error 1
make[1]: Leaving directory `/home/anthony/Downloads/postgis-2.0.0/regress'
make: *** [check] Error 1/tmp/pgis_reg/regress_log的内部是:
SET
BEGIN
psql:/home/anthony/Downloads/postgis-2.0.0/regress/00-regress-install/share/contrib/postgis/postgis.sql:69: ERROR: could not load library "/home/anthony/Downloads/postgis-2.0.0/regress/00-regress-install/lib/postgis-2.0.so": /home/anthony/Downloads/postgis-2.0.0/regress/00-regress-install/lib/postgis-2.0.so: undefined symbol: GEOSRelatePatternMatch我试图忽略这个问题,继续运行sudo make install,但是当我使用psql -d infinitydb -f postgis.sql设置我的数据库时,我得到了类似的问题:
SET
BEGIN
psql:postgis.sql:69: ERROR: could not load library "/usr/lib/postgresql/9.1/lib/postgis-2.0.so": /usr/lib/postgresql/9.1/lib/postgis-2.0.so: undefined symbol: GEOSRelatePatternMatch我在网上四处寻找,发现另一个人有GEOSRelatePatternMatch问题,但他的问题是由于多个GEOS安装造成的。据我所知,我只有一个。有什么想法吗?
发布于 2012-05-22 19:52:28
PostGIS试图从不同的geos库中加载符号,而不是编译时使用的库。在您的系统中搜索geo,将其全部删除并重新编译。
发布于 2012-07-11 01:48:36
我认为这是因为postgis认为库在服务器上的位置与它们的实际位置不同。对于我从Ubuntu GIS得到的包,我也遇到了同样的错误。它们被安装在/usr/lib中,但是出于某种原因,postgis在/usr/local/lib中查找它们。无论哪种方式,我运行'ldconfig‘并再次运行测试,它工作得很好。
发布于 2012-05-13 16:17:41
前段时间我在写这些指令的时候遇到了这个问题,并为此编写了submitted a bug。我尝试过修复它,但是放弃了,因此make test有一个众所周知的限制。(我渴望找出测试的问题,并重新打开票证,那里有任何指针。可能与Makefile有关,因为它混合了GEOS和GDAL的版本。)
尽管make test失败了,但您的安装应该可以在没有这个问题的情况下工作,所以我将继续执行下一步并进行安装。
https://stackoverflow.com/questions/10543552
复制相似问题