Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#3423 closed defect (worksforme)

CREATE EXTENSION postgis fails with "ERROR: could not load library "/usr/pgsql-9.5/lib/postgis-2.2.so": /usr/pgsql-9.5/lib/postgis-2.2.so: undefined symbol: GEOSClipByRect"

Reported by: motiumansky Owned by: pramsey
Priority: medium Milestone: PostGIS 2.2.2
Component: postgis Version: 2.2.x
Keywords: Cc: koyae

Description

I'm trying to install the new 9.5 Postgres version with Postgis 2.2 (downloaded from https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-6.7-x86_64/)

When I issue "CREATE EXTENSION postgis", I'm getting :

ERROR: could not load library "/usr/pgsql-9.5/lib/postgis-2.2.so": /usr/pgsql-9.5/lib/postgis-2.2.so: undefined symbol: GEOSClipByRect

OS : Oracle Linux 6U7 Postgres version : "PostgreSQL 9.5.0 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16), 64-bit"

I have tried to reproduce the issue on Postgres 9.4.5 downloaded from https://download.postgresql.org/pub/repos/yum/9.4/redhat/rhel-6.7-x86_64.

The issue was not reproduced.

Thanks, Moti

Change History (18)

comment:1 by gdt, 9 years ago

That symbol is in geos (3.5.0 anyway). Are you using the same prefix pattern for 9.4, or do 9.4 and geos share a prefix? This looks like a failure to set -L in the LDFLAGS of linking postgis.so (broadly; I realize the specific L, -rpath, etc. vary).

Run ldd on postgis.so and see if it is finding all the shlibs, and in particular if it is finding the libgeos_c that you expect.

(I have not tried with 9.5, but this looks like a postgis build issue, not a 9.5 issue to me.)

comment:2 by robe, 9 years ago

Hmm I wonder if the package is missing the GEOS 3.5.0 entirely or has GEOS 3.4 instead. I was meaning to do tests on CentOS packages but haven't gotten to it yet.

Which one did you install. I would think you'd want this one - http://yum.postgresql.org/9.5/redhat/rhel-6-x86_64/pgdg-oraclelinux95-9.5-2.noarch.rpm

Not clear to me if that's the same as whatever you are downloading above or not.

comment:3 by robe, 9 years ago

Well I just tried the centos 6 package from yum and didn't run into any problems, but looks like its only PostGIS 2.2.0. Sent note to postgresql yum package group that there might be something wrong with the Oracle package.

Last edited 9 years ago by robe (previous) (diff)

in reply to:  1 ; comment:4 by motiumansky, 9 years ago

Thank you for your update.

I'm not sure I understood correctly your question regarding the prefixes.

ldd /usr/pgsql-9.5/lib/postgis-2.2.so

linux-vdso.so.1 => (0x00007fffaa7bb000) libgeos_c.so.1 => /usr/lib64/libgeos_c.so.1 (0x00007f6c40984000) libproj.so.0 => /usr/lib64/libproj.so.0 (0x00007f6c40737000) libjson-c.so.2 => /lib64/libjson-c.so.2 (0x00007f6c4052c000) libxml2.so.2 => /usr/lib64/libxml2.so.2 (0x00007f6c401d9000) libm.so.6 => /lib64/libm.so.6 (0x00007f6c3ff55000) libc.so.6 => /lib64/libc.so.6 (0x00007f6c3fbc0000) libgeos-3.4.2.so => /usr/lib64/libgeos-3.4.2.so (0x00007f6c3f81b000) libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007f6c3f515000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f6c3f2fe000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f6c3f0fa000) libz.so.1 => /lib64/libz.so.1 (0x00007f6c3eee4000) /lib64/ld-linux-x86-64.so.2 (0x000000353b000000)

in reply to:  2 comment:5 by motiumansky, 9 years ago

Replying to robe:

Hmm I wonder if the package is missing the GEOS 3.5.0 entirely or has GEOS 3.4 instead. I was meaning to do tests on CentOS packages but haven't gotten to it yet.

Which one did you install. I would think you'd want this one - http://yum.postgresql.org/9.5/redhat/rhel-6-x86_64/pgdg-oraclelinux95-9.5-2.noarch.rpm

Not clear to me if that's the same as whatever you are downloading above or not.

Thank you for your update.

Since my environment has no internet connection, I have download the repository from https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-6.7-x86_64/, created a local repository based on in and installed.

Moti

in reply to:  3 comment:6 by motiumansky, 9 years ago

Replying to robe:

Well I just tried the centos 6 package from yum and didn't run into any problems, but looks like its only PostGIS 2.2.0. Sent note to postgresql yum package group that there might be something wrong with the Oracle package.

