[R] R: error while loading shared libraries: libg2c.so.o

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Jan 19 09:18:43 CET 2005


On Tue, 18 Jan 2005, Jon Dressel wrote:

> I have just installed the version of R for Linux Enterprise Server AS.

Is the `RedHat  Linux Enterprise Server AS'?  AFAIK, there is no version 
of R for any specific RHEL, but there are versions like 2.0.1.
If you installed an RPM, please tell us so, and which one from where.

> When R is launched, I receive the following error message:

> R: error while loading shared libraries: libg2c.so.o cannot open shared 
> object file: no such file or directory

I very much suspect it is libg2c.so.0.

> I have added the path to the library

It should be in /usr/lib if you have the prerequisites installed.
It may be that you have libg2c.so.0 there, linked to a non-existent 
file.

> above to the /usr/etc/ld.so.conf file and then run ldconfig -v. The 
> listing then shows that the libg2c.so.o is included in the path. 
> Please advise.

You need to know where R's home is.  Normally R RHOME will tell you, but 
that might give the same error.  So use

grep '^R_HOME_DIR' `which R`

and then substitute it in

R CMD ldd R_HOME_DIR/bin/exec/R

My FC3 system with gcc-3.4.3 and readline-5.0 installed from source gives

gannet% R CMD ldd /usr/local/lib/R/bin/exec/R
         libblas.so.3 => /usr/lib/libblas.so.3 (0x0094e000)
         libg2c.so.0 => /usr/local/lib/libg2c.so.0 (0xb7fc0000)
         libm.so.6 => /lib/tls/libm.so.6 (0x00b4f000)
         libgcc_s.so.1 => /usr/local/lib/libgcc_s.so.1 (0xb7fb7000)
         libreadline.so.5 => /usr/local/lib/libreadline.so.5 (0xb7f8d000)
         libdl.so.2 => /lib/libdl.so.2 (0x00948000)
         libncurses.so.5 => /usr/lib/libncurses.so.5 (0x04c8b000)
         libc.so.6 => /lib/tls/libc.so.6 (0x0081c000)
         /lib/ld-linux.so.2 (0x00803000)

and then see if the place it resolves libg2c.so.0 to is an actual file.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list