cantera: make sundials dependency optional (#10764)
This commit is contained in:
parent
c717f56359
commit
c939e36ed9
@ -21,13 +21,15 @@ class Cantera(SConsPackage):
|
|||||||
description='Build the Cantera Python module')
|
description='Build the Cantera Python module')
|
||||||
variant('matlab', default=False,
|
variant('matlab', default=False,
|
||||||
description='Build the Cantera Matlab toolbox')
|
description='Build the Cantera Matlab toolbox')
|
||||||
|
variant('sundials', default=True,
|
||||||
|
description='Build with Sundials')
|
||||||
|
|
||||||
# Required dependencies
|
# Required dependencies
|
||||||
depends_on('fmt@3.0.0:3.0.2', when='@2.3.0:')
|
depends_on('fmt@3.0.0:3.0.2', when='@2.3.0:')
|
||||||
depends_on('googletest', when='@2.3.0:')
|
depends_on('googletest', when='@2.3.0:')
|
||||||
depends_on('eigen', when='@2.3.0:')
|
depends_on('eigen', when='@2.3.0:')
|
||||||
depends_on('boost')
|
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('blas')
|
||||||
depends_on('lapack')
|
depends_on('lapack')
|
||||||
|
|
||||||
@ -43,6 +45,8 @@ class Cantera(SConsPackage):
|
|||||||
# Matlab toolbox dependencies
|
# Matlab toolbox dependencies
|
||||||
extends('matlab', when='+matlab')
|
extends('matlab', when='+matlab')
|
||||||
|
|
||||||
|
conflicts('~sundials', when='@2.3.0:')
|
||||||
|
|
||||||
def build_args(self, spec, prefix):
|
def build_args(self, spec, prefix):
|
||||||
# Valid args can be found by running `scons help`
|
# Valid args can be found by running `scons help`
|
||||||
|
|
||||||
@ -98,19 +102,20 @@ def build_args(self, spec, prefix):
|
|||||||
])
|
])
|
||||||
|
|
||||||
# Sundials support
|
# Sundials support
|
||||||
if spec.satisfies('@2.3.0:'):
|
if '+sundials' in spec:
|
||||||
args.append('system_sundials=y')
|
if spec.satisfies('@2.3.0:'):
|
||||||
else:
|
args.append('system_sundials=y')
|
||||||
args.extend([
|
else:
|
||||||
'use_sundials=y',
|
args.extend([
|
||||||
'sundials_license={0}'.format(
|
'use_sundials=y',
|
||||||
spec['sundials'].prefix.LICENSE)
|
'sundials_license={0}'.format(
|
||||||
])
|
spec['sundials'].prefix.LICENSE)
|
||||||
|
])
|
||||||
|
|
||||||
args.extend([
|
args.extend([
|
||||||
'sundials_include={0}'.format(spec['sundials'].prefix.include),
|
'sundials_include={0}'.format(spec['sundials'].prefix.include),
|
||||||
'sundials_libdir={0}'.format(spec['sundials'].prefix.lib),
|
'sundials_libdir={0}'.format(spec['sundials'].prefix.lib),
|
||||||
])
|
])
|
||||||
|
|
||||||
# Python module
|
# Python module
|
||||||
if '+python' in spec:
|
if '+python' in spec:
|
||||||
|
Loading…
Reference in New Issue
Block a user