summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/kripke/package.py
blob: 15a95bbc73f6c04c259c4ba76df37d4539a99cff (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
# 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 *


class Kripke(CMakePackage):
    """Kripke is a simple, scalable, 3D Sn deterministic particle
       transport proxy/mini app.
    """
    homepage = "https://computing.llnl.gov/projects/co-design/kripke"
    git      = "https://github.com/LLNL/Kripke.git"

    tags = ['proxy-app']
    version('1.2.4', submodules=True, tag='v1.2.4')
    version('1.2.3', submodules=True, tag='v1.2.3')
    version('1.2.2', submodules=True, tag='v1.2.2-CORAL2')
    version('1.2.1', submodules=True, tag='v1.2.1-CORAL2')
    version('1.2.0', submodules=True, tag='v1.2.0-CORAL2')

    variant('mpi',    default=True, description='Build with MPI.')
    variant('openmp', default=True, description='Build with OpenMP enabled.')
    variant('caliper', default=False, description='Build with Caliper support enabled.')

    depends_on('mpi', when='+mpi')
    depends_on('cmake@3.0:', type='build')
    depends_on('caliper', when='+caliper')

    def cmake_args(self):
        def enabled(variant):
            return (1 if variant in self.spec else 0)

        return [
            '-DENABLE_OPENMP=%d' % enabled('+openmp'),
            '-DENABLE_MPI=%d' % enabled('+mpi'),
            '-DENABLE_CALIPER=%d' % enabled('+caliper'),
        ]

    def install(self, spec, prefix):
        # Kripke does not provide install target, so we have to copy
        # things into place.
        mkdirp(prefix.bin)
        install(join_path(self.build_directory, 'bin/kripke.exe'), prefix.bin)