summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/flecsi/package.py
blob: 8920172a65d492c93c4e0613b42a9171fc67938b (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
60
61
62
63
64
65
66
67
# 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 Flecsi(CMakePackage):
    """FleCSI is a compile-time configurable framework designed to support
       multi-physics application development. As such, FleCSI attempts to
       provide a very general set of infrastructure design patterns that can
       be specialized and extended to suit the needs of a broad variety of
       solver and data requirements. Current support includes multi-dimensional
       mesh topology, mesh geometry, and mesh adjacency information,
       n-dimensional hashed-tree data structures, graph partitioning
       interfaces,and dependency closures.
    """
    homepage = "http://flecsi.lanl.gov/"
    git      = "https://github.com/laristra/flecsi.git"

    version('develop', branch='master', submodules=False)
    variant('backend', default='mpi', values=('serial', 'mpi', 'legion'),
            description="Backend to use for distributed memory")
    variant('graphviz', default=False,
            description='Enable GraphViz Support')
    variant('tutorial', default=False,
            description='Build FleCSI Tutorials')

    depends_on("cmake@3.1:",  type='build')
    # Requires cinch > 1.0 due to cinchlog installation issue
    depends_on("cinch@1.01:", type='build')
    depends_on('mpi', when='backend=mpi')
    depends_on('mpi', when='backend=legion')
    depends_on("gasnet@2019.3.0 ~pshm", when='backend=legion')
    depends_on("legion@19.04.0 +shared +mpi", when='backend=legion')
    depends_on("boost@1.59.0: cxxstd=11 +program_options")
    depends_on("metis@5.1.0:")
    depends_on("parmetis@4.0.3:")
    depends_on("caliper")
    depends_on("gotcha")
    depends_on("graphviz", when='+graphviz')
    depends_on('python@3.0:', when='+tutorial')

    def cmake_args(self):
        options = ['-DCMAKE_BUILD_TYPE=debug']
        options.append('-DCINCH_SOURCE_DIR=' + self.spec['cinch'].prefix)

        if self.spec.variants['backend'].value == 'legion':
            options.append('-DFLECSI_RUNTIME_MODEL=legion')
        elif self.spec.variants['backend'].value == 'mpi':
            options.append('-DFLECSI_RUNTIME_MODEL=mpi')
        else:
            options.append('-DFLECSI_RUNTIME_MODEL=serial')
            options.append(
                '-DENABLE_MPI=OFF',
            )

        if '+tutorial' in self.spec:
            options.append('-DENABLE_FLECSIT=ON')
            options.append('-DENABLE_FLECSI_TUTORIAL=ON')
        else:
            options.append('-DENABLE_FLECSIT=OFF')
            options.append('-DENABLE_FLECSI_TUTORIAL=OFF')

        return options