summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/scorep/package.py
blob: fd7da69442d88785a5c17ee46bc75c3afead32b0 (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
#
# For details, see https://github.com/spack/spack
# Please also see the NOTICE and LICENSE files for our notice and the LGPL.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License (as
# published by the Free Software Foundation) version 2.1, February 1999.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
# conditions of the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
from spack import *


class Scorep(AutotoolsPackage):
    """The Score-P measurement infrastructure is a highly scalable and
    easy-to-use tool suite for profiling, event tracing, and online analysis
    of HPC applications.
    """

    homepage = "http://www.vi-hps.org/projects/score-p"
    url      = "http://www.vi-hps.org/upload/packages/scorep/scorep-2.0.2.tar.gz"

    version('3.1',   '065bf8eb08398e8146c895718ddb9145')
    version('3.0',   '44da8beaa3f71436a5f6fe51938aab2f')
    version('2.0.2', '8f00e79e1b5b96e511c5ebecd10b2888')
    version('1.4.2', '3b9a042b13bdd5836452354e6567f71e')
    version('1.3',   '9db6f957b7f51fa01377a9537867a55c')

    patch('gcc7.patch')

    ##########
    # Dependencies for SCORE-P are quite tight. See the homepage for more
    # information.
    # SCOREP 3
    depends_on('otf2@2:', when='@3:')
    depends_on('opari2@2:', when='@3:')
    depends_on('cube@4.3:', when='@3:')
    # SCOREP 2.0.2
    depends_on('otf2@2.0', when='@2.0.2')
    depends_on('opari2@2.0', when='@2.0.2')
    depends_on('cube@4.3:4.4', when='@2.0.2')
    # SCOREP 1.4.2
    depends_on('otf2@1.5:1.6', when='@1.4.2')
    depends_on('opari2@1.1.4', when='@1.4.2')
    depends_on('cube@4.3:4.4', when='@1.4.2')
    # SCOREP 1.3
    depends_on("otf2@1.4", when='@1.3')
    depends_on("opari2@1.1.4", when='@1.3')
    depends_on("cube@4.2.3", when='@1.3')
    ##########

    depends_on("mpi")
    depends_on("papi")
    depends_on('pdt')

    variant('shmem', default=False, description='Enable shmem tracing')

    # Score-P requires a case-sensitive file system, and therefore
    # does not work on macOS
    # https://github.com/spack/spack/issues/1609
    conflicts('platform=darwin')

    def configure_args(self):
        spec = self.spec

        config_args = [
            "--with-otf2=%s" % spec['otf2'].prefix.bin,
            "--with-opari2=%s" % spec['opari2'].prefix.bin,
            "--with-cube=%s" % spec['cube'].prefix.bin,
            "--with-papi-header=%s" % spec['papi'].prefix.include,
            "--with-papi-lib=%s" % spec['papi'].prefix.lib,
            "--with-pdt=%s" % spec['pdt'].prefix.bin,
            "--enable-shared"]

        cname = spec.compiler.name
        config_args.append('--with-nocross-compiler-suite={0}'.format(cname))

        if spec.satisfies('^intel-mpi'):
            config_args.append('--with-mpi=intel3')
        elif spec.satisfies('^mpich') or spec.satisfies('^mvapich2'):
            config_args.append('--with-mpi=mpich3')
        elif spec.satisfies('^openmpi'):
            config_args.append('--with-mpi=openmpi')

        if '~shmem' in spec:
            config_args.append("--without-shmem")

        config_args.extend([
            'CFLAGS={0}'.format(self.compiler.pic_flag),
            'CXXFLAGS={0}'.format(self.compiler.pic_flag),
            'MPICC={0}'.format(spec['mpi'].mpicc),
            'MPICXX={0}'.format(spec['mpi'].mpicxx),
            'MPIF77={0}'.format(spec['mpi'].mpif77),
            'MPIFC={0}'.format(spec['mpi'].mpifc)
        ])

        return config_args