Subversion Repositories slepc-dev

Rev

Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1377 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
1377 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/>.
1377 slepc 19
#  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
20
#
21
 
808 dsic.upv.es!antodo 22
import os
23
import sys
24
 
912 dsic.upv.es!antodo 25
import petscconf
923 dsic.upv.es!antodo 26
import log
912 dsic.upv.es!antodo 27
import check
808 dsic.upv.es!antodo 28
 
912 dsic.upv.es!antodo 29
def Check(conf):
1105 slepc 30
  log.Write('='*80)
31
  log.Println('Checking LAPACK library...')
808 dsic.upv.es!antodo 32
 
1530 slepc 33
  # LAPACK standard functions
1848 antodo 34
  l = ['laev2','gehrd','lanhs','lange','getri','hseqr','trexc','trevc','geevx','ggevx','gelqf','gesdd','tgexc','gges']
808 dsic.upv.es!antodo 35
 
1530 slepc 36
  # LAPACK functions with different real and complex versions
912 dsic.upv.es!antodo 37
  if petscconf.SCALAR == 'real':
1549 slepc 38
    l += ['orghr','syevr','sygvd','ormlq']
1091 slepc 39
    if petscconf.PRECISION == 'single':
40
      prefix = 's'
41
    else:
808 dsic.upv.es!antodo 42
      prefix = 'd'
43
  else:
1544 slepc 44
    l += ['unghr','heevr','hegvd','unmlq','ungtr','hetrd']
1091 slepc 45
    if petscconf.PRECISION == 'single':
46
      prefix = 'c'
47
    else:
808 dsic.upv.es!antodo 48
      prefix = 'z'
1530 slepc 49
 
50
  # add prefix to LAPACK names  
51
  functions = []
52
  for i in l:
53
    functions.append(prefix + i)
54
 
55
  # LAPACK functions which are always used in real version
56
  if petscconf.PRECISION == 'single':
1793 antodo 57
    functions += ['sstevr','sbdsdc','ssteqr','sorgtr','ssytrd','slamch','slag2']
1530 slepc 58
  else:
1793 antodo 59
    functions += ['dstevr','dbdsdc','dsteqr','dorgtr','dsytrd','dlamch','dlag2']
1530 slepc 60
 
61
  # check for all functions at once
62
  all = []
808 dsic.upv.es!antodo 63
  for i in functions:
1554 slepc 64
    f =  '#if defined(PETSC_BLASLAPACK_UNDERSCORE)\n'
1530 slepc 65
    f += i + '_\n'
1554 slepc 66
    f += '#elif defined(PETSC_BLASLAPACK_CAPS) || defined(PETSC_BLASLAPACK_STDCALL)\n'
1530 slepc 67
    f += i.upper() + '\n'
808 dsic.upv.es!antodo 68
    f += '#else\n'
1530 slepc 69
    f += i + '\n'
808 dsic.upv.es!antodo 70
    f += '#endif\n'
1530 slepc 71
    all.append(f)
899 dsic.upv.es!antodo 72
 
1530 slepc 73
  log.Write('=== Checking all LAPACK functions...')
74
  if check.Link(all,[],[]):
75
    return []
899 dsic.upv.es!antodo 76
 
1530 slepc 77
  # check functions one by one
78
  missing = []
79
  conf.write('SLEPC_MISSING_LAPACK =')
899 dsic.upv.es!antodo 80
  for i in functions:
1554 slepc 81
    f =  '#if defined(PETSC_BLASLAPACK_UNDERSCORE)\n'
1530 slepc 82
    f += i + '_\n'
1554 slepc 83
    f += '#elif defined(PETSC_BLASLAPACK_CAPS) || defined(PETSC_BLASLAPACK_STDCALL)\n'
1530 slepc 84
    f += i.upper() + '\n'
899 dsic.upv.es!antodo 85
    f += '#else\n'
1530 slepc 86
    f += i + '\n'
899 dsic.upv.es!antodo 87
    f += '#endif\n'
1530 slepc 88
 
923 dsic.upv.es!antodo 89
    log.Write('=== Checking LAPACK '+i+' function...')
912 dsic.upv.es!antodo 90
    if not check.Link([f],[],[]):
1530 slepc 91
      missing.append(i)
92
      conf.write(' -DSLEPC_MISSING_LAPACK_' + i[1:].upper())
93
 
808 dsic.upv.es!antodo 94
  conf.write('\n')
948 dsic.upv.es!jroman 95
  return missing