From e27ccac4a5baf42bb5e6ed132a130557f34e89cc Mon Sep 17 00:00:00 2001 From: David Böhme Date: Fri, 23 Jun 2017 06:59:59 -0700 Subject: caliper: Update caliper package (#4532) * caliper: Update caliper package * caliper: Explicitly enable/disable cmake options for all variants * caliper: Fix flake8 warnings * caliper: Modify defaults for Mac * caliper: Fix some more flake8 warnings --- .../repos/builtin/packages/caliper/package.py | 60 +++++++++++++++++----- 1 file changed, 48 insertions(+), 12 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/caliper/package.py b/var/spack/repos/builtin/packages/caliper/package.py index c9d4a41bc2..2350880d22 100644 --- a/var/spack/repos/builtin/packages/caliper/package.py +++ b/var/spack/repos/builtin/packages/caliper/package.py @@ -24,11 +24,15 @@ ############################################################################## from spack import * +import sys -class Caliper(Package): - """Caliper is a generic context annotation system. It gives programmers the - ability to provide arbitrary program context information to (performance) - tools at runtime. + +class Caliper(CMakePackage): + """Caliper is a program instrumentation and performance measurement + framework. It provides data collection mechanisms and a source-code + annotation API for a variety of performance engineering use cases, + e.g., performance profiling, tracing, monitoring, and + auto-tuning. """ homepage = "https://github.com/LLNL/Caliper" @@ -36,15 +40,47 @@ class Caliper(Package): version('master', git='https://github.com/LLNL/Caliper.git') - variant('mpi', default=True, description='Enable MPI function wrappers.') + variant('mpi', default=True, + description='Enable MPI wrappers') + variant('dyninst', default=False, + 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') + # gotcha doesn't work on Mac + variant('gotcha', default=sys.platform != 'darwin', + description='Enable GOTCHA support') - depends_on('libunwind') - depends_on('papi') + depends_on('dyninst', when='+dyninst') + depends_on('papi', when='+papi') depends_on('mpi', when='+mpi') + depends_on('libunwind', when='+callpath') + depends_on('cmake', type='build') + depends_on('python', type='build') + + def cmake_args(self): + spec = self.spec + + args = [ + '-DBUILD_TESTING=Off', + '-DWITH_DOCS=Off', + '-DWITH_TEST_APPS=Off', + '-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'), + '-DWITH_MPI=%s' % ('On' if '+mpi' in spec else 'Off') + ] + + if '+papi' in spec: + args.append('-DPAPI_PREFIX=%s' % spec['papi'].prefix) + + if '+mpi' in spec: + args.append('-DMPI_C_COMPILER=%s' % spec['mpi'].mpicc) + args.append('-DMPI_CXX_COMPILER=%s' % spec['mpi'].mpicxx) - def install(self, spec, prefix): - with working_dir('build', create=True): - cmake('..', *std_cmake_args) - make() - make("install") + return args -- cgit v1.2.3-70-g09d2