Thank you for you update. Actually, I have installed the packages for Red Hat. Maybe you could try this as well?

Thanks, Moti

comment:7 by robe, 9 years ago

Did it work? what's the rpm link for it?

in reply to:  7 comment:8 by motiumansky, 9 years ago

Replying to robe:

Did it work? what's the rpm link for it?

Yes.

What do you mean by RPM link? All the RPMs are located in https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-6.7-x86_64/ .

Moti

comment:9 by robe, 9 years ago

I wasn't sure if you were talking about redhat stable upstream. Also I'm not sure what the difference is between the ones I use:

Like this one http://yum.postgresql.org/9.5/redhat/rhel-6-x86_64/pgdg-oraclelinux95-9.5-2.noarch.rpm

and the one you pointed at. They have different urls, so I wasn't sure if they are just copies of the same thing.

in reply to:  9 comment:10 by motiumansky, 9 years ago

Replying to robe:

I wasn't sure if you were talking about redhat stable upstream. Also I'm not sure what the difference is between the ones I use:

Like this one http://yum.postgresql.org/9.5/redhat/rhel-6-x86_64/pgdg-oraclelinux95-9.5-2.noarch.rpm

and the one you pointed at. They have different urls, so I wasn't sure if they are just copies of the same thing.

I have reproduced the issue when installing with yum install from the internet.

I think there is something wrong with the last version installation on Oracle Linux (or Red Hat).

Has anyone succeeded to install the last version on Oracle Linux or Red Hat?

in reply to:  4 comment:11 by motiumansky, 9 years ago

Replying to motiumansky:

Thank you for your update.

I'm not sure I understood correctly your question regarding the prefixes.

ldd /usr/pgsql-9.5/lib/postgis-2.2.so

linux-vdso.so.1 => (0x00007fffaa7bb000) libgeos_c.so.1 => /usr/lib64/libgeos_c.so.1 (0x00007f6c40984000) libproj.so.0 => /usr/lib64/libproj.so.0 (0x00007f6c40737000) libjson-c.so.2 => /lib64/libjson-c.so.2 (0x00007f6c4052c000) libxml2.so.2 => /usr/lib64/libxml2.so.2 (0x00007f6c401d9000) libm.so.6 => /lib64/libm.so.6 (0x00007f6c3ff55000) libc.so.6 => /lib64/libc.so.6 (0x00007f6c3fbc0000) libgeos-3.4.2.so => /usr/lib64/libgeos-3.4.2.so (0x00007f6c3f81b000) libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007f6c3f515000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f6c3f2fe000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f6c3f0fa000) libz.so.1 => /lib64/libz.so.1 (0x00007f6c3eee4000) /lib64/ld-linux-x86-64.so.2 (0x000000353b000000)

I have reproduced the issue when installing with yum install from the internet.

I think there is something wrong with the last version installation on Oracle Linux (or Red Hat).

Has anyone succeeded to install the last version on Oracle Linux or Red Hat?

in reply to:  description comment:12 by motiumansky, 9 years ago

Replying to motiumansky:

I'm trying to install the new 9.5 Postgres version with Postgis 2.2 (downloaded from https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-6.7-x86_64/)

When I issue "CREATE EXTENSION postgis", I'm getting :

ERROR: could not load library "/usr/pgsql-9.5/lib/postgis-2.2.so": /usr/pgsql-9.5/lib/postgis-2.2.so: undefined symbol: GEOSClipByRect

OS : Oracle Linux 6U7 Postgres version : "PostgreSQL 9.5.0 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16), 64-bit"

I have tried to reproduce the issue on Postgres 9.4.5 downloaded from https://download.postgresql.org/pub/repos/yum/9.4/redhat/rhel-6.7-x86_64.

The issue was not reproduced.

Thanks, Moti

I have reproduced the issue when installing with yum install from the internet.

I think there is something wrong with the last version installation on Oracle Linux (or Red Hat).

Has anyone succeeded to install the last version on Oracle Linux or Red Hat?

comment:13 by koyae, 9 years ago

Cc: koyae added

Though unintentionally, it seems I reproduced this on Postgres 9.4.5 with PostGIS version 2.2.1 (compiled from source against GEOS 3.5.0), which in turn caused me to find this page.

Operating system is based off of Red Hat; it's Linux 4.1.13-19.31.amzn1.x86_64 # 1 SMP Wed Jan 20 00:25:47 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

I have created a snapshot of the primary boot volume of the server so I should be able to offer access to it if that's helpful.

comment:14 by robe, 9 years ago

Did you run ldconfig? That error usually happens if you compiled with say GEOS 3.5 but your postgis at runtime is pointing at GEOS 3.4

