re[postgis-users] solved - more centos install troubles

Paul McCullough paul.mccullough at sfgov.org
Wed May 20 16:47:15 PDT 2009


All,

Thanks to your help, I was able to get everything installed.

One of the key steps was to use pgsqlrpms rather than centos:
    http://yum.pgsqlrpms.org/howtoyum.php

This was also a helpful page:
   
http://www.postgresonline.com/journal/index.php?/archives/45-An-Almost-Idiots-Guide-to-PostgreSQL-YUM.html

Finally, I include my (internal) wiki notes.
Sorry about the missing formatting.

Cheers!
Paul


/////////////////////////


Introduction

Do this slowly and carefully, and if your lucky, you won't get hurt.


keywords

Fedora 8
Fedora 9
centos
proj.4
geos
postgis
postgresql

[edit] one - install proj4 (projection library)

>From http://trac.osgeo.org/proj/, download and install the the PROJ4
projection library source.

 
$ cd /tmp
$ wget http://download.osgeo.org/proj/proj-4.6.1.tar.gz
$ tar xvfz proj-4.6.1.tar.gz
$ cd proj-4.6.0
$ ./configure

If you are on a fresh system, you may see a number errors such as

    * "C preprocessor "/lib/cpp" fails sanity check"
    * no compiler found
    * etc 

If so, you need to fiddle a bit.
Here is some of the buckshot I used; sometimes reapeating yum installs.
I'm just a hacker; you are welcome to do correctly and edit this doc.

 
> yum install gcc
> yum groupinstall "Development Libraries"
> yum install glibc-headers glibc glibc-commonglibc-devel
> yum update glibc glibc-common glibc-headers glibc-devel

then proceed...

 
$ make
$ su
$ make install
$ exit

Odd as though it may sound, "make" may not have been installed.

 
$ yum install make

Lather, rinse, repeat.


You should eventually see no errors and no dependency check failures.
[edit] two - install GEOS (C++ port of the Java Topology Suite)

 
 $ bunzip2 geos-3.0.0.tar.bz2
 $ tar xvf geos-3.0.0.tar
 $ cd geos-3.0.0
 $ ./configure
 $ make
 $ su
 $ make install
 $ exit

ON centos, when I issued the make command I saw this:

../../../libtool: line 1223: g++: command not found

The googles suggested

yum install gcc-c++

which worked first time.

If the output from "make install" included the following

----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

you need to do this:

echo '/usr/local/lib' >> /etc/ld.so.conf.d/local-lib.conf
ldconfig

[edit] three - install PostGIS

In order to build postGIS you need some artifacts from the postgresQL
development package. This is not as straight forward as it should be.
I encourage you to take a few minutes to read this through. First, your
"disto repository" is not likely to be up to date with respect to postgresql
packages. In other words, if you blindly type "yum install
postgresql-devel", you may have trouble getting everything installed
properly. I've seen errors regarding missing libraries and the like. To
avoid the fuss, when you are installing postgresql packages, use the
postgresql repositories instead of your ditsro repsository.


Here is how you do that. You should read this from top to bottom.

   http://yum.pgsqlrpms.org/howtoyum.php

Also read this; you can safley skip sections on this page.

  
http://www.postgresonline.com/journal/index.php?/archives/45-An-Almost-Idiots-Guide-to-PostgreSQL-YUM.html


Did you do your reading?


OK, now we build postGIS.

 
 $ yum install postgresql-devel
 $ tar xvfz postgis-1.3.1.tar.gz
 $ cd postgis-1.3.1
 $ ./configure --with-pgsql=/usr/bin/pg_config
--with-geos=/usr/local/bin/geos-config --with-proj=/usr/local 
 $ make
 $ su
 $ make install
 $ exit

Errors I've seen: error

configure: error: Can't find 'flex'

solution

yum install flex

[edit] four - make a database

 
$ su postgres
$ cd
$ createdb sfmaps
$ createlang plpgsql sfmaps
$ psql -f /usr/share/lwpostgis.sql -d sfmaps (error: could not load library)
$ psql -f /usr/share/spatial_ref_sys.sql -d sfmaps
$ psql sfmaps

if you encounter this error:

libgeos_c.so.1: cannot open shared object file: No such file or
directory<br> 

do this
Add /usr/local/lib to the dynamic linker run-time bindings

echo '/usr/local/lib' >> /etc/ld.so.conf.d/local-lib.conf
ldconfig


[edit] five - make a postgis_template (optional)

This page shows how to create and use a db template:

   http://geospatial.nomad-labs.com/2006/12/24/postgis-template-database/

-- 
View this message in context: http://www.nabble.com/more-centos-install-troubles-tp23626022p23645586.html
Sent from the PostGIS - User mailing list archive at Nabble.com.




More information about the postgis-users mailing list