# PetscGetVersionNumber
Gets the PETSc version information from the library 
## Synopsis
```
PetscErrorCode PetscGetVersionNumber(PetscInt *major, PetscInt *minor, PetscInt *subminor, PetscInt *release)
```
Not collective


## Output Parameters

- ***major -*** the major version (optional, pass NULL if not requested)
- ***minor -*** the minor version (optional, pass NULL if not requested)
- ***subminor -*** the subminor version (patch number)  (optional, pass NULL if not requested)
- ***release -*** indicates the library is from a release, not random git repository  (optional, pass NULL if not requested)





## Notes
The C macros `PETSC_VERSION_MAJOR`, `PETSC_VERSION_MINOR`, `PETSC_VERSION_SUBMINOR`, `PETSC_VERSION_RELEASE` provide the information at
compile time. This can be used to confirm that the shared library being loaded at runtime has the appropriate version updates.

This function can be called before `PetscInitialize()`


## See Also
 `PetscGetProgramName()`, `PetscGetVersion()`, `PetscInitialize()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/objects/version.c.html#PetscGetVersionNumber">src/sys/objects/version.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/tutorials/ex17.c.html">src/sys/tutorials/ex17.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/tutorials/ex17f.F90.html">src/sys/tutorials/ex17f.F90.html</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/objects/version.c)


[Index of all Sys routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
