Subversion Repositories slepc-dev

Rev

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

Rev Author Line No. Line
1377 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
 
808 dsic.upv.es!antodo 11
import os
12
import sys
13
 
912 dsic.upv.es!antodo 14
import petscconf
923 dsic.upv.es!antodo 15
import log
912 dsic.upv.es!antodo 16
import check
808 dsic.upv.es!antodo 17
 
912 dsic.upv.es!antodo 18
def Check(conf):
1105 slepc 19
  log.Write('='*80)
20
  log.Println('Checking LAPACK library...')
808 dsic.upv.es!antodo 21
 
1341 slepc 22
  functions = ['laev2','gehrd','lanhs','lange','getri','hseqr','trexc','trevc','geevx','ggevx','gelqf','gesdd']
808 dsic.upv.es!antodo 23
 
912 dsic.upv.es!antodo 24
  if petscconf.SCALAR == 'real':
948 dsic.upv.es!jroman 25
    functions += ['orghr','syevr','sygvd','ormlq']
1091 slepc 26
    if petscconf.PRECISION == 'single':
27
      prefix = 's'
28
    else:
808 dsic.upv.es!antodo 29
      prefix = 'd'
30
  else:
948 dsic.upv.es!jroman 31
    functions += ['unghr','heevr','hegvd','unmlq']
1091 slepc 32
    if petscconf.PRECISION == 'single':
33
      prefix = 'c'
34
    else:
808 dsic.upv.es!antodo 35
      prefix = 'z'
36
 
37
  missing = []
38
  conf.write('SLEPC_MISSING_LAPACK =')
899 dsic.upv.es!antodo 39
 
808 dsic.upv.es!antodo 40
  for i in functions:
41
    f =  '#if defined(PETSC_HAVE_FORTRAN_UNDERSCORE) || defined(PETSC_BLASLAPACK_UNDERSCORE)\n'
42
    f += prefix + i + '_\n'
43
    f += '#elif defined(PETSC_HAVE_FORTRAN_CAPS)\n'
816 dsic.upv.es!antodo 44
    f += prefix.upper() + i.upper() + '\n'
808 dsic.upv.es!antodo 45
    f += '#else\n'
46
    f += prefix + i + '\n'
47
    f += '#endif\n'
48
 
923 dsic.upv.es!antodo 49
    log.Write('=== Checking LAPACK '+prefix+i+' function...')
912 dsic.upv.es!antodo 50
    if not check.Link([f],[],[]):
808 dsic.upv.es!antodo 51
      missing.append(prefix + i)
52
      conf.write(' -DSLEPC_MISSING_LAPACK_' + i.upper())
899 dsic.upv.es!antodo 53
 
54
 
1439 slepc 55
  functions = ['stevr','bdsdc']
1091 slepc 56
  if petscconf.PRECISION == 'single':
1439 slepc 57
    prefix = 's'
1091 slepc 58
  else:
1439 slepc 59
    prefix = 'd'
899 dsic.upv.es!antodo 60
 
61
  for i in functions:
62
    f =  '#if defined(PETSC_HAVE_FORTRAN_UNDERSCORE) || defined(PETSC_BLASLAPACK_UNDERSCORE)\n'
1439 slepc 63
    f += prefix + i + '_\n'
899 dsic.upv.es!antodo 64
    f += '#elif defined(PETSC_HAVE_FORTRAN_CAPS)\n'
1439 slepc 65
    f += prefix.upper() + i.upper() + '\n'
899 dsic.upv.es!antodo 66
    f += '#else\n'
1439 slepc 67
    f += prefix + i + '\n'
899 dsic.upv.es!antodo 68
    f += '#endif\n'
69
 
923 dsic.upv.es!antodo 70
    log.Write('=== Checking LAPACK '+i+' function...')
912 dsic.upv.es!antodo 71
    if not check.Link([f],[],[]):
1442 slepc 72
      missing.append(prefix + i)
899 dsic.upv.es!antodo 73
      conf.write(' -DSLEPC_MISSING_LAPACK_' + i.upper())
74
 
808 dsic.upv.es!antodo 75
  conf.write('\n')
948 dsic.upv.es!jroman 76
  return missing