| 1527 |
slepc |
1 |
#
|
|
|
2 |
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
| 1672 |
slepc |
3 |
# SLEPc - Scalable Library for Eigenvalue Problem Computations
|
| 2116 |
eromero |
4 |
# Copyright (c) 2002-2010, Universidad Politecnica de Valencia, Spain
|
| 1527 |
slepc |
5 |
#
|
| 1672 |
slepc |
6 |
# This file is part of SLEPc.
|
|
|
7 |
#
|
|
|
8 |
# SLEPc is free software: you can redistribute it and/or modify it under the
|
|
|
9 |
# terms of version 3 of the GNU Lesser General Public License as published by
|
|
|
10 |
# the Free Software Foundation.
|
|
|
11 |
#
|
|
|
12 |
# SLEPc is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
13 |
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
|
14 |
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
|
|
|
15 |
# more details.
|
|
|
16 |
#
|
|
|
17 |
# You should have received a copy of the GNU Lesser General Public License
|
|
|
18 |
# along with SLEPc. If not, see <http://www.gnu.org/licenses/>.
|
| 1527 |
slepc |
19 |
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
20 |
#
|
|
|
21 |
|
|
|
22 |
import os
|
|
|
23 |
import sys
|
|
|
24 |
|
|
|
25 |
def Load(petscdir):
|
|
|
26 |
global VERSION,RELEASE
|
|
|
27 |
try:
|
|
|
28 |
f = open(os.sep.join([petscdir,'include','petscversion.h']))
|
|
|
29 |
for l in f.readlines():
|
|
|
30 |
l = l.split()
|
|
|
31 |
if len(l) == 3:
|
|
|
32 |
if l[1] == 'PETSC_VERSION_RELEASE':
|
|
|
33 |
RELEASE = l[2]
|
|
|
34 |
if l[1] == 'PETSC_VERSION_MAJOR':
|
|
|
35 |
major = l[2]
|
|
|
36 |
elif l[1] == 'PETSC_VERSION_MINOR':
|
|
|
37 |
minor = l[2]
|
|
|
38 |
elif l[1] == 'PETSC_VERSION_SUBMINOR':
|
|
|
39 |
subminor = l[2]
|
|
|
40 |
f.close()
|
| 2121 |
jroman |
41 |
VERSION = major + '.' + minor
|
| 1527 |
slepc |
42 |
except:
|
|
|
43 |
sys.exit('ERROR: file error while reading PETSC version')
|