コード例 #1
0
ファイル: sowing.py プロジェクト: uesoft/petsc
 def buildFortranStubs(self):
     if hasattr(self.compilers, 'FC'):
         if self.argDB['with-batch'] and not hasattr(self, 'bfort'):
             self.logPrintBox(
                 'Batch build that could not generate bfort, skipping generating Fortran stubs\n \
                       you will need to copy them from some other system (src/fortran/auto)'
             )
         else:
             self.logWrite('           Running ' + self.bfort +
                           ' to generate fortran stubs\n')
             try:
                 import os, sys
                 sys.path.insert(
                     0,
                     os.path.abspath(
                         os.path.join('lib', 'petsc', 'bin', 'maint')))
                 import generatefortranstubs
                 del sys.path[0]
                 generatefortranstubs.main(self.petscdir.dir, self.bfort,
                                           self.petscdir.dir, 0)
                 if self.compilers.fortranIsF90:
                     generatefortranstubs.processf90interfaces(
                         self.petscdir.dir, 0)
                 self.framework.actions.addArgument(
                     'PETSc', 'File creation', 'Generated Fortran stubs')
             except RuntimeError, e:
                 raise RuntimeError(
                     '*******Error generating Fortran stubs: ' + str(e) +
                     '*******\n')
コード例 #2
0
 def buildFortranStubs(self):
   if hasattr(self.compilers, 'FC'):
     if self.framework.argDB['with-batch'] and not hasattr(self,'bfort'):
       self.logPrintBox('Batch build that could not generate bfort, skipping generating Fortran stubs\n \
                         you will need to copy them from some other system (src/fortran/auto)')
     else:     
       self.framework.log.write('           Running '+self.bfort+' to generate fortran stubs\n')
       try:
         import os,sys
         sys.path.insert(0, os.path.abspath(os.path.join('bin','maint')))
         import generatefortranstubs
         del sys.path[0]
         generatefortranstubs.main(self.bfort)
         self.framework.actions.addArgument('PETSc', 'File creation', 'Generated Fortran stubs')
       except RuntimeError, e:
         raise RuntimeError('*******Error generating Fortran stubs: '+str(e)+'*******\n')
コード例 #3
0
if haveprimme:
  primmelibs = primme.Check(slepcconf,slepcvars,cmake,tmpdir,primmedir,primmelibs)
if havefeast:
  feastlibs = feast.Check(slepcconf,slepcvars,cmake,tmpdir,feastdir,feastlibs)
if getblopex:
  blopexlibs = blopex.Install(slepcconf,slepcvars,cmake,tmpdir,blopexurl,archdir)
  haveblopex = 1

# Check for missing LAPACK functions
missing = lapack.Check(slepcconf,slepcvars,cmake,tmpdir)

# Make Fortran stubs if necessary
if slepcversion.ISREPO and hasattr(petscconf,'FC'):
  try:
    import generatefortranstubs
    generatefortranstubs.main(slepcdir,petscconf.BFORT,os.getcwd(),0)
    generatefortranstubs.processf90interfaces(slepcdir,0)
    for f in os.listdir(os.sep.join([slepcdir,'include/finclude/ftn-auto'])):
      if '-tmpdir' in f: shutil.rmtree(os.sep.join([slepcdir,'include/finclude/ftn-auto/',f]))
      if 'petsc' in f: os.remove(os.sep.join([slepcdir,'include/finclude/ftn-auto/',f]))
  except AttributeError:
    sys.exit('ERROR: cannot generate Fortran stubs; try configuring PETSc with --download-sowing or use a mercurial version of PETSc')

# CMake stuff
cmake.write('set (SLEPC_PACKAGE_LIBS "${ARPACK_LIB}" "${BLZPACK_LIB}" "${TRLAN_LIB}" "${PRIMME_LIB}" "${FEAST_LIB}" "${BLOPEX_LIB}" )\n')
cmake.write('set (SLEPC_PACKAGE_INCLUDES "${PRIMME_INCLUDE}")\n')
cmake.write('find_library (PETSC_LIB petsc HINTS ${PETSc_BINARY_DIR}/lib )\n')
cmake.write('''
if (NOT PETSC_LIB) # Interpret missing libpetsc to mean that PETSc was built --with-single-library=0
  set (PETSC_LIB "")
  foreach (pkg sys vec mat dm ksp snes ts tao)
コード例 #4
0
ファイル: configure.py プロジェクト: firedrakeproject/slepc
bfort = petsc.bfort
if sowing.downloadpackage:
    bfort = sowing.Install(archdir, petsc.make)

if slepc.isrepo and petsc.fortran:
    try:
        if not os.path.exists(bfort):
            bfort = os.path.join(archdir, 'bin', 'bfort')
        if not os.path.exists(bfort):
            bfort = sowing.Install(archdir, petsc.make)
        log.NewSection('Generating Fortran stubs...')
        log.write('Using BFORT=' + bfort)
        sys.path.insert(
            0, os.path.abspath(os.path.join('lib', 'slepc', 'bin', 'maint')))
        import generatefortranstubs
        generatefortranstubs.main(slepc.dir, bfort, os.getcwd(), 0)
        generatefortranstubs.processf90interfaces(slepc.dir, 0)
    except:
        log.Exit(
            'ERROR: Try configuring with --download-sowing or use a git version of PETSc'
        )

if bfort != petsc.bfort:
    slepcvars.write('BFORT = ' + bfort + '\n')

# Finally we can close the slepcvariables file
slepcvars.close()

# Print summary
log.NewSection('')
log.Println('')
コード例 #5
0
if havefeast:
    feastlibs = feast.Check(slepcconf, slepcvars, cmake, tmpdir, feastdir,
                            feastlibs)
if getblopex:
    blopexlibs = blopex.Install(slepcconf, slepcvars, cmake, tmpdir, blopexurl,
                                archdir)
    haveblopex = 1

# Check for missing LAPACK functions
missing = lapack.Check(slepcconf, slepcvars, cmake, tmpdir)

# Make Fortran stubs if necessary
if slepcversion.ISREPO and hasattr(petscconf, 'FC'):
    try:
        import generatefortranstubs
        generatefortranstubs.main(slepcdir, petscconf.BFORT, os.getcwd(), 0)
        generatefortranstubs.processf90interfaces(slepcdir, 0)
        for f in os.listdir(
                os.sep.join([slepcdir, 'include/finclude/ftn-auto'])):
            if '-tmpdir' in f:
                shutil.rmtree(
                    os.sep.join([slepcdir, 'include/finclude/ftn-auto/', f]))
            if 'petsc' in f:
                os.remove(
                    os.sep.join([slepcdir, 'include/finclude/ftn-auto/', f]))
    except AttributeError:
        sys.exit(
            'ERROR: cannot generate Fortran stubs; try configuring PETSc with --download-sowing or use a mercurial version of PETSc'
        )

# CMake stuff