pfunit: add max_array_rank=(int) variant (#15348)

* pfunit: add max_array_rank=(int) variant

* pfunit: flake8 line length fixes
This commit is contained in:
Bryce Allen 2020-03-12 12:58:18 -04:00 committed by GitHub
parent d95766756c
commit 6887cb3da4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,10 +30,14 @@ class Pfunit(CMakePackage):
variant('shared', default=True,
description='Build shared library in addition to static')
variant('mpi', default=False, description='Enable MPI')
variant('use_comm_world', default=False, description='Enable MPI_COMM_WORLD for testing')
variant('use_comm_world', default=False,
description='Enable MPI_COMM_WORLD for testing')
variant('openmp', default=False, description='Enable OpenMP')
variant('docs', default=False, description='Build docs')
variant('max_array_rank', values=int, default=5,
description='Max number of Fortran dimensions of array asserts')
depends_on('python@2.7:', type=('build', 'run')) # python3 too!
depends_on('mpi', when='+mpi')
@ -53,7 +57,8 @@ def cmake_args(self):
'-DBUILD_SHARED=%s' % ('YES' if '+shared' in spec else 'NO'),
'-DCMAKE_Fortran_MODULE_DIRECTORY=%s' % spec.prefix.include,
'-DBUILD_DOCS=%s' % ('YES' if '+docs' in spec else 'NO'),
'-DOPENMP=%s' % ('YES' if '+openmp' in spec else 'NO')]
'-DOPENMP=%s' % ('YES' if '+openmp' in spec else 'NO'),
'-DMAX_RANK=%s' % spec.variants['max_array_rank'].value]
if spec.satisfies('+mpi'):
args.extend(['-DMPI=YES', '-DMPI_USE_MPIEXEC=YES',