R Packages, gcc, and BLAS on Amazon EC2

1k views Asked by At

I am trying to install RTextTools for R on my Amazon EC2 instance. I'm using R 3.1.1. (installed 2014-07-10) with Amazon's Linux AMI. I open R with root privileges and try the following:

> 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

It appears that the problem is that there is no Rblas. I have:

  • Tried installing slam, tm, and maxent separately
  • Confirmed gcc is installed
  • Installed other R packages (Zelig, ggplot2) with no problem
  • Read these SO questions.
  • Tried to understand enter link description herethe R documentation on BLAS

I think the problem is R looking for a different version of BLAS than gcc uses. But I really have no idea. I would prefer not to have to reinstall R, as it is under heavy use on the server.

What do I do?

1

There are 1 answers

0
ZacharyST On

Figured it out. Amazon's default machine image uses the Atlas BLAS. R points to that when installed with all defaults, but RTextTools expects the ordinary BLAS. I uninstalled Atlas, uninstalled R, reinstalled R, and was then able to install RTextTools.