jemalloc: Use AutotoolsPackage and allow for arbitrary public API prefixes (#18680)

Removed je variant
This commit is contained in:
Jason Lee 2020-09-15 19:37:05 -06:00 committed by GitHub
parent 6a3583f181
commit 1a9f97fd0d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,7 +6,7 @@
from spack import * from spack import *
class Jemalloc(Package): class Jemalloc(AutotoolsPackage):
"""jemalloc is a general purpose malloc(3) implementation that emphasizes """jemalloc is a general purpose malloc(3) implementation that emphasizes
fragmentation avoidance and scalable concurrency support.""" fragmentation avoidance and scalable concurrency support."""
homepage = "http://www.canonware.com/jemalloc/" homepage = "http://www.canonware.com/jemalloc/"
@ -24,22 +24,24 @@ class Jemalloc(Package):
variant('stats', default=False, description='Enable heap statistics') variant('stats', default=False, description='Enable heap statistics')
variant('prof', default=False, description='Enable heap profiling') variant('prof', default=False, description='Enable heap profiling')
variant('je', default=False, description='Prepend the public API functions with "je_"') variant(
'jemalloc_prefix', default='none',
description='Prefix to prepend to all public APIs',
values=None,
multi=False
)
def install(self, spec, prefix): def configure_args(self):
configure_args = ['--prefix=%s' % prefix, ] spec = self.spec
args = []
if '+stats' in spec: if '+stats' in spec:
configure_args.append('--enable-stats') args.append('--enable-stats')
if '+prof' in spec: if '+prof' in spec:
configure_args.append('--enable-prof') args.append('--enable-prof')
if '+je' in spec:
configure_args.append('--with-jemalloc-prefix=je_')
configure(*configure_args) je_prefix = spec.variants['jemalloc_prefix'].value
if je_prefix != 'none':
args.append('--with-jemalloc-prefix={0}'.format(je_prefix))
# Don't use -Werror return args
filter_file(r'-Werror=\S*', '', 'Makefile')
make()
make("install")