From be9ff99a9ba5aed72928d72df12e59838152bc4a Mon Sep 17 00:00:00 2001 From: band-a-prend Date: Wed, 25 Mar 2020 10:24:18 +0300 Subject: [PATCH] Replace sundials version list with LooseVerion condition within version check --- SConstruct | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/SConstruct b/SConstruct index 7f18c3428a6..f2bf359b738 100644 --- a/SConstruct +++ b/SConstruct @@ -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') @@ -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'))