From d3e4e88bae2b3ddf71bf56da18fe510e74e020b2 Mon Sep 17 00:00:00 2001 From: Robert Pavel Date: Mon, 2 Oct 2017 12:51:06 -0600 Subject: [PATCH] Added support for BML+mpi variant (#5563) * Added support for BML+mpi variant Added support for BML+mpi variant. Currently restricted to master (develop) branch pending release of next bml tag * Update package.py Removing redundant statement * Update package.py Added explicit disabling of MPI when not requested --- var/spack/repos/builtin/packages/bml/package.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/bml/package.py b/var/spack/repos/builtin/packages/bml/package.py index 0131cf145e..31d08f89ec 100644 --- a/var/spack/repos/builtin/packages/bml/package.py +++ b/var/spack/repos/builtin/packages/bml/package.py @@ -38,12 +38,25 @@ class Bml(CMakePackage): version('develop', git='https://github.com/lanl/bml', branch='master') variant('shared', default=True, description='Build shared libs') + variant('mpi', default=False, description='Build with MPI Support') + + conflicts('+mpi', when='@:1.2.2') depends_on("blas") depends_on("lapack") + depends_on('mpi', when='+mpi') def cmake_args(self): - return [ + args = [ '-DBUILD_SHARED_LIBS={0}'.format( 'ON' if '+shared' in self.spec else 'OFF') ] + spec = self.spec + if '+mpi' in spec: + args.append('-DBML_MPI=True') + args.append('-DCMAKE_C_COMPILER=%s' % spec['mpi'].mpicc) + args.append('-DCMAKE_CXX_COMPILER=%s' % spec['mpi'].mpicxx) + args.append('-DCMAKE_Fortran_COMPILER=%s' % spec['mpi'].mpifc) + else: + args.append('-DBML_MPI=False') + return args