Skip to content

Commit

Permalink
Replace sundials version list with LooseVerion condition within versi…
Browse files Browse the repository at this point in the history
…on check
  • Loading branch information
band-a-prend committed Mar 26, 2020
1 parent f696b48 commit be9ff99
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -1108,13 +1108,14 @@ if env['system_sundials'] == 'y':

# Ignore the minor version, e.g. 2.4.x -> 2.4
env['sundials_version'] = '.'.join(sundials_version.split('.')[:2])
if env['sundials_version'] not in ('2.4','2.5','2.6','2.7','3.0','3.1','3.2','4.0','4.1','5.0','5.1'):
system_sundials_version = LooseVersion(env['sundials_version'])
if system_sundials_version < LooseVersion('2.4') or system_sundials_version >= LooseVersion('6.0'):
print("""ERROR: Sundials version %r is not supported.""" % env['sundials_version'])
sys.exit(1)
print("""INFO: Using system installation of Sundials version %s.""" % sundials_version)

#Determine whether or not Sundials was built with BLAS/LAPACK
if LooseVersion(env['sundials_version']) < LooseVersion('2.6'):
if system_sundials_version < LooseVersion('2.6'):
# In Sundials 2.4 / 2.5, SUNDIALS_BLAS_LAPACK is either 0 or 1
sundials_blas_lapack = get_expression_value(['"sundials/sundials_config.h"'],
'SUNDIALS_BLAS_LAPACK')
Expand Down Expand Up @@ -1606,7 +1607,7 @@ linkSharedLibs = ['cantera_shared']

if env['system_sundials'] == 'y':
env['sundials_libs'] = ['sundials_cvodes', 'sundials_ida', 'sundials_nvecserial']
if env['use_lapack'] and LooseVersion(env['sundials_version']) >= LooseVersion('3.0'):
if env['use_lapack'] and system_sundials_version >= LooseVersion('3.0'):
if env.get('has_sundials_lapack'):
env['sundials_libs'].extend(('sundials_sunlinsollapackdense',
'sundials_sunlinsollapackband'))
Expand Down

0 comments on commit be9ff99

Please sign in to comment.