Commits

Jed Brown committed 3e01044 Merge

Merge branch 'knepley/builder-sharedlibrary-fix' into next

* knepley/builder-sharedlibrary-fix:
Builder: Conforming to PETSc log filename standard
Builder: Separate logs for different functions
Builder. Fix stupid mistake
Builder: Use sharedLinker for all shared library creation, Logging for shared library creation

Comments (0)

Files changed (2)

config/builder.py

      raise RuntimeError('You must provide a valid PETSC_ARCH')
    return arch
 
- def __init__(self):
+ def __init__(self, logname = 'make.log'):
    import RDict
    import os
 
    argDB.saveFilename = os.path.join(self.petscDir, arch, 'conf', 'RDict.db')
    argDB.load()
    script.Script.__init__(self, argDB = argDB)
-   self.logName = 'make.log'
+   self.logName = logname
    #self.log = sys.stdout
    return
 
 
  def linkShared(self, sharedLib, libDir, tmpDir):
    osName = sys.platform
+   self.logPrint('Making shared libraries for OS %s using language %s' % (osName, self.configInfo.setCompilers.language[-1]))
    # PCC_LINKER PCC_LINKER_FLAGS
-   linker      = self.configInfo.setCompilers.getLinker()
+   linker      = self.configInfo.setCompilers.getSharedLinker()
    linkerFlags = self.configInfo.setCompilers.getLinkerFlags()
    packageIncludes, packageLibs = self.getPackageInfo()
    extraLibs = self.configInfo.libraries.toStringNoDupes(self.configInfo.compilers.flibs+self.configInfo.compilers.cxxlibs+self.configInfo.compilers.LIBS.split(' '))+self.configInfo.CHUD.LIBS
          cmd += 'MACOSX_DEPLOYMENT_TARGET=10.5 '
        if self.configInfo.setCompilers.getLinkerFlags().find('-Wl,-commons,use_dylibs') > -1:
          flags += '-Wl,-commons,use_dylibs'
-       cmd += self.configInfo.setCompilers.getSharedLinker()+' -g  -dynamiclib -single_module -multiply_defined suppress -undefined dynamic_lookup '+flags+' -o '+sharedLib+' *.o -L'+libDir+' '+packageLibs+' '+sysLib+' '+extraLibs+' -lm -lc'
+       cmd += linker+' -g  -dynamiclib -single_module -multiply_defined suppress -undefined dynamic_lookup '+flags+' -o '+sharedLib+' *.o -L'+libDir+' '+packageLibs+' '+sysLib+' '+extraLibs+' -lm -lc'
      elif osName == 'cygwin':
        cmd = linker+' '+linkerFlags+' -shared -o '+sharedLib+' *.o '+externalLib
      else:
-       raise RuntimeError('Do not know how to make shared library for your crappy '+osName+' OS')
+       raise RuntimeError('Do not know how to make shared library for your '+osName+' OS')
      oldDir = os.getcwd()
      os.chdir(tmpDir)
      (output, error, status) = self.executeShellCommand(cmd, checkCommand = noCheckCommand, log=self.log)

config/builder2.py

 def buildExample(args):
   '''Build and link an example'''
   ret   = 0
-  maker = builder.PETScMaker()
+  maker = builder.PETScMaker('example.log')
   maker.setup()
   examples = []
   for f in args.files:
   '''Check that build is functional'''
   ret       = 0
   extraArgs = ' '+' '.join(args.args)
-  maker     = builder.PETScMaker()
+  maker     = builder.PETScMaker('example.log')
   maker.setup()
   # C test
   if len(args.files):
   '''Run complete regression suite'''
   ret   = 0
   gret  = 0
-  maker = builder.PETScMaker()
+  maker = builder.PETScMaker('examples.log')
   maker.setup()
   haltOnError = False