summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/vampirtrace/package.py
blob: 19d37118fd6a5f616ea9150b8164cdd34175fefa (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
# 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 Vampirtrace(AutotoolsPackage):
    """VampirTrace is an open source library that allows detailed logging of
    program execution for parallel applications using message passing (MPI)
    and threads (OpenMP, Pthreads)."""

    homepage = "https://tu-dresden.de/zih/forschung/projekte/vampirtrace"
    url      = "http://wwwpub.zih.tu-dresden.de/~mlieber/dcount/dcount.php?package=vampirtrace&get=VampirTrace-5.14.4.tar.gz"

    version('5.14.4', '1c92b23169df9bcc860e5fc737dbc9c9')

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

    depends_on('mpi', when='+mpi')
    depends_on('otf')
    depends_on('papi')
    depends_on('zlib')

    def patch(self):
        path = 'tools/vtwrapper/vt{0}-wrapper-data.txt.in'

        for wrapper in ('cc', 'c++', 'fort'):
            filter_file('@VT_WRAPPER_OPARI_TAB_COMPILER@',
                        '@VT_WRAPPER_CC_COMPILER@',
                        path.format(wrapper))

    def configure_args(self):
        spec = self.spec
        compiler = self.compiler

        args = [
            '--with-extern-otf',
            '--with-extern-otf-dir={0}'.format(spec['otf'].prefix),
            '--with-papi-dir={0}'.format(spec['papi'].prefix),
            '--with-zlib-dir={0}'.format(spec['zlib'].prefix),
            '--with-wrapper-cc-compiler={0}'.format(compiler.cc),
            '--with-wrapper-cc-cpp={0} -E'.format(compiler.cc),
            '--with-wrapper-cxx-compiler={0}'.format(compiler.cxx),
            '--with-wrapper-cxx-cpp={0} -E'.format(compiler.cxx),
            '--with-wrapper-fc-compiler={0}'.format(compiler.fc),
            '--with-wrapper-fc-cpp={0} -E'.format(compiler.fc)
        ]

        if '+mpi' in spec:
            args.append('--with-mpi-dir={0}'.format(spec['mpi'].prefix))

        return args