package.py 1.34 KB
Newer Older
Jerome Soumagne's avatar
Jerome Soumagne committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *


class Hdf5Rados(CMakePackage):
    """The HDF5 RADOS VOL connector is an external VOL connector that interfaces with the RADOS API"""

    homepage = ''
    url = ''
    git = 'https://git.hdfgroup.org/scm/hdf5vol/rados-api.git'

    maintainers = ['soumagne']

    version('master', branch='master', submodules=True)

    variant('mobject', default=True, description='Use mobject')

    depends_on('cmake@2.8.12.2:', type='build')
22 23
    depends_on('mobject', when='+mobject')
    depends_on('hdf5@1.12.0:+mpi')
Jerome Soumagne's avatar
Jerome Soumagne committed
24 25

    def cmake_args(self):
Jerome Soumagne's avatar
Jerome Soumagne committed
26
        """Populate cmake arguments for HDF5 RADOS."""
Jerome Soumagne's avatar
Jerome Soumagne committed
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
        spec = self.spec
        variant_bool = lambda feature: str(feature in spec)
        parallel_tests = '+mpi' in spec and self.run_tests

        cmake_args = [
            '-DBUILD_SHARED_LIBS:BOOL=ON',
            '-DBUILD_TESTING:BOOL=%s' % str(self.run_tests),
            '-DHDF5_VOL_RADOS_USE_MOBJECT:BOOL=%s'
            % variant_bool('+mobject'),
        ]

        return cmake_args

    def check(self):
        """Unit tests fail when run in parallel."""

        with working_dir(self.build_directory):
            make('test', parallel=False)