PostGis 问题一例

安装环境

今天准备在 PostgreSQL 9.0 版本基础上搭建一套postgis数据库环境,安装过程中遇到一点小问题,后来还是解决了。

安装过程

环境信息
OS : Red Hat Enterprise 5
PostgreSQL: 9.0.1
PostGIS: 1.5.1
proj: proj-4.7.0
geos: geos-3.2.2

proj,geos 的安装已经完成,这里不再记录,下面是安装postgis过程,

config 通过

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
./configure --prefix=/usr/local/pg_tool/postgis --with-pgconfig=/opt/pgsql/bin/pg_config --with-projdir=/usr/local/pg_tool/proj --with-geosconfig=/usr/local/pg_tool/geos/bin/geos-config  
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/pg_tool/geos/bin/geos-config
GEOS version: 3.2.2
PostgreSQL config: /opt/pgsql/bin/pg_config
PostgreSQL version: PostgreSQL 9.0.1
PROJ4 version: 47
Libxml2 config: /usr/bin/xml2-config
Libxml2 version: 2.6.26
PostGIS debug level: 0
-------- Documentation Generation --------
xsltproc: /usr/bin/xsltproc
xsl style sheets:
dblatex:
convert:

编译通过

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
[root@172_16_3_216 postgis-1.5.1]# make  
make -C liblwgeom
make[1]: Entering directory `/opt/soft_bak/postgis-1.5.1/liblwgeom'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/opt/soft_bak/postgis-1.5.1/liblwgeom'
make -C postgis
make[1]: Entering directory `/opt/soft_bak/postgis-1.5.1/postgis'
Makefile.pgxs:17: warning: overriding commands for target `install'
/opt/pgsql/lib/pgxs/src/makefiles/pgxs.mk:99: warning: ignoring old commands for target `install'
Makefile.pgxs:63: warning: overriding commands for target `installdirs'
/opt/pgsql/lib/pgxs/src/makefiles/pgxs.mk:147: warning: ignoring old commands for target `installdirs'
Makefile.pgxs:82: warning: overriding commands for target `uninstall'
/opt/pgsql/lib/pgxs/src/makefiles/pgxs.mk:171: warning: ignoring old commands for target `uninstall'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/opt/soft_bak/postgis-1.5.1/postgis'
make -C loader
make[1]: Entering directory `/opt/soft_bak/postgis-1.5.1/loader'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/opt/soft_bak/postgis-1.5.1/loader'
make -C utils
make[1]: Entering directory `/opt/soft_bak/postgis-1.5.1/utils'
chmod +x postgis_restore.pl create_undef.pl postgis_proc_upgrade.pl profile_intersects.pl test_estimation.pl test_joinestimation.pl
make[1]: Leaving directory `/opt/soft_bak/postgis-1.5.1/utils'
PostGIS was built successfully. Ready to install.

Make Check 不成功

make check报CUnit没安装

[root@172_16_3_216 postgis-1.5.1]# make check  
make -C liblwgeom  
make[1]: Entering directory `/opt/soft_bak/postgis-1.5.1/liblwgeom'  
make[1]: Nothing to be done for `all'.  
make[1]: Leaving directory `/opt/soft_bak/postgis-1.5.1/liblwgeom'  
make -C postgis  
make[1]: Entering directory `/opt/soft_bak/postgis-1.5.1/postgis'  
Makefile.pgxs:17: warning: overriding commands for target `install'  
/opt/pgsql/lib/pgxs/src/makefiles/pgxs.mk:99: warning: ignoring old commands for target `install'  
Makefile.pgxs:63: warning: overriding commands for target `installdirs'  
/opt/pgsql/lib/pgxs/src/makefiles/pgxs.mk:147: warning: ignoring old commands for target `installdirs'  
Makefile.pgxs:82: warning: overriding commands for target `uninstall'  
/opt/pgsql/lib/pgxs/src/makefiles/pgxs.mk:171: warning: ignoring old commands for target `uninstall'  
make[1]: Nothing to be done for `all'.  
make[1]: Leaving directory `/opt/soft_bak/postgis-1.5.1/postgis'  
make -C liblwgeom/cunit check  
make[1]: Entering directory `/opt/soft_bak/postgis-1.5.1/liblwgeom/cunit'
WARNING:
configure was unable to find CUnit which is required for unit testing.  
In order to enable unit testing, you must install CUnit and then re-run configure.
make[1]: Leaving directory `/opt/soft_bak/postgis-1.5.1/liblwgeom/cunit'  
make -C regress check  
make[1]: Entering directory `/opt/soft_bak/postgis-1.5.1/regress'  
make -C ../postgis REGRESS=1 DESTDIR=/opt/soft_bak/postgis-1.5.1/regress/00-regress-install install  
make[2]: Entering directory `/opt/soft_bak/postgis-1.5.1/postgis'  
Makefile.pgxs:17: warning: overriding commands for target `install'  
/opt/pgsql/lib/pgxs/src/makefiles/pgxs.mk:99: warning: ignoring old commands for target `install'  
Makefile.pgxs:63: warning: overriding commands for target `installdirs'  
/opt/pgsql/lib/pgxs/src/makefiles/pgxs.mk:147: warning: ignoring old commands for target `installdirs'  
Makefile.pgxs:82: warning: overriding commands for target `uninstall'  
/opt/pgsql/lib/pgxs/src/makefiles/pgxs.mk:171: warning: ignoring old commands for target `uninstall'  
/bin/mkdir -p '/opt/soft_bak/postgis-1.5.1/regress/00-regress-install/lib'  
'/opt/soft_bak/postgis-1.5.1/regress/00-regress-install/share/contrib/postgis-1.5'  
make[2]: /opt/soft_bak/postgis-1.5.1/regress/00-regress-install/share/contrib/postgis-1.5: Command not found  
make[2]: * [installdirs] Error 127  
make[2]: Leaving directory `/opt/soft_bak/postgis-1.5.1/postgis'  
make[1]: * [check] Error 2  
make[1]: Leaving directory `/opt/soft_bak/postgis-1.5.1/regress'  
make: * [check] Error 2
 注意红色字体部分,出现一个 WARNING,  
WARNING:  
configure was unable to find CUnit which is required for unit testing.  
In order to enable unit testing, you must install CUnit and then re-run configure.
 从上面信息来看,应该是没装CUnit,后来在网上找到 CUnit 官网,以下是关于CUnit的介绍。  
 CUnit is a lightweight system for writing, administering, and running unit tests in C.  
It provides C programmers a basic testing functionality with a flexible variety of user interfaces.  

解决方法

后来猜测 PostGis 可能与新版本的PostgreSQL不兼容,于是到PostGIS官网,发现有最新版本,1.5.2,下载最新版本后,重新编译安装,成功。

原创文章,作者:1402239773,如若转载,请注明出处:https://blog.ytso.com/236335.html

(0)
上一篇 2022年1月24日
下一篇 2022年1月24日

相关推荐

发表回复

登录后才能评论