2019-12-31 14:36:56 +08:00
|
|
|
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
2018-10-08 04:52:23 +08:00
|
|
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
2016-05-12 12:22:25 +08:00
|
|
|
#
|
2018-10-08 04:52:23 +08:00
|
|
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
|
|
|
|
2016-01-29 05:22:56 +08:00
|
|
|
from spack import *
|
|
|
|
|
2017-06-23 21:59:59 +08:00
|
|
|
import sys
|
2016-08-10 16:50:00 +08:00
|
|
|
|
2017-06-23 21:59:59 +08:00
|
|
|
|
|
|
|
class Caliper(CMakePackage):
|
|
|
|
"""Caliper is a program instrumentation and performance measurement
|
2019-11-14 08:11:09 +08:00
|
|
|
framework. It is designed as a performance analysis toolbox in a
|
|
|
|
library, allowing one to bake performance analysis capabilities
|
|
|
|
directly into applications and activate them at runtime.
|
2016-08-31 05:28:55 +08:00
|
|
|
"""
|
2016-01-29 05:22:56 +08:00
|
|
|
|
|
|
|
homepage = "https://github.com/LLNL/Caliper"
|
2018-07-23 15:00:15 +08:00
|
|
|
git = "https://github.com/LLNL/Caliper.git"
|
2016-01-29 05:22:56 +08:00
|
|
|
|
2018-07-23 15:00:15 +08:00
|
|
|
version('master')
|
2020-07-30 09:41:41 +08:00
|
|
|
version('2.4.0', tag='v2.4.0')
|
2020-03-13 02:37:15 +08:00
|
|
|
version('2.3.0', tag='v2.3.0')
|
2019-11-14 08:11:09 +08:00
|
|
|
version('2.2.0', tag='v2.2.0')
|
|
|
|
version('2.1.1', tag='v2.1.1')
|
2019-03-13 09:28:13 +08:00
|
|
|
version('2.0.1', tag='v2.0.1')
|
|
|
|
version('1.9.1', tag='v1.9.1')
|
|
|
|
version('1.9.0', tag='v1.9.0')
|
|
|
|
version('1.8.0', tag='v1.8.0')
|
2018-07-23 15:00:15 +08:00
|
|
|
version('1.7.0', tag='v1.7.0')
|
2016-01-29 05:22:56 +08:00
|
|
|
|
2018-06-28 06:21:23 +08:00
|
|
|
is_linux = sys.platform.startswith('linux')
|
2019-03-13 09:28:13 +08:00
|
|
|
variant('shared', default=True,
|
|
|
|
description='Build shared libraries')
|
2019-11-14 08:11:09 +08:00
|
|
|
variant('adiak', default=True,
|
|
|
|
description='Enable Adiak support')
|
2018-07-23 15:00:15 +08:00
|
|
|
variant('mpi', default=True,
|
2017-06-23 21:59:59 +08:00
|
|
|
description='Enable MPI wrappers')
|
2018-07-23 15:00:15 +08:00
|
|
|
variant('dyninst', default=False,
|
2017-06-23 21:59:59 +08:00
|
|
|
description='Enable symbol translation support with dyninst')
|
|
|
|
# libunwind has some issues on Mac
|
|
|
|
variant('callpath', default=sys.platform != 'darwin',
|
|
|
|
description='Enable callpath service (requires libunwind)')
|
|
|
|
# pthread_self() signature is incompatible with PAPI_thread_init() on Mac
|
|
|
|
variant('papi', default=sys.platform != 'darwin',
|
|
|
|
description='Enable PAPI service')
|
2018-06-28 06:21:23 +08:00
|
|
|
variant('libpfm', default=is_linux,
|
2017-12-17 10:39:52 +08:00
|
|
|
description='Enable libpfm (perf_events) service')
|
2020-07-30 09:41:41 +08:00
|
|
|
# Gotcha is Linux-only
|
|
|
|
variant('gotcha', default=is_linux,
|
2017-06-23 21:59:59 +08:00
|
|
|
description='Enable GOTCHA support')
|
2018-06-28 06:21:23 +08:00
|
|
|
variant('sampler', default=is_linux,
|
|
|
|
description='Enable sampling support on Linux')
|
2017-12-17 10:39:52 +08:00
|
|
|
variant('sosflow', default=False,
|
|
|
|
description='Enable SOSflow support')
|
2016-01-29 05:22:56 +08:00
|
|
|
|
2020-07-30 09:41:41 +08:00
|
|
|
depends_on('adiak@0.1:0.99', when='@2.2: +adiak')
|
2019-03-13 09:28:13 +08:00
|
|
|
|
|
|
|
depends_on('dyninst@10.0:10.99', when='@2: +dyninst')
|
|
|
|
|
2020-07-30 09:41:41 +08:00
|
|
|
depends_on('papi@5.3:5.99', when='@:2.2 +papi')
|
|
|
|
depends_on('papi@5.3:6.99', when='@2.3: +papi')
|
2019-03-13 09:28:13 +08:00
|
|
|
|
|
|
|
depends_on('libpfm4@4.8:4.99', when='+libpfm')
|
|
|
|
|
2016-01-29 05:22:56 +08:00
|
|
|
depends_on('mpi', when='+mpi')
|
2020-03-06 22:49:46 +08:00
|
|
|
depends_on('unwind@1.2:1.99', when='+callpath')
|
2019-03-13 09:28:13 +08:00
|
|
|
|
|
|
|
depends_on('sosflow@spack', when='@1.0:1.99+sosflow')
|
2017-06-23 21:59:59 +08:00
|
|
|
|
2020-07-30 09:41:41 +08:00
|
|
|
depends_on('cmake', type='build')
|
|
|
|
depends_on('python', type='build')
|
2017-06-23 21:59:59 +08:00
|
|
|
|
2019-03-13 09:28:13 +08:00
|
|
|
# sosflow support not yet in 2.0
|
2020-07-30 09:41:41 +08:00
|
|
|
conflicts('+sosflow', '@2.0.0:2.4.99')
|
2019-11-14 08:11:09 +08:00
|
|
|
conflicts('+adiak', '@:2.1.99')
|
2019-03-13 09:28:13 +08:00
|
|
|
|
2020-08-27 09:51:00 +08:00
|
|
|
# The Dyninst 9.X used by v1.9.X is deprecated
|
|
|
|
conflicts('+dyninst', when='@:1.99',
|
|
|
|
msg='Dyninst unsupported by version <=2.0.1')
|
|
|
|
|
2017-06-23 21:59:59 +08:00
|
|
|
def cmake_args(self):
|
|
|
|
spec = self.spec
|
|
|
|
|
|
|
|
args = [
|
2020-03-01 05:32:51 +08:00
|
|
|
('-DPYTHON_EXECUTABLE=%s' %
|
|
|
|
spec['python'].command.path),
|
2017-06-23 21:59:59 +08:00
|
|
|
'-DBUILD_TESTING=Off',
|
2017-12-17 10:39:52 +08:00
|
|
|
'-DBUILD_DOCS=Off',
|
2019-03-13 09:28:13 +08:00
|
|
|
'-DBUILD_SHARED_LIBS=%s' % ('On' if '+shared' in spec else 'Off'),
|
2019-11-14 08:11:09 +08:00
|
|
|
'-DWITH_ADIAK=%s' % ('On' if '+adiak' in spec else 'Off'),
|
2017-06-23 21:59:59 +08:00
|
|
|
'-DWITH_DYNINST=%s' % ('On' if '+dyninst' in spec else 'Off'),
|
|
|
|
'-DWITH_CALLPATH=%s' % ('On' if '+callpath' in spec else 'Off'),
|
|
|
|
'-DWITH_GOTCHA=%s' % ('On' if '+gotcha' in spec else 'Off'),
|
|
|
|
'-DWITH_PAPI=%s' % ('On' if '+papi' in spec else 'Off'),
|
2017-12-17 10:39:52 +08:00
|
|
|
'-DWITH_LIBPFM=%s' % ('On' if '+libpfm' in spec else 'Off'),
|
|
|
|
'-DWITH_SOSFLOW=%s' % ('On' if '+sosflow' in spec else 'Off'),
|
2018-06-28 06:21:23 +08:00
|
|
|
'-DWITH_SAMPLER=%s' % ('On' if '+sampler' in spec else 'Off'),
|
2019-03-13 09:28:13 +08:00
|
|
|
'-DWITH_MPI=%s' % ('On' if '+mpi' in spec else 'Off')
|
2017-06-23 21:59:59 +08:00
|
|
|
]
|
|
|
|
|
|
|
|
if '+papi' in spec:
|
2017-12-17 10:39:52 +08:00
|
|
|
args.append('-DPAPI_PREFIX=%s' % spec['papi'].prefix)
|
|
|
|
if '+libpfm' in spec:
|
|
|
|
args.append('-DLIBPFM_INSTALL=%s' % spec['libpfm4'].prefix)
|
|
|
|
if '+sosflow' in spec:
|
|
|
|
args.append('-DSOS_PREFIX=%s' % spec['sosflow'].prefix)
|
2018-10-31 01:37:44 +08:00
|
|
|
if '+callpath' in spec:
|
|
|
|
args.append('-DLIBUNWIND_PREFIX=%s' % spec['libunwind'].prefix)
|
2017-06-23 21:59:59 +08:00
|
|
|
|
|
|
|
if '+mpi' in spec:
|
|
|
|
args.append('-DMPI_C_COMPILER=%s' % spec['mpi'].mpicc)
|
|
|
|
args.append('-DMPI_CXX_COMPILER=%s' % spec['mpi'].mpicxx)
|
2016-01-29 05:22:56 +08:00
|
|
|
|
2017-06-23 21:59:59 +08:00
|
|
|
return args
|