安装环境
今天准备在 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 |
./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 |
编译通过
1 |
[root@172_16_3_216 postgis-1.5.1] |
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