summaryrefslogtreecommitdiff
path: root/var/spack/packages/scorep/package.py
blob: 32a772e3dbeedf850a934caf3fb13c1fce16082d (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
# FIXME: Add copyright statement

from spack import *
from contextlib import closing

class Scorep(Package):
    """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."""

    # FIXME: add a proper url for your package's homepage here.
    homepage = "http://www.vi-hps.org/projects/score-p"
    url      = "http://www.vi-hps.org/upload/packages/scorep/scorep-1.2.3.tar.gz"

    version('1.3', '9db6f957b7f51fa01377a9537867a55c',
            url = 'http://www.vi-hps.org/upload/packages/scorep/scorep-1.3.tar.gz')

    version('1.2.3', '4978084e7cbd05b94517aa8beaea0817')

    depends_on("mpi")
    depends_on("papi")
    # depends_on("otf2@1.2:1.2.1") # only Score-P 1.2.x
    depends_on("otf2") 
    depends_on("opari2")
    depends_on("cube@4.2:4.2.3")

    backend_user_provided = """\
CC=cc
CXX=c++
F77=f77
FC=f90
CFLAGS=-fPIC
CXXFLAGS=-fPIC
"""
    frontend_user_provided = """\
CC_FOR_BUILD=cc
CXX_FOR_BUILD=c++
F77_FOR_BUILD=f70
FC_FOR_BUILD=f90
CFLAGS_FOR_BUILD=-fPIC
CXXFLAGS_FOR_BUILD=-fPIC
"""
    mpi_user_provided = """\
MPICC=mpicc
MPICXX=mpicxx
MPIF77=mpif77
MPIFC=mpif90
MPI_CFLAGS=-fPIC
MPI_CXXFLAGS=-fPIC
"""

    def install(self, spec, prefix):
        # Use a custom compiler configuration, otherwise the score-p
        # build system messes with spack's compiler settings.
        # Create these three files in the build directory
        with closing(open("platform-backend-user-provided", "w")) as backend_file:
            backend_file.write(self.backend_user_provided)
        with closing(open("platform-frontend-user-provided", "w")) as frontend_file:
            frontend_file.write(self.frontend_user_provided)
        with closing(open("platform-mpi-user-provided", "w")) as mpi_file:
            mpi_file.write(self.mpi_user_provided)            

        configure_args = ["--prefix=%s" % prefix,
                          "--with-custom-compilers",
                          "--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,
                          "--enable-shared"]

        configure(*configure_args)

        make()
        make("install")