[GRASS5] Getting r.in.gdal running

Glynn Clements glynn.clements at virgin.net
Wed Jul 25 16:06:43 EDT 2001


Rich Shepard wrote:

>   I'm stumped. Downloaded the libgdal* and libstdc++* tarball from Frank's
> web site, put the files in $GISBASE/lib (/usr/local/grass5/lib), added that
> path to /etc/ld.so.conf and ran /sbin/ldconfig. But, ...
> 
>   When I run r.in.gdal within GRASS, I keep getting the error message that
> it's unable to initialize the GDAL bridge. From within GRASS, 'echo
> $LD_LIBRARY_PATH' shows /usr/local/grass5/lib.

Note that r.in.gdal uses its own "home grown" mechanism for locating
the GDAL library. It looks for the library under the names
libgdal.1.1.so, gdal.1.0.so, gdal.so.1.0 and libgdal.so.1 (in that
order).

For each name, it tries (in order) $GISBASE/lib/<name>,
$GDAL_HOME/<name> then just <name>. The last one should use the
dynamic loader's standard lookup mechanism (i.e. $LD_LIBRARY_PATH then
/etc/ld.so.cache).

For each actual pathname, it calls dlopen(<name>, RTLD_LAZY) on the
pathname, then dlysym(<handle>, "GDALOpen").

Things that could go wrong include it not being in the right directory
(although both the first and third attempts should find it in your
case), not having the right filename, not defining GDALOpen (e.g. 
because the name is "decorated"), or failing to load necessary
dependencies (e.g. my version requires the TIFF, JPEG, PNG and zlib
libraries, as well as libstdc++ and the libc, libm and libdl system
libraries).

-- 
Glynn Clements <glynn.clements at virgin.net>



More information about the grass-dev mailing list