Actual source code: ex33.c
1: /*
2: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
3: SLEPc - Scalable Library for Eigenvalue Problem Computations
4: Copyright (c) 2002-, Universitat Politecnica de Valencia, Spain
6: This file is part of SLEPc.
7: SLEPc is distributed under a 2-clause BSD license (see LICENSE).
8: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
9: */
11: static char help[] = "Demonstrates SlepcGetVersionNumber().\n\n";
13: #include <slepcsys.h>
15: int main(int argc,char **argv)
16: {
17: char version[128];
18: const char *config;
19: PetscInt major,minor,subminor;
20: PetscBool verbose;
22: PetscFunctionBeginUser;
23: PetscCall(SlepcInitialize(&argc,&argv,NULL,help));
24: PetscCall(PetscPrintf(PETSC_COMM_WORLD,"Checking SLEPc version.\n"));
26: PetscCall(SlepcGetVersion(version,sizeof(version)));
27: PetscCall(PetscOptionsHasName(NULL,NULL,"-verbose",&verbose));
28: if (verbose) PetscCall(PetscPrintf(PETSC_COMM_WORLD,"Version information:\n%s\n",version));
30: PetscCall(SlepcGetVersionNumber(&major,&minor,&subminor,NULL));
31: PetscCheck(major==SLEPC_VERSION_MAJOR,PETSC_COMM_WORLD,PETSC_ERR_PLIB,"Library major %" PetscInt_FMT " does not equal include %d",major,SLEPC_VERSION_MAJOR);
32: PetscCheck(minor==SLEPC_VERSION_MINOR,PETSC_COMM_WORLD,PETSC_ERR_PLIB,"Library minor %" PetscInt_FMT " does not equal include %d",minor,SLEPC_VERSION_MINOR);
33: PetscCheck(subminor==SLEPC_VERSION_SUBMINOR,PETSC_COMM_WORLD,PETSC_ERR_PLIB,"Library subminor %" PetscInt_FMT " does not equal include %d",subminor,SLEPC_VERSION_SUBMINOR);
35: PetscCall(SlepcGetConfiguration(&config));
37: PetscCall(SlepcFinalize());
38: return 0;
39: }
41: /*TEST
43: test:
44: suffix: 1
46: TEST*/