[Portugal] Postgis 2.0 Problema de instalação - "undefined reference to `GEOSGeom_createEmptyPolygon'"

Jorge Gustavo Rocha jgr di.uminho.pt
Quinta-Feira, 26 de Abril de 2012 - 05:37:47 EDT


Olá Alexandre,

Não sei que versão do GEOS estás a usar. Sugiro que comeces por 
actualizar o GEOS.

Passo-te a minha cábula com GEOS + PostGIS 2.0, para ver se ajuda.

Abraço,

Jorge

1) GEOS
GEOS (installed into /usr/local):
sudo apt-get install swig php5-dev phpunit
wget http://download.osgeo.org/geos/geos-3.3.2.tar.bz2
tar xjvf geos-3.3.2.tar.bz2
cd geos-3.3.2
./configure --enable-python --enable-php
make
sudo make install
sudo ldconfig

2) PostGIS 2.0
wget http://postgis.refractions.net/download/postgis-2.0.1SVN.tar.gz
tar -zxvf postgis-2.0.1SVN.tar.gz

cd postgis-2.0.1SVN/
./configure
make
sudo make install
sudo service postgresql restart

sudo su postgres
dropdb template_postgis

createdb testdb
psql -d testdb -f 
/usr/share/postgresql/9.1/contrib/postgis-2.0/postgis.sql -v ON_ERROR_STOP=1
psql -d testdb -f 
/usr/share/postgresql/9.1/contrib/postgis-2.0/spatial_ref_sys.sql -v 
ON_ERROR_STOP=1
psql -d testdb -f 
/usr/share/postgresql/9.1/contrib/postgis-2.0/topology.sql -v 
ON_ERROR_STOP=1
psql -d testdb -f 
/usr/share/postgresql/9.1/contrib/postgis-2.0/rtpostgis.sql -v 
ON_ERROR_STOP=1




Em 26-04-2012 11:15, Alexandre Neto escreveu:
> Bom dia,
>
> Estou a tentar instalar o Postgis 2.0 numa máquina com ubuntu 11.10.
>
> É a primeira vez que tento compilar da fonte.
>
> Consegui fazer o "configure" e o "make" com sucesso, mas ao fazer a
> verificação (make check) deu o seguinte erro que indico abaixo.
>
> Pelo que consegui procurar encontrei algumas referências a este erro,
> por exemplo:
> http://postgis.refractions.net/pipermail/postgis-devel/2012-March/019607.html
>
> Terá alguma coisa a ver com mais do que uma versão do GEOS instalada no
> sistema.
>
> Uma das soluções apresentadas prende-se com alterar a ordem dos
> "-L/usr/lib -lgdal1.8.0" e "-L/usr/local/lib -lgeos_c"no makefile.
>
> Mas em qual? Já alterei uns quantos (raster\rt_core,raster\test\core),
> corri o "make clean" e o "make". Mas volta a dar o mesmo erro, e a ordem
> não foi alterada.
>
> Alexandre Neto
>
>
>
> -------------------------------
> make[1]: Leaving directory `/media/DADOS1/TEMPORARIO/postgis-2.0.0/regress'
> ---- Making check in raster
> make[1]: Entering directory `/media/DADOS1/TEMPORARIO/postgis-2.0.0/raster'
> make -C test check
> make[2]: Entering directory
> `/media/DADOS1/TEMPORARIO/postgis-2.0.0/raster/test'
> make -C core check
> make[3]: Entering directory
> `/media/DADOS1/TEMPORARIO/postgis-2.0.0/raster/test/core'
> gcc -g -O2  -fPIC -DPIC  -Wall -Wmissing-prototypes -I../../rt_core
> -I../../../liblwgeom  -I/usr/include/gdal -I/usr/local/include -c testapi.c
> mode=link gcc -g -O2  -fPIC -DPIC  -Wall -Wmissing-prototypes
> -I../../rt_core -I../../../liblwgeom  -I/usr/include/gdal
> -I/usr/local/include testapi.o ../../rt_core/librtcore.a
> ../../rt_core/librtcore.a ../../../liblwgeom/.libs/liblwgeom.a
> -L/usr/lib -lgdal1.8.0 -L/usr/local/lib -lgeos_c -lm  -o testapi
> ../../../liblwgeom/.libs/liblwgeom.a(lwgeom_geos.o): In function
> `LWGEOM2GEOS':
> /media/DADOS1/TEMPORARIO/postgis-2.0.0/liblwgeom/lwgeom_geos.c:326:
> undefined reference to `GEOSGeom_createEmptyPolygon'
> ../../../liblwgeom/.libs/liblwgeom.a(lwgeom_geos.o): In function
> `lwgeom_snap':
> /media/DADOS1/TEMPORARIO/postgis-2.0.0/liblwgeom/lwgeom_geos.c:972:
> undefined reference to `GEOSSnap'
> .
> .
> .
> /media/DADOS1/TEMPORARIO/postgis-2.0.0/liblwgeom/lwgeom_geos_clean.c:864: undefined
> reference to `GEOSGeom_extractUniquePoints'
> collect2: ld returned 1 exit status
> make[3]: [testwkb] Error 1 (ignored)
> ./testapi
> make[3]: ./testapi: Command not found
> make[3]: *** [check] Error 127
> make[3]: Leaving directory
> `/media/DADOS1/TEMPORARIO/postgis-2.0.0/raster/test/core'
> make[2]: *** [core-check] Error 2
> make[2]: Leaving directory
> `/media/DADOS1/TEMPORARIO/postgis-2.0.0/raster/test'
> make[1]: *** [check] Error 2
> make[1]: Leaving directory `/media/DADOS1/TEMPORARIO/postgis-2.0.0/raster'
> make: *** [check] Error 1
>
> ---------------------------
>
> Pelo que consegui procurar
> http://postgis.refractions.net/pipermail/postgis-devel/2012-March/019607.html
>
> Something to do with more than one GEOS installed
>
> The presented solution would be to change the order of "-L/usr/lib
> -lgdal1.8.0" and "-L/usr/local/lib
>   -lgeos_c"in the makefile.
>
> But in witch makefile?
>
> Have have changed a bunch of them (raster\rt_core,raster\test\core), and
> used the make command again. But, in the "make check" the order is
> mantained and gives the same error.
>
> Alexandre Neto
>
>
>
> _______________________________________________
> Portugal mailing list
> Portugal  lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/portugal


-- 
Jorge Gustavo Rocha
Departamento de Informática
Universidade do Minho
4710-057 Braga
Tel: +351 253604480
Fax: +351 253604471
Móvel: +351 910333888
skype: nabocudnosor


Mais informações acerca da lista Portugal