summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/blaspp/package.py
blob: 8436e289403a1a8f24d3318e641ca9fc6a473828 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Copyright 2013-2020 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 *
import os


class Blaspp(CMakePackage, CudaPackage):
    """C++ API for the Basic Linear Algebra Subroutines. Developed by the
       Innovative Computing Laboratory at the University of Tennessee,
       Knoxville."""

    homepage = 'https://bitbucket.org/icl/blaspp'
    git = homepage
    url = 'https://bitbucket.org/icl/blaspp/downloads/blaspp-2020.09.00.tar.gz'
    maintainers = ['teonnik', 'Sely85', 'G-Ragghianti', 'mgates3']

    version('master', branch='master')
    version('2020.10.01', sha256='1a05dbc46caf797d59a7c189216b876fdb1b2ff3e2eb48f1e6ca4b2756c59153')
    version('2020.10.00', sha256='ce148cfe397428d507c72d7d9eba5e9d3f55ad4cd842e6e873c670183dcb7795')
    version('2020.09.00', sha256='ee5d29171bbed515734007dd121ce2e733e2f83920c4d5ede046e657f4a513ef')

    variant('openmp', default=True, description='Use OpenMP internally.')
    variant('cuda',   default=True, description='Build with CUDA')
    variant('shared', default=True, description='Build shared libraries')

    depends_on('cmake@3.15.0:', type='build')
    depends_on('blas')

    # This will attempt to use a supported version of OpenBLAS
    depends_on('openblas@:0.3.5', when='^openblas')
    # In some cases, the spack concretizer will fail to use a supported
    # version of OpenBLAS.  In this case, present an error message.
    conflicts('^openblas@0.3.6:', msg='Testing errors in OpenBLAS >=0.3.6')

    def cmake_args(self):
        spec = self.spec
        return [
            '-Dbuild_tests=%s'       % self.run_tests,
            '-Duse_openmp=%s'        % ('+openmp' in spec),
            '-DBUILD_SHARED_LIBS=%s' % ('+shared' in spec),
            '-Duse_cuda=%s'          % ('+cuda' in spec),
            '-DBLAS_LIBRARIES=%s'    % spec['blas'].libs.joined(';')
        ]

    def check(self):
        # If the tester fails to build, ensure that the check() fails.
        if os.path.isfile(join_path(self.build_directory, 'test', 'tester')):
            make('check')
        else:
            raise Exception('The tester was not built!')