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 1 commit
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
12 changes: 9 additions & 3 deletions easybuild/easyblocks/generic/rpackage.py
Expand Up @@ -112,9 +112,12 @@ 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:
cmd = "R CMD INSTALL %s %s %s %s --no-clean-on-error" % (self.ext_dir, confargs, confvars, prefix)
else:
cmd = "R CMD INSTALL %s %s %s %s --no-clean-on-error" % (self.ext_src, confargs, confvars, prefix)
Copy link
Member

Choose a reason for hiding this comment

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

the cmd value is exactly the same in both cases?!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Look at more close!
cmd = "R CMD INSTALL %s %s %s %s --no-clean-on-error" % (self.ext_dir, confargs, confvars, prefix)
and
cmd = "R CMD INSTALL %s %s %s %s --no-clean-on-error" % (self.ext_src, confargs, confvars, prefix)

Copy link
Member

Choose a reason for hiding this comment

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

Maybe split up the command and the tuple then? The cmd string itself is the same?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, exactly. Suggestion:

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 +170,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
8 changes: 7 additions & 1 deletion easybuild/easyblocks/r/rmpi.py
Expand Up @@ -32,6 +32,7 @@
@author: Toon Willems (Ghent University)
"""
import easybuild.tools.toolchain as toolchain
from distutils.version import LooseVersion
from easybuild.easyblocks.generic.rpackage import RPackage


Expand All @@ -46,12 +47,17 @@ def run(self):
toolchain.MPI_TYPE_MPICH: "MPICH",
#toolchain.MPI_TYPE_LAM: "LAM", # no support for LAM yet
}
# type of MPI
mpi_type = self.toolchain.mpi_family()
Rmpi_type = mpi_types[self.toolchain.MPI_TYPE]
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...