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

Jon Dressel jdressel at surromed.com
Wed Jan 19 22:37:09 CET 2005


> If you installed an RPM, please tell us so, and which one from where

The RPM I installed is R-2.0.1-0.RH3AS.i386.rpm from Index of /bin/linux/redhat/el3/i386 located at http://cran.stat.ucla.edu/ .

> I very much suspect it is libg2c.so.0.
> It should be in /usr/lib if you have the prerequisites installed.

It is currently installed in /usr/lib64

> 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

I did the above and determined that R_HOME_DIR is /usr/lib/R . I plugged in above and did not get any of the description as in your example and received the same error message:

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

Please advise.

Jon


-----Original Message-----
From:	Prof Brian Ripley [mailto:ripley at stats.ox.ac.uk]
Sent:	Wed 1/19/2005 12:18 AM
To:	Jon Dressel
Cc:	R-help at stat.math.ethz.ch
Subject:	Re: [R] R: error while loading shared libraries: libg2c.so.o
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