Actual source code: ex56.c
2: static char help[] = "Tests PetscHasExternalPackage().\n\n";
4: #include <petscsys.h>
6: int main(int argc, char **argv)
7: {
8: char pkg[128] = "hdf5";
9: PetscBool has, flg;
12: PetscInitialize(&argc, &argv, NULL, help);
13: PetscOptionsGetString(NULL, NULL, "-pkg", pkg, sizeof(pkg), NULL);
14: PetscHasExternalPackage(pkg, &has);
15: PetscPrintf(PETSC_COMM_WORLD, "PETSc has %s? %s\n", pkg, PetscBools[has]);
16: PetscStrcmp(pkg, "hdf5", &flg);
17: #if defined(PETSC_HAVE_HDF5)
19: #else
21: #endif
22: PetscStrcmp(pkg, "parmetis", &flg);
23: #if defined(PETSC_HAVE_PARMETIS)
25: #else
27: #endif
28: PetscStrcmp(pkg, "yaml", &flg);
29: #if defined(PETSC_HAVE_YAML)
31: #else
33: #endif
34: PetscFinalize();
35: return 0;
36: }
38: /*TEST
40: test:
41: suffix: blaslapack
42: args: -pkg blaslapack
43: test:
44: suffix: hdf5
45: requires: hdf5
46: args: -pkg hdf5
47: test:
48: suffix: no-hdf5
49: requires: !hdf5
50: args: -pkg hdf5
51: test:
52: suffix: parmetis
53: requires: parmetis
54: args: -pkg parmetis
55: test:
56: suffix: no-parmetis
57: requires: !parmetis
58: args: -pkg parmetis
59: test:
60: suffix: yaml
61: requires: yaml
62: args: -pkg yaml
63: test:
64: suffix: no-yaml
65: requires: !yaml
66: args: -pkg yaml
68: TEST*/