comment:15 by koyae, 9 years ago

robe - I went back and tried doing ldconfig (by itself) as root from the GEOS directory before and after ./configure, make, and make install of GEOS 3.5.0, and again between these steps as I built PostGIS itself. I still get the same error when I try CREATE EXTENSION PostGIS; in psql. To be sure the command wasn't hitting old dependencies that failed to be overwritten or removed, I also did rm /usr/share/pgsql94/extension/* before I retried.

On the same system, the installation went smoothly with GEOS 3.4.2.

PostGIS configure output:

  PostGIS is now configured for x86_64-pc-linux-gnu

 -------------- Compiler Info -------------
  C compiler:           gcc -g -O2
  SQL preprocessor:     /usr/bin/cpp -traditional-cpp -w -P

 -------------- Dependencies --------------
  GEOS config:          /usr/local/bin/geos-config
  GEOS version:         3.5.0
  GDAL config:          /usr/bin/gdal-config
  GDAL version:         1.9.2
  PostgreSQL config:    /usr/bin/pg_config
  PostgreSQL version:   PostgreSQL 9.4.5
  PROJ4 version:        48
  Libxml2 config:       /usr/bin/xml2-config
  Libxml2 version:      2.9.1
  JSON-C support:       no
  PCRE support:         no
  PostGIS debug level:  0
  Perl:                 /usr/bin/perl

 --------------- Extensions ---------------
  PostGIS Raster:       enabled
  PostGIS Topology:     enabled
  SFCGAL support:       disabled
  Address Standardizer support:       disabled

 -------- Documentation Generation --------
  xsltproc:             /usr/bin/xsltproc
  xsl style sheets:
  dblatex:
  convert:
  mathml2.dtd:          http://www.w3.org/Math/DTD/mathml2/mathml2.dtd

Let me know what else I can provide.

Version 0, edited 9 years ago by koyae (next)

comment:16 by dcalde, 9 years ago

I had the same error, but was able to fix it. If I had installed on a new server, this would probably not have been a problem, but this server is already running pg 9.4 with postgis 2.1.

I was merely running an old version of GEOS. A simple 'yum update geos' did the trick.

[root@ip-10-0-4-58 data]# yum info geos
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.mirror.serversaustralia.com.au
 * epel: epel.mirror.digitalpacific.com.au
 * extras: mirror.ventraip.net.au
 * updates: centos.mirror.serversaustralia.com.au
Installed Packages
Name        : geos
Arch        : x86_64
Version     : 3.4.2
Release     : 1.rhel7
Size        : 1.8 M
Repo        : installed
From repo   : pgdg94
Summary     : GEOS is a C++ port of the Java Topology Suite
URL         : http://trac.osgeo.org/geos/
License     : LGPLv2
Description : GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology
            : Suite (JTS). As such, it aims to contain the complete functionality of
            : JTS in C++. This includes all the OpenGIS "Simple Features for SQL" spatial
            : predicate functions and spatial operators, as well as specific JTS topology
            : functions such as IsValid()

Available Packages
Name        : geos
Arch        : x86_64
Version     : 3.5.0
Release     : 1.rhel7
Size        : 540 k
Repo        : pgdg95/7/x86_64
Summary     : GEOS is a C++ port of the Java Topology Suite
URL         : http://trac.osgeo.org/geos/
License     : LGPLv2
Description : GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology
            : Suite (JTS). As such, it aims to contain the complete functionality of
            : JTS in C++. This includes all the OpenGIS "Simple Features for SQL" spatial
            : predicate functions and spatial operators, as well as specific JTS topology
            : functions such as IsValid()

[root@ip-10-0-4-58 data]# yum update geos
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.mirror.serversaustralia.com.au
 * epel: epel.mirror.digitalpacific.com.au
 * extras: mirror.ventraip.net.au
 * updates: centos.mirror.serversaustralia.com.au
Resolving Dependencies
--> Running transaction check
---> Package geos.x86_64 0:3.4.2-1.rhel7 will be updated
---> Package geos.x86_64 0:3.5.0-1.rhel7 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

comment:17 by pramsey, 9 years ago

Resolution: worksforme
Status: newclosed

I'm closing this because it's out of our hands as either a packaging issue or just a local configuration issue (use find to try and track down copies of libgeos that might be installed in places you don't expect)

in reply to:  16 comment:18 by koyae, 9 years ago

To follow up: in my case, dcalde's solution worked just fine. Although it took me some time to get yum to know there was an update for GEOS, it worked fine once I had done so.

Thanks, all.

Note: See TracTickets for help on using tickets.