| if petscconf.PRECISION == 'single': |
| sys.exit('ERROR: PRIMME does not support single precision.') |
| functions = ['primme_set_method','primme_Free','primme_initialize'] |
| if petscconf.SCALAR == 'real': |
| functions += ['dprimme'] |
| include = 'DPRIMME' |
| if not libs: |
| libs = ['-ldprimme'] |
| else: |
| functions += ['zprimme'] |
| include = 'ZPRIMME' |
| if not libs: |
| libs = ['-lzprimme'] |
| functions_base = ['primme_set_method','primme_Free','primme_initialize'] |
| if directory: |
| dirs = [directory] |
| else: |
| dirs = check.GenerateGuesses('Primme') |
| include = 'PRIMMESRC/COMMONSRC' |
| if not libs: |
| libs = ['-lprimme'] |
| if petscconf.SCALAR == 'real': |
| functions = functions_base + ['dprimme'] |
| else: |
| functions = functions_base + ['zprimme'] |
| for d in dirs: |
| if d: |
| l = ['-L' + d] + libs |
| conf.write('SLEPC_HAVE_PRIMME = -DSLEPC_HAVE_PRIMME\n') |
| conf.write('PRIMME_LIB =' + str.join(' ', l) + '\n') |
| conf.write('PRIMME_FLAGS =' + str.join(' ', f) + '\n') |
| return l+f |
| return l+f |
| log.Println('ERROR: Unable to link with PRIMME library') |
| print 'ERROR: In directories',dirs |
| print 'ERROR: With flags',libs, |
| log.Exit('') |
| log.Println('ERROR: Unable to link with PRIMME library') |
| print 'ERROR: In directories',dirs |
| print 'ERROR: With flags',libs, |
| log.Exit('') |
| cfile.write(code) |
| cfile.close() |
| (result, output) = commands.getstatusoutput(petscconf.MAKE + ' checklink TESTFLAGS="'+str.join(' ',flags)+'"') |
| if os.path.exists('checklink.o'): |
| os.unlink('checklink.o') |
| os.chdir(os.pardir) |
| if result: |
| return (0,code + output) |
| elif i.startswith('--with-primme-dir'): |
| primmedir = i.split('=')[1] |
| haveprimme = 1 |
| elif i.startswith('--with-primme'): |
| haveprimme = not i.endswith('=0') |
| elif i.startswith('--with-primme-flags='): |
| primmelibs = i.split('=')[1].split(',') |
| haveprimme = 1 |
| elif i.startswith('--with-primme'): |
| haveprimme = not i.endswith('=0') |
| elif i.startswith('--h') or i.startswith('-h') or i.startswith('-?'): |
| print 'SLEPc Configure Help' |
| print '-'*80 |