[petsc-dev] Are there both a function AND a #define to retrieve PETSc version?

Eric Chamberland Eric.Chamberland at giref.ulaval.ca
Fri Aug 26 13:53:37 CDT 2016


wanting to prevent a possible error: I compile and link (dynamically) my 
code with petsc-3.7.2 BUT I may change my LD_LIBRARY_PATH to point to 

I would the like my code to stop and tell me I am using the wrong libs...

I could add something like:

if (PETSC_VERSION_MAJOR != PetscInfoVersionMajor() ||
     PETSC_VERSION_MINOR != PetscInfoVersionMinor() ||
     PETSC_VERSION_PATCH != PetscInfoVersionPatch()) {

   printf("You are using a different version of PETSc than the one you 
linked with...");

But I then need non-inlined functions PetscInfoVersion* to have this to 

Does this exists?

I think It could even be into Petsc itself...



More information about the petsc-dev mailing list