| 1527 |
slepc |
1 |
#
|
|
|
2 |
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
3 |
# SLEPc - Scalable Library for Eigenvalue Problem Computations
|
|
|
4 |
# Copyright (c) 2002-2007, Universidad Politecnica de Valencia, Spain
|
|
|
5 |
#
|
|
|
6 |
# This file is part of SLEPc. See the README file for conditions of use
|
|
|
7 |
# and additional information.
|
|
|
8 |
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
9 |
#
|
|
|
10 |
|
|
|
11 |
import os
|
|
|
12 |
import sys
|
|
|
13 |
|
|
|
14 |
def Load(petscdir):
|
|
|
15 |
global VERSION,RELEASE
|
|
|
16 |
try:
|
|
|
17 |
f = open(os.sep.join([petscdir,'include','petscversion.h']))
|
|
|
18 |
for l in f.readlines():
|
|
|
19 |
l = l.split()
|
|
|
20 |
if len(l) == 3:
|
|
|
21 |
if l[1] == 'PETSC_VERSION_RELEASE':
|
|
|
22 |
RELEASE = l[2]
|
|
|
23 |
if l[1] == 'PETSC_VERSION_MAJOR':
|
|
|
24 |
major = l[2]
|
|
|
25 |
elif l[1] == 'PETSC_VERSION_MINOR':
|
|
|
26 |
minor = l[2]
|
|
|
27 |
elif l[1] == 'PETSC_VERSION_SUBMINOR':
|
|
|
28 |
subminor = l[2]
|
|
|
29 |
f.close()
|
|
|
30 |
VERSION = major + '.' + minor + '.' + subminor
|
|
|
31 |
except:
|
|
|
32 |
sys.exit('ERROR: file error while reading PETSC version')
|