darshan runtime,darshan-util: convert to autotool packages (#24906)

This commit is contained in:
shanedsnyder 2021-07-19 06:14:32 -05:00 committed by GitHub
parent efd9884e83
commit feb229a5f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 53 additions and 38 deletions

View File

@ -8,7 +8,7 @@
from spack import * from spack import *
class DarshanRuntime(Package): class DarshanRuntime(AutotoolsPackage):
"""Darshan (runtime) is a scalable HPC I/O characterization tool """Darshan (runtime) is a scalable HPC I/O characterization tool
designed to capture an accurate picture of application I/O behavior, designed to capture an accurate picture of application I/O behavior,
including properties such as patterns of access within files, with including properties such as patterns of access within files, with
@ -38,6 +38,10 @@ class DarshanRuntime(Package):
depends_on('zlib') depends_on('zlib')
depends_on('hdf5', when='+hdf5') depends_on('hdf5', when='+hdf5')
depends_on('papi', when='+apxc') depends_on('papi', when='+apxc')
depends_on('autoconf', type='build', when='@main')
depends_on('automake', type='build', when='@main')
depends_on('libtool', type='build', when='@main')
depends_on('m4', type='build', when='@main')
variant('mpi', default=True, description='Compile with MPI support') variant('mpi', default=True, description='Compile with MPI support')
variant('hdf5', default=False, description='Compile with HDF5 module') variant('hdf5', default=False, description='Compile with HDF5 module')
@ -61,7 +65,13 @@ class DarshanRuntime(Package):
conflicts('+apxc', when='@:3.2.1', conflicts('+apxc', when='@:3.2.1',
msg='+apxc variant only available starting from version 3.3.0') msg='+apxc variant only available starting from version 3.3.0')
def install(self, spec, prefix): @property
def configure_directory(self):
return 'darshan-runtime'
def configure_args(self):
spec = self.spec
extra_args = []
job_id = 'NONE' job_id = 'NONE'
if '+slurm' in spec: if '+slurm' in spec:
@ -73,34 +83,31 @@ def install(self, spec, prefix):
if '+sge' in spec: if '+sge' in spec:
job_id = 'JOB_ID' job_id = 'JOB_ID'
# TODO: BG-Q and other platform configure options
options = []
if '+mpi' in spec:
options = ['CC=%s' % spec['mpi'].mpicc]
else:
options = ['--without-mpi']
if '+hdf5' in spec: if '+hdf5' in spec:
options.extend(['--enable-hdf5-mod=%s' % spec['hdf5'].prefix]) if self.version < Version('3.3.2'):
extra_args.append('--enable-hdf5-mod=%s' % spec['hdf5'].prefix)
else:
extra_args.append('--enable-hdf5-mod')
if '+apmpi' in spec: if '+apmpi' in spec:
options.extend(['--enable-apmpi-mod']) extra_args.append('--enable-apmpi-mod')
if '+apmpi_sync' in spec: if '+apmpi_sync' in spec:
options.extend(['--enable-apmpi-mod', extra_args.append(['--enable-apmpi-mod',
'--enable-apmpi-coll-sync']) '--enable-apmpi-coll-sync'])
if '+apxc' in spec: if '+apxc' in spec:
options.extend(['--enable-apxc-mod']) extra_args.append(['--enable-apxc-mod'])
options.extend(['--with-mem-align=8', extra_args.append('--with-mem-align=8')
'--with-log-path-by-env=DARSHAN_LOG_DIR_PATH', extra_args.append('--with-log-path-by-env=DARSHAN_LOG_DIR_PATH')
'--with-jobid-env=%s' % job_id, extra_args.append('--with-jobid-env=%s' % job_id)
'--with-zlib=%s' % spec['zlib'].prefix]) extra_args.append('--with-zlib=%s' % spec['zlib'].prefix)
with working_dir('spack-build', create=True): if '+mpi' in spec:
configure = Executable('../darshan-runtime/configure') extra_args.append('CC=%s' % self.spec['mpi'].mpicc)
configure('--prefix=%s' % prefix, *options) else:
make() extra_args.append('CC=%s' % self.compiler.cc)
make('install') extra_args.append('--without-mpi')
return extra_args
def setup_run_environment(self, env): def setup_run_environment(self, env):
# default path for log file, could be user or site specific setting # default path for log file, could be user or site specific setting

View File

@ -6,7 +6,7 @@
from spack import * from spack import *
class DarshanUtil(Package): class DarshanUtil(AutotoolsPackage):
"""Darshan (util) is collection of tools for parsing and summarizing log """Darshan (util) is collection of tools for parsing and summarizing log
files produced by Darshan (runtime) instrumentation. This package is files produced by Darshan (runtime) instrumentation. This package is
typically installed on systems (front-end) where you intend to analyze typically installed on systems (front-end) where you intend to analyze
@ -32,12 +32,15 @@ class DarshanUtil(Package):
version('3.0.0', sha256='95232710f5631bbf665964c0650df729c48104494e887442596128d189da43e0') version('3.0.0', sha256='95232710f5631bbf665964c0650df729c48104494e887442596128d189da43e0')
variant('bzip2', default=False, description="Enable bzip2 compression") variant('bzip2', default=False, description="Enable bzip2 compression")
variant('shared', default=True, description='Build shared libraries')
variant('apmpi', default=False, description='Compile with AutoPerf MPI module support') variant('apmpi', default=False, description='Compile with AutoPerf MPI module support')
variant('apxc', default=False, description='Compile with AutoPerf XC module support') variant('apxc', default=False, description='Compile with AutoPerf XC module support')
depends_on('zlib') depends_on('zlib')
depends_on('bzip2', when="+bzip2", type=("build", "link", "run")) depends_on('bzip2', when="+bzip2", type=("build", "link", "run"))
depends_on('autoconf', type='build', when='@main')
depends_on('automake', type='build', when='@main')
depends_on('libtool', type='build', when='@main')
depends_on('m4', type='build', when='@main')
patch('retvoid.patch', when='@3.2.0:3.2.1') patch('retvoid.patch', when='@3.2.0:3.2.1')
@ -46,20 +49,25 @@ class DarshanUtil(Package):
conflicts('+apxc', when='@:3.2.1', conflicts('+apxc', when='@:3.2.1',
msg='+apxc variant only available starting from version 3.3.0') msg='+apxc variant only available starting from version 3.3.0')
def install(self, spec, prefix): @property
def configure_directory(self):
return 'darshan-util'
options = ['CC=%s' % self.compiler.cc, def configure_args(self):
'--with-zlib=%s' % spec['zlib'].prefix] spec = self.spec
if '+shared' in spec: extra_args = []
options.extend(['--enable-shared'])
extra_args.append('CC=%s' % self.compiler.cc)
extra_args.append('--with-zlib=%s' % spec['zlib'].prefix)
if '+apmpi' in spec: if '+apmpi' in spec:
options.extend(['--enable-autoperf-apmpi']) if self.version < Version('3.3.2'):
extra_args.append('--enable-autoperf-apmpi')
else:
extra_args.append('--enable-apmpi-mod')
if '+apxc' in spec: if '+apxc' in spec:
options.extend(['--enable-autoperf-apxc']) if self.version < Version('3.3.2'):
extra_args.append('--enable-autoperf-apxc')
else:
extra_args.append('--enable-apxc-mod')
with working_dir('spack-build', create=True): return extra_args
configure = Executable('../darshan-util/configure')
configure('--prefix=%s' % prefix, *options)
make()
make('install')