Sunday, June 18, 2017

Installation of R on SuSE Linux

We are going to install R software package on Linux and for that we are going to use SLES11 SP3 and R 3.3.3.
A fresh install of SLES will not have any development packages and hence, it is assumed that the SDK repo has been enabled to resolve the dependencies. Java should be installed as a pre-requisite dependency package and it's installation is not covered in this tutorial. However, you can refer my previous post on "Manual Installation of Oracle Java 8". A sample screenshot of the SDK repository is shown below.


Downloads

Download the R-3.3.3 software package from here.

Dependency Downloads

Download and place the packages in /opt location or whichever location you like. It is recommended to have java pre-installed and declare the JAVA_HOME variable accordingly.

Installation

This installation assumes that you have a fresh install of the operating system. Installation of R requires many development packages which can be fetched from the SDK repositories, and a few version dependent packages like bzip2_1.0.6, pcre_8.40 and curl_7.54.1.

Installation of OS dependency packages

# zypper in gcc-c++ gcc43-c++ gcc47-c++ gcc-fortran gcc33-fortran gcc43-fortran gcc47-fortran libgfortran3 libgfortran43 libgfortran46 readline-devel xz-devel xorg-x11-devel latex2html texlive-bin-latex texlive-cjk-latex-extras texlive-latex

Installation of bzip2

Extract the downloaded tarball and move into the extracted directory.
# tar -xzvf bzip2-1.0.6.tar.gz
# cd bzip2-1.0.6/

Install
# make -f Makefile-libbz2_so
# make clean


Modify the "Makefile" in line number 18 and replace "CC=gcc" with "CC=gcc -fPIC" as shown in below screenshot.


# make
# make install PREFIX=/opt/bzip2_1.0.6

Define the binary path and load the library by making an entry in profile and /etc/ld.so.conf files.

Now bzip2 1.0.6 is installed.

Installation of pcre

Extract the downloaded tarball and move into the extracted directory.
# tar -xzvf pcre-8.40.tar.gz
# cd pcre-8.40/

Install
# ./configure --prefix=/opt/pcre_8.40 --enable-utf8
# make
# make install

Define the binary path and load the library by making an entry in profile and /etc/ld.so.conf files.

Now pcre 8.40 is installed.

Installation of curl

Extract the downloaded tarball and move into the extracted directory.
# tar -xzvf curl-7.54.1.tar.gz
# cd curl-7.54.1/

Install
# ./configure --prefix=/opt/curl_7.54.1
# make
# make install

Define the binary path and load the library by making an entry in profile and /etc/ld.so.conf files.

Now curl 7.54.1 is installed.

Installation of R

Extract the downloaded tarball and move into the extracted directory.
# tar -xzvf R-3.3.3.tar.gz
# cd R-3.3.3/

Install
# export LD_LIBRARY_PATH=/opt/curl_7.54.1/lib
# export INCLUDE=/opt/curl_7.54.1/include
# ./configure --prefix=/opt/R_3.3.3 --enable-R-shlib LDFLAGS="-L/opt/bzip2_1.0.6/lib -L/opt/pcre_8.40/lib -L/opt/curl_7.54.1/lib" CPPFLAGS="-I/opt/bzip2_1.0.6/include -I/opt/pcre_8.40/include -I/opt/curl_7.54.1/include"


# make


# make install


Define the binary path and load the library by making an entry in profile and /etc/ld.so.conf files. Below screenshot shows all the binaries exported and libraries loaded while the installation of R 3.3.3.



Verification

Test the binary and check if it is working properly.


Congrats! Now you have a working "R". 

No comments:

Post a Comment