Saturday, February 12, 2011

Installing R on Amazon Linux

When I wanted to run R (statistical software) on the Amazon "cloud", the first thing I found was this post explaining how to launch an Amazon EC2 "instance" (virtual machine) and pointing to an "image" (contains operating system and whatever else you want) that had Ubuntu and R.

Then I wanted 64-bit R, and it turned out that by far the easiest thing was to launch a Windows instance on Amazon EC2. I googled for an explanation, but it doesn't really need one. You launch a Windows instance, make sure the security group allows RDP, and connect with Remote Desktop. Works very smoothly. I could even connect with my phone.

But now I wanted to run R on a virtual machine which I could (for free) leave running all the time. For this I needed to run Amazon Linux on a "micro" instance, which ruled out both of the above. I launched a micro instance running Amazon Linux, and ssh'd into it.

Okay, now how do I install R?

I'll outline the process I went through. But I also went through a lot more confusion/frustration than I'll describe!

  • Can I use an automatic installer? Apt-get and yum seem to work for various people on the internet. But not for me! Oh well.
  • How do I get a file? Googled, found wget.
wget http://cran.at.r-project.org/src/base/R-2/R-2.12.1.tar.gz
  • How do I unzip this? Googled, found:
tar xf R-2.12.1.tar.gz
cd R-2.12.1

./configure
  • There's an error message! Google the error message to learn I need a C compiler. I had learned earlier that yum is for installing things, and googling reveals that gcc is a C compiler:
sudo yum install gcc
./configure
  • Another error message! Google the message to find that I need a C++ compiler. Maybe something like gcc will help...
yum search gcc
  • Yep! I now see gcc-c++, so I'll install that:
sudo yum install gcc-c++
./configure
  • Another error message! I need a fortran compiler. In the search above, I saw gcc-gfortran, so:
sudo yum install gcc-gfortran
./configure
  • Another error message! Google the message, revealing that I need readline-devel. I still don't know what that is, but this works:
