Van Campenhout Bjorn
2006-Oct-24 13:47 UTC
[R] Unable to load foreign after upgrade on ubuntu
I am running R on ubuntu dapper. The version that is in the ubuntu repos is 2.2.1, so I decided to upgrade by adding deb http://cran.R-project.org/bin/linux/ubuntu dapper/ to my sources.list, as advised on the web page. After sudo apt-get update and upgrade, I have version 2.3.1. However, when I try to load the library 'foreign', I get the following error: Error in dyn.load(x, as.logical(local), as.logical(now)): Unable to load shared library '/usr/lib/R/library/foreign/libs/foreign.so': /usr/lib/R/library/foreign/libs/foreign.so: undefined symbol: isfinite Error: package/namespace load failed for 'foreign' What is going wrong? Bjorn Bjorn Van Campenhout Institute of Development Policy and Management (IDPM) University of Antwerp Venusstraat 35 2000 Antwerp - Belgium ++32 3 220 4648 www.ua.ac.be/bjorn.vancampenhout
Dirk Eddelbuettel
2006-Oct-24 15:11 UTC
[R] Unable to load foreign after upgrade on ubuntu
On 24 October 2006 at 15:47, Van Campenhout Bjorn wrote: | I am running R on ubuntu dapper. The version that is in the ubuntu | repos is 2.2.1, so I decided to upgrade by adding | | deb http://cran.R-project.org/bin/linux/ubuntu dapper/ | | to my sources.list, as advised on the web page. After sudo apt-get | update and upgrade, I have version 2.3.1. However, when I try to load | the library 'foreign', I get the following error: | | Error in dyn.load(x, as.logical(local), as.logical(now)): | Unable to load shared library | '/usr/lib/R/library/foreign/libs/foreign.so': | /usr/lib/R/library/foreign/libs/foreign.so: undefined symbol: isfinite | Error: package/namespace load failed for 'foreign' | | What is going wrong? There are interdependencies between the R binary and the dynamically loaded libraries it loads. By upgrading R, you have agreed to the Faustian bargain of potentially having to upgrade these libraries too. So reinstalling foreign from CRAN should do. R can do that for you, see help("update.packages") and make sure you also have r-base-dev installed as this will cover most if not all of the tools Hth, Dirk -- Hell, there are no rules here - we're trying to accomplish something. -- Thomas A. Edison
Van Campenhout Bjorn
2006-Oct-25 13:19 UTC
[R] Unable to load foreign after upgrade on ubuntu
> | > | But since foreign is part of R, installing a new version of R will > | update the standard and recommended packages including foreign. So > | this suggests that what is being picked up is another copy > of foreign > | from another library. > > Good point. > > As I recall, Christian always builds a sumo 'r-recommends' > package which Bjorn should install from the same apt-get'able > archive on CRAN. >Even when I completely remove the old version of R and install r-base-core from CRAN (which includes r-base and r-recommende), I get the error with the foreign library. Anyway, I compiled from source and now have 2.4 and everything works fine. Bjorn