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;

 11:   PetscInitialize(&argc,&argv,NULL,help);
 12:   PetscOptionsGetString(NULL,NULL,"-pkg",pkg,sizeof(pkg),NULL);
 13:   PetscHasExternalPackage(pkg, &has);
 14:   PetscPrintf(PETSC_COMM_WORLD, "PETSc has %s? %s\n", pkg, PetscBools[has]);
 15:   PetscStrcmp(pkg, "hdf5", &flg);
 16: #if defined(PETSC_HAVE_HDF5)
 18: #else
 20: #endif
 21:   PetscStrcmp(pkg, "parmetis", &flg);
 22: #if defined(PETSC_HAVE_PARMETIS)
 24: #else
 26: #endif
 27:   PetscStrcmp(pkg, "yaml", &flg);
 28: #if defined(PETSC_HAVE_YAML)
 30: #else
 32: #endif
 33:   PetscFinalize();
 34:   return 0;
 35: }

 37: /*TEST

 39:    test:
 40:       suffix: blaslapack
 41:       args: -pkg blaslapack
 42:    test:
 43:       suffix: hdf5
 44:       requires: hdf5
 45:       args: -pkg hdf5
 46:    test:
 47:       suffix: no-hdf5
 48:       requires: !hdf5
 49:       args: -pkg hdf5
 50:    test:
 51:       suffix: parmetis
 52:       requires: parmetis
 53:       args: -pkg parmetis
 54:    test:
 55:       suffix: no-parmetis
 56:       requires: !parmetis
 57:       args: -pkg parmetis
 58:    test:
 59:       suffix: yaml
 60:       requires: yaml
 61:       args: -pkg yaml
 62:    test:
 63:       suffix: no-yaml
 64:       requires: !yaml
 65:       args: -pkg yaml

 67: TEST*/