在 Ubuntu Linux 上安装功能齐全的 PostGIS 2.0 GEOS/GDAL 问题
我一直致力于在 ubuntu-maverick-amd64 Linux 服务器上启动并运行 postgis 2.0 大约一周。我正在寻求栅格和拓扑支持。
我使用以下内容进行配置:
sudo ./configure --with-raster --with-topology --with-jsondir=/home/zonabili/json-c-0.9
下面的配置文件描述了我的规格。
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.1
GDAL config: /usr/bin/gdal-config
GDAL version: 1.8.0
PostgreSQL config: /usr/bin/pg_config
PostgreSQL version: PostgreSQL 9.1.2
PROJ4 version: 47
Libxml2 config: /usr/bin/xml2-config
Libxml2 version: 2.7.7
JSON-C support: Yes
PostGIS debug level: 0
-------------- Extensions --------------
PostGIS Raster: 0.1.6d
PostGIS Topology
-------- Documentation Generation --------
xsltproc: /usr/bin/xsltproc
xsl style sheets:
dblatex: /usr/bin/dblatex
convert: /usr/bin/convert
我设法使用旧版本(对新功能无用)的 gdal 和 geos 运行 make 和 sudo make install 。因此,我的猜测是问题出在我安装的 GEOS 或 GDAL 上。我的 Linux 版本没有 3.3.1 可下载包,所以我必须从源代码构建,我可能搞砸了,因为我不习惯这样做,尽管我遵循了 网站 并下载了 tar 文件。除了 cd 到配置 make 和安装的目录之外,我没有偏离说明。我做了它明确规定我应该做的一切。当我构建它时,我没有收到一条消息表明它构建正确,所以我认为出了问题,因为我在失败的 postgis 构建结束时收到以下错误:
make[2]: Leaving directory `/home/zonabili/postgis-2.0.0SVN/raster/rt_pg'
make -C loader
make[2]: Entering directory `/home/zonabili/postgis-2.0.0SVN/raster/loader'
/bin/bash ../..//libtool --mode=link gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-pr
ototypes -I../rt_core -I/home/zonabili/postgis-2.0.0SVN/liblwgeom -I/usr/includ
e/gdal -I/usr/local/include raster2pgsql.o ../rt_core/librtcore.a ../rt_core/lib
rtcore.a /home/zonabili/postgis-2.0.0SVN/liblwgeom/.libs/liblwgeom.a -L/usr/lib
-lgdal1.8.0 -L/usr/local/lib -lgeos_c -lm -o raster2pgsql
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -I../rt_core -I/home/zonabili/
postgis-2.0.0SVN/liblwgeom -I/usr/include/gdal -I/usr/local/include raster2pgsql
.o -o raster2pgsql ../rt_core/librtcore.a /home/zonabili/postgis-2.0.0SVN/liblw
geom/.libs/liblwgeom.a -L/usr/lib -lgdal1.8.0 -L/usr/local/lib -lgeos_c -lm
/home/zonabili/postgis-2.0.0SVN/liblwgeom/.libs/liblwgeom.a(lwgeom_geos.o): In f
unction `LWGEOM2GEOS':
/home/zonabili/postgis-2.0.0SVN/liblwgeom/lwgeom_geos.c:319: undefined reference
to `GEOSGeom_createEmptyPolygon'
/home/zonabili/postgis-2.0.0SVN/liblwgeom/.libs/liblwgeom.a(lwgeom_geos.o): In f
unction `lwgeom_sharedpaths':
/home/zonabili/postgis-2.0.0SVN/liblwgeom/lwgeom_geos.c:1024: undefined referenc
e to `GEOSSharedPaths'
/home/zonabili/postgis-2.0.0SVN/liblwgeom/.libs/liblwgeom.a(lwgeom_geos.o): In f
unction `lwgeom_snap':
/home/zonabili/postgis-2.0.0SVN/liblwgeom/lwgeom_geos.c:961: undefined reference
to `GEOSSnap'
v collect2: ld returned 1 exit status
make[2]: *** [raster2pgsql] Error 1
make[2]: Leaving directory `/home/zonabili/postgis-2.0.0SVN/raster/loader'
make[1]: *** [rtloader] Error 2
make[1]: Leaving directory `/home/zonabili/postgis-2.0.0SVN/raster'
make: *** [all] Error 1
JSON-C 模块也是一个问题,因为它们都存在说要做的就是解压它并 /.configure 进行它。但我觉得我可能还需要做更多的事情。
我真的对此感到沮丧,因为我觉得我已经很接近了,但不断遇到无法克服的障碍,我不知道该怎么做。
我将非常感谢任何能够帮助修复这些公然错误并帮助我导航这个真正地狱般的安装过程的人!我愿意卸载所有内容并从头开始,尽管我实际上不知道如何卸载 geos,因为我必须从源代码而不是 apt-get 构建它们!
我也是 Linux 新手(我终于弄清楚如何在我的 Windows 笔记本电脑上安装 postgis 2.0!),所以请尽可能描述性。
预先感谢,因为这对我来说非常头疼!
I have been working on getting postgis 2.0 up and running on an ubuntu-maverick-amd64 linux server for about a week now. I am going for raster and topology support.
I used the following to configure:
sudo ./configure --with-raster --with-topology --with-jsondir=/home/zonabili/json-c-0.9
The configuration file below describes my specs.
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.1
GDAL config: /usr/bin/gdal-config
GDAL version: 1.8.0
PostgreSQL config: /usr/bin/pg_config
PostgreSQL version: PostgreSQL 9.1.2
PROJ4 version: 47
Libxml2 config: /usr/bin/xml2-config
Libxml2 version: 2.7.7
JSON-C support: Yes
PostGIS debug level: 0
-------------- Extensions --------------
PostGIS Raster: 0.1.6d
PostGIS Topology
-------- Documentation Generation --------
xsltproc: /usr/bin/xsltproc
xsl style sheets:
dblatex: /usr/bin/dblatex
convert: /usr/bin/convert
I managed to run make and sudo make install with older (and useless for new functions) versions of gdal and geos. Thus, my guess is that the problems lies with my install of GEOS or GDAL. There is no 3.3.1 downloadable package for my linux version so I had to build from source and I probably messed this up as I am not used to doing it, although I followed the directions provided on the website and downloaded the tarfile. I did not deviate from the instructions other than cd-ing to the directory to configure make and install. I did everything that it explicitly stated that I should do. I didn't get a message that it built correctly when I built it, so I think something went wrong as I got the following errors near the end of my failed postgis build:
make[2]: Leaving directory `/home/zonabili/postgis-2.0.0SVN/raster/rt_pg'
make -C loader
make[2]: Entering directory `/home/zonabili/postgis-2.0.0SVN/raster/loader'
/bin/bash ../..//libtool --mode=link gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-pr
ototypes -I../rt_core -I/home/zonabili/postgis-2.0.0SVN/liblwgeom -I/usr/includ
e/gdal -I/usr/local/include raster2pgsql.o ../rt_core/librtcore.a ../rt_core/lib
rtcore.a /home/zonabili/postgis-2.0.0SVN/liblwgeom/.libs/liblwgeom.a -L/usr/lib
-lgdal1.8.0 -L/usr/local/lib -lgeos_c -lm -o raster2pgsql
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -I../rt_core -I/home/zonabili/
postgis-2.0.0SVN/liblwgeom -I/usr/include/gdal -I/usr/local/include raster2pgsql
.o -o raster2pgsql ../rt_core/librtcore.a /home/zonabili/postgis-2.0.0SVN/liblw
geom/.libs/liblwgeom.a -L/usr/lib -lgdal1.8.0 -L/usr/local/lib -lgeos_c -lm
/home/zonabili/postgis-2.0.0SVN/liblwgeom/.libs/liblwgeom.a(lwgeom_geos.o): In f
unction `LWGEOM2GEOS':
/home/zonabili/postgis-2.0.0SVN/liblwgeom/lwgeom_geos.c:319: undefined reference
to `GEOSGeom_createEmptyPolygon'
/home/zonabili/postgis-2.0.0SVN/liblwgeom/.libs/liblwgeom.a(lwgeom_geos.o): In f
unction `lwgeom_sharedpaths':
/home/zonabili/postgis-2.0.0SVN/liblwgeom/lwgeom_geos.c:1024: undefined referenc
e to `GEOSSharedPaths'
/home/zonabili/postgis-2.0.0SVN/liblwgeom/.libs/liblwgeom.a(lwgeom_geos.o): In f
unction `lwgeom_snap':
/home/zonabili/postgis-2.0.0SVN/liblwgeom/lwgeom_geos.c:961: undefined reference
to `GEOSSnap'
v collect2: ld returned 1 exit status
make[2]: *** [raster2pgsql] Error 1
make[2]: Leaving directory `/home/zonabili/postgis-2.0.0SVN/raster/loader'
make[1]: *** [rtloader] Error 2
make[1]: Leaving directory `/home/zonabili/postgis-2.0.0SVN/raster'
make: *** [all] Error 1
The JSON-C module was also a problem, as all they say to do with it is untar it and /.configure make it. but I feel like there is probably more that I need to do.
I am really getting frustrated with this as I feel that I am so close, but keep hitting insurmountable obstacles where I have no clue what to do.
I would greatly appreciate anyone who could help fix these flagrant errors and help me navigate this truly hellish installation process! I would be willing to uninstall everything and start from the beginning, although I don't actually know how to uninstall the geos because I had to build them from source and not apt-get!
I am also new to linux (I finally just figured out how to get postgis 2.0 installed on my windows laptop!) so please be as descriptive as possible.
Thanks in advance, as this has been a huge headache for me!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
./configure
和make
,并且仅以root用户身份执行最后的make install
。 (这将避免构建目录被具有奇怪所有权的文件污染)geos-2.0SVN 随后构建为:
通过 gcc 预处理 *.sql.in 时存在一个小问题(恶心) ,可以(暂时)通过注释掉 raster/rt_pg/Makefile.in 文件中的一行(@linenumber 91)来解决
(在./配置,当然)
./configure
andmake
as a plain user, and only doing the finalemake install
as user root. (this will avoid the build directory to be polluted by files with strange ownership)geos-2.0SVN was subsequently built with:
There was one minor issue with preprocessing *.sql.in via gcc (yuck), which can (temporarily) be worked-around by commenting out one line (@linenumber 91)
in the raster/rt_pg/Makefile.in file (prior to ./configure, of course)