diff options
author | Matthias Diener <matthias.diener@gmail.com> | 2019-03-05 12:58:00 -0600 |
---|---|---|
committer | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2019-03-05 19:58:00 +0100 |
commit | c939e36ed909fb3fd45577f09e08562d028436d7 (patch) | |
tree | b8ef4c998953d8e6f42019de8dcfe03da4de3190 | |
parent | c717f56359ed15a0c5f80ad1bdca5d9de819a371 (diff) | |
download | spack-c939e36ed909fb3fd45577f09e08562d028436d7.tar.gz spack-c939e36ed909fb3fd45577f09e08562d028436d7.tar.bz2 spack-c939e36ed909fb3fd45577f09e08562d028436d7.tar.xz spack-c939e36ed909fb3fd45577f09e08562d028436d7.zip |
cantera: make sundials dependency optional (#10764)
-rw-r--r-- | var/spack/repos/builtin/packages/cantera/package.py | 29 |
1 files changed, 17 insertions, 12 deletions
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([ |