R Packages, gcc, and BLAS on Amazon EC2



我试图在我的Amazon EC2实例上安装RTextTools for R。我用的是r3.1.1。(2014-07-10安装)与亚马逊的Linux AMI。我以root权限打开R并尝试以下操作:

> install.packages('RTextTools')
Installing package into ‘/root/R/x86_64-redhat-linux-gnu-library/3.1’
(as ‘lib’ is unspecified)
also installing the dependencies ‘slam’, ‘tm’, ‘maxent’
trying URL 'http://cran.stat.ucla.edu/src/contrib/slam_0.1-32.tar.gz'
Content type 'application/x-tar' length 46672 bytes (45 Kb)
opened URL
==================================================
downloaded 45 Kb
trying URL 'http://cran.stat.ucla.edu/src/contrib/tm_0.6-1.tar.gz'
Content type 'application/x-tar' length 510444 bytes (498 Kb)
opened URL
==================================================
downloaded 498 Kb
trying URL 'http://cran.stat.ucla.edu/src/contrib/maxent_1.3.3.1.tar.gz'
Content type 'application/x-tar' length 395873 bytes (386 Kb)
opened URL
==================================================
downloaded 386 Kb
trying URL 'http://cran.stat.ucla.edu/src/contrib/RTextTools_1.4.2.tar.gz'
Content type 'application/x-tar' length 448187 bytes (437 Kb)
opened URL
==================================================
downloaded 437 Kb
* installing *source* package ‘slam’ ...
** package ‘slam’ successfully unpacked and MD5 sums checked
** libs
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG  -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic  -c apply.c -o apply.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG  -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic  -c grouped.c -o grouped.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG  -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic  -c sparse.c -o sparse.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG  -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic  -c util.c -o util.o
gcc -m64 -std=gnu99 -shared -L/usr/local/lib64 -o slam.so apply.o grouped.o sparse.o util.o -L/usr/lib64/R/lib -lRblas -lgfortran -lm -lquadmath -L/usr/lib64/R/lib -lR
/usr/bin/ld: cannot find -lRblas
collect2: error: ld returned 1 exit status
make: *** [slam.so] Error 1
ERROR: compilation failed for package ‘slam’
* removing ‘/root/R/x86_64-redhat-linux-gnu-library/3.1/slam’
ERROR: dependency ‘slam’ is not available for package ‘tm’
* removing ‘/root/R/x86_64-redhat-linux-gnu-library/3.1/tm’
ERROR: dependency ‘tm’ is not available for package ‘maxent’
* removing ‘/root/R/x86_64-redhat-linux-gnu-library/3.1/maxent’
ERROR: dependencies ‘tm’, ‘maxent’ are not available for package ‘RTextTools’
* removing ‘/root/R/x86_64-redhat-linux-gnu-library/3.1/RTextTools’
The downloaded source packages are in
    ‘/tmp/RtmpkiBUCd/downloaded_packages’
Warning messages:
1: In install.packages("RTextTools") :
  installation of package ‘slam’ had non-zero exit status
2: In install.packages("RTextTools") :
  installation of package ‘tm’ had non-zero exit status
3: In install.packages("RTextTools") :
  installation of package ‘maxent’ had non-zero exit status
4: In install.packages("RTextTools") :
  installation of package ‘RTextTools’ had non-zero exit status

问题似乎是没有Rblas。我:

  • 尝试分别安装slam, tm和maxent
  • 确认gcc已安装
  • 安装其他R包(Zelig, ggplot2)没有问题
  • 阅读这些SO问题。
  • 试图理解进入链接描述这里的R文档在BLAS

我认为问题是R寻找不同版本的BLAS比gcc使用。但我真的不知道。我不希望重新安装R,因为它在服务器上被大量使用。

我该怎么办?

明白了。Amazon的默认机器映像使用Atlas BLAS。R指出,当安装所有默认值时,但RTextTools期望普通的BLAS。我卸载了Atlas,卸载了R,重新安装了R,然后就可以安装RTextTools了。

最新更新