<div class="gmail_quote">On Wed, Feb 9, 2011 at 13:17, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>What does this sentence mean? If petscconf.h has no logic, then isn't all the logic on the Python side? Isn't all that logic used from C?</div></blockquote><div><br></div><div>The result of tests go into petscconf.h. For the example I brought up, different macro values imply that different code must be executed. To remove the #if completely, you would have to generate different imperative code.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div> bodies are currently generated by Python. It sounds like you want to generated imperative code in Python and call that from C. I think that would add</div></blockquote><div><br></div></div><div>We can currently control the build to do selective builds, just as we do with #defines right now. I think that removing that code from the tree and</div>

<div>building everything would actually be simpler.</div></blockquote></div><div><br></div>I agree that when possible, configuration choices should be available at runtime instead of compile time. However, "everything" cannot be compiled because some are mutually exclusive: scalar precision, real/complex, int size, C++ mangling, and architecture specific things. Consider the code that sets up floating point trapping. Only one path can be compiled on any specific architecture. Either you generate the fp.c source file differently for each architecture, you have a different source file for each architecture and have the build system use the correct one, or you keep them all in the same file and use the preprocessor to decide which one to compile (this is currently done).