From 67c8a63a0a890c3378e3f4ef06b71767cf0c88f7 Mon Sep 17 00:00:00 2001 From: Severin Strobl Date: Wed, 1 Dec 2021 16:24:15 +0100 Subject: [PATCH] adol-c: add variant stdczero (#27721) --- .../repos/builtin/packages/adol-c/package.py | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/var/spack/repos/builtin/packages/adol-c/package.py b/var/spack/repos/builtin/packages/adol-c/package.py index 404a511236..3c8442feda 100644 --- a/var/spack/repos/builtin/packages/adol-c/package.py +++ b/var/spack/repos/builtin/packages/adol-c/package.py @@ -30,6 +30,8 @@ class AdolC(AutotoolsPackage): description='Enable advanced branching to reduce retaping') variant('atrig_erf', default=True, description='Enable arc-trig and error functions') + variant('stdczero', default=True, + description='Enable default initialization for the adouble datatype') variant('doc', default=True, description='Install documentation') variant('openmp', default=False, description='Enable OpenMP support') variant('sparse', default=False, description='Enable sparse drivers') @@ -70,25 +72,17 @@ def configure_args(self): '--with-boost=no' ) - if '+advanced_branching' in spec: - configure_args.append( - '--enable-advanced-branching' - ) - - if '+atrig_erf' in spec: - configure_args.append( - '--enable-atrig-erf' - ) - if '+openmp' in spec: configure_args.append( '--with-openmp-flag={0}'.format(self.compiler.openmp_flag) ) - if '+sparse' in spec: - configure_args.append( - '--enable-sparse' - ) + configure_args.extend(self.enable_or_disable('advanced-branching', + variant='advanced_branching')) + + configure_args.extend(self.enable_or_disable('atrig-erf', variant='atrig_erf')) + configure_args.extend(self.enable_or_disable('sparse')) + configure_args.extend(self.enable_or_disable('stdczero')) # We can simply use the bundled examples to check # whether Adol-C works as expected