summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/cbtf-krell/package.py
blob: 9458ac113c9b7117c7e82081391827d663530538 (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
112
113
114
115
116
################################################################################
# Copyright (c) 2015 Krell Institute. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# 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 GNU General Public License for more
# details.
#
# You should have received a copy of the GNU 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 CbtfKrell(Package):
    """CBTF Krell project contains the Krell Institute contributions to the CBTF project. 
       These contributions include many performance data collectors and support 
       libraries as well as some example tools that drive the data collection at 
       HPC levels of scale."""
    homepage = "http://sourceforge.net/p/cbtf/wiki/Home/"

    # optional mirror access template
    #url      = "file:/g/g24/jeg/cbtf-krell-1.5.tar.gz"
    #version('1.5', 'b13f6df6a93c44149d977773dd776d2f')

    version('1.6', branch='master', git='http://git.code.sf.net/p/cbtf-krell/cbtf-krell')


    # Dependencies for cbtf-krell

    # For binutils service
    depends_on("binutils@2.24+krellpatch")

    # collectionTool
    depends_on("boost@1.50.0")
    depends_on("dyninst@8.2.1")
    depends_on("mrnet@4.1.0:+lwthreads")
    depends_on("xerces-c@3.1.1:")
    depends_on("cbtf")

    # for services and collectors
    depends_on("libmonitor+krellpatch")
    depends_on("libunwind")
    depends_on("papi")

    # MPI Installations
    # These have not worked either for build or execution, commenting out for now
    #depends_on("openmpi")
    #depends_on("mvapich2@2.0")
    #depends_on("mpich")

    parallel = False

    def install(self, spec, prefix):

        # Add in paths for finding package config files that tell us where to find these packages
        cmake_prefix_path = join_path(spec['cbtf'].prefix) + ':' + join_path(spec['dyninst'].prefix)

        # FIXME - hard code path until external package support is available
        # Need to change this path and/or add additional paths for MPI experiment support on different platforms
        #openmpi_prefix_path = "/opt/openmpi-1.8.2"
        #mvapich_prefix_path = "/usr/local/tools/mvapich-gnu"

        # Other possibilities, they will need a -DMVAPICH_DIR=, etc clause in the cmake command to be recognized
        # mvapich_prefix_path = "<mvapich install path>"
        # mvapich2_prefix_path = "<mvapich2 install path>"
        # mpich2_prefix_path = "<mpich2 install path>"
        # mpich_prefix_path = "<mpich install path>"
        # mpt_prefix_path = "<mpt install path>"

        # Add in paths for cuda if requested via the cuda variant
        # FIXME - hard code path until external package support is available
        #if '+cuda' in spec:
        #    cuda_prefix_path = "/usr/local/cuda-6.0"
        #    cupti_prefix_path = "/usr/local/cuda-6.0/extras/CUPTI"
        #else:
        #    cuda_prefix_path = ""
        #    cupti_prefix_path = ""

        #'-DMVAPICH2_DIR=%s'           % spec['mvapich2'].prefix,
        #'-DOPENMPI_DIR=%s'            % spec['openmpi'].prefix,
        #'-DMPICH_DIR=%s'              % spec['mpich'].prefix,
        #'-DCMAKE_LIBRARY_PATH=%s'	% prefix.lib64,
        #'-DOPENMPI_DIR=%s'            % openmpi_prefix_path,
        #'-DMVAPICH_DIR=%s'            % mvapich_prefix_path,
        #'-DLIB_SUFFIX=64',
        #'-DCUDA_DIR=%s'               % cuda_prefix_path,
        #'-DCUPTI_DIR=%s'              % cupti_prefix_path,

        # Build cbtf-krell with cmake 
        with working_dir('build_cbtf_krell', create=True):
            cmake('..',
                  '-DCMAKE_BUILD_TYPE=Debug',
                  '-DCMAKE_INSTALL_PREFIX=%s'	% prefix,
                  '-DCBTF_DIR=%s'		% spec['cbtf'].prefix,
                  '-DBINUTILS_DIR=%s'           % spec['binutils'].prefix,
                  '-DLIBMONITOR_DIR=%s'         % spec['libmonitor'].prefix,
                  '-DLIBUNWIND_DIR=%s'          % spec['libunwind'].prefix,
                  '-DPAPI_DIR=%s'               % spec['papi'].prefix,
                  '-DBOOST_DIR=%s'              % spec['boost'].prefix,
                  '-DMRNET_DIR=%s'              % spec['mrnet'].prefix,
                  '-DDYNINST_DIR=%s'		% spec['dyninst'].prefix,
                  '-DXERCESC_DIR=%s'            % spec['xerces-c'].prefix,
                  '-DCMAKE_PREFIX_PATH=%s'	% cmake_prefix_path,
                  *std_cmake_args)

            make("clean")
            make()
            make("install")