2012-05-10 48 views
3

試圖在Ubuntu 11.10上安裝PostGIS 2.0.0。我基本上遵循這裏找到的OSGeo說明:http://trac.osgeo.org/postgis/wiki/UsersWikiPostGIS20Ubuntu1110src。我建立了GEOS 3.3.3。如果我輸入geos-config --version進入終端,則返回3.3.3PostGIS 2.0.0安裝GEOS問題

我沒有問題運行./configuremake./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安裝。據我所知,我只有一個。有任何想法嗎?

回答

4

PostGIS正試圖從不同的geos庫中加載符號,然後加載它所編譯的符號。在您的系統上搜索地理位置,將其全部刪除並重新編譯。

0

我寫這些指令時遇到了這個問題而回,並submitted a bug它。我試過修復它,但放棄了,因此make test有一個已知的限制。 (我會急於找出測試問題並重新打開票證,這裏有任何提示,可能與Makefile有關,因爲它將GEOS版本與GDAL混合使用。)

儘管make test失敗,您的安裝應該沒有這個問題,所以我會繼續下一步並安裝。

5

我認爲這是由於PostGIS的思想庫是在不同的位置您的服務器上,然後他們實際上是。我從Ubuntu GIS獲得的軟件包也有同樣的錯誤。它們被安裝到/ usr/lib,但由於某種原因,postgis正在/ usr/local/lib中查找它們。無論哪種方式,我運行'ldconfig'並再次運行測試,它工作得很好。

+0

這是對的,修正了同樣的問題。謝謝 – chhantyal