SlideShare a Scribd company logo
1 of 6
How to Install and Configure R on a Linux Server
08/12/2014
EIM MDM Services
Vikrant Singh Bisht
R/SAS Analytics
vikrant.bisht@tcs.com
Table of Content
1. Introduction.................................................................................................................................................. 3
2. Pre requisites................................................................................................................................................ 3
3. Setting up and Installing Linux system level libraries (Also referred to as OS level libraries)................................ 3
4. Installing R.................................................................................................................................................... 4
5. Post Installation Verification .......................................................................................................................... 5
6. Conclusion.................................................................................................................................................... 5
1. Introduction
This Documentdescribes how to install R ona Linuxsystem. The list of pre requisite Linuxlibraries needed has also
been documented.Since R is a freeware, information available online is very scattered and incomplete. This
documentattempts at collating all information obtained by performingmultiple proofof concepts.
2. Pre requisites
Asa pre requisite, the user performingthe install should have the ability to sudointo the server as root. Inother
wordsroot accessis a must to performthe install.
The LinuxOperating System usedfor establishing all proofof conceptswas Red Hat 6.3 (Santiago) ,itis
recommended to usea 64bit Operatingsystem to retain the flexibility ofallowing reverse compatibility in case a 32
bit R install is needed onthe same server. The Linuxrepository usedwas as6-u3_64.
The R sourcefiles were downloaded fromCRAN- http://cran.r-project.org.Thesourcerpm’scanbe downloaded
from trustedLinuxftp sites such as ftp://ftp.remotesensing.org orhttp://www.rpmfind.net.
3. Setting up and Installing Linux system level libraries (Also referred to as OS level
libraries)
The OS level libraries that need tobe installed prior toinstalling R fall undertwocategories. The firstcategory
includes those libraries that canbe installed fromthe local Linuxrepository using the yum commandand the second
one includespackages downloadedfrom trusted internet websites that can be installed usingthe rpmcommand.
The table below describes the order in whichthese libraries need to be installed.
Index Library Name Type of
install
(yum/rpm)
Purpose Criticality
1. fontconfig-devel yum Native text support. HIGH
2. libtiff yum Supportfor.tiff files. HIGH
3. Libtiff-devel yum Supportfor.tiff files. HIGH
4. pango-devel yum Header library support. HIGH
5. cairo yum X11 library support. HIGH
6. texlive-latex yum PDF Support. HIGH
7. libRmath rpm N/A HIGH
8. readline-devel yum GNU readline Support. HIGH
9. libXt-devel yum N/A HIGH
10. firefox yum Standard BrowserSupport. HIGH
11. tcl-devel yum N/A HIGH
12. tk-devel yum N/A HIGH
13. bzip2-devel yum Core RSupport. HIGH
14. pcre-devel yum N/A HIGH
15. libxml2-devel yum XMLsupport. HIGH
16. java-openjdk- yum HIGH
devel Standard JAVA support.
17. boost-devel yum Pre requisite forR studio. MEDIUM
18. openssl-devel yum SupportforSSL
connections.
HIGH
19. openmpi-devel yum SupportforMPI
connections.
HIGH
20. gtk2-devel yum GraphicsSupport. MEDIUM
21. *texinfo build from
source
Native charactersetsupport. HIGH
22. libjpeg-turbo rpm Standard JPEGfile Support. HIGH
23. R-core rpm R studiosupport. LOW
24. *gdal rpm Standard pre requisite for R
add onpackage rgdal.
LOW
25. *proj build from
source
Standard pre requisite for R
add onpackage rgdal.
LOW
26. *geos build from
source
Standard pre requisite for R
add onpackage rgeos.
LOW
27. jags rpm Standard pre requisite for R
add onpackage rjags.
LOW
28. jags3-devel rpm Standard pre requisite for R
add onpackage rjags.
LOW
*NOTE –These libraries need to be configuredandbuild usingthe configure andmake commandsrespectively.
However,this may vary dependinguponthe sourcerpm. It is recommended tobuild the rpm’s withdefault settings
so as to ensurethat the OSis able to locate the configurationwithoutany issues.
It is very important to updatethebash_profilelocatedat theroot homeafterevery installwiththelocationof
the installedlibrary(separatedby a colon). Thiswillhelp inresolvinginterdependencybetweenlibrariessince
the bash_profileisthe automaticlookup filefromwhere all installationpathsarefetched.
Thespecialinconsolatafix should beupdatedinthebash_profilesinceit is essentialto ensure pdf support. Once
all installationpathshavebeenupdatedinthe bash_profile,addthe following:-
R_RD4PDF =times:inconsolata
Export R_RD4PDF
4. InstallingR
4.1 Downloading the R sourcetar file – The R sourcetar file canbe downloadedfrom the CRANwebsite
(http://cran.r-project.org/)whichisthestandard website for downloadingR.
4.2 Oncethe sourcehas been downloadedonto the Linuxmachine, the followingsteps can be usedto extract,
configureandinstall R :-
4.2.1 Downloading and extracting the source
 Navigate to the folder containingthe tar file. Example cd /usr/local/R
 Untar the sourceusingthe tar –xvf command(ifthe sourcefile has the extension .gz as well then a
gunzipwill need tobe done prior to this step as well.
4.2.2 Compiling,building and installation.
 Navigate to within the created by the above twosteps. Example cd /usr/local/R/R-3.1.2.
 Configurethe R softwareby issuingthe configurecommandwiththe accompanyingoptions.If all
the pre requisite libraries marked with HIGHcriticality earlier installed successfully,then the
followingconfigurecommandcan be used:-
 ./configure --prefix=/usr/local/R/R-3.1.2 --with-cairo=yes--enable-R-shlib--with-tcltk --with-
x=yes--with-libpng=yes--with-jpeglib=yes
 This ensures that all the capabilities are installed and available, if it is explicitly required notto
include some functionality,then the correspondingflag canbe unset byreplacing the ye s witha no.
 Next, from the same location (/usr/local/R/R-3.1.2),executethemake command.This doesnot
need any parameters andwill runfor approximately 20 minutes building up internal libraries forall
configureparameters.
 Next runthe commandmake install –this commandwill dothe Rinstall based on the configure
and build steps earlier.
 Next the make install-infocommandcanberun-this is optional but helpfulin summarising the
install.
 The final commandto be runis make install-pdf.Thiscommandis usedto setup pdfsupport.
5. PostInstallation Verification
 Logoutas an administrator and re login as a normal enduser.
 Type R at the commandprompt – IfR is installed exactly perthe steps earlier, no soft link creation is
necessary – in case the user experiences some issues, he/she cannavigate to the lib64/R folder
within the installation directory and key in ./R to ensurethe correct64bit version ofR is launched.
 Atthe R prompt type in sessionInfo() toverifysession details.
 The capabilities() command canbe typed to verify the features that are enabled. Using the
sequenceof steps in this manual, only profmem andaqua capabilities will be FALSE,sincethese
are not supportedin Linux.
 The demo(graphics) commandcanbe used to test the graphic capabilities ofthe install.
6. Conclusion
Using the above steps Rcan be installed in the Linux environment with full capabilities.Almost all the steps were
earlier performed UNIXadministration team, butthis documentintends to make this possible for even a nonUNIX
administrator to install andmaintain R onLinux.
Contact
For more information, contact vikrant.bisht@tcs.com
About Tata Consultancy Services (TCS)
Tata ConsultancyServices is an IT services, consulting andbusinesssolutions
organizationthat delivers real results to global business, ensuring a level of certaintyno
other firm can match. TCS offers a consulting-led, integrated portfolioof IT andIT-
enabledinfrastructure, engineering andassurance services. Thisis deliveredthroughits
unique Global NetworkDeliveryModelTM, recognizedas the benchmark ofexcellence in
software development. A part of the Tata Group, India’s largest industrial conglomerate,
TCS has a global footprint and is listedonthe National Stock Exchange and Bombay
Stock Exchange inIndia.
For more information, visit us at www.tcs.com.
IT Services
Business Solutions
Consulting
All content / information present here is the exclusive property of Tata Consultancy Services Limited (TCS). The content /
information contained here is correct at the time of publishing. No material from here may be copied, modified,
reproduced, republished, uploaded, transmitted, posted or distributed in any form without prior written permission from
TCS. Unauthorized use of the content / information appearing here may violate copyright, trademark and other applicable
laws, and could result in criminal or civil penalties. Copyright © 2011 Tata Consultancy Services Limited
Thank You

More Related Content

What's hot

Red Hat Certified engineer course
  Red Hat Certified engineer course   Red Hat Certified engineer course
Red Hat Certified engineer course Ali Abdo
 
Software Packaging with RPM
Software Packaging with RPMSoftware Packaging with RPM
Software Packaging with RPMSchalk Cronjé
 
Rhce syllabus | Red Hat Linux Training: IPSR Solutions
Rhce syllabus | Red Hat Linux Training: IPSR SolutionsRhce syllabus | Red Hat Linux Training: IPSR Solutions
Rhce syllabus | Red Hat Linux Training: IPSR SolutionsIPSRAptitudetraining
 
RPM (Red Hat Package Manager)
RPM (Red Hat Package Manager)RPM (Red Hat Package Manager)
RPM (Red Hat Package Manager)skalaivanibutp
 
101 2.5 use rpm and yum package management
101 2.5 use rpm and yum package management101 2.5 use rpm and yum package management
101 2.5 use rpm and yum package managementAcácio Oliveira
 
RPM: Speed up your deploy
RPM: Speed up your deployRPM: Speed up your deploy
RPM: Speed up your deployfcrippa
 
图文详解安装Net backup 6.5备份恢复oracle 10g rac 数据库
图文详解安装Net backup 6.5备份恢复oracle 10g rac 数据库图文详解安装Net backup 6.5备份恢复oracle 10g rac 数据库
图文详解安装Net backup 6.5备份恢复oracle 10g rac 数据库maclean liu
 
Configure, Pack and Distribute: An RPM Creation Workshop
Configure, Pack and Distribute: An RPM Creation WorkshopConfigure, Pack and Distribute: An RPM Creation Workshop
Configure, Pack and Distribute: An RPM Creation WorkshopNovell
 
Fast boot
Fast bootFast boot
Fast bootSZ Lin
 
Rh202 q&a-demo-cert magic
Rh202 q&a-demo-cert magicRh202 q&a-demo-cert magic
Rh202 q&a-demo-cert magicEllina Beckman
 
Software management in linux
Software management in linuxSoftware management in linux
Software management in linuxnejadmand
 
Bundling Packages and Deploying Applications with RPM
Bundling Packages and Deploying Applications with RPMBundling Packages and Deploying Applications with RPM
Bundling Packages and Deploying Applications with RPMAlexander Shopov
 
Linux or unix interview questions
Linux or unix interview questionsLinux or unix interview questions
Linux or unix interview questionsTeja Bheemanapally
 
SUSE Expert Days Paris 2018 - SUSE HA Cluster Multi-Device
SUSE Expert Days Paris 2018 - SUSE HA Cluster Multi-DeviceSUSE Expert Days Paris 2018 - SUSE HA Cluster Multi-Device
SUSE Expert Days Paris 2018 - SUSE HA Cluster Multi-DeviceSUSE
 
Jurijs Velikanovs Direct NFS - Why and How?
Jurijs Velikanovs Direct NFS - Why and How?Jurijs Velikanovs Direct NFS - Why and How?
Jurijs Velikanovs Direct NFS - Why and How?Andrejs Vorobjovs
 
Chicago Docker Meetup Presentation - Mediafly
Chicago Docker Meetup Presentation - MediaflyChicago Docker Meetup Presentation - Mediafly
Chicago Docker Meetup Presentation - MediaflyMediafly
 

What's hot (20)

Red Hat Certified engineer course
  Red Hat Certified engineer course   Red Hat Certified engineer course
Red Hat Certified engineer course
 
Software Packaging with RPM
Software Packaging with RPMSoftware Packaging with RPM
Software Packaging with RPM
 
Rhce syllabus | Red Hat Linux Training: IPSR Solutions
Rhce syllabus | Red Hat Linux Training: IPSR SolutionsRhce syllabus | Red Hat Linux Training: IPSR Solutions
Rhce syllabus | Red Hat Linux Training: IPSR Solutions
 
Presentation on rhce
Presentation on rhcePresentation on rhce
Presentation on rhce
 
RPM (Red Hat Package Manager)
RPM (Red Hat Package Manager)RPM (Red Hat Package Manager)
RPM (Red Hat Package Manager)
 
101 2.5 use rpm and yum package management
101 2.5 use rpm and yum package management101 2.5 use rpm and yum package management
101 2.5 use rpm and yum package management
 
RPM: Speed up your deploy
RPM: Speed up your deployRPM: Speed up your deploy
RPM: Speed up your deploy
 
图文详解安装Net backup 6.5备份恢复oracle 10g rac 数据库
图文详解安装Net backup 6.5备份恢复oracle 10g rac 数据库图文详解安装Net backup 6.5备份恢复oracle 10g rac 数据库
图文详解安装Net backup 6.5备份恢复oracle 10g rac 数据库
 
Configure, Pack and Distribute: An RPM Creation Workshop
Configure, Pack and Distribute: An RPM Creation WorkshopConfigure, Pack and Distribute: An RPM Creation Workshop
Configure, Pack and Distribute: An RPM Creation Workshop
 
Linux16 RPM
Linux16 RPMLinux16 RPM
Linux16 RPM
 
Fast boot
Fast bootFast boot
Fast boot
 
Rh202 q&a-demo-cert magic
Rh202 q&a-demo-cert magicRh202 q&a-demo-cert magic
Rh202 q&a-demo-cert magic
 
Software management in linux
Software management in linuxSoftware management in linux
Software management in linux
 
Bundling Packages and Deploying Applications with RPM
Bundling Packages and Deploying Applications with RPMBundling Packages and Deploying Applications with RPM
Bundling Packages and Deploying Applications with RPM
 
Linux or unix interview questions
Linux or unix interview questionsLinux or unix interview questions
Linux or unix interview questions
 
NIH package manager for pkgsrc
NIH package manager for pkgsrcNIH package manager for pkgsrc
NIH package manager for pkgsrc
 
101 apend. backups
101 apend. backups101 apend. backups
101 apend. backups
 
SUSE Expert Days Paris 2018 - SUSE HA Cluster Multi-Device
SUSE Expert Days Paris 2018 - SUSE HA Cluster Multi-DeviceSUSE Expert Days Paris 2018 - SUSE HA Cluster Multi-Device
SUSE Expert Days Paris 2018 - SUSE HA Cluster Multi-Device
 
Jurijs Velikanovs Direct NFS - Why and How?
Jurijs Velikanovs Direct NFS - Why and How?Jurijs Velikanovs Direct NFS - Why and How?
Jurijs Velikanovs Direct NFS - Why and How?
 
Chicago Docker Meetup Presentation - Mediafly
Chicago Docker Meetup Presentation - MediaflyChicago Docker Meetup Presentation - Mediafly
Chicago Docker Meetup Presentation - Mediafly
 

Similar to How to install_and_configure_r_on_a_linux_server

101 2.5 use rpm and yum package management
101 2.5 use rpm and yum package management101 2.5 use rpm and yum package management
101 2.5 use rpm and yum package managementAcácio Oliveira
 
Essay About ISS 418 Lab 7 And 8
Essay About ISS 418 Lab 7 And 8Essay About ISS 418 Lab 7 And 8
Essay About ISS 418 Lab 7 And 8Paula Smith
 
Nrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core
Nrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios CoreNrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core
Nrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios CoreNagios
 
NRPE - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core 4 and others.
NRPE - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core 4 and others.NRPE - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core 4 and others.
NRPE - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core 4 and others.Marc Trimble
 
Instalando Cacti no CentOS 5
Instalando Cacti no CentOS 5Instalando Cacti no CentOS 5
Instalando Cacti no CentOS 5Carlos Eduardo
 
Radiomic Features.pdf
Radiomic Features.pdfRadiomic Features.pdf
Radiomic Features.pdfLallHussain
 
Cluster management (supercomputer)
Cluster management (supercomputer)Cluster management (supercomputer)
Cluster management (supercomputer)Hary HarysMatta
 
Oracle ebs-r12-1-3installationlinux64bit
Oracle ebs-r12-1-3installationlinux64bitOracle ebs-r12-1-3installationlinux64bit
Oracle ebs-r12-1-3installationlinux64bitRavi Kumar Lanke
 
Install websphere message broker 8 RHEL 6 64 bits
Install websphere message broker 8 RHEL 6 64 bitsInstall websphere message broker 8 RHEL 6 64 bits
Install websphere message broker 8 RHEL 6 64 bitsManuel Vega
 
Trying and evaluating the new features of GlusterFS 3.5
Trying and evaluating the new features of GlusterFS 3.5Trying and evaluating the new features of GlusterFS 3.5
Trying and evaluating the new features of GlusterFS 3.5Keisuke Takahashi
 
Installing & Configuring IBM Domino 9 on CentOS
Installing & Configuring IBM Domino 9 on CentOSInstalling & Configuring IBM Domino 9 on CentOS
Installing & Configuring IBM Domino 9 on CentOSDevin Olson
 
18587936 squid-proxy-configuration-guide - [the-xp.blogspot.com]
18587936 squid-proxy-configuration-guide - [the-xp.blogspot.com]18587936 squid-proxy-configuration-guide - [the-xp.blogspot.com]
18587936 squid-proxy-configuration-guide - [the-xp.blogspot.com]Krisman Tarigan
 
Linux security quick reference guide
Linux security quick reference guideLinux security quick reference guide
Linux security quick reference guideCraig Cannon
 
Prizm Installation Guide
Prizm Installation GuidePrizm Installation Guide
Prizm Installation Guidevjvarenya
 

Similar to How to install_and_configure_r_on_a_linux_server (20)

101 2.5 use rpm and yum package management
101 2.5 use rpm and yum package management101 2.5 use rpm and yum package management
101 2.5 use rpm and yum package management
 
Essay About ISS 418 Lab 7 And 8
Essay About ISS 418 Lab 7 And 8Essay About ISS 418 Lab 7 And 8
Essay About ISS 418 Lab 7 And 8
 
linux installation.pdf
linux installation.pdflinux installation.pdf
linux installation.pdf
 
Nrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core
Nrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios CoreNrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core
Nrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core
 
NRPE - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core 4 and others.
NRPE - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core 4 and others.NRPE - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core 4 and others.
NRPE - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core 4 and others.
 
Unix Administration 2
Unix Administration 2Unix Administration 2
Unix Administration 2
 
Instalando Cacti no CentOS 5
Instalando Cacti no CentOS 5Instalando Cacti no CentOS 5
Instalando Cacti no CentOS 5
 
Radiomic Features.pdf
Radiomic Features.pdfRadiomic Features.pdf
Radiomic Features.pdf
 
Rac on NFS
Rac on NFSRac on NFS
Rac on NFS
 
Cluster management (supercomputer)
Cluster management (supercomputer)Cluster management (supercomputer)
Cluster management (supercomputer)
 
Oracle ebs-r12-1-3installationlinux64bit
Oracle ebs-r12-1-3installationlinux64bitOracle ebs-r12-1-3installationlinux64bit
Oracle ebs-r12-1-3installationlinux64bit
 
Install websphere message broker 8 RHEL 6 64 bits
Install websphere message broker 8 RHEL 6 64 bitsInstall websphere message broker 8 RHEL 6 64 bits
Install websphere message broker 8 RHEL 6 64 bits
 
All in one
All in oneAll in one
All in one
 
Trying and evaluating the new features of GlusterFS 3.5
Trying and evaluating the new features of GlusterFS 3.5Trying and evaluating the new features of GlusterFS 3.5
Trying and evaluating the new features of GlusterFS 3.5
 
Installing & Configuring IBM Domino 9 on CentOS
Installing & Configuring IBM Domino 9 on CentOSInstalling & Configuring IBM Domino 9 on CentOS
Installing & Configuring IBM Domino 9 on CentOS
 
18587936 squid-proxy-configuration-guide - [the-xp.blogspot.com]
18587936 squid-proxy-configuration-guide - [the-xp.blogspot.com]18587936 squid-proxy-configuration-guide - [the-xp.blogspot.com]
18587936 squid-proxy-configuration-guide - [the-xp.blogspot.com]
 
Linux
Linux Linux
Linux
 
Linux security quick reference guide
Linux security quick reference guideLinux security quick reference guide
Linux security quick reference guide
 
Resume
ResumeResume
Resume
 
Prizm Installation Guide
Prizm Installation GuidePrizm Installation Guide
Prizm Installation Guide
 

More from sushantbit04

How to analyze_table_through_informatica
How to analyze_table_through_informaticaHow to analyze_table_through_informatica
How to analyze_table_through_informaticasushantbit04
 
Two single node cluster to one multinode cluster
Two single node cluster to one multinode clusterTwo single node cluster to one multinode cluster
Two single node cluster to one multinode clustersushantbit04
 
Apache hadoop 2_installation
Apache hadoop 2_installationApache hadoop 2_installation
Apache hadoop 2_installationsushantbit04
 
A_human_resource_information_system
A_human_resource_information_systemA_human_resource_information_system
A_human_resource_information_systemsushantbit04
 
Characteristics_of_the_database_system
Characteristics_of_the_database_systemCharacteristics_of_the_database_system
Characteristics_of_the_database_systemsushantbit04
 
The_factories_act__1948
The_factories_act__1948The_factories_act__1948
The_factories_act__1948sushantbit04
 
Employees_state_insurance_act
Employees_state_insurance_actEmployees_state_insurance_act
Employees_state_insurance_actsushantbit04
 
Variable_pay _at_care_soft
Variable_pay _at_care_softVariable_pay _at_care_soft
Variable_pay _at_care_softsushantbit04
 
Industrial and labour laws (comprehensive)
Industrial and labour laws (comprehensive)Industrial and labour laws (comprehensive)
Industrial and labour laws (comprehensive)sushantbit04
 

More from sushantbit04 (13)

How to analyze_table_through_informatica
How to analyze_table_through_informaticaHow to analyze_table_through_informatica
How to analyze_table_through_informatica
 
Two single node cluster to one multinode cluster
Two single node cluster to one multinode clusterTwo single node cluster to one multinode cluster
Two single node cluster to one multinode cluster
 
Apache hadoop 2_installation
Apache hadoop 2_installationApache hadoop 2_installation
Apache hadoop 2_installation
 
A_human_resource_information_system
A_human_resource_information_systemA_human_resource_information_system
A_human_resource_information_system
 
Characteristics_of_the_database_system
Characteristics_of_the_database_systemCharacteristics_of_the_database_system
Characteristics_of_the_database_system
 
Dbms_class _14
Dbms_class _14Dbms_class _14
Dbms_class _14
 
The_factories_act__1948
The_factories_act__1948The_factories_act__1948
The_factories_act__1948
 
Labour_law
Labour_lawLabour_law
Labour_law
 
Employees_state_insurance_act
Employees_state_insurance_actEmployees_state_insurance_act
Employees_state_insurance_act
 
Variable_pay _at_care_soft
Variable_pay _at_care_softVariable_pay _at_care_soft
Variable_pay _at_care_soft
 
Hris_notes
Hris_notesHris_notes
Hris_notes
 
Case2 _layoff
Case2 _layoffCase2 _layoff
Case2 _layoff
 
Industrial and labour laws (comprehensive)
Industrial and labour laws (comprehensive)Industrial and labour laws (comprehensive)
Industrial and labour laws (comprehensive)
 

How to install_and_configure_r_on_a_linux_server

  • 1. How to Install and Configure R on a Linux Server 08/12/2014 EIM MDM Services Vikrant Singh Bisht R/SAS Analytics vikrant.bisht@tcs.com
  • 2. Table of Content 1. Introduction.................................................................................................................................................. 3 2. Pre requisites................................................................................................................................................ 3 3. Setting up and Installing Linux system level libraries (Also referred to as OS level libraries)................................ 3 4. Installing R.................................................................................................................................................... 4 5. Post Installation Verification .......................................................................................................................... 5 6. Conclusion.................................................................................................................................................... 5
  • 3. 1. Introduction This Documentdescribes how to install R ona Linuxsystem. The list of pre requisite Linuxlibraries needed has also been documented.Since R is a freeware, information available online is very scattered and incomplete. This documentattempts at collating all information obtained by performingmultiple proofof concepts. 2. Pre requisites Asa pre requisite, the user performingthe install should have the ability to sudointo the server as root. Inother wordsroot accessis a must to performthe install. The LinuxOperating System usedfor establishing all proofof conceptswas Red Hat 6.3 (Santiago) ,itis recommended to usea 64bit Operatingsystem to retain the flexibility ofallowing reverse compatibility in case a 32 bit R install is needed onthe same server. The Linuxrepository usedwas as6-u3_64. The R sourcefiles were downloaded fromCRAN- http://cran.r-project.org.Thesourcerpm’scanbe downloaded from trustedLinuxftp sites such as ftp://ftp.remotesensing.org orhttp://www.rpmfind.net. 3. Setting up and Installing Linux system level libraries (Also referred to as OS level libraries) The OS level libraries that need tobe installed prior toinstalling R fall undertwocategories. The firstcategory includes those libraries that canbe installed fromthe local Linuxrepository using the yum commandand the second one includespackages downloadedfrom trusted internet websites that can be installed usingthe rpmcommand. The table below describes the order in whichthese libraries need to be installed. Index Library Name Type of install (yum/rpm) Purpose Criticality 1. fontconfig-devel yum Native text support. HIGH 2. libtiff yum Supportfor.tiff files. HIGH 3. Libtiff-devel yum Supportfor.tiff files. HIGH 4. pango-devel yum Header library support. HIGH 5. cairo yum X11 library support. HIGH 6. texlive-latex yum PDF Support. HIGH 7. libRmath rpm N/A HIGH 8. readline-devel yum GNU readline Support. HIGH 9. libXt-devel yum N/A HIGH 10. firefox yum Standard BrowserSupport. HIGH 11. tcl-devel yum N/A HIGH 12. tk-devel yum N/A HIGH 13. bzip2-devel yum Core RSupport. HIGH 14. pcre-devel yum N/A HIGH 15. libxml2-devel yum XMLsupport. HIGH 16. java-openjdk- yum HIGH
  • 4. devel Standard JAVA support. 17. boost-devel yum Pre requisite forR studio. MEDIUM 18. openssl-devel yum SupportforSSL connections. HIGH 19. openmpi-devel yum SupportforMPI connections. HIGH 20. gtk2-devel yum GraphicsSupport. MEDIUM 21. *texinfo build from source Native charactersetsupport. HIGH 22. libjpeg-turbo rpm Standard JPEGfile Support. HIGH 23. R-core rpm R studiosupport. LOW 24. *gdal rpm Standard pre requisite for R add onpackage rgdal. LOW 25. *proj build from source Standard pre requisite for R add onpackage rgdal. LOW 26. *geos build from source Standard pre requisite for R add onpackage rgeos. LOW 27. jags rpm Standard pre requisite for R add onpackage rjags. LOW 28. jags3-devel rpm Standard pre requisite for R add onpackage rjags. LOW *NOTE –These libraries need to be configuredandbuild usingthe configure andmake commandsrespectively. However,this may vary dependinguponthe sourcerpm. It is recommended tobuild the rpm’s withdefault settings so as to ensurethat the OSis able to locate the configurationwithoutany issues. It is very important to updatethebash_profilelocatedat theroot homeafterevery installwiththelocationof the installedlibrary(separatedby a colon). Thiswillhelp inresolvinginterdependencybetweenlibrariessince the bash_profileisthe automaticlookup filefromwhere all installationpathsarefetched. Thespecialinconsolatafix should beupdatedinthebash_profilesinceit is essentialto ensure pdf support. Once all installationpathshavebeenupdatedinthe bash_profile,addthe following:- R_RD4PDF =times:inconsolata Export R_RD4PDF 4. InstallingR 4.1 Downloading the R sourcetar file – The R sourcetar file canbe downloadedfrom the CRANwebsite (http://cran.r-project.org/)whichisthestandard website for downloadingR. 4.2 Oncethe sourcehas been downloadedonto the Linuxmachine, the followingsteps can be usedto extract, configureandinstall R :- 4.2.1 Downloading and extracting the source  Navigate to the folder containingthe tar file. Example cd /usr/local/R
  • 5.  Untar the sourceusingthe tar –xvf command(ifthe sourcefile has the extension .gz as well then a gunzipwill need tobe done prior to this step as well. 4.2.2 Compiling,building and installation.  Navigate to within the created by the above twosteps. Example cd /usr/local/R/R-3.1.2.  Configurethe R softwareby issuingthe configurecommandwiththe accompanyingoptions.If all the pre requisite libraries marked with HIGHcriticality earlier installed successfully,then the followingconfigurecommandcan be used:-  ./configure --prefix=/usr/local/R/R-3.1.2 --with-cairo=yes--enable-R-shlib--with-tcltk --with- x=yes--with-libpng=yes--with-jpeglib=yes  This ensures that all the capabilities are installed and available, if it is explicitly required notto include some functionality,then the correspondingflag canbe unset byreplacing the ye s witha no.  Next, from the same location (/usr/local/R/R-3.1.2),executethemake command.This doesnot need any parameters andwill runfor approximately 20 minutes building up internal libraries forall configureparameters.  Next runthe commandmake install –this commandwill dothe Rinstall based on the configure and build steps earlier.  Next the make install-infocommandcanberun-this is optional but helpfulin summarising the install.  The final commandto be runis make install-pdf.Thiscommandis usedto setup pdfsupport. 5. PostInstallation Verification  Logoutas an administrator and re login as a normal enduser.  Type R at the commandprompt – IfR is installed exactly perthe steps earlier, no soft link creation is necessary – in case the user experiences some issues, he/she cannavigate to the lib64/R folder within the installation directory and key in ./R to ensurethe correct64bit version ofR is launched.  Atthe R prompt type in sessionInfo() toverifysession details.  The capabilities() command canbe typed to verify the features that are enabled. Using the sequenceof steps in this manual, only profmem andaqua capabilities will be FALSE,sincethese are not supportedin Linux.  The demo(graphics) commandcanbe used to test the graphic capabilities ofthe install. 6. Conclusion Using the above steps Rcan be installed in the Linux environment with full capabilities.Almost all the steps were earlier performed UNIXadministration team, butthis documentintends to make this possible for even a nonUNIX administrator to install andmaintain R onLinux.
  • 6. Contact For more information, contact vikrant.bisht@tcs.com About Tata Consultancy Services (TCS) Tata ConsultancyServices is an IT services, consulting andbusinesssolutions organizationthat delivers real results to global business, ensuring a level of certaintyno other firm can match. TCS offers a consulting-led, integrated portfolioof IT andIT- enabledinfrastructure, engineering andassurance services. Thisis deliveredthroughits unique Global NetworkDeliveryModelTM, recognizedas the benchmark ofexcellence in software development. A part of the Tata Group, India’s largest industrial conglomerate, TCS has a global footprint and is listedonthe National Stock Exchange and Bombay Stock Exchange inIndia. For more information, visit us at www.tcs.com. IT Services Business Solutions Consulting All content / information present here is the exclusive property of Tata Consultancy Services Limited (TCS). The content / information contained here is correct at the time of publishing. No material from here may be copied, modified, reproduced, republished, uploaded, transmitted, posted or distributed in any form without prior written permission from TCS. Unauthorized use of the content / information appearing here may violate copyright, trademark and other applicable laws, and could result in criminal or civil penalties. Copyright © 2011 Tata Consultancy Services Limited Thank You