Opened 7 years ago

Closed 7 years ago

#2068 closed defect (fixed)

Error caused by libgdal-grass version in Bionic

Reported by: kalxas Owned by: osgeolive@…
Priority: critical Milestone: OSGeoLive12.0
Component: OSGeoLive Keywords: libgdal-grass
Cc: osgeolive@…

Description

Errors in the build93 logs, caused by this line:

https://github.com/OSGeo/OSGeoLive/blob/master/bin/load_gisdata.sh#L177

--2018-06-09 13:51:53--  http://download.osgeo.org/livedvd/data/natural_earth2/HYP_50M_SR_W_reduced.zip
Resolving download.osgeo.org (download.osgeo.org)... 140.211.15.132
Connecting to download.osgeo.org (download.osgeo.org)|140.211.15.132|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 7208717 (6.9M) [application/zip]
Saving to: 'HYP_50M_SR_W_reduced.zip'

     0K ........ ........ ........ ........ ........ ........ 43%  445K 9s
  3072K ........ ........ ........ ........ ........ ........ 87% 1.75M 1s
  6144K ........ .....                                       100% 2.67M=8.9s

2018-06-09 13:52:03 (787 KB/s) - 'HYP_50M_SR_W_reduced.zip' saved [7208717/7208717]

Archive:  HYP_50M_SR_W_reduced.zip
  inflating: HYP_50M_SR_W.prj        
  inflating: HYP_50M_SR_W.README.html  
  inflating: HYP_50M_SR_W.tfw        
  inflating: HYP_50M_SR_W.tif        
 extracting: HYP_50M_SR_W.VERSION.txt  
ERROR 1: libgrass_vector.7.4.0.so: cannot open shared object file: No such file or directory
ERROR 1: libgrass_vector.7.4.0.so: cannot open shared object file: No such file or directory
ERROR 1: libgrass_dgl.7.4.0.so: cannot open shared object file: No such file or directory
ERROR 1: libgrass_dgl.7.4.0.so: cannot open shared object file: No such file or directory
INFO: Open of `ne_10m_admin_0_countries.shp'
      using driver `ESRI Shapefile' successful.
ERROR 1: libgrass_vector.7.4.0.so: cannot open shared object file: No such file or directory
ERROR 1: libgrass_vector.7.4.0.so: cannot open shared object file: No such file or directory
ERROR 1: libgrass_dgl.7.4.0.so: cannot open shared object file: No such file or directory
ERROR 1: libgrass_dgl.7.4.0.so: cannot open shared object file: No such file or directory
INFO: Open of `ne_10m_admin_1_states_provinces_shp.shp'
      using driver `ESRI Shapefile' successful.

Change History (6)

comment:1 by Bas Couwenberg, 7 years ago

On Debian unstable, the libraries in question are included in the NEEDED section and can be found in the RUNPATH:

$ objdump -x /usr/lib/gdalplugins/*_GRASS.so | egrep "gdalplugins|NEEDED|RUNPATH"
/usr/lib/gdalplugins/gdal_GRASS.so:     file format elf64-x86-64
/usr/lib/gdalplugins/gdal_GRASS.so
  NEEDED               libgrass_vector.7.4.0.so
  NEEDED               libgrass_dig2.7.4.0.so
  NEEDED               libgrass_dgl.7.4.0.so
  NEEDED               libgrass_rtree.7.4.0.so
  NEEDED               libgrass_linkm.7.4.0.so
  NEEDED               libgrass_dbmiclient.7.4.0.so
  NEEDED               libgrass_dbmibase.7.4.0.so
  NEEDED               libgrass_raster.7.4.0.so
  NEEDED               libgrass_imagery.7.4.0.so
  NEEDED               libgrass_gproj.7.4.0.so
  NEEDED               libgrass_gmath.7.4.0.so
  NEEDED               libgrass_gis.7.4.0.so
  NEEDED               libgrass_datetime.7.4.0.so
  NEEDED               libgrass_btree2.7.4.0.so
  NEEDED               libgrass_ccmath.7.4.0.so
  NEEDED               libgdal.so.20
  NEEDED               libstdc++.so.6
  NEEDED               libm.so.6
  NEEDED               libgcc_s.so.1
  NEEDED               libc.so.6
  RUNPATH              /usr/lib/grass74/lib
/usr/lib/gdalplugins/ogr_GRASS.so:     file format elf64-x86-64
/usr/lib/gdalplugins/ogr_GRASS.so
  NEEDED               libgrass_vector.7.4.0.so
  NEEDED               libgrass_dig2.7.4.0.so
  NEEDED               libgrass_dgl.7.4.0.so
  NEEDED               libgrass_rtree.7.4.0.so
  NEEDED               libgrass_linkm.7.4.0.so
  NEEDED               libgrass_dbmiclient.7.4.0.so
  NEEDED               libgrass_dbmibase.7.4.0.so
  NEEDED               libgrass_raster.7.4.0.so
  NEEDED               libgrass_imagery.7.4.0.so
  NEEDED               libgrass_gproj.7.4.0.so
  NEEDED               libgrass_gmath.7.4.0.so
  NEEDED               libgrass_gis.7.4.0.so
  NEEDED               libgrass_datetime.7.4.0.so
  NEEDED               libgrass_btree2.7.4.0.so
  NEEDED               libgrass_ccmath.7.4.0.so
  NEEDED               libgdal.so.20
  NEEDED               libstdc++.so.6
  NEEDED               libm.so.6
  NEEDED               libgcc_s.so.1
  NEEDED               libc.so.6
  RUNPATH              /usr/lib/grass74/lib

Creating an index on a shapefile works as expected:

$ ogrinfo -sql "CREATE SPATIAL INDEX on pv_2012" /tmp/pv_2012.shp 
INFO: Open of `/tmp/pv_2012.shp'
      using driver `ESRI Shapefile' successful.

The libgdal-grass package in bionic indeed lacks these libraries in its NEEDED section:

# objdump -x /usr/lib/gdalplugins/*/*_GRASS.so | egrep "gdalplugins|NEEDED|RUNPATH"
/usr/lib/gdalplugins/2.2/gdal_GRASS.so:     file format elf64-x86-64
/usr/lib/gdalplugins/2.2/gdal_GRASS.so
  NEEDED               libgrass_raster.7.4.0.so
  NEEDED               libgrass_imagery.7.4.0.so
  NEEDED               libgrass_gproj.7.4.0.so
  NEEDED               libgrass_gis.7.4.0.so
  NEEDED               libgdal.so.20
  NEEDED               libstdc++.so.6
  NEEDED               libgcc_s.so.1
  NEEDED               libc.so.6
  RUNPATH              /usr/lib/grass74/lib
