summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorAdam J. Stewart <ajstewart426@gmail.com>2017-05-26 16:37:06 -0500
committerGitHub <noreply@github.com>2017-05-26 16:37:06 -0500
commit6f0ac9d54cc8494cdb4a002c7a203622dfe656eb (patch)
treeec23a3f1617c49a7cc975bee611a474d44f73247 /var
parentf38d250e508ef933a6f0bf1e0e5be89c23e20559 (diff)
downloadspack-6f0ac9d54cc8494cdb4a002c7a203622dfe656eb.tar.gz
spack-6f0ac9d54cc8494cdb4a002c7a203622dfe656eb.tar.bz2
spack-6f0ac9d54cc8494cdb4a002c7a203622dfe656eb.tar.xz
spack-6f0ac9d54cc8494cdb4a002c7a203622dfe656eb.zip
Add --configure-args/vars support to RPackage (#4289)
* Add --configure-args/vars support to RPackage * Docstring formatting change
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/r-rmpi/package.py33
1 files changed, 20 insertions, 13 deletions
diff --git a/var/spack/repos/builtin/packages/r-rmpi/package.py b/var/spack/repos/builtin/packages/r-rmpi/package.py
index 7b955545d8..4ef46791ec 100644
--- a/var/spack/repos/builtin/packages/r-rmpi/package.py
+++ b/var/spack/repos/builtin/packages/r-rmpi/package.py
@@ -38,18 +38,25 @@ class RRmpi(RPackage):
depends_on('mpi')
depends_on('r@2.15.1:')
- def install(self, spec, prefix):
- if 'mpich' in spec:
- Rmpi_type = 'MPICH'
- elif 'mvapich' in spec:
- Rmpi_type = 'MVAPICH'
- else:
+ # The following MPI types are not supported
+ conflicts('^intel-mpi')
+ conflicts('^intel-parallel-studio')
+ conflicts('^mvapich2')
+ conflicts('^spectrum-mpi')
+
+ def configure_args(self, spec, prefix):
+ mpi_name = spec['mpi'].name
+
+ # The type of MPI. Supported values are:
+ # OPENMPI, LAM, MPICH, MPICH2, or CRAY
+ if mpi_name == 'openmpi':
Rmpi_type = 'OPENMPI'
+ elif mpi_name == 'mpich':
+ Rmpi_type = 'MPICH2'
+ else:
+ raise InstallError('Unsupported MPI type')
- my_mpi = spec['mpi']
-
- R('CMD', 'INSTALL',
- '--configure-args=--with-Rmpi-type=%s' % Rmpi_type +
- ' --with-mpi=%s' % my_mpi.prefix,
- '--library={0}'.format(self.module.r_lib_dir),
- self.stage.source_path)
+ return [
+ '--with-Rmpi-type={0}'.format(Rmpi_type),
+ '--with-mpi={0}'.format(spec['mpi'].prefix),
+ ]