summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Lee <jasonlee@lanl.gov>2020-09-15 19:37:05 -0600
committerGitHub <noreply@github.com>2020-09-15 20:37:05 -0500
commit1a9f97fd0de21f3a82e20f41e1e411c208ad26be (patch)
tree10bf3e60f185a2e3e4b58ca6b24959979aa3d1f9
parent6a3583f1818ea5c7125a7d550ef6fb49d4fbc17e (diff)
downloadspack-1a9f97fd0de21f3a82e20f41e1e411c208ad26be.tar.gz
spack-1a9f97fd0de21f3a82e20f41e1e411c208ad26be.tar.bz2
spack-1a9f97fd0de21f3a82e20f41e1e411c208ad26be.tar.xz
spack-1a9f97fd0de21f3a82e20f41e1e411c208ad26be.zip
jemalloc: Use AutotoolsPackage and allow for arbitrary public API prefixes (#18680)
Removed je variant
-rw-r--r--var/spack/repos/builtin/packages/jemalloc/package.py30
1 files changed, 16 insertions, 14 deletions
diff --git a/var/spack/repos/builtin/packages/jemalloc/package.py b/var/spack/repos/builtin/packages/jemalloc/package.py
index d0a680547c..85ae590699 100644
--- a/var/spack/repos/builtin/packages/jemalloc/package.py
+++ b/var/spack/repos/builtin/packages/jemalloc/package.py
@@ -6,7 +6,7 @@
from spack import *
-class Jemalloc(Package):
+class Jemalloc(AutotoolsPackage):
"""jemalloc is a general purpose malloc(3) implementation that emphasizes
fragmentation avoidance and scalable concurrency support."""
homepage = "http://www.canonware.com/jemalloc/"
@@ -24,22 +24,24 @@ class Jemalloc(Package):
variant('stats', default=False, description='Enable heap statistics')
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):
- configure_args = ['--prefix=%s' % prefix, ]
+ def configure_args(self):
+ spec = self.spec
+ args = []
if '+stats' in spec:
- configure_args.append('--enable-stats')
+ args.append('--enable-stats')
if '+prof' in spec:
- configure_args.append('--enable-prof')
- if '+je' in spec:
- configure_args.append('--with-jemalloc-prefix=je_')
+ args.append('--enable-prof')
- 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
- filter_file(r'-Werror=\S*', '', 'Makefile')
-
- make()
- make("install")
+ return args