sudo yum install readline-devel
./configure
  • Another error message! Google shows me a post from someone who seems a bit confused, but less confused than I am. Following the advice in that post (which seems like it will get me an incomplete R build, maybe with something related to windowing missing--but I won't be using windows anyway):
./configure --with-x=no
  • It works!
make
PATH=$PATH:~/R-2.12.1/bin/

R

  • Yippeee! I have R now. You can follow these steps, or I think you can use the public AMI I've created, AmazonLinuxWithR_c.

58 comments:

  1. You don't say which Linux you are using. I've been playing on EC2 for the last few weeks and was able to install R very easily on a Ubuntu 10.10 64 bit machine.

    ReplyDelete
  2. "Amazon Linux" seems to be their own special flavor.

    I don't think I was able to run Ubuntu on a micro instance. (I want to leave it running all the time, so this was my goal.)

    ReplyDelete
  3. Thanks for posting this -- it was a lifesaver. I think I solved the X11 library problem -- (perhaps by installing more than I needed, but nevertheless):

    sudo yum install libX11-devel.*
    sudo yum install libICE-devel.*
    sudo yum install libSM-devel.*
    sudo yum install libdmx-devel.*
    sudo yum install libx*
    sudo yum install xorg-x11*
    sudo yum install libFS*
    sudo yum install libX*

    ReplyDelete
  4. Please consider www.elasticr.net. It's awesome.

    ReplyDelete
  5. It's also worth noting that you should add

    sudo yum install make

    The Amazon Linux doesn't seem to include this either.

    ReplyDelete
  6. Thanks madcoverboy! I could swear that 'make' was already there the first time I tried this, but probably I'm wrong--just launched a new server, and it's not.

    Thanks Ed! After that, are you able to run R with windowing?

    ReplyDelete
  7. Very good points you wrote here..Great stuff...I think you've made some truly interesting points.Keep up the good work.
    Amazon

    ReplyDelete
  8. At the point when the thing sells, you at that point need to deal with bundling and transporting the thing to the purchaser, after which you will affirm by means of Amazon that the thing has been dispatched so the purchaser can be informed.Ecom Income Blueprint

    ReplyDelete
  9. Amazon.com is America's biggest and best online retailer. Amazon completes three fold the amount of business as their nearest rival as far as online retail business, Staples.אינדקס אתרים

    ReplyDelete
  10. The blog is so charming. You can't avoid it.
    consigli prezzo

    ReplyDelete
  11. You put a couple of connections to formula books on your site. A peruser at your site taps on one of those connections and they get taken to Amazon through your exceptional connection. air conditioners review

    ReplyDelete
  12. online stumbled upon online casino advertising, all kinds of slot machines And I was glad to click on the link to see such a cool design and everything is clear where and how to play and what to press merely online casino now this is my favorite site

    ReplyDelete
  13. Thank you for the informative post about Security challenges in AWS , Found it useful . cloud migration services have now become secured and with no-risk
    Vmware Cloud Migration services

    Database Migration services

    ReplyDelete
  14. While model advancement is viewed as the center action in the entire procedure, perception and correspondence are essential to cause the client to comprehend the displayed information.ExcelR Data Science Courses

    ReplyDelete
  15. I have read your article, it is very informative and helpful for me.I admire the valuable information you offer in your articles. Thanks for posting it..
    aluminum fence nashville tn

    ReplyDelete
  16. I think this is one of the most significant information for me. And i’m glad reading your article. But should remark on some general things, The web site style is perfect, the articles is really great : D. Good job, cheers.
    construction demolition san diego

    ReplyDelete
  17. I think this is one of the most significant information for me. And i’m glad reading your article. But should remark on some general things, The web site style is perfect, the articles is really great : D. Good job, cheers.
    remodeling contractors houston tx

    ReplyDelete
  18. Great article and a nice way to promote online. I’m satisfied with the information that you provided
    palm tree trimming palm beach gardens

    ReplyDelete
  19. Great article and a nice way to promote online. I’m satisfied with the information that you provided
    bathtub reglazing san diego

    ReplyDelete
  20. Great article and a nice way to promote online. I’m satisfied with the information that you provided
    kitchen & bath las vegas nv

    ReplyDelete
  21. Hi, This is nice article you shared great information i have read it thanks for giving such a wonderful Blog for reader.
    decorative concrete port st lucie

    ReplyDelete
  22. I have read your article, it is very informative and helpful for me.I admire the valuable information you offer in your articles. Thanks for posting it..
    pool screen enclosures collier county

    ReplyDelete
  23. Thanks for a wonderful share. Your article has proved your hard work and experience you have got in this field. Brilliant .i love it reading.
    tree removal tampa

    ReplyDelete
  24. I have read your article, it is very informative and helpful for me.I admire the valuable information you offer in your articles. Thanks for posting it.. Escort service new york

    ReplyDelete
  25. Yeah, running application in the cloud could be tricky, thanks for a guide!

    ReplyDelete
  26. Thanks for sharing your innovative ideas to our vision. Your Blog writing Skill is simply awesome with useful information, excellent work! I will get back here.
    Machine Learning Training In Hyderabad

    ReplyDelete
  27. Hi, Thanks for sharing wonderful content...

    For More:

    AI Training In Hyderabad

    ReplyDelete
  28. Thank you for sharing such a wonderful articles. Keep sharing
    AWS Training In Hyderabad

    ReplyDelete
  29. thanks for sharing nice information....
    more : https://www.kellytechno.com/Hyderabad/Course/Machine-Learning-Training-In-Hyderabad

    ReplyDelete
  30. Hey, i liked reading your article. You may go through few of my creative works here
    Marhabapilates
    Poppriceguide

    ReplyDelete
  31. I was astounded after reading your post. I realize you 're really good at describing it. And I hope that after reading your post, other readers can know how I feel too.data science course

    ReplyDelete
  32. I like this post,And I figure that they making some incredible memories to scrutinize this post,they may take a good site to make an information,thanks for sharing it to me
    artificial intelligence course in noida

    ReplyDelete
  33. Every person, from a child to an 80-year-old man, use the facilities the technology has provided us. Along with this, the increase in population has also played a big role in the tremendous growth of information technology. data science course in hyderabad

    ReplyDelete
  34. It is good that you always notice the positive image of these types of topics but on the other hand if you need related assistance. I really love this post and hope to see such informative news furthermore. Keep it up. Guest Post

    ReplyDelete
  35. I was just browsing through the internet looking for some information and came across your blog. I am impressed by the information that you have on this blog. It shows how well you understand this subject. Bookmarked this page, will come back for more. watch series

    ReplyDelete
  36. It doesn't make sense to spend that much pennies on using that when you can just have it also. I couldn't refer this a 'Leptitox killer'. You might have to be aware of all the fulfilling stuff you can do with this. best gaming

    ReplyDelete
  37. wow, great, I was wondering how to cure acne naturally. and found your site by google, learned a lot, now i’m a bit clear. I’ve bookmark your site and also add rss. keep us updated. real estate closing gifts

    ReplyDelete
  38. Our academic pursuits, along with a range of extracurricular activities, help in honing a child's skills and ensuring that he/she grows to be a mature and responsible citizen. watch series

    ReplyDelete
  39. That is extremely useful for expanding my insight in this field. christmas

    ReplyDelete
  40. The miracle thoughts are acceptable to look from the correct assistance line. I permit the harmony end to give the correct source on this perfect substance. A debt of gratitude is in order for this pleasant chance digital marketing company hongkong

    ReplyDelete
  41. I truly value the sort of points you post here. Much obliged for sharing us an incredible data that is really useful. Great day! digital marketing company hongkong

    ReplyDelete
  42. I am another client of this site so here I saw different articles and posts posted by this site,I inquisitive more enthusiasm for some of them trust you will give more data on this subjects in your next articles. online retailer

    ReplyDelete
  43. I was simply perusing through the web searching for some data and ran over your blog. I am dazzled by the data that you have on this blog. It shows how well you comprehend this subject. Bookmarked this page, will return for additional. gift

    ReplyDelete
  44. Thank you because you have been willing to share information with us. we will always appreciate all you have done here because I know you are very concerned with our. Sarkari Naukri

    ReplyDelete
  45. Hi I am so charmed I found your blog, I truly found you unintentionally, while I was watching on google for something different, Anyways I am here now and could simply prefer to state thank for a colossal post and an overall engaging site. Kindly keep up the incredible work. judi slot

    ReplyDelete
  46. A very awesome blog post. We are really grateful for your blog post. You will find a lot of approaches after visiting your post. relationship

    ReplyDelete
  47. You really make it look so natural with your exhibition however I discover this issue to be really something which I figure I could never appreciate. It appears to be excessively confounded and amazingly wide for me. I'm searching forward for your next post, I'll attempt to get its hang! high DA

    ReplyDelete
  48. You make so many great points here that I read your article a couple of times. Your views are in accordance with my own for the most part. This is great content for your readers. Speedup Forex

    ReplyDelete
  49. Yes i am totally agreed with this article and i just want say that this article is very nice and very informative article.I will make sure to be reading your blog more. You made a good point but I can't help but wonder, what about the other side? !!!!!!Thanks judi slot online

    ReplyDelete
  50. Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon. Big thanks for the useful info. RRB Group D Admit Card

    ReplyDelete