# MatInitializePackage
This function initializes everything in the `Mat` package. It is called from `PetscDLLibraryRegister_petscmat()` when using dynamic libraries, and on the first call to `MatCreate()` when using shared or static libraries. 
## Synopsis
```
PetscErrorCode MatInitializePackage(void)
```



## See Also
 `Mat`, `PetscInitialize()`, `MatFinalizePackage()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/interface/dlregismat.c.html#MatInitializePackage">src/mat/interface/dlregismat.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/mat/interface/dlregismat.c)


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