Implemented +shared and +static_tools variants (#16105)
This commit is contained in:
parent
c6ef9c2b87
commit
5e69125e51
@ -2,6 +2,7 @@
|
|||||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
import glob
|
import glob
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
@ -38,10 +39,20 @@ class Papi(AutotoolsPackage):
|
|||||||
variant('lmsensors', default=False, description='Enable lm_sensors support')
|
variant('lmsensors', default=False, description='Enable lm_sensors support')
|
||||||
variant('sde', default=False, description='Enable software defined events')
|
variant('sde', default=False, description='Enable software defined events')
|
||||||
|
|
||||||
|
variant('shared', default=True, description='Build shared libraries')
|
||||||
|
# PAPI requires building static libraries, so there is no "static" variant
|
||||||
|
variant('static_tools', default=False, description='Statically link the PAPI tools')
|
||||||
|
# The PAPI configure option "--with-shlib-tools" is deprecated
|
||||||
|
# and therefore not implemented here
|
||||||
|
|
||||||
depends_on('lm-sensors', when='+lmsensors')
|
depends_on('lm-sensors', when='+lmsensors')
|
||||||
|
|
||||||
conflicts('%gcc@8:', when='@5.3.0', msg='Requires GCC version less than 8.0')
|
conflicts('%gcc@8:', when='@5.3.0', msg='Requires GCC version less than 8.0')
|
||||||
|
|
||||||
|
# This is the only way to match exactly version 6.0.0 without also
|
||||||
|
# including version 6.0.0.1 due to spack version matching logic
|
||||||
|
conflicts('@5.9.99999:6.0.0.a', when='+static_tools', msg='Static tools cannot build on version 6.0.0')
|
||||||
|
|
||||||
# Does not build with newer versions of gcc, see
|
# Does not build with newer versions of gcc, see
|
||||||
# https://bitbucket.org/icl/papi/issues/46/cannot-compile-on-arch-linux
|
# https://bitbucket.org/icl/papi/issues/46/cannot-compile-on-arch-linux
|
||||||
patch('https://bitbucket.org/icl/papi/commits/53de184a162b8a7edff48fed01a15980664e15b1/raw', sha256='64c57b3ad4026255238cc495df6abfacc41de391a0af497c27d0ac819444a1f8', when='@5.4.0:5.6.99%gcc@8:')
|
patch('https://bitbucket.org/icl/papi/commits/53de184a162b8a7edff48fed01a15980664e15b1/raw', sha256='64c57b3ad4026255238cc495df6abfacc41de391a0af497c27d0ac819444a1f8', when='@5.4.0:5.6.99%gcc@8:')
|
||||||
@ -55,15 +66,24 @@ def setup_build_environment(self, env):
|
|||||||
setup_run_environment = setup_build_environment
|
setup_run_environment = setup_build_environment
|
||||||
|
|
||||||
def configure_args(self):
|
def configure_args(self):
|
||||||
|
spec = self.spec
|
||||||
# PAPI uses MPI if MPI is present; since we don't require
|
# PAPI uses MPI if MPI is present; since we don't require
|
||||||
# an MPI package, we ensure that all attempts to use MPI
|
# an MPI package, we ensure that all attempts to use MPI
|
||||||
# fail, so that PAPI does not get confused
|
# fail, so that PAPI does not get confused
|
||||||
options = ['MPICC=:']
|
options = ['MPICC=:']
|
||||||
# Build a list of activated variants (optional PAPI components)
|
# Build a list of PAPI components
|
||||||
variants = filter(lambda x: self.spec.variants[x].value is True,
|
components = filter(
|
||||||
self.spec.variants)
|
lambda x: spec.variants[x].value,
|
||||||
if variants:
|
['example', 'infiniband', 'powercap', 'rapl', 'lmsensors', 'sde'])
|
||||||
options.append('--with-components={0}'.format(' '.join(variants)))
|
if components:
|
||||||
|
options.append('--with-components=' + ' '.join(components))
|
||||||
|
|
||||||
|
build_shared = 'yes' if '+shared' in spec else 'no'
|
||||||
|
options.append('--with-shared-lib=' + build_shared)
|
||||||
|
|
||||||
|
if '+static_tools' in spec:
|
||||||
|
options.append('--with-static-tools')
|
||||||
|
|
||||||
return options
|
return options
|
||||||
|
|
||||||
@run_before('configure')
|
@run_before('configure')
|
||||||
|
Loading…
Reference in New Issue
Block a user