From 5c20b7f2afa9c43a9cf681d87fe8998d60097330 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Wed, 4 Apr 2012 18:44:14 +0000 Subject: [PATCH] SCons: Better error handling when sundials paths are given If sundials_include or sundials_libdir are specified, promote use_sundials='default' to 'y' so that we won't unexpectedly fall back to the built in solvers if there's a configuration problem. --- SConstruct | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index 6067706d7..a5469eb41 100644 --- a/SConstruct +++ b/SConstruct @@ -676,6 +676,10 @@ if env['CC'] == 'cl': if env['boost_inc_dir']: env.Append(CPPPATH=env['boost_inc_dir']) +if (env['use_sundials'] == 'default' and + (env['sundials_include'] or env['sundials_libdir'])): + env['use_sundials'] = 'y' + if env['use_sundials'] in ('y','default'): if env['sundials_include']: env.Append(CPPPATH=[env['sundials_include']]) @@ -806,7 +810,8 @@ if env['use_sundials'] == 'default': print "INFO: Sundials was not found. Building with minimal ODE solver capabilities." env['use_sundials'] = 'n' elif env['use_sundials'] == 'y' and not env['HAS_SUNDIALS']: - print """ERROR: Unable to find Sundials headers""" + print "ERROR: Unable to find Sundials headers and / or libraries." + print "See config.log for details." sys.exit(1) elif env['use_sundials'] == 'y' and env['sundials_version'] not in ('2.2','2.3','2.4'): print """ERROR: Sundials version %r is not supported."""