Problems compiling Postgis from source in Ubuntu 9.10

Hi All,
- I got the following error when I ran configure:
$ sudo ./configure --with-pgsql=/usr/local/pgsql/bin/pg_config --with-geos=/usr/local/bin/geos-config --with-proj=/usr/local/ --with-proj-libdir=/usr/local/lib

configure: error: the PGXS Makefile /usr/lib/postgresql/8.4/lib/pgxs/src/makefiles/ pgxs.mk cannotbefound.PleaseinstallthePostgreSQL server development packages and re-runconfigure.

- I didn't see a configure option to specify a path for this, so I createdthe missing dir,and put a symbolic link in it that points back to where pgxs.mk lives:
$ sudo ln -s /usr/local/pgsql/lib/pgxs/src/makefiles/ pgxs.mk /usr/lib/postgresql/8.4/lib/pgxs/src/makefiles/ pgxs.mk

- The configure passed, but I get a related error when I try torun make:
$ sudo make
<snip>
make -C postgis
make[1]: Entering directory `/usr/local/postgresql-8.4.2/contrib/postgis-1.4.1/postgis'
/usr/lib/postgresql/8.4/lib/pgxs/src/makefiles/ pgxs.mk:59 : /usr/lib/postgresql/8.4/lib/pgxs/src/makefiles/../../src/Makefile.global: No such file or directory
/usr/lib/postgresql/8.4/lib/pgxs/src/makefiles/ pgxs.mk:84 : /usr/lib/postgresql/8.4/lib/pgxs/src/makefiles/../../src/Makefile.shlib: No such file or directory
make[1]: *** No rule to make target `/usr/lib/postgresql/8.4/lib/pgxs/src/makefiles/../../src/Makefile.shlib'.  Stop.
make[1]: Leaving directory `/usr/local/postgresql-8.4.2/contrib/postgis-1.4.1/postgis'
make: *** [postgis] Error 2

- Can someone please advise me how to get past this?

Thanks,


It looks as if you have multiple copies of PostgreSQL installed on your
computer one in /usr/localand one in /usr, i.e. you haveinstalled one
from packages using aptitudeand compiled another one by hand. You are
also using the wrong --with arguments fromthe 1.3release that don't
work with PostGIS 1.4.

Karmic Koala already comes with PostgreSQL 8.4 so you should "make
uninstall" in your hand-compiled source tree to remove all traces of it
from /usr/local. Then install the postgresql-server-dev-8.4 packageand
re-runconfigure like this:

$ sudo ./configure --with-geosconfig=/usr/local/bin/geos-config
--with-projdir=/usr/local

I really am tempted to come up with a fix for this brain-dead piece of
Debian packaging as it seems to catch a lot of people out...

---------------------------------解决方案--------------------------------------------


Ok, cleaned all of the Ubuntu-installed junk outandreinstalled from source into /usr/local with:


 $ sudo ./configure --with-geosconfig=/usr/local/bin/geos-config --with-projdir=/usr/local --with-pgconfig=/usr/local/pgsql/bin/pg_config

Ran "make" and "make install" with no problems and everything looks good now.

That bogus pg_config was the source of my grief, so thanks again forthe help.

Roger


最后总结:重复安装后可能出现以上问题,要解决的话,要彻底删除安装的软件:

使用如下命令: sudo apt-get remove --purge 软件名

再次安装就不会有问题了,之上是指定了相应的配置文件,效果一样,推荐完全卸载。



from     http://postgis.17.n6.nabble.com/Problems-compiling-Postgis-from-source-in-Ubuntu-9-10-td3568494.html


你可能感兴趣的:(tree,ubuntu,File,PostgreSQL,Path,makefile)