[R-sig-Geo] Error to load rgdal

Roger Bivand Roger.Bivand at nhh.no
Thu May 12 10:39:15 CEST 2005


On Thu, 12 May 2005, Susumu Tanimura wrote:

> Dear elijah
> 
> Thank you very much for your reply.
> 
> $ ldd /usr/lib/R/library/rgdal/libs/rgdal.so
>         libR.so => not found
>         libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x40276000)
>         libm.so.6 => /lib/i686/libm.so.6 (0x4032e000)
>         libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x40350000)
>         libc.so.6 => /lib/i686/libc.so.6 (0x40358000)
>         /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
> $ locate libR.so
> /usr/lib/R/lib/libR.so
> 
> So, I added /usr/lib/R/lib in /etc/ld.co.conf and did /sbin/ldconfig.
> Then the result of ldd was changed.
> 
> $ ldd /usr/lib/R/library/rgdal/libs/rgdal.so
>         libR.so => /usr/lib/R/lib/libR.so (0x40276000)
>         libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x404f2000)
>         libm.so.6 => /lib/i686/libm.so.6 (0x405aa000)
>         libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x405cc000)
>         libc.so.6 => /lib/i686/libc.so.6 (0x405d4000)
>         libg2c.so.0 => /usr/lib/libg2c.so.0 (0x4070f000)
>         libreadline.so.4 => /usr/lib/libreadline.so.4 (0x4072d000)
>         libncurses.so.5 => /usr/lib/libncurses.so.5 (0x40759000)
>         libdl.so.2 => /lib/libdl.so.2 (0x40799000)
>         /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
>         libgpm.so.1 => /usr/lib/libgpm.so.1 (0x4079c000)
> 
> Nevertheless, there is the same failure.
> 
> > library(rgdal)
> Loading required package: abind
> Loading required package: pixmap
> Error in dyn.load(x, as.logical(local), as.logical(now)) : 
>         unable to load shared library '/usr/lib/R/library/rgdal/libs/rgdal.so':
>   /usr/lib/R/library/rgdal/libs/rgdal.so: undefined symbol: DGifCloseFile
> Error in library(rgdal) : .First.lib failed for 'rgdal'
> 
> Could you give me further advice?

What does:

$ gdalinfo --version
GDAL 1.2.6.0, released 2005/03/13

report for you? I do not think you have installed GDAL properly, my ldd on 
rgdal.so lists libgdal.so and its (many) dependencies, these are missing 
for you (the dependency on R is not at all necessary):

$ ldd /home/rsb/topics/Ris210/lib/R/library/rgdal/libs/rgdal.
so
        libgdal.so.1 => /usr/local/lib/libgdal.so.1 (0x003f0000)
        libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x00bcb000)
        libm.so.6 => /lib/tls/libm.so.6 (0x00335000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x002e7000)
        libc.so.6 => /lib/tls/libc.so.6 (0x00111000)
        libodbc.so.1 => /usr/lib/libodbc.so.1 (0x00d86000)
        libungif.so.4 => /usr/lib/libungif.so.4 (0x00249000)
        libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0x00935000)
        libpng12.so.0 => /usr/lib/libpng12.so.0 (0x00251000)
        libz.so.1 => /usr/lib/libz.so.1 (0x008ba000)
        libdl.so.2 => /lib/libdl.so.2 (0x00bb0000)
        libpq.so.3 => /usr/lib/libpq.so.3 (0x0095c000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00312000)
        libpthread.so.0 => /lib/tls/libpthread.so.0 (0x00274000)
        libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x0072e000)
        libssl.so.4 => /lib/libssl.so.4 (0x00284000)
        libcrypto.so.4 => /lib/libcrypto.so.4 (0x00971000)
        libkrb5.so.3 => /usr/kerberos/lib/libkrb5.so.3 (0x00357000)
        libcrypt.so.1 => /lib/libcrypt.so.1 (0x003b5000)
        libresolv.so.2 => /lib/libresolv.so.2 (0x002b8000)
        libnsl.so.1 => /lib/libnsl.so.1 (0x00c92000)
        libgssapi_krb5.so.2 => /usr/kerberos/lib/libgssapi_krb5.so.2 (0x00d10000)
        libcom_err.so.3 => /usr/kerberos/lib/libcom_err.so.3 (0x002ca000)
        libk5crypto.so.3 => /usr/kerberos/lib/libk5crypto.so.3 (0x00cd4000)

It is almost never a good idea to install binary on Linux, almost always a 
good idea to install GDAL from source, then install rgdal from source, 
which is simple:

> install.packages("rgdal")

which then makes sure that all the bits and pieces are lined up correctly.

Please let the list know if this helps.

Roger


> 
> --
> Susumu Tanimura
> 
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no




More information about the R-sig-Geo mailing list