summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/minitri/package.py
blob: 570d4b44a4cbc920396e56048e71257b83b745d9 (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
# Copyright 2013-2018 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 Minitri(MakefilePackage):
    """A simple, triangle-based data analytics proxy application."""

    homepage = "https://github.com/Mantevo/miniTri"
    url      = "https://github.com/Mantevo/miniTri/archive/v1.0.tar.gz"

    version('1.0', '947e296ca408275232f47724267a85ce')

    variant('mpi', default=True, description='Build with MPI support')

    depends_on('mpi', when="+mpi")

    tags = ['proxy-app', 'ecp-proxy-app']

    @property
    def build_targets(self):
        targets = []
        if '+mpi' in self.spec:
            targets.append('CCC={0}'.format(self.spec['mpi'].mpicxx))
            targets.append('--directory=miniTri/linearAlgebra/MPI')
        else:
            targets.append('CCC={0}'.format(self.compiler.cxx))
            targets.append('--directory=miniTri/linearAlgebra/serial')

        targets.append('--file=Makefile')
        return targets

    def install(self, spec, prefix):
        # Manual installation
        mkdir(prefix.bin)
        mkdir(prefix.doc)

        if '+mpi' in spec:
            install('miniTri/linearAlgebra/MPI/miniTri.exe', prefix.bin)
        else:
            install('miniTri/linearAlgebra/serial/miniTri.exe', prefix.bin)