Actual source code: ex33.c
slepc-3.10.1 2018-10-23
Report Typos and Errors

      1: /*
      2:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      3:    SLEPc - Scalable Library for Eigenvalue Problem Computations
      4:    Copyright (c) 2002-2018, 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: {
     18:   char           version[128];
     19:   PetscInt       major,minor,subminor;
     20:   PetscBool      verbose;

     22:   SlepcInitialize(&argc,&argv,(char*)0,help);if (ierr) return ierr;
     23:   PetscPrintf(PETSC_COMM_WORLD,"Checking SLEPc version.\n");

     25:   SlepcGetVersion(version,sizeof(version));
     26:   PetscOptionsHasName(NULL,NULL,"-verbose",&verbose);
     27:   if (verbose) {
     28:     PetscPrintf(PETSC_COMM_WORLD,"Version information:\n%s\n",version);
     29:   }

     31:   SlepcGetVersionNumber(&major,&minor,&subminor,NULL);
     32:   if (major != SLEPC_VERSION_MAJOR) SETERRQ2(PETSC_COMM_WORLD,PETSC_ERR_PLIB,"Library major %d does not equal include %d",(int)major,SLEPC_VERSION_MAJOR);
     33:   if (minor != SLEPC_VERSION_MINOR) SETERRQ2(PETSC_COMM_WORLD,PETSC_ERR_PLIB,"Library minor %d does not equal include %d",(int)minor,SLEPC_VERSION_MINOR);
     34:   if (subminor != SLEPC_VERSION_SUBMINOR) SETERRQ2(PETSC_COMM_WORLD,PETSC_ERR_PLIB,"Library subminor %d does not equal include %d",(int)subminor,SLEPC_VERSION_SUBMINOR);

     36:   SlepcFinalize();
     37:   return ierr;
     38: }

     40: /*TEST

     42:    test:
     43:       suffix: 1

     45: TEST*/