[petsc-dev] now that we have -lpetsc should we also have #include "petsc.h"?

Barry Smith bsmith at mcs.anl.gov
Thu Feb 25 20:19:44 CST 2010


   One mistake below, it would be petscsys.h not petsccore.h

    Barry

On Feb 25, 2010, at 4:27 PM, Barry Smith wrote:

>
>  We can install PETSc with the option --with-single-library so that  
> one links against -lpetsc instead of -lpetscts -lpetscsnes ... - 
> lpetscsys
>
>  This suggests that with include files we should have a parallel  
> construct where one can do #include "petsc.h" to access all of  
> PETSc's functionality (while, of course, continuing to be able to  
> include just some some includes if you like).
>
>  I propose the following, change petsc.h to petsccore.h and  
> introduce a new petsc.h that is basically petscts.h
>
>  What does everyone think?
>
>  Notes:
> * Current C compiles won't break if users do not update there code  
> (just everything will be included if they happen to have a #include  
> "petsc.h")
> * Most users likely have include "petscksp.h" or "petscsnes.h"  
> already in their code won't even have to change things to match the  
> new "paradigm", the need only remove the "petsc.h" that they have  
> now before other includes (which they never needed).
>
> * Fortran is a bit trickier so things might break for some users
> * Implementing this change means I go though the source code  
> replacing "petsc.h" everywhere with "petsccore.h" no big deal.
>
>  I really like this idea, in fact I like it so much I just want to  
> do it this moment and push and be done with it, BUT I'll listen to  
> your screams first in case I am missing something.
>
>   Barry
>




More information about the petsc-dev mailing list