xref: /petsc/src/sys/objects/version.c (revision 9895aa37ac365bac650f6bd8bf977519f7222510)
1 #include <petscsys.h>
2 /*@C
3     PetscGetVersion - Gets the PETSc version information in a string.
4 
5     Input Parameter:
6 .   len - length of the string
7 
8     Output Parameter:
9 .   version - version string
10 
11     Level: developer
12 
13     Fortran Note:
14     This routine is not supported in Fortran.
15 
16     Developer Note: The version information is also listed in
17 $    src/docs/tex/manual/intro.tex,
18 $    src/docs/tex/manual/manual.tex.
19 $    src/docs/website/index.html.
20 
21 .seealso: PetscGetProgramName()
22 
23 @*/
24 
25 #undef __FUNCT__
26 #define __FUNCT__ "PetscGetVersion"
27 PetscErrorCode PetscGetVersion(char version[], size_t len)
28 {
29   PetscErrorCode ierr;
30 #if (PETSC_VERSION_RELEASE == 1)
31   ierr = PetscSNPrintf(version,len,"Petsc Release Version %d.%d.%d, Patch %d, %s ",PETSC_VERSION_MAJOR,PETSC_VERSION_MINOR, PETSC_VERSION_SUBMINOR,PETSC_VERSION_PATCH,PETSC_VERSION_PATCH_DATE);CHKERRQ(ierr);
32 #else
33   ierr = PetscSNPrintf(version,len,"Petsc Development HG revision: %s  HG Date: %s",PETSC_VERSION_HG, PETSC_VERSION_DATE_HG);CHKERRQ(ierr);
34 #endif
35   PetscFunctionReturn(0);
36 }
37 
38 
39