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
This commit is contained in:
Robert Pavel 2017-10-02 12:51:06 -06:00 committed by Christoph Junghans
parent 0d0d2663d2
commit d3e4e88bae

View file

@ -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