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
 
1530 slepc 22
  # LAPACK standard functions
23
  l = ['laev2','gehrd','lanhs','lange','getri','hseqr','trexc','trevc','geevx','ggevx','gelqf','gesdd']
808 dsic.upv.es!antodo 24
 
1530 slepc 25
  # LAPACK functions with different real and complex versions
912 dsic.upv.es!antodo 26
  if petscconf.SCALAR == 'real':
1530 slepc 27
    l += ['orghr','syevr','sygvd','ormlq']
1091 slepc 28
    if petscconf.PRECISION == 'single':
29
      prefix = 's'
30
    else:
808 dsic.upv.es!antodo 31
      prefix = 'd'
32
  else:
1530 slepc 33
    l += ['unghr','heevr','hegvd','unmlq']
1091 slepc 34
    if petscconf.PRECISION == 'single':
35
      prefix = 'c'
36
    else:
808 dsic.upv.es!antodo 37
      prefix = 'z'
1530 slepc 38
 
39
  # add prefix to LAPACK names  
40
  functions = []
41
  for i in l:
42
    functions.append(prefix + i)
43
 
44
  # LAPACK functions which are always used in real version
45
  if petscconf.PRECISION == 'single':
46
    functions += ['sstevr','sbdsdc']
47
  else:
48
    functions += ['dstevr','dbdsdc']
49
 
50
  # check for all functions at once
51
  all = []
808 dsic.upv.es!antodo 52
  for i in functions:
53
    f =  '#if defined(PETSC_HAVE_FORTRAN_UNDERSCORE) || defined(PETSC_BLASLAPACK_UNDERSCORE)\n'
1530 slepc 54
    f += i + '_\n'
808 dsic.upv.es!antodo 55
    f += '#elif defined(PETSC_HAVE_FORTRAN_CAPS)\n'
1530 slepc 56
    f += i.upper() + '\n'
808 dsic.upv.es!antodo 57
    f += '#else\n'
1530 slepc 58
    f += i + '\n'
808 dsic.upv.es!antodo 59
    f += '#endif\n'
1530 slepc 60
    all.append(f)
899 dsic.upv.es!antodo 61
 
1530 slepc 62
  log.Write('=== Checking all LAPACK functions...')
63
  if check.Link(all,[],[]):
64
    return []
899 dsic.upv.es!antodo 65
 
1530 slepc 66
  # check functions one by one
67
  missing = []
68
  conf.write('SLEPC_MISSING_LAPACK =')
899 dsic.upv.es!antodo 69
  for i in functions:
70
    f =  '#if defined(PETSC_HAVE_FORTRAN_UNDERSCORE) || defined(PETSC_BLASLAPACK_UNDERSCORE)\n'
1530 slepc 71
    f += i + '_\n'
899 dsic.upv.es!antodo 72
    f += '#elif defined(PETSC_HAVE_FORTRAN_CAPS)\n'
1530 slepc 73
    f += i.upper() + '\n'
899 dsic.upv.es!antodo 74
    f += '#else\n'
1530 slepc 75
    f += i + '\n'
899 dsic.upv.es!antodo 76
    f += '#endif\n'
1530 slepc 77
 
923 dsic.upv.es!antodo 78
    log.Write('=== Checking LAPACK '+i+' function...')
912 dsic.upv.es!antodo 79
    if not check.Link([f],[],[]):
1530 slepc 80
      missing.append(i)
81
      conf.write(' -DSLEPC_MISSING_LAPACK_' + i[1:].upper())
82
 
808 dsic.upv.es!antodo 83
  conf.write('\n')
948 dsic.upv.es!jroman 84
  return missing