From c939e36ed909fb3fd45577f09e08562d028436d7 Mon Sep 17 00:00:00 2001 From: Matthias Diener Date: Tue, 5 Mar 2019 12:58:00 -0600 Subject: cantera: make sundials dependency optional (#10764) --- .../repos/builtin/packages/cantera/package.py | 29 +++++++++++++--------- 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/cantera/package.py b/var/spack/repos/builtin/packages/cantera/package.py index b0652c6e12..d357c0d6ab 100644 --- a/var/spack/repos/builtin/packages/cantera/package.py +++ b/var/spack/repos/builtin/packages/cantera/package.py @@ -21,13 +21,15 @@ class Cantera(SConsPackage): description='Build the Cantera Python module') variant('matlab', default=False, description='Build the Cantera Matlab toolbox') + variant('sundials', default=True, + description='Build with Sundials') # Required dependencies depends_on('fmt@3.0.0:3.0.2', when='@2.3.0:') depends_on('googletest', when='@2.3.0:') depends_on('eigen', when='@2.3.0:') depends_on('boost') - depends_on('sundials') # must be compiled with -fPIC + depends_on('sundials', when='+sundials') # must be compiled with -fPIC depends_on('blas') depends_on('lapack') @@ -43,6 +45,8 @@ class Cantera(SConsPackage): # Matlab toolbox dependencies extends('matlab', when='+matlab') + conflicts('~sundials', when='@2.3.0:') + def build_args(self, spec, prefix): # Valid args can be found by running `scons help` @@ -98,20 +102,21 @@ class Cantera(SConsPackage): ]) # Sundials support - if spec.satisfies('@2.3.0:'): - args.append('system_sundials=y') - else: + if '+sundials' in spec: + if spec.satisfies('@2.3.0:'): + args.append('system_sundials=y') + else: + args.extend([ + 'use_sundials=y', + 'sundials_license={0}'.format( + spec['sundials'].prefix.LICENSE) + ]) + args.extend([ - 'use_sundials=y', - 'sundials_license={0}'.format( - spec['sundials'].prefix.LICENSE) + 'sundials_include={0}'.format(spec['sundials'].prefix.include), + 'sundials_libdir={0}'.format(spec['sundials'].prefix.lib), ]) - args.extend([ - 'sundials_include={0}'.format(spec['sundials'].prefix.include), - 'sundials_libdir={0}'.format(spec['sundials'].prefix.lib), - ]) - # Python module if '+python' in spec: args.extend([ -- cgit v1.2.3-70-g09d2