Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple fix for Sundials 5.1 compatibility #814

Merged
merged 5 commits into from
Apr 3, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 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'):
sundials_ver = LooseVersion(env['sundials_version'])
if sundials_ver < LooseVersion('2.4') or sundials_ver >= 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 sundials_ver < 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 All @@ -1133,8 +1134,8 @@ if env['system_sundials'] == 'y':
print('WARNING: External BLAS/LAPACK has been specified for Cantera '
'but Sundials was built without this support.')
else: # env['system_sundials'] == 'n'
print("""INFO: Using private installation of Sundials version 5.0.""")
env['sundials_version'] = '5.0'
print("""INFO: Using private installation of Sundials version 5.1.""")
env['sundials_version'] = '5.1'
env['has_sundials_lapack'] = int(env['use_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 sundials_ver >= LooseVersion('3.0'):
if env.get('has_sundials_lapack'):
env['sundials_libs'].extend(('sundials_sunlinsollapackdense',
'sundials_sunlinsollapackband'))
Expand Down
2 changes: 1 addition & 1 deletion ext/sundials
Submodule sundials updated 997 files
4 changes: 2 additions & 2 deletions ext/sundials_config.h.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* Minimal set of SUNDIALS configuration variables */
#define SUNDIALS_VERSION "5.0.0"
#define SUNDIALS_VERSION "5.1.0"
#define SUNDIALS_VERSION_MAJOR 5
#define SUNDIALS_VERSION_MINOR 0
#define SUNDIALS_VERSION_MINOR 1
#define SUNDIALS_VERSION_PATCH 0
#define SUNDIALS_VERSION_LABEL ""
#define SUNDIALS_F77_FUNC(name,NAME) name ## _
Expand Down