当我在EC2上打开Debian Lenny的基本图像(实际上是EC2上的EMR )时,我得到的是Lenny版本5.0.7,并且我能够使用outlined in a previous question方法升级R。升级R后,我的版本是2.12。
然后我无法安装Hmisc包。我看到它有一个Debian包,所以我试过了:
sudo apt-get update
sudo apt-get install r-cran-hmisc这似乎是可行的,但当我进入R时,我会得到以下结果:
> require(Hmisc)
Loading required package: Hmisc
Failed with error: ‘package 'Hmisc' was built before R 2.10.0: please re-install it’所以我假设Debian代码库中的Hmisc是一个旧版本。所以我还是升级吧。所以我进入R,然后:
install.packages("Hmisc")这会失败,出现以下错误:
...
gcc -I/usr/share/R/include -fpic -std=gnu99 -O3 -pipe -g -c string_box.c -o string_box.o
gfortran -fpic -O3 -pipe -g -c wclosest.f -o wclosest.o
gcc -shared -o Hmisc.so Hmisc.o cidxcn.o cidxcp.o hoeffd.o jacklins.o largrec.o mChoice.o nstr.o ranksort.o rcorr.o string_box.o wclosest.o -lgfortran -lm -L/usr/lib64/R/lib -lR
/usr/bin/ld: cannot find -lgfortran
collect2: ld returned 1 exit status
make: *** [Hmisc.so] Error 1
ERROR: compilation failed for package ‘Hmisc’
* removing ‘/home/hadoop/R/x86_64-pc-linux-gnu-library/2.12/Hmisc’
The downloaded packages are in
‘/tmp/Rtmp2Ej5Tn/downloaded_packages’
Warning message:
In install.packages("Hmisc") :
installation of package 'Hmisc' had non-zero exit status
> 看起来ld正在努力使用lgfortran。我检查了一下,gfortran已经安装了。所以我尝试安装gfortran-4.1:
sudo apt-get install gfortran-4.1这并没有改变任何事情。安装4.2也没有用。
关于下一步要尝试什么,有什么建议吗?
发布于 2011-01-14 22:36:20
我在这里发帖后,偶然发现了this previous question。看起来我需要手动链接到gfortran库:
sudo ln -s /usr/lib/libgfortran.so.3 /usr/lib/libgfortran.so更新群集包后,我可以install.packages("Hmisc")
发布于 2011-01-15 00:06:14
安装r-base-dev包时会发生什么?那么它会构建吗?应该是这样的。
https://stackoverflow.com/questions/4692100
复制相似问题