Building R from Source On CentOS

1,970 views
Skip to first unread message

Shekhar

unread,
Dec 22, 2011, 6:53:07 AM12/22/11
to Bangalore R Users - BRU
R can be installed on CentOS easily using "yum", but if you are
interested in doing development or writing a package/library of your
own, then you need to build it.
At first galnce through the documentation and web, i felt it would be
pretty easy to do, but once i started it took half a day to solve
it.There are lot of package dependencies which are not mentioned in
the docs.

Even though i would say it is not yet completed. (I have not
incorporated x11 package which i think is meant for graphics).

if you are unable to install R using Yum, then you can create
repository for R under /etc/yum.repos.d and rest yum will do the job.
I wrote R.repo something like this

[R-project]
name=R project for Statistical Computing repository
baseurl=http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/
failovermethod=priority
enabled=1
gpgcheck=0

Before building R, check whether the following packages are avaialable
on your system. The pre-requisite packages are as follows:

1. gcc
I am using 4.1.2 version .(gcc (GCC) 4.1.2 20080704 (Red Hat
4.1.2-51))

2. Perl ( Mine is 5.8.8)

3. make (3.81)

4. autoconf (2.59) [yum install autoconf]

5.automake(1.9.6) [yum install automake]

6. g77 or f77 compiler (Fortran compiler)

yum install compat-gcc-34-g

Shekhar

unread,
Dec 22, 2011, 7:22:04 AM12/22/11
to Bangalore R Users - BRU
Sorry for the break.
Starting from the 6th step:

6. g77 or f77 compiler (Fortran compiler)

yum install compat-gcc-34-g77.x86_64

7. Install g++
yum install gcc-c++.x86_64

8. Install read line package
yum install readline-devel.x86_64

9.yum install gcc44-gfortran.x86_64

10.yum install gcc-gfortran.x86_64

11.yum install gcc44-c++.x86_64

We need to install X11 package for graphics, so i have installed
following libraries (Even though while building i got error, so i
parked this as of now). I have installed following packages for the
same

12. yum install libX11-devel.x86_64 (Already installed)

13. yum install libXtst-devel.x86_64
14. yum install xorg-x11-xtrans-devel.x86_64
15. yum install libpng-devel.x86_64

Follow the steps to build R
1. wget http://cran.r-project.org/src/base/R-2/R-2.14.1.tar.gz

2. tar -zxf R-2.14.1.tar.gz

3. cd R-2.14.1

4. ./configure --with-x=no

5. make

6. You can check by

make check
make check-all

7. create a environment variable export R_HOME="path to R"
and add bin to PATH variable

export PATH=$PATH:$R_HOME/bin

Thats it!!!!

I would suggest that keep R.repo, since most of the libraries are in R
base directory.

Now you can open R console by typing R . Hope this would help
somebody.

Regards,
Som Shekhar






황진경[Cloud스토리지개발팀]

unread,
Dec 22, 2011, 11:12:30 PM12/22/11
to <brumail@googlegroups.com>
Som,

I happen to find out that your message is in the junk mail folder. (below one)

I am afraid that I might miss any mail you sent.

Could you let me know if it is or not?

Also pls let me know if you did any progress on the prerequisites I asked you.

Thank you.

Jinkyung Hwang

Sent from jkhwang's iPhone

2011. 12. 22. 오후 9:22 "Shekhar" <shekh...@gmail.com> 작성:
이 메일은 지정된 수취인만을 위해 작성되었으며, 중요한 정보나 저작권을 포함하고 있을 수 있습니다. 어떠한 권한 없이, 본 문서에 포함된 정보의 전부 또는 일부를 무단으로 제3자에게 공개, 배포, 복사 또는 사용하는 것을 엄격히 금지합니다. 만약, 본 메일이 잘못 전송된 경우, 발신인 또는 당사에 알려주시고, 본 메일을 즉시 삭제하여 주시기 바랍니다.
This E-mail may contain confidential information and/or copyright material. This email is intended for the use of the addressee only. If you receive this email by mistake, please either delete it without reproducing, distributing or retaining copies thereof or notify the sender immediately.
Reply all
Reply to author
Forward
0 new messages