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

Barry Smith bsmith at mcs.anl.gov
Thu Feb 25 16:27:51 CST 2010

   We can install PETSc with the option --with-single-library so that  
one links against -lpetsc instead of -lpetscts -lpetscsnes ... - 

   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?

* 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  
* 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.



More information about the petsc-dev mailing list