Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easyblocks for R extenison patching (including extract) and Extesnion Rm... #435

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 11 additions & 3 deletions easybuild/easyblocks/generic/rpackage.py
Expand Up @@ -30,6 +30,7 @@
@author: Kenneth Hoste (Ghent University)
@author: Jens Timmerman (Ghent University)
@author: Toon Willems (Ghent University)
@author: Balazs Hajgato (Vrije Universiteit Brussel)
"""
import shutil

Expand Down Expand Up @@ -112,9 +113,13 @@ def make_cmdline_cmd(self, prefix=None):
else:
prefix = ''

cmd = "R CMD INSTALL %s %s %s %s --no-clean-on-error" % (self.ext_src, confargs, confvars, prefix)
self.log.debug("make_cmdline_cmd returns %s" % cmd)
if self.patches:
loc = self.ext_dir
else:
loc = self.ext_src
cmd = "R CMD INSTALL %s %s %s %s --no-clean-on-error" % (loc, confargs, confvars, prefix)

self.log.debug("make_cmdline_cmd returns %s" % cmd)
return cmd, None

def extract_step(self):
Expand Down Expand Up @@ -167,7 +172,10 @@ def install_step(self):
def run(self):
"""Install R package as an extension."""

super(RPackage, self).run()
if self.patches:
super(RPackage, self).run(unpack_src=True)
else:
super(RPackage, self).run()

if self.src:
self.ext_src = self.src
Expand Down
11 changes: 10 additions & 1 deletion easybuild/easyblocks/r/rmpi.py
Expand Up @@ -30,8 +30,10 @@
@author: Kenneth Hoste (Ghent University)
@author: Jens Timmerman (Ghent University)
@author: Toon Willems (Ghent University)
@author: Balazs Hajgato (Vrije Universiteit Brussel)
"""
import easybuild.tools.toolchain as toolchain
from distutils.version import LooseVersion
from easybuild.easyblocks.generic.rpackage import RPackage


Expand All @@ -46,12 +48,19 @@ def run(self):
toolchain.MPI_TYPE_MPICH: "MPICH",
#toolchain.MPI_TYPE_LAM: "LAM", # no support for LAM yet
}
# type of MPI
# MPI_TYPE does not distinguish between MPICH and IntelMPI, which is why we also check mpi_family()
mpi_type = self.toolchain.mpi_family()
Rmpi_type = mpi_types[self.toolchain.MPI_TYPE]
# Rmpi versions 0.6-4 and up support INTELMPI (using --with-Rmpi-type=INTELMPI)
if ((LooseVersion(self.version) >= LooseVersion('0.6-4')) and (mpi_type == toolchain.INTELMPI)):
Rmpi_type = 'INTELMPI'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs a comment... why only since v0.6-4, is it simply not supported in earlier versions?
also mention that MPI_TYPE doesn't distinguish between MPICH and Intel MPI, which is why we also check mpi_family()


self.log.debug("Setting configure args for Rmpi")
self.configureargs = [
"--with-Rmpi-include=%s" % self.toolchain.get_variable('MPI_INC_DIR'),
"--with-Rmpi-libpath=%s" % self.toolchain.get_variable('MPI_LIB_DIR'),
"--with-mpi=%s" % self.toolchain.get_software_root(self.toolchain.MPI_MODULE_NAME)[0],
"--with-Rmpi-type=%s" % mpi_types[self.toolchain.MPI_TYPE],
"--with-Rmpi-type=%s" % Rmpi_type,
]
super(EB_Rmpi, self).run() # it might be needed to get the R cmd and run it with mympirun...