2022-01-13 03:21:41 +08:00
|
|
|
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
2018-12-08 15:06:28 +08:00
|
|
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
|
|
|
|
2022-05-29 00:55:44 +08:00
|
|
|
from spack.package import *
|
2018-12-08 15:06:28 +08:00
|
|
|
|
|
|
|
|
2022-03-14 18:32:19 +08:00
|
|
|
class Eztrace(Package):
|
2018-12-08 15:06:28 +08:00
|
|
|
"""EZTrace is a tool to automatically generate execution traces
|
|
|
|
of HPC applications."""
|
|
|
|
|
2022-03-14 18:32:19 +08:00
|
|
|
homepage = "https://gitlab.com/eztrace"
|
2020-04-05 22:39:57 +08:00
|
|
|
maintainers = ['trahay']
|
2022-03-14 18:32:19 +08:00
|
|
|
git = "https://gitlab.com/eztrace/eztrace.git"
|
2018-12-08 15:06:28 +08:00
|
|
|
|
2022-03-14 18:32:19 +08:00
|
|
|
version('master', branch='master')
|
|
|
|
version('2.0-rc1', sha256='2ad322df5aeb0c668ebadbfeb3b21c8841831b2c15944d86d1d217f738fee74e')
|
|
|
|
version('1.1-13', sha256='6144d04fb62b3ccad41af0268cd921161f168d0cca3f6c210c448bb0b07be7e0')
|
|
|
|
version('1.1-10', sha256='63d1af2db38b04efa817614574f381e7536e12db06a2c75375d1795adda3d1d8')
|
2018-12-08 15:06:28 +08:00
|
|
|
|
2022-03-14 18:32:19 +08:00
|
|
|
# dependencies for eztrace 1.x and 2.x
|
2018-12-08 15:06:28 +08:00
|
|
|
depends_on('mpi')
|
2022-03-14 18:32:19 +08:00
|
|
|
depends_on('opari2')
|
|
|
|
depends_on('binutils')
|
2018-12-08 15:06:28 +08:00
|
|
|
|
2022-03-14 18:32:19 +08:00
|
|
|
# eztrace 1.x dependencies
|
|
|
|
depends_on('autoconf@2.71', type='build', when="@:1")
|
|
|
|
depends_on('automake', type='build', when="@:1")
|
|
|
|
depends_on('libtool', type='build', when="@:1")
|
2018-12-08 15:06:28 +08:00
|
|
|
# Does not work on Darwin due to MAP_POPULATE
|
2022-03-14 18:32:19 +08:00
|
|
|
conflicts('platform=darwin', when='@:1')
|
2018-12-08 15:06:28 +08:00
|
|
|
|
2022-03-14 18:32:19 +08:00
|
|
|
# eztrace 2.x dependencies
|
|
|
|
depends_on('cmake@3.1:', type='build', when="@2.0:")
|
|
|
|
depends_on('otf2', when="@2.0:")
|
|
|
|
|
|
|
|
def url_for_version(self, version):
|
|
|
|
url = "https://gitlab.com/eztrace/eztrace/-/archive/{0}/eztrace-{1}.tar.gz"
|
|
|
|
return url.format(version, version)
|
|
|
|
|
|
|
|
@when('@2.0:')
|
|
|
|
def install(self, spec, prefix):
|
|
|
|
# Since eztrace 2.0, the build system uses CMake
|
|
|
|
spec = self.spec
|
|
|
|
args = [
|
|
|
|
"-DCMAKE_INSTALL_PREFIX=$prefix",
|
|
|
|
"-DEZTRACE_ENABLE_MEMORY=ON",
|
|
|
|
"-DEZTRACE_ENABLE_MPI=ON",
|
|
|
|
"-DEZTRACE_ENABLE_OPENMP=ON",
|
|
|
|
"-DEZTRACE_ENABLE_POSIXIO=ON",
|
|
|
|
"-DEZTRACE_ENABLE_PTHREAD=ON",
|
|
|
|
"-DOTF2_INCLUDE_PATH=%s" % spec['otf2'].prefix.include,
|
|
|
|
"-DOTF2_LIBRARY_PATH=%s" % spec['otf2'].libs,
|
|
|
|
]
|
|
|
|
|
|
|
|
if(spec.satisfies('%llvm-openmp-ompt')):
|
|
|
|
args.append("-DEZTRACE_ENABLE_OMPT=ON")
|
|
|
|
|
|
|
|
args.extend(std_cmake_args)
|
|
|
|
|
|
|
|
with working_dir('spack-build', create=True):
|
|
|
|
cmake('..', *args)
|
|
|
|
make()
|
|
|
|
make('install')
|
|
|
|
|
|
|
|
# Until eztrace 2.0, the build system uses autoconf
|
|
|
|
@when('@:1')
|
|
|
|
def install(self, spec, prefix):
|
|
|
|
if self.spec.satisfies('%fj'):
|
|
|
|
env.set('LDFLAGS', '--linkfortran')
|
|
|
|
self.patch()
|
|
|
|
which('bash')('bootstrap')
|
|
|
|
configure("--prefix=" + prefix,
|
|
|
|
"--with-mpi={0}".format(self.spec["mpi"].prefix))
|
|
|
|
self.fix_libtool()
|
|
|
|
make()
|
|
|
|
make("install")
|
|
|
|
|
|
|
|
@when('@:1')
|
2020-08-13 09:16:59 +08:00
|
|
|
def patch(self):
|
|
|
|
filter_file(
|
|
|
|
'"DEFAULT_OUTFILE"',
|
|
|
|
'" DEFAULT_OUTFILE "',
|
|
|
|
'extlib/gtg/extlib/otf/tools/otfshrink/otfshrink.cpp',
|
|
|
|
string=True
|
|
|
|
)
|
|
|
|
|
2022-03-14 18:32:19 +08:00
|
|
|
@when('@:1')
|
2020-08-13 09:16:59 +08:00
|
|
|
def fix_libtool(self):
|
|
|
|
if self.spec.satisfies('%fj'):
|
|
|
|
libtools = ['extlib/gtg/libtool',
|
|
|
|
'extlib/opari2/build-frontend/libtool']
|
|
|
|
for f in libtools:
|
|
|
|
filter_file('wl=""', 'wl="-Wl,"', f, string=True)
|