From: Timo Heister Date: Tue, 17 Nov 2015 21:33:14 +0000 (-0500) Subject: fix expand_instantiation split logic X-Git-Tag: v8.4.0-rc2~218^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1880%2Fhead;p=dealii.git fix expand_instantiation split logic We optionally split instantiations in the generated .inst files based on two macros SPLIT_INSTANTIATIONS_COUNT and SPLIT_INSTANTIATIONS_INDEX. Intel 14 generates an error with an invalid % 0 in the old solution, which happens if _COUNT is undefined. Fix this by defining a macro at the beginning of the .inst file. --- diff --git a/cmake/scripts/expand_instantiations.cc b/cmake/scripts/expand_instantiations.cc index bb099183bf..2e224bb298 100644 --- a/cmake/scripts/expand_instantiations.cc +++ b/cmake/scripts/expand_instantiations.cc @@ -386,9 +386,9 @@ void substitute (const std::string &text, // between 0 and SPLIT_INSTANTIATIONS_COUNT-1 to get the instantiations of that // particular chunk. static unsigned int counter = 0; - std::cout << "#if !defined(SPLIT_INSTANTIATIONS_COUNT) || (" + std::cout << "#if (SPLIT_INSTANTIATIONS_CHECK(" << counter++ - << " % SPLIT_INSTANTIATIONS_COUNT == SPLIT_INSTANTIATIONS_INDEX)" << std::endl; + << "))" << std::endl; std::cout << substitute_tokens (text, name, *expansion) << std::endl; std::cout << "#endif" << std::endl; @@ -506,5 +506,27 @@ int main (int argc, char **argv) for (int i=1; i