[petsc-dev] reminder never use #include "mylocalinclude.h" in PETSc source

Barry Smith bsmith at mcs.anl.gov
Tue May 4 15:32:46 CDT 2010


On May 4, 2010, at 11:20 AM, Jed Brown wrote:

> On Tue, 4 May 2010 10:51:58 -0700, Barry Smith <bsmith at mcs.anl.gov>  
> wrote:
>>    Absolutely. It does not belong in some centralized place; it
>> belongs with each chunk of code.
>>
>>    In fact, could/should we move it into the source files directly
>> and thus not need a file with this meta-data at all. The python tool
>> can just as easily get it out of the source files then the makefile.
>> (Currently there is one copy of this data per directory, it is not  
>> per
>> file; should we change it to per file, I'm not sure.)
>
> If you were to move it into the source file, it could be as simple as
>
>  #if PETSC_HAVE_XXX
>  /* body of file */
>  #endif

   we bagged this because some compilers couldn't handle source files  
with no source :-(

   plus it is ugly.

    Barry

>
> in which case the Python tool (or any build system for that matter)
> doesn't have to learn whether it should be built or not.  I'm not
> convinced this is better, but it is simpler if your goal is to be able
> to just dump a bunch of files on a new build system and get correct
> behavior (all you would need is a way to exclude examples from the
> library, but most systems have a way to ignore directories matching a
> given filter).
>
> Jed




More information about the petsc-dev mailing list