summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/otf2/package.py
blob: 95611af6031adc02bc6c052979efe02c36d1305e (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
# Copyright 2013-2023 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.package import *


class Otf2(AutotoolsPackage):
    """The Open Trace Format 2 is a highly scalable, memory efficient event
    trace data format plus support library.
    """

    homepage = "https://www.vi-hps.org/projects/score-p"
    url = "https://perftools.pages.jsc.fz-juelich.de/cicd/otf2/tags/otf2-3.0/otf2-3.0.tar.gz"

    version("3.0", sha256="6fff0728761556e805b140fd464402ced394a3c622ededdb618025e6cdaa6d8c")
    version("2.3", sha256="36957428d37c40d35b6b45208f050fb5cfe23c54e874189778a24b0e9219c7e3")
    version("2.2", sha256="d0519af93839dc778eddca2ce1447b1ee23002c41e60beac41ea7fe43117172d")
    version("2.1.1", sha256="01591b42e76f396869ffc84672f4eaa90ee8ec2a8939755d9c0b5b8ecdcf47d3")
    version("2.1", sha256="8ad38ea0461099e34f00f2947af4409ce9b9c379e14c3f449ba162e51ac4cad3")
    version("2.0", sha256="bafe0ac08e0a13e71568e5774dc83bd305d907159b4ceeb53d2e9f6e29462754")
    version("1.5.1", sha256="a4dc9f6c99376030b43a4c7b1ee77cfb530b03928ea688c6d1a380b3f4e8e488")
    version("1.4", sha256="fb5fe169003c01e40848e224f09c440014e9872e84d2ca02ce7fffdd3f879a2f")
    version(
        "1.3.1",
        sha256="c4605ace845d89fb1a19223137b92cc503b01e3db5eda8c9e0715d0cfcf2e4b9",
        deprecated=True,
    )
    version(
        "1.2.1",
        sha256="1db9fb0789de4a9c3c96042495e4212a22cb581f734a1593813adaf84f2288e4",
        deprecated=True,
    )

    def url_for_version(self, version):
        if version < Version("2.3"):
            return "https://www.vi-hps.org/cms/upload/packages/otf2/otf2-{0}.tar.gz".format(
                version
            )

        return "https://perftools.pages.jsc.fz-juelich.de/cicd/otf2/tags/otf2-{0}/otf2-{0}.tar.gz".format(
            version
        )

    with when("@2.2 %cce"):
        depends_on("autoconf", type="build")
        depends_on("automake", type="build")
        depends_on("libtool", type="build")
        depends_on("m4", type="build")

    # Fix missing initialization of variable resulting in issues when used by
    # APEX/HPX: https://github.com/STEllAR-GROUP/hpx/issues/5239
    patch("collective_callbacks.patch", when="@2.1:")

    # when using Cray's cs-prgenv, allow the build system to detect the systems as an XC
    patch("cray_ac_scorep_sys_detection-m4.patch", when="@2.2 %cce")

    @property
    def force_autoreconf(self):
        return self.spec.satisfies("@2.2 %cce")

    def configure_args(self):
        return [
            "--enable-shared",
            "CC={0}".format(spack_cc),
            "CXX={0}".format(spack_cxx),
            "F77={0}".format(spack_f77),
            "FC={0}".format(spack_fc),
            "CFLAGS={0}".format(self.compiler.cc_pic_flag),
            "CXXFLAGS={0}".format(self.compiler.cxx_pic_flag),
            "PYTHON_FOR_GENERATOR=:",
        ]