From 719dbcc6502d252998fa315065de5005d927196f Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Mon, 27 Aug 2018 22:05:55 -0400 Subject: [PATCH] Fix warnings about Cabinet::s_storage Recent versions of clang++ warn that instantiation of a templated variable is required at a certain point where no definition is available. Declaring such a definition to be available is fine with older versions of clang++ as well, but causes linker errors with g++, so this change is only applied when using clang++. --- SConstruct | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index 261fdc23f..de38b6497 100644 --- a/SConstruct +++ b/SConstruct @@ -998,6 +998,8 @@ print('INFO: Found Eigen version {}'.format(env['EIGEN_LIB_VERSION'])) env['HAS_GLIBCXX'] = conf.CheckDeclaration('__GLIBCXX__', '#include ', 'C++') env['HAS_LIBCPP'] = conf.CheckDeclaration('_LIBCPP_VERSION', '#include ', 'C++') +env['HAS_CLANG'] = conf.CheckDeclaration('__clang__', '', 'C++') + boost_version_source = get_expression_value([''], 'BOOST_LIB_VERSION') retcode, boost_lib_version = conf.TryRun(boost_version_source, '.cpp') env['BOOST_LIB_VERSION'] = '.'.join(boost_lib_version.strip().split('_')) @@ -1586,7 +1588,9 @@ def cdefine(definevar, configvar, comp=True, value=1): # Need to test all of these to see what platform.system() returns configh['SOLARIS'] = 1 if env['OS'] == 'Solaris' else None configh['DARWIN'] = 1 if env['OS'] == 'Darwin' else None -cdefine('NEEDS_GENERIC_TEMPL_STATIC_DECL', 'OS', 'Solaris') + +if env['OS'] == 'Solaris' or env['HAS_CLANG']: + configh['NEEDS_GENERIC_TEMPL_STATIC_DECL'] = 1 configh['CT_SUNDIALS_VERSION'] = env['sundials_version'].replace('.','')