# PetscHasExternalPackage
Determine whether PETSc has been configured with the given package 
## Synopsis
```
#include "petscsys.h"   
PetscErrorCode PetscHasExternalPackage(const char pkg[], PetscBool *has)
```
Not Collective


## Input Parameters

- ***pkg -*** external package name



## Output Parameters

- ***has -*** `PETSC_TRUE` if PETSc is configured with the given package, else `PETSC_FALSE`.





## Notes
This is basically an alternative for PETSC_HAVE_XXX whenever a preprocessor macro is not available/desirable, e.g. in Python.

The external package name pkg is e.g. "hdf5", "yaml", "parmetis".
It should correspond to the name listed in  ./configure --help  or e.g. in PetscViewerType, MatPartitioningType, MatSolverType.

The lookup is case insensitive, i.e. looking for "HDF5" or "hdf5" is the same.


## See Also
 `PetscViewerType`, `MatPartitioningType`, `MatSolverType`

## Level
intermediate

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


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/objects/package.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)  
