Howdy Niek,

We have a non-Easybuild module tree.  The attachment
from before lives in /software/tamusc/modulefiles/R.
It loads the EB R and then sets the needed env vars
for building extensions.

Note that I don't maintain the R extensions so don't
have details.  Here are the scripts written by my colleague
Maikel Pennings for such things.  You'd have to ask him to
explain them.

Jack Perdue
Lead Systems Administrator
High Performance Research Computing
TAMU Division of Research
[email protected]    http://sc.tamu.edu
SC Helpdesk: [email protected]

On 06/18/2015 09:27 AM, Niek de Klein wrote:
Hi Jack,

Thank you for your answer. I don't understand the attached file. How
do you use that to install extensions, and how do you keep it so that
if you want to migrate to another cluster you can install R with the
exact same R libraries installed? Do you keep a separate file with all
the R packages you installed extra?

Thanks,
Niek

On Thu, Jun 18, 2015 at 4:20 PM, Jack Perdue <[email protected]> wrote:
Howdy Niek,

FWIW, here is our latest build of R (with lots of
dependencies added):

http://www.siliconslick.com/easybuild/ebfiles_repo_cleaned/ada/R/R-3.2.0-intel-2015B-default-mt.eb

For extensions, we have another (non-EB) module (attached)
for installing extensions to the above by hand.

Between the two, we've:

a) tried to make sure we aren't using system libs (e.g. TCL)
b) are able to satisfy user requests for misc. R extensions
     (automagically)

Jack Perdue
Lead Systems Administrator
High Performance Research Computing
TAMU Division of Research
[email protected]    http://sc.tamu.edu
SC Helpdesk: [email protected]


On 06/18/2015 08:57 AM, Niek de Klein wrote:
Hi mailinglist,

I'm probably missing something here and unnecessarily complicating
things. I am trying to get R installed with just a few packages we
use. One of the packages, ggplot2, has a lot of dependencies. So when
I try to install R with one of the existing EasyBuild files and have
ggplot2 as the dependency it will throw an error due to the
dependencies of ggplot2 not being installed, and I have to add the
dependencies to the .eb file. And then add the dependencies of the
dependencies to the .eb file, etc etc.

When installing libraries from within R you can simply give the option
"dependency=True" and it will automagically install all dependencies
for you. Is there an option like that when installing R and some R
libraries?

Thanks,
Niek


Attachment: install-R-packages.sh
Description: Bourne shell script

# first get the neccessary env variables

rpackageroot=Sys.getenv("RPACKAGEROOT",unset="")
rmpidir=Sys.getenv("RMPIDIR",unset="")

# get the list of installed packages
installed <- installed.packages()[,1]

# define a function to check if a package has been installed
is.installed <- function(mypkg) is.element(mypkg, installed) 

#the full path to the package file
packages_file <- paste(rpackageroot,"/packages/packages",sep="")
print(packages_file)

# read the file of packages that need to be installed
input <- read.delim(packages_file)

# the vector of package can be reached by extracting the column named PACKAGE
packages <- input$PACKAGE

# first thing to do is to install Rmpi package, since this requires special configuration flags
# and other packages depend on this one

if (! is.installed("Rmpi")) {
   mpiargs <- paste("--with-mpi=",rmpidir," --with-Rmpi-type=INTELMPI",sep="")
# use the local Rmpi install
    rmpi_package <- paste(rpackageroot,"/packages/Rmpi.tar.gz",sep="")
    print("===============RMPI_PACKAGE===============")
    print(rmpi_package)
    install.packages(rmpi_package,configure.args=mpiargs)
#   install.packages("Rmpi",configure.args=mpiargs,repo="http://cran.us.r-project.org";)
}

# iterate over all the packages and install them only if they were not installed yet
for (pkg in packages) {
   if (! is.installed(pkg)) {
      install.packages(pkg,repo="http://cran.us.r-project.org";)
   } 
} 

print("... all packages are installed, exiting now")
quit()

Reply via email to