2022-01-13 03:21:41 +08:00
|
|
|
# Copyright 2013-2022 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)
|
|
|
|
|
2021-06-11 16:12:18 +08:00
|
|
|
import os
|
2021-07-09 06:12:30 +08:00
|
|
|
|
2014-06-21 08:15:32 +08:00
|
|
|
from spack import *
|
2022-03-18 07:42:07 +08:00
|
|
|
from spack.pkg.builtin.boost import Boost
|
2014-06-21 08:15:32 +08:00
|
|
|
|
2015-01-13 03:38:32 +08:00
|
|
|
# typical working line with extrae 3.0.1
|
2016-08-10 16:50:00 +08:00
|
|
|
# ./configure
|
|
|
|
# --prefix=/usr/local
|
|
|
|
# --with-mpi=/usr/lib64/mpi/gcc/openmpi
|
|
|
|
# --with-unwind=/usr/local
|
|
|
|
# --with-papi=/usr
|
|
|
|
# --with-dwarf=/usr
|
|
|
|
# --with-elf=/usr
|
|
|
|
# --with-dyninst=/usr
|
|
|
|
# --with-binutils=/usr
|
|
|
|
# --with-xml-prefix=/usr
|
|
|
|
# --enable-openmp
|
|
|
|
# --enable-nanos
|
|
|
|
# --enable-pthread
|
|
|
|
# --disable-parallel-merge
|
|
|
|
#
|
|
|
|
# LDFLAGS=-pthread
|
|
|
|
|
2015-01-13 03:38:32 +08:00
|
|
|
|
2019-08-31 02:28:14 +08:00
|
|
|
class Extrae(AutotoolsPackage):
|
2014-08-01 05:09:38 +08:00
|
|
|
"""Extrae is the package devoted to generate tracefiles which can
|
|
|
|
be analyzed later by Paraver. Extrae is a tool that uses
|
|
|
|
different interposition mechanisms to inject probes into the
|
|
|
|
target application so as to gather information regarding the
|
|
|
|
application performance. The Extrae instrumentation package can
|
|
|
|
instrument the MPI programin model, and the following parallel
|
|
|
|
programming models either alone or in conjunction with MPI :
|
|
|
|
OpenMP, CUDA, OpenCL, pthread, OmpSs"""
|
2021-03-22 22:03:03 +08:00
|
|
|
|
2017-02-23 03:03:25 +08:00
|
|
|
homepage = "https://tools.bsc.es/extrae"
|
|
|
|
url = "https://ftp.tools.bsc.es/extrae/extrae-3.4.1-src.tar.bz2"
|
2021-03-22 22:03:03 +08:00
|
|
|
|
|
|
|
version('3.8.3', sha256='c3bf27fb6f18e66200e40a0b4c35bc257766e5c1a525dc5725f561879e88bf32')
|
2020-04-01 07:14:43 +08:00
|
|
|
version('3.7.1', sha256='c83ddd18a380c9414d64ee5de263efc6f7bac5fe362d5b8374170c7f18360378')
|
2019-10-11 13:44:41 +08:00
|
|
|
version('3.4.1', sha256='77bfec16d6b5eee061fbaa879949dcef4cad28395d6a546b1ae1b9246f142725')
|
2014-06-21 08:15:32 +08:00
|
|
|
|
2019-08-31 02:28:14 +08:00
|
|
|
depends_on("autoconf", type='build')
|
|
|
|
depends_on("automake", type='build')
|
|
|
|
depends_on("libtool", type='build')
|
|
|
|
depends_on("m4", type='build')
|
|
|
|
|
2015-01-13 03:38:32 +08:00
|
|
|
depends_on("mpi")
|
2014-06-21 08:15:32 +08:00
|
|
|
depends_on("libunwind")
|
2022-03-18 07:42:07 +08:00
|
|
|
|
|
|
|
# TODO: replace this with an explicit list of components of Boost,
|
|
|
|
# for instance depends_on('boost +filesystem')
|
|
|
|
# See https://github.com/spack/spack/pull/22303 for reference
|
|
|
|
depends_on(Boost.with_default_variants)
|
2014-06-21 08:15:32 +08:00
|
|
|
depends_on("libdwarf")
|
|
|
|
depends_on("papi")
|
2017-03-10 02:36:32 +08:00
|
|
|
depends_on("elf", type="link")
|
2016-09-30 03:37:07 +08:00
|
|
|
depends_on("libxml2")
|
2019-08-31 02:28:14 +08:00
|
|
|
depends_on("numactl")
|
2020-04-01 07:14:43 +08:00
|
|
|
depends_on("binutils+libiberty@:2.33")
|
2019-08-31 02:28:14 +08:00
|
|
|
depends_on("gettext")
|
2017-03-10 02:36:32 +08:00
|
|
|
# gettext dependency added to find -lintl
|
|
|
|
# https://www.gnu.org/software/gettext/FAQ.html#integrating_undefined
|
2014-06-21 08:15:32 +08:00
|
|
|
|
2019-08-31 02:28:14 +08:00
|
|
|
build_directory = 'spack-build'
|
|
|
|
|
|
|
|
variant('dyninst', default=False, description="Use dyninst for dynamic code installation")
|
|
|
|
depends_on('dyninst@:9', when='+dyninst')
|
|
|
|
|
|
|
|
variant('papi', default=True, description="Use PAPI to collect performance counters")
|
|
|
|
depends_on('papi', when='+papi')
|
2014-06-21 08:15:32 +08:00
|
|
|
|
2021-05-26 01:34:28 +08:00
|
|
|
variant('cuda', default=False, description="Enable support for tracing CUDA")
|
|
|
|
depends_on('cuda', when='+cuda')
|
|
|
|
|
|
|
|
variant('cupti', default=False, description='Enable CUPTI support')
|
|
|
|
depends_on('cuda', when='+cupti')
|
|
|
|
conflicts('+cupti', when='~cuda', msg='CUPTI requires CUDA')
|
|
|
|
|
2019-08-31 02:28:14 +08:00
|
|
|
def configure_args(self):
|
|
|
|
spec = self.spec
|
|
|
|
args = ["--with-mpi=%s" % spec['mpi'].prefix,
|
|
|
|
"--with-unwind=%s" % spec['libunwind'].prefix,
|
|
|
|
"--with-boost=%s" % spec['boost'].prefix,
|
|
|
|
"--with-dwarf=%s" % spec['libdwarf'].prefix,
|
|
|
|
"--with-elf=%s" % spec['elf'].prefix,
|
|
|
|
"--with-xml-prefix=%s" % spec['libxml2'].prefix,
|
|
|
|
"--with-binutils=%s" % spec['binutils'].prefix]
|
|
|
|
|
|
|
|
args += (["--with-papi=%s" % spec['papi'].prefix]
|
|
|
|
if '+papi' in self.spec else
|
|
|
|
["--without-papi"])
|
|
|
|
|
|
|
|
args += (["--with-dyninst=%s" % spec['dyninst'].prefix]
|
|
|
|
if '+dyninst' in self.spec else
|
|
|
|
["--without-dyninst"])
|
|
|
|
|
2021-05-26 01:34:28 +08:00
|
|
|
args += (["--with-cuda=%s" % spec['cuda'].prefix]
|
|
|
|
if '+cuda' in self.spec else
|
|
|
|
["--without-cuda"])
|
|
|
|
|
|
|
|
if '+cupti' in self.spec:
|
|
|
|
cupti_h = find_headers('cupti', spec['cuda'].prefix,
|
|
|
|
recursive=True)
|
|
|
|
cupti_dir = os.path.dirname(os.path.dirname(cupti_h[0]))
|
|
|
|
|
|
|
|
args += (["--with-cupti=%s" % cupti_dir]
|
|
|
|
if '+cupti' in self.spec else
|
|
|
|
["--without-cupti"])
|
|
|
|
|
2019-08-31 02:28:14 +08:00
|
|
|
if spec.satisfies("^dyninst@9.3.0:"):
|
|
|
|
make.add_default_arg("CXXFLAGS=%s" % self.compiler.cxx11_flag)
|
|
|
|
args.append("CXXFLAGS=%s" % self.compiler.cxx11_flag)
|
2017-03-10 02:36:32 +08:00
|
|
|
|
2021-06-11 16:12:18 +08:00
|
|
|
# This was added due to:
|
|
|
|
# - configure failure
|
2017-03-10 02:36:32 +08:00
|
|
|
# https://www.gnu.org/software/gettext/FAQ.html#integrating_undefined
|
2021-06-11 16:12:18 +08:00
|
|
|
# - linking error
|
|
|
|
# https://github.com/bsc-performance-tools/extrae/issues/57
|
|
|
|
args.append('LDFLAGS=-lintl -pthread')
|
2017-03-10 02:36:32 +08:00
|
|
|
|
2019-08-31 02:28:14 +08:00
|
|
|
return(args)
|
|
|
|
|
|
|
|
def install(self, spec, prefix):
|
|
|
|
with working_dir(self.build_directory):
|
|
|
|
# parallel installs are buggy prior to 3.7
|
|
|
|
# see https://github.com/bsc-performance-tools/extrae/issues/18
|
|
|
|
if(spec.satisfies('@3.7:')):
|
|
|
|
make('install', parallel=True)
|
|
|
|
else:
|
|
|
|
make('install', parallel=False)
|
|
|
|
|
2019-11-30 05:00:44 +08:00
|
|
|
def setup_run_environment(self, env):
|
2019-08-31 02:28:14 +08:00
|
|
|
# set EXTRAE_HOME in the module file
|
2019-11-30 05:00:44 +08:00
|
|
|
env.set('EXTRAE_HOME', self.prefix)
|
2019-08-31 02:28:14 +08:00
|
|
|
|
2019-11-30 05:00:44 +08:00
|
|
|
def setup_dependent_build_environment(self, env, dependent_spec):
|
2019-08-31 02:28:14 +08:00
|
|
|
# set EXTRAE_HOME for everyone using the Extrae package
|
2019-11-30 05:00:44 +08:00
|
|
|
env.set('EXTRAE_HOME', self.prefix)
|