summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/lapackpp/package.py
blob: 155ee379ab8ef5222181db777f123868fac63b86 (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
54
55
56
57
58
59
# Copyright 2013-2021 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

# Each LAPACK++ version requires a specific BLAS++ version
_versions = [
    # LAPACK++,     BLAS++
    ['master',     'master'],
    ['2020.10.00', '2020.10.00'],
    ['2020.10.01', '2020.10.01'],
    ['2020.10.02', '2020.10.02'],
    ['2021.04.00', '2021.04.01:'],  # or later
]


class Lapackpp(CMakePackage):
    """LAPACK++: C++ API for the LAPACK Linear Algebra Package. Developed
       by the Innovative Computing Laboratory at the University of Tennessee,
       Knoxville."""

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

    version('master', branch='master')
    version('2021.04.00', sha256='67abd8de9757dba86eb5d154cdb91f176b6c8b2b7d8e2a669ba0c221c4bb60ed')
    version('2020.10.02', sha256='8dde9b95d75b494c4f8b893d68034e95b7a7541981359acb97b6c1c4a9c45cd9')
    version('2020.10.01', sha256='ecd659730b4c3cfb8d2595f9bbb6af65d96b79397db654f17fe045bdfea841c0')
    version('2020.10.00', sha256='5f6ab3bd3794711818a3a50198efd29571520bf455e13ffa8ba50fa8376d7d1a')

    variant('shared', default=True, description='Build shared library')

    # Match each LAPACK++ version to a specific BLAS++ version
    for (lpp_ver, bpp_ver) in _versions:
        depends_on('blaspp@' + bpp_ver, when='@' + lpp_ver)

    depends_on('blas')
    depends_on('lapack')

    def cmake_args(self):
        spec = self.spec
        return [
            '-DBUILD_SHARED_LIBS=%s' % ('+shared' in spec),
            '-Dbuild_tests=%s'       % self.run_tests,
            '-DLAPACK_LIBRARIES=%s'  % spec['lapack'].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')):
            with working_dir(self.build_directory):
                make('check')
        else:
            raise Exception('The tester was not built!')