Difference between revisions of "R"

From HPC
m
Line 1: Line 1:
'''This is work in progress.'''
 
 
 
== General remarks ==
 
== General remarks ==
It is necessary to install R locally in your home directory. This puts you in control of the version installed, the packages installed and you can tweak the installation according to your needs.
 
Consequently, before we can use R, we have to do the following:
 
  
- Install R [http://www.r-project.org/] (download from [http://cran.za.r-project.org/]) and the relevant packages;
+
You may want to install R locally in your home directory. This puts you in control of the version installed, the packages installed and you can tweak the installation according to your needs. Consequently, before you can use R, you have to do the following:
  
- Write the code to be executed on the cluster;
+
* [[Install R]] and the relevant packages
 
+
* Write the code to be executed on the cluster
- Write the submit script to be submitted via qsub;
+
* Write the submit script to be submitted via qsub
  
 
Below each of these steps is documented in detail.
 
Below each of these steps is documented in detail.
Line 25: Line 21:
 
== Example ==
 
== Example ==
  
 +
== System-wide install ==
 +
 +
Available in '''/apps/R-3.0.1'''. The system-wide install of R has been compiled and installed with the commands given below. If this is sufficient for your purposes, you don't have to install your own version in your home directory.
  
 +
<pre>
 +
$ ./configure --prefix=/apps/R-3.0.1 --enable-R-shlib --with-blas --with-lapack --with-system-zlib --with-system-bzlib --with-system-pcre --with-x=no
 +
$ make
 +
$ make check
 +
$ make install
 +
</pre>
  
----
+
=== Rmpi 0.6-3 ===
  
--[[User:Rkrug|rkrug]] 07:22, 19 December 2008 (UTC)
+
<pre>
 +
/apps/R-3.0.1/bin/R CMD INSTALL \
 +
  -l /apps/R-3.0.1/lib64/R/library/ \
 +
  --configure-args=" \
 +
    --with-mpi=/usr/lib64/openmpi/ \
 +
    --with-Rmpi-libpath=/usr/lib64/openmpi/lib/ \
 +
    --with-Rmpi-include=/usr/include/openmpi-x86_64/ \
 +
    --with-Rmpi-type=OPENMPI" \
 +
  /usr/local/src/shared/Rmpi_0.6-3.tar.gz
 +
</pre>

Revision as of 12:11, 4 July 2013

General remarks

You may want to install R locally in your home directory. This puts you in control of the version installed, the packages installed and you can tweak the installation according to your needs. Consequently, before you can use R, you have to do the following:

  • Install R and the relevant packages
  • Write the code to be executed on the cluster
  • Write the submit script to be submitted via qsub

Below each of these steps is documented in detail.

Installation of R and necessary packages

Install R

Install packages

Install Rmpi package

Submit script

Example

System-wide install

Available in /apps/R-3.0.1. The system-wide install of R has been compiled and installed with the commands given below. If this is sufficient for your purposes, you don't have to install your own version in your home directory.

$ ./configure --prefix=/apps/R-3.0.1 --enable-R-shlib --with-blas --with-lapack --with-system-zlib --with-system-bzlib --with-system-pcre --with-x=no
$ make
$ make check
$ make install

Rmpi 0.6-3

/apps/R-3.0.1/bin/R CMD INSTALL \
  -l /apps/R-3.0.1/lib64/R/library/ \
  --configure-args=" \
    --with-mpi=/usr/lib64/openmpi/ \
    --with-Rmpi-libpath=/usr/lib64/openmpi/lib/ \
    --with-Rmpi-include=/usr/include/openmpi-x86_64/ \
    --with-Rmpi-type=OPENMPI" \
  /usr/local/src/shared/Rmpi_0.6-3.tar.gz