[postgis-users] PostGIS JSON issue AWS

Daniel Devine daniel.m.devine at gmail.com
Sat Oct 20 17:39:51 PDT 2012


Hi,

I'm having the same trouble building PostGIS on AWS that some other posters here have encountered.

ERROR:  could not load library …..postgis-2.0.so: undefined symbol: json_tokener_errors


See threads:

http://postgis.refractions.net/pipermail/postgis-users/2012-January/032073.html
https://github.com/Vizzuality/cartodb/issues/438
http://postgis.refractions.net/pipermail/postgis-devel/2011-November/016058.html


I've pretty much done everything suggested in all of the previous threads I could fine.
I looked up some of the bug tickets about this too.

Is there a concrete answer for this?
There are several other threads that just stop without resolution.

Thanks

DD





Additional Information:


1) I'm building the json-c source that's required, and it's creating two libraries.

# They're getting properly placed into the "/usr/local/lib" directory…...
[root at ip-10-252-94-19 pkgconfig]# ls -l /usr/local/lib/libjson*
-rw-r--r-- 1 root root   2188 Oct 21 00:12 /usr/local/lib/libjson.a
-rw-r--r-- 1 root root 149986 Oct 21 00:12 /usr/local/lib/libjson-c.a
-rwxr-xr-x 1 root root    932 Oct 21 00:12 /usr/local/lib/libjson-c.la
lrwxrwxrwx 1 root root     18 Oct 21 00:12 /usr/local/lib/libjson-c.so -> libjson-c.so.2.0.0
lrwxrwxrwx 1 root root     18 Oct 21 00:12 /usr/local/lib/libjson-c.so.2 -> libjson-c.so.2.0.0
-rwxr-xr-x 1 root root  93727 Oct 21 00:12 /usr/local/lib/libjson-c.so.2.0.0
-rwxr-xr-x 1 root root    946 Oct 21 00:12 /usr/local/lib/libjson.la
lrwxrwxrwx 1 root root     16 Oct 21 00:12 /usr/local/lib/libjson.so -> libjson.so.0.1.0
lrwxrwxrwx 1 root root     16 Oct 21 00:12 /usr/local/lib/libjson.so.0 -> libjson.so.0.1.0
-rwxr-xr-x 1 root root   6103 Oct 21 00:12 /usr/local/lib/libjson.so.0.1.0

# It's generating two package config files…..
[root at ip-10-252-94-19 pkgconfig]# ls -l /usr/local/lib/pkgconfig
total 16
-rw-r--r-- 1 root root 209 Oct 20 21:32 cunit.pc
-rw-r--r-- 1 root root 231 Oct 21 00:12 json-c.pc
-rw-r--r-- 1 root root 227 Oct 21 00:12 json.pc
-rw-r--r-- 1 root root 228 Oct 20 21:03 proj.pc

# These package config files are getting soft linked to the 64 bit library….
[root at ip-10-252-94-19 pkgconfig]# ls -l /usr/lib64/pkgconfig/json*
lrwxrwxrwx 1 root root 34 Oct 21 00:29 /usr/lib64/pkgconfig/json-c.pc -> /usr/local/lib/pkgconfig/json-c.pc
lrwxrwxrwx 1 root root 32 Oct 21 00:27 /usr/lib64/pkgconfig/json.pc -> /usr/local/lib/pkgconfig/json.pc



2) Doing a check on the PostGIS-2.0.1 module linkages shows that json-c.so is not being referenced…

#  Nothing here…..
[root at ip-10-252-94-19 pgsql]# ldd postgis-2.0.so
 linux-vdso.so.1 =>  (0x00007fffeb490000)
 libgeos_c.so.1 => /usr/local/lib/libgeos_c.so.1 (0x00007ff3f1b51000)
 libproj.so.0 => /usr/local/lib/libproj.so.0 (0x00007ff3f1900000)
 libxml2.so.2 => /usr/lib64/libxml2.so.2 (0x00007ff3f15a4000)
 libm.so.6 => /lib64/libm.so.6 (0x00007ff3f1320000)
 libc.so.6 => /lib64/libc.so.6 (0x00007ff3f0f8d000)
 libgeos-3.3.5.so => /usr/local/lib/libgeos-3.3.5.so (0x00007ff3f0c04000)
 libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007ff3f08fd000)
 libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007ff3f06e8000)
 libdl.so.2 => /lib64/libdl.so.2 (0x00007ff3f04e3000)
 libz.so.1 => /lib64/libz.so.1 (0x00007ff3f02cc000)
 /lib64/ld-linux-x86-64.so.2 (0x00007ff3f2019000)
[root at ip-10-252-94-19 pgsql]#


3) Checking for the availability of the module to be loaded shows that libjson-c.so is available, and that it's location matches where it's supposed to be found at:

[root at ip-10-252-94-19 etc]# ldconfig -p
468 libs found in cache `/etc/ld.so.cache'
        ....
 libkadm5clnt_mit.so.8 (libc6) => /usr/lib/libkadm5clnt_mit.so.8
 libjson.so.0 (libc6,x86-64) => /usr/local/lib/libjson.so.0
 libjson.so (libc6,x86-64) => /usr/local/lib/libjson.so
 libjson-c.so.2 (libc6,x86-64) => /usr/local/lib/libjson-c.so.2		<------  Duplicates?
 libjson-c.so (libc6,x86-64) => /usr/local/lib/libjson-c.so			<------  json-c source creates does two items?
 libjpeg.so.62 (libc6,x86-64) => /usr/lib64/libjpeg.so.62
 libjpeg.so (libc6,x86-64) => /usr/lib64/libjpeg.so


4)  The libjson-c.so module has the symbol that I'm looking for…

#  Yep, here it is… sitting pretty...
[root at ip-10-252-94-19 lib]# nm /usr/local/lib/libjson-c.so | grep json_tokener_errors
0000000000208580 D json_tokener_errors



5)  Specifying the local directory where my json lives doesn't seem to have any effect…
Even removing json-c from the system entirely 

[root at ip-10-252-94-19 postgis]# tar xvf postgis-2.0.1.tar.gz
[root at ip-10-252-94-19 postgis]# cd postgis-2.0.1
[root at ip-10-252-94-19 postgis-2.0.1]#  ./configure --with-gdalconfig="/usr/local/bin/gdal-config" --with-jsondir="/usr/local"

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

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

 -------------- Dependencies -------------- 
  GEOS config:          /usr/bin/geos-config
  GEOS version:         3.3.2
  GDAL config:          /usr/local/bin/gdal-config
  GDAL version:         1.9.2
  PostgreSQL config:    /usr/bin/pg_config
  PostgreSQL version:   PostgreSQL 9.2.1
  PROJ4 version:        48
  Libxml2 config:       /usr/bin/xml2-config
  Libxml2 version:      2.7.8
  JSON-C support:       yes
  PostGIS debug level:  0
  Perl:                 /usr/bin/perl

 --------------- Extensions --------------- 
  PostGIS Raster:       enabled
  PostGIS Topology:     enabled

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

[root at ip-10-252-94-19 postgis-2.0.1]# make
[root at ip-10-252-94-19 postgis-2.0.1]# make install


More information about the postgis-users mailing list