From 50a3fecb23f4cf97e71d989812a48c1a4c40f754 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Thu, 8 Feb 2018 22:58:16 -0500 Subject: [PATCH] Rename Sundials-related macros to avoid name conflicts --- SConstruct | 6 +++--- include/cantera/base/config.h.in | 4 ++-- include/cantera/cython/wrappers.h | 2 +- src/numerics/BandMatrix.cpp | 2 +- src/numerics/CVodesIntegrator.cpp | 8 ++++---- src/numerics/IDA_Solver.cpp | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/SConstruct b/SConstruct index 6f7acfbba..e07be4e8d 100644 --- a/SConstruct +++ b/SConstruct @@ -1539,12 +1539,12 @@ 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') -configh['SUNDIALS_VERSION'] = env['sundials_version'].replace('.','') +configh['CT_SUNDIALS_VERSION'] = env['sundials_version'].replace('.','') if env.get('has_sundials_lapack') and env['use_lapack']: - configh['SUNDIALS_USE_LAPACK'] = 1 + configh['CT_SUNDIALS_USE_LAPACK'] = 1 else: - configh['SUNDIALS_USE_LAPACK'] = 0 + configh['CT_SUNDIALS_USE_LAPACK'] = 0 cdefine('LAPACK_FTN_STRING_LEN_AT_END', 'lapack_ftn_string_len_at_end') cdefine('LAPACK_FTN_TRAILING_UNDERSCORE', 'lapack_ftn_trailing_underscore') diff --git a/include/cantera/base/config.h.in b/include/cantera/base/config.h.in index cdbc7ed61..15e25c845 100644 --- a/include/cantera/base/config.h.in +++ b/include/cantera/base/config.h.in @@ -33,7 +33,7 @@ typedef int ftnlen; // Fortran hidden string length type %(FTN_TRAILING_UNDERSCORE)s -%(SUNDIALS_VERSION)s +%(CT_SUNDIALS_VERSION)s //-------- LAPACK / BLAS --------- @@ -74,6 +74,6 @@ typedef int ftnlen; // Fortran hidden string length type // Enable Sundials to use an external BLAS/LAPACK library if it was // built to use this option -%(SUNDIALS_USE_LAPACK)s +%(CT_SUNDIALS_USE_LAPACK)s #endif diff --git a/include/cantera/cython/wrappers.h b/include/cantera/cython/wrappers.h index 09aec98ef..e7c510d7f 100644 --- a/include/cantera/cython/wrappers.h +++ b/include/cantera/cython/wrappers.h @@ -16,7 +16,7 @@ std::string get_cantera_version() int get_sundials_version() { - return SUNDIALS_VERSION; + return CT_SUNDIALS_VERSION; } class PythonLogger : public Cantera::Logger diff --git a/src/numerics/BandMatrix.cpp b/src/numerics/BandMatrix.cpp index 37053532f..034b8e415 100644 --- a/src/numerics/BandMatrix.cpp +++ b/src/numerics/BandMatrix.cpp @@ -10,7 +10,7 @@ #if CT_USE_LAPACK #include "cantera/numerics/ctlapack.h" #else - #if SUNDIALS_USE_LAPACK + #if CT_SUNDIALS_USE_LAPACK #include "cvodes/cvodes_lapack.h" #else #include "cvodes/cvodes_dense.h" diff --git a/src/numerics/CVodesIntegrator.cpp b/src/numerics/CVodesIntegrator.cpp index 4d034b9c0..2a412d0a7 100644 --- a/src/numerics/CVodesIntegrator.cpp +++ b/src/numerics/CVodesIntegrator.cpp @@ -14,7 +14,7 @@ using namespace std; #include "sundials/sundials_nvector.h" #include "nvector/nvector_serial.h" #include "cvodes/cvodes.h" -#if SUNDIALS_USE_LAPACK +#if CT_SUNDIALS_USE_LAPACK #include "cvodes/cvodes_lapack.h" #else #include "cvodes/cvodes_dense.h" @@ -26,7 +26,7 @@ using namespace std; #define CV_SS 1 #define CV_SV 2 -#if SUNDIALS_VERSION < 25 +#if CT_SUNDIALS_VERSION < 25 typedef int sd_size_t; #else typedef long int sd_size_t; @@ -338,7 +338,7 @@ void CVodesIntegrator::applyOptions() { if (m_type == DENSE + NOJAC) { sd_size_t N = static_cast(m_neq); - #if SUNDIALS_USE_LAPACK + #if CT_SUNDIALS_USE_LAPACK CVLapackDense(m_cvode_mem, N); #else CVDense(m_cvode_mem, N); @@ -351,7 +351,7 @@ void CVodesIntegrator::applyOptions() sd_size_t N = static_cast(m_neq); long int nu = m_mupper; long int nl = m_mlower; - #if SUNDIALS_USE_LAPACK + #if CT_SUNDIALS_USE_LAPACK CVLapackBand(m_cvode_mem, N, nu, nl); #else CVBand(m_cvode_mem, N, nu, nl); diff --git a/src/numerics/IDA_Solver.cpp b/src/numerics/IDA_Solver.cpp index b08ceb86b..6993a88d1 100644 --- a/src/numerics/IDA_Solver.cpp +++ b/src/numerics/IDA_Solver.cpp @@ -16,7 +16,7 @@ using namespace std; -#if SUNDIALS_VERSION < 25 +#if CT_SUNDIALS_VERSION < 25 typedef int sd_size_t; #else typedef long int sd_size_t;