/usr/lib/gdalplugins/2.2/ogr_GRASS.so:     file format elf64-x86-64
/usr/lib/gdalplugins/2.2/ogr_GRASS.so
  NEEDED               libgrass_vector.7.4.0.so
  NEEDED               libgrass_dbmiclient.7.4.0.so
  NEEDED               libgrass_dbmibase.7.4.0.so
  NEEDED               libgrass_gproj.7.4.0.so
  NEEDED               libgrass_gis.7.4.0.so
  NEEDED               libgdal.so.20
  NEEDED               libstdc++.so.6
  NEEDED               libgcc_s.so.1
  NEEDED               libc.so.6
  RUNPATH              /usr/lib/grass74/lib

This looks like an issue specific to Ubuntu (which links with --as-needed).

The error is non-fatal, so you could chose to ignore it and redirect STDERR to /dev/null:

ogrinfo -sql "CREATE SPATIAL INDEX ON $S" $SHP 2> /dev/null;

comment:2 by Bas Couwenberg, 7 years ago

Ubuntu definitely strips a bunch of libraries from the NEEDED section.

From the diff between libgdal-grass (2.3.0-1) from Debian unstable & libgdal-grass (2.3.0-1build1) from Ubuntu cosmic:

gdal_GRASS.so

[...]
 Dynamic Section:
-  NEEDED               libgrass_vector.7.4.0.so
-  NEEDED               libgrass_dig2.7.4.0.so
-  NEEDED               libgrass_dgl.7.4.0.so
-  NEEDED               libgrass_rtree.7.4.0.so
-  NEEDED               libgrass_linkm.7.4.0.so
-  NEEDED               libgrass_dbmiclient.7.4.0.so
-  NEEDED               libgrass_dbmibase.7.4.0.so
   NEEDED               libgrass_raster.7.4.0.so
   NEEDED               libgrass_imagery.7.4.0.so
   NEEDED               libgrass_gproj.7.4.0.so
-  NEEDED               libgrass_gmath.7.4.0.so
   NEEDED               libgrass_gis.7.4.0.so
-  NEEDED               libgrass_datetime.7.4.0.so
-  NEEDED               libgrass_btree2.7.4.0.so
-  NEEDED               libgrass_ccmath.7.4.0.so
   NEEDED               libgdal.so.20
   NEEDED               libstdc++.so.6
-  NEEDED               libm.so.6
   NEEDED               libgcc_s.so.1
   NEEDED               libc.so.6
   RUNPATH              /usr/lib/grass74/lib
[...]

ogr_GRASS.so

[...]
 Dynamic Section:
   NEEDED               libgrass_vector.7.4.0.so
-  NEEDED               libgrass_dig2.7.4.0.so
-  NEEDED               libgrass_dgl.7.4.0.so
-  NEEDED               libgrass_rtree.7.4.0.so
-  NEEDED               libgrass_linkm.7.4.0.so
   NEEDED               libgrass_dbmiclient.7.4.0.so
   NEEDED               libgrass_dbmibase.7.4.0.so
-  NEEDED               libgrass_raster.7.4.0.so
-  NEEDED               libgrass_imagery.7.4.0.so
   NEEDED               libgrass_gproj.7.4.0.so
-  NEEDED               libgrass_gmath.7.4.0.so
   NEEDED               libgrass_gis.7.4.0.so
-  NEEDED               libgrass_datetime.7.4.0.so
-  NEEDED               libgrass_btree2.7.4.0.so
-  NEEDED               libgrass_ccmath.7.4.0.so
   NEEDED               libgdal.so.20
   NEEDED               libstdc++.so.6
-  NEEDED               libm.so.6
   NEEDED               libgcc_s.so.1
   NEEDED               libc.so.6
   RUNPATH              /usr/lib/grass74/lib
[...]

libgdal-grass should probably be built with --no-as-needed on Ubuntu.

comment:4 by kalxas, 7 years ago

Thanks Bas, just uploaded this fix to the staging ppa.

comment:5 by Bas Couwenberg, 7 years ago

As mentioned on IRC, the commit caused build failures.

That's most likely because -Wl,--no-as-needed should have been used instead:

https://salsa.debian.org/debian-gis-team/gdal-grass/commit/4308a6fdf47533e2d56b3a7011dd39a55957e2b6

comment:6 by kalxas, 7 years ago

Resolution: fixed
Status: newclosed

Thanks. Fix pushed to OSGeoLive ppa and UbuntuGIS unstable.

Note: See TracTickets for help on using tickets.