Commits

Peter Brune committed 578f55a Merge with conflicts

Merge branch 'master' into madams/gamg-destroy

Conflicts:
src/ksp/pc/impls/gamg/gamg.c

Comments (0)

Files changed (1049)

bin/maint/buildtest

 endif
 set GCOV=`grep PETSC_USE_GCOV $nPETSC_DIR/$PETSC_ARCH/include/petscconf.h`
 
-if ( "${BUILDER}" == "yes" ) then
-  env PETSC_ARCH=$PETSC_ARCH PETSC_DIR=$nPETSC_DIR ./config/builder2.py clean >>& build.log
-  env PETSC_ARCH=$PETSC_ARCH PETSC_DIR=$nPETSC_DIR ./config/builder2.py build >>& build.log
-else if ( "${GCOV}" != "" ) then
+if ( "${GCOV}" != "" ) then
   make PETSC_ARCH=$PETSC_ARCH PETSC_DIR=$nPETSC_DIR  all-legacy test >>& build.log
 else
   make PETSC_ARCH=$PETSC_ARCH PETSC_DIR=$nPETSC_DIR  all test >>& build.log

bin/maint/generatefortranstubs.py

     (status,output) = commands.getstatusoutput(cmd)
     if status:
       raise RuntimeError('Error running bfort\n'+cmd+'\n'+output)
-    FixDir(petscdir,outdir,verbose)
+    try:
+      FixDir(petscdir,outdir,verbose)
+    except:
+      print 'Error! with FixDir('+outdir+')'
 
   # remove from list of subdirectories all directories without source code
   rmnames=[]

bin/maint/getinterfaces.py

   classes['PetscBinary'] = {}
   classes['PetscOptions'] = {}
   classes['PetscMalloc'] = {}
-  classes['PetscHMPI'] = {}
   classes['PetscToken'] = {}
   for i in args:
     getclasses(i)
+#!/usr/bin/env python
+import os, sys
+import json
+try:
+  import requests
+except:
+  raise RuntimeError('Run "sudo easy_install requests" before running this script')
+
+
+#
+#  If requests does not exist use sudo easy_install requests to install it.
+#
+host = os.getenv('SAWS_HOST')
+if not host:
+  host = 'localhost'
+port = os.getenv('SAWS_PORT')
+if not port:
+  port = '8080'
+url = 'http://'+host+':'+port+'/SAWs'
+
+
+r = requests.get(url)
+j = json.loads(r.content)
+
+#  Example that access the functions in the stack
+j = j['directories']['SAWs_ROOT_DIRECTORY']['directories']['PETSc']['directories']['Stack']['variables']['functions']['data']
+
+print j
+
+

bin/saws/getSAWs.bash

+#!/bin/bash
+#
+#  getSAWs.bash [dir1[/dir2[/variablename]]]
+#
+#
+if [ "${SAWS_HOST}foo" == "foo" ]; then export SAWS_HOST=localhost; fi
+if [ "${SAWS_PORT}foo" == "foo" ]; then export SAWS_PORT=8080; fi
+if [ $# == 1 ]; then
+  export mem=$1;
+else 
+  export mem="*";
+fi
+
+curl --silent --show-error "${SAWS_HOST}:${SAWS_PORT}/SAWs/${mem}"

bin/saws/getStack.bash

+#!/bin/bash
+#
+#  Returns the SAWS published PETSc stack one function per line
+#
+which jshon > /dev/null
+if [ $? != 0 ] ; then
+  echo "You must install jshon before using this app"
+  exit 1
+fi
+
+${PETSC_DIR}/bin/saws/getSAWs.bash PETSc/Stack | jshon -e directories -e Stack -e variables -e functions -e data 
+#
+
+
 	@echo "Building PETSc using GNU Make with ${MAKE_NP} build threads"
 	@echo "=========================================="
 	@cd ${PETSC_DIR} && ${OMAKE_PRINTDIR} -f gmakefile -j ${MAKE_NP} V=${V}
-	@if [ "${BUILDSHAREDLIB}" = "yes" -a "${DSYMUTIL}" != "true" ]; then \
-        echo "Running ${DSYMUTIL} on ${SHLIBS}";\
-        for LIBNAME in ${SHLIBS}; do ${DSYMUTIL} ${INSTALL_LIB_DIR}/$$LIBNAME.${SL_LINKER_SUFFIX}; done; fi
 	@echo "========================================="
 
 # Does nothing; needed for some rules that require actions.
         if [ $${mypwd} != $${newpwd} ]; then \
 	  ${OMAKE}  PETSC_ARCH=${PETSC_ARCH}  chk_petscdir;\
         fi
-	${PETSC_COMPILE_SINGLE} ${PWD}/$<
+	${PETSC_COMPILE_SINGLE} `pwd`/$<
 	@if [ "${PETSCPORTABLE}" != "" ]; then \
           ${PYTHON} ${PETSC_DIR}/bin/portabilitycheck.py $*.o ; \
         fi
 #
 #   Compiles CUDA code
 .cu.o:
-	${PETSC_CUCOMPILE_SINGLE} ${PWD}/$<
+	${PETSC_CUCOMPILE_SINGLE} `pwd`/$<
 
 .cu.a:
-	${PETSC_CUCOMPILE_SINGLE} ${PWD}/$<
+	${PETSC_CUCOMPILE_SINGLE} `pwd`/$<
 	-${AR} ${AR_FLAGS} ${LIBNAME} $*.o
 	-if test -n "${LIBTOOL}"; then ${AR} ${AR_FLAGS} ${LT_LIBNAME} $*.lo; fi
 	-${RM} $*.o $*.lo
 
 .c.a .cpp.a .cc.a .C.a:
-	-${PETSC_COMPILE_SINGLE} ${PWD}/$<
+	-${PETSC_COMPILE_SINGLE} `pwd`/$<
 	-${AR} ${AR_FLAGS} ${LIBNAME} $*.o
 	-if test -n "${LIBTOOL}"; then ${AR} ${AR_FLAGS} ${LT_LIBNAME} $*.lo; fi
 	-${RM} $*.o $*.lo
           grep -v "IPO Error: unresolved" | \
 	  grep -v "is being replaced by a real definition" | \
           grep -v "may result in errors or" | \
+          grep -v "clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated" | \
 	  egrep -i '(Error|warning|Can|Unresolved)' >> /dev/null;\
 	  if [ "$$?" != 1 ]; then \
           printf ${PETSC_TEXT_HILIGHT}"*******************Error detected during compile or link!*******************\n";\
 testexamples_C_NoComplex: ${TESTEXAMPLES_C_NOCOMPLEX}
 testexamples_DATAFILESPATH: ${TESTEXAMPLES_DATAFILESPATH}
 
+testexamples_F90_DataTypes: ${TESTEXAMPLES_F90_DATATYPES}
 testexamples_Fortran_NoComplex: ${TESTEXAMPLES_FORTRAN_NOCOMPLEX}
 testexamples_Fortran_MPIUni: ${TESTEXAMPLES_FORTRAN_MPIUNI}
 testexamples_Fortran_Complex: ${TESTEXAMPLES_FORTRAN_COMPLEX}
 testexamples_SPAI: ${TESTEXAMPLES_SPAI}
 testexamples_ADIFOR: ${TESTEXAMPLES_ADIFOR}
 testexamples_FFTW: ${TESTEXAMPLES_FFTW}
-testexamples_AMS: ${TESTEXAMPLES_AMS}
+testexamples_SAWS: ${TESTEXAMPLES_SAWS}
 testexamples_VALGRIND: ${TESTEXAMPLES_VALGRIND}
 testexamples_MATLAB: ${TESTEXAMPLES_MATLAB}
 testexamples_MUMPS: ${TESTEXAMPLES_MUMPS}
 buildexamples_DATAFILESPATH:
 	-@${OMAKE} testexamples_DATAFILESPATH TESTEXAMPLES_DATAFILESPATH=`echo ${TESTEXAMPLES_DATAFILESPATH} | sed s/runex[0-9]*[a-z0-9_]*//g`
 
+buildexamples_F90_DataTypes:
+	-@${OMAKE} testexamples_F90_DataTypes TESTEXAMPLES_F90_DATATYPES=`echo ${TESTEXAMPLES_F90_DATATYPES} | sed s/runex[0-9]*[a-z0-9_]*//g`
 buildexamples_Fortran_NoComplex:
 	-@${OMAKE} testexamples_Fortran_NoComplex TESTEXAMPLES_FORTRAN_NOCOMPLEX=`echo ${TESTEXAMPLES_FORTRAN_NOCOMPLEX} | sed s/runex[0-9]*[a-z0-9_]*//g`
 buildexamples_Fortran_MPIUni:
 	-@${OMAKE} testexamples_ADIFOR TESTEXAMPLES_ADIFOR=`echo ${TESTEXAMPLES_ADIFOR} | sed s/runex[0-9]*[a-z0-9_]*//g`
 buildexamples_FFTW:
 	-@${OMAKE} testexamples_FFTW TESTEXAMPLES_FFTW=`echo ${TESTEXAMPLES_FFTW} | sed s/runex[0-9]*[a-z0-9_]*//g`
-buildexamples_AMS:
-	-@${OMAKE} testexamples_AMS TESTEXAMPLES_AMS=`echo ${TESTEXAMPLES_AMS} | sed s/runex[0-9]*[a-z0-9_]*//g`
+buildexamples_SAWS:
+	-@${OMAKE} testexamples_SAWS TESTEXAMPLES_SAWS=`echo ${TESTEXAMPLES_SAWS} | sed s/runex[0-9]*[a-z0-9_]*//g`
 buildexamples_VALGRIND:
 	-@${OMAKE} testexamples_VALGRIND TESTEXAMPLES_VALGRIND=`echo ${TESTEXAMPLES_VALGRIND} | sed s/runex[0-9]*[a-z0-9_]*//g`
 buildexamples_MATLAB:
 #
 # The following variables define PETSc compile procedures
 #
-PSOURCEC  = $(SOURCEC:%=${PWD}/%)
-PSOURCECU = $(SOURCECU:%=${PWD}/%)
+PSOURCEC  = $(SOURCEC:%=`pwd`/%)
+PSOURCECU = $(SOURCECU:%=`pwd`/%)
 PETSC_COMPILE         = ${PCC} -c ${PCC_FLAGS} ${CFLAGS} ${CCPPFLAGS}  ${PSOURCEC}
 PETSC_COMPILE_SINGLE  = ${PCC} -o $*.o -c ${PCC_FLAGS} ${CFLAGS} ${CCPPFLAGS}
 PETSC_FCOMPILE        = ${FC} -c ${FC_FLAGS} ${FFLAGS} ${FCPPFLAGS}  ${SOURCEF}

config/BuildSystem/config/compilerOptions.py

           flags.append('-g') #cuda 4.1 with sm_20 is buggy with -g3
         else:
           flags.append('-g3')
-        flags.append('-fno-inline')
-        flags.append('-O0')
+        flags.append('-O0') # MPICH puts CFLAGS into wrappers, so ensure that we do not use optimization
       elif bopt == 'O':
         flags.append('-O')
     else:
           flags.extend(['-fprofile-arcs', '-ftest-coverage'])
         # -g3 causes an as SEGV on OSX
         flags.append('-g')
+        flags.append('-O0') # MPICH puts CXXFLAGS into wrappers, so ensure that we do not use optimization
       elif bopt in ['O']:
         if os.environ.has_key('USER'):
           flags.append('-O')
           flags.extend(['-fprofile-arcs', '-ftest-coverage'])
         # g77 3.2.3 preprocesses the file into nothing if we give -g3
         flags.append('-g')
+        flags.append('-O0') # MPICH puts FFLAGS into wrappers, so ensure that we do not use optimization
       elif bopt == 'O':
         flags.extend(['-O'])
     else:

config/BuildSystem/config/framework.py

 Notice that passing self for the last arguments means that the MPI module will
 run before the HYPRE module. Furthermore, we save the resulting object as
 self.mpi so that we may interogate it later. HYPRE can initially test whether
-MPI was indeed found using self.mpi.foundMPI. When HYPRE requires the list of
+MPI was indeed found using self.mpi.found. When HYPRE requires the list of
 MPI libraries in order to link a test object, the module can use self.mpi.lib.
 '''
 import user
     return output
 
   def filterCompileOutput(self, output):
-    if self.argDB['ignoreCompileOutput']:
+    if output.find('warning:  attribute "deprecated" is unknown, ignored') >= 0: return output
+    if output.find('warning: ISO C90 does not support complex types') >= 0: return output
+    elif self.argDB['ignoreCompileOutput']:
       output = ''
     elif output:
       lines = output.splitlines()

config/BuildSystem/config/package.py

     self.includedir       = 'include' # location of includes in the package directory tree
     self.license          = None # optional license text
     self.excludedDirs     = []   # list of directory names that could be false positives, SuperLU_DIST when looking for SuperLU
-    self.archIndependent  = 0    # 1 means the install directory does not incorporate the ARCH name
     self.downloadonWindows   = 0  # 1 means the --download-package works on Microsoft Windows
     self.worksonWindows      = 0  # 1 means that package can be used on Microsof Windows
     # Outside coupling
 
   def getExternalPackagesDir(self):
     '''The directory for downloaded packages'''
-    if not self.framework.externalPackagesDir is None:
-      packages = os.path.abspath('externalpackages')
-      return self.framework.externalPackagesDir
+    if hasattr(self, 'externalPackagesDirProvider'):
+      if hasattr(self.externalPackagesDirProvider, 'dir'):
+        return self.externalPackagesDirProvider.dir
+    elif not self.framework.externalPackagesDir is None:
+      return os.path.abspath('externalpackages')
     return self._externalPackagesDir
   def setExternalPackagesDir(self, externalPackagesDir):
     '''The directory for downloaded packages'''
     return []
 
   def getInstallDir(self):
-    if not self.arch:  raise RuntimeError('Why the hell is self.arch not defined for this package -- '+self.package+'\n')
-    self.installDir = os.path.join(self.defaultInstallDir, self.arch)
+    self.installDir = self.defaultInstallDir
     self.confDir    = os.path.join(self.installDir, 'conf')
     self.includeDir = os.path.join(self.installDir, 'include')
     self.libDir     = os.path.join(self.installDir, 'lib')
         raise RuntimeError('Unable to download '+self.downloadname)
       self.downLoad()
       return self.getDir(retry = 0)
-    if not self.archIndependent:
-      if not os.path.isdir(os.path.join(packages, Dir, self.arch)):
-        os.mkdir(os.path.join(packages, Dir, self.arch))
     return os.path.join(packages, Dir)
 
   def gitPreReqCheck(self):
         raise RuntimeError('Cannot use '+self.name+' without Fortran, make sure you do NOT have --with-fc=0')
       if self.noMPIUni and self.mpi.usingMPIUni:
         raise RuntimeError('Cannot use '+self.name+' with MPIUNI, you need a real MPI')
-      if not self.worksonWindows and self.setCompilers.isWindows(self.setCompilers.CC):
+      if not self.worksonWindows and (self.setCompilers.CC.find('win32fe') >= 0):
         raise RuntimeError('External package '+self.name+' does not work with Microsoft compilers')
-      if self.download and self.framework.argDB.get('download-'+self.downloadname.lower()) and not self.downloadonWindows and self.setCompilers.isWindows(self.setCompilers.CC):
+      if self.download and self.framework.argDB.get('download-'+self.downloadname.lower()) and not self.downloadonWindows and (self.setCompilers.CC.find('win32fe') >= 0):
         raise RuntimeError('External package '+self.name+' does not support --download-'+self.downloadname.lower()+' with Microsoft compilers')
     if not self.download and self.framework.argDB.has_key('download-'+self.downloadname.lower()) and self.framework.argDB['download-'+self.downloadname.lower()]:
       raise RuntimeError('External package '+self.name+' does not support --download-'+self.downloadname.lower())

config/BuildSystem/config/packages/MPI.py

     oldLibs  = self.compilers.LIBS
     self.compilers.CPPFLAGS += ' '+self.headers.toString(self.include)
     self.compilers.LIBS = self.libraries.toString(self.lib)+' '+self.compilers.LIBS
-    mpitypes = [('MPI_LONG_DOUBLE', 'long-double')]
+    mpitypes = [('MPI_LONG_DOUBLE', 'long-double'), ('MPI_INT64_T', 'int64_t')]
     if self.getDefaultLanguage() == 'C': mpitypes.extend([('MPI_C_DOUBLE_COMPLEX', 'c-double-complex')])
     for datatype, name in mpitypes:
       includes = '#ifdef PETSC_HAVE_STDLIB_H\n  #include <stdlib.h>\n#endif\n#include <mpi.h>\n'
     openmpiDir = self.getDir()
 
     # Get the OPENMPI directories
-    installDir = os.path.join(self.defaultInstallDir,self.arch)
-    confDir = os.path.join(self.defaultInstallDir,self.arch,'conf')
+    installDir = self.installDir
     args = ['--prefix='+installDir,'--with-rsh=ssh']
     args.append('MAKE='+self.make.make)
     # Configure and Build OPENMPI
 
   def InstallMPICH(self):
     mpichDir = self.getDir()
-    installDir = os.path.join(self.defaultInstallDir,self.arch)
-    confDir = os.path.join(self.defaultInstallDir,self.arch,'conf')
+    installDir = self.installDir
     if not os.path.isdir(installDir):
       os.mkdir(installDir)
 

config/BuildSystem/config/packages/boost.py

     self.download        = ['http://ftp.mcs.anl.gov/pub/petsc/externalpackages/boost_minimal_1_42_0.tar.gz']
     self.includes        = ['boost/multi_index_container.hpp']
     self.cxx             = 1
-    self.archIndependent = 1
     self.worksonWindows  = 1
     self.downloadonWindows = 1
     return

config/BuildSystem/config/packages/cusp.py

     self.includedir      = ['','include']
     self.forceLanguage   = 'CUDA'
     self.cxx             = 0
-    self.archIndependent = 1
     self.worksonWindows  = 1
     return
 

config/BuildSystem/config/packages/fiat.py

   def __init__(self, framework):
     config.package.Package.__init__(self, framework)
     self.download = ['http://launchpad.net/fiat/0.x/0.9.9/+download/fiat-0.9.9.tar.gz'] # 'http://ftp.mcs.anl.gov/pub/petsc/externalpackages/fiat-dev.tar.gz'
-    self.archIndependent   = 1
     self.worksonWindows    = 1
     self.downloadonWindows = 1
     self.liblist           = [['Lagrange.py']]

config/BuildSystem/config/packages/hdf5.py

         raise RuntimeError('Error running configure on HDF5: '+str(e))
       try:
         self.logPrintBox('Compiling HDF5; this may take several minutes')
-        output2,err2,ret2  = config.package.Package.executeShellCommand('cd '+self.packageDir+' && make clean && make && make install', timeout=2500, log = self.framework.log)
+        output2,err2,ret2  = config.package.Package.executeShellCommand('cd '+self.packageDir+' && '+self.make.make+' clean && '+self.make.make_jnp+' && '+self.make.make+' install', timeout=2500, log = self.framework.log)
       except RuntimeError, e:
         raise RuntimeError('Error running make on HDF5: '+str(e))
       self.postInstall(output1+err1+output2+err2,'hdf5')

config/BuildSystem/config/packages/scientificpython.py

   def __init__(self, framework):
     config.package.Package.__init__(self, framework)
     self.download = ['http://ftp.mcs.anl.gov/pub/petsc/externalpackages/ScientificPythonSimple.tar.gz']
-    self.archIndependent   = 1
     self.worksonWindows    = 1
     self.downloadonWindows = 1
     self.liblist           = [['Derivatives.py']]

config/BuildSystem/config/packages/thrust.py

     self.includedir      = ''
     self.forceLanguage   = 'CUDA'
     self.cxx             = 0
-    self.archIndependent = 1
     self.worksonWindows  = 1
     return
 

config/BuildSystem/config/types.py

     return
 
   def checkC99Complex(self):
-    '''Check for complex numbers in in C99 std'''
+    '''Check for complex numbers in in C99 std
+       Note that since PETSc source code uses _Complex we test specifically for that, not complex'''
     includes = '#include <complex.h>\n'
-    body     = 'double complex x;\n x = I;\n'
+    body     = 'double _Complex x;\n x = I;\n'
+    if not self.checkCompile(includes, body): return    # checkLink can succeed even if checkCompile fails
     if self.checkLink(includes, body):
       self.addDefine('HAVE_C99_COMPLEX', 1)
       self.c99_complex = 1

config/BuildSystem/retrieval.py

         tf  = tarfile.open(os.path.join(root, localFile))
       except tarfile.ReadError, e:
         raise RuntimeError(str(e)+'\n'+failureMessage)
-      # some tarfiles list packagename/ but some list packagename/filename in the first entry
       if not tf: raise RuntimeError(failureMessage)
-      if not tf.firstmember: raise RuntimeError(failureMessage)
-      if tf.firstmember.isdir():
-        dirname = tf.firstmember.name
+      #git puts 'pax_global_header' as the first entry and some tar utils process this as a file
+      firstname = tf.getnames()[0]
+      if firstname == 'pax_global_header':
+        firstmember = tf.getmembers()[1]
+      else:
+        firstmember = tf.getmembers()[0]
+      # some tarfiles list packagename/ but some list packagename/filename in the first entry
+      if firstmember.isdir():
+        dirname = firstmember.name
       else:
-        dirname = os.path.dirname(tf.firstmember.name)
+        dirname = os.path.dirname(firstmember.name)
       if hasattr(tf,'extractall'): #python 2.5+
         tf.extractall(root)
       else:
 
     # fix file permissions for the untared tarballs.
     try:
-      config.base.Configure.executeShellCommand('cd '+root+'; chmod -R a+r '+dirname+';find  '+dirname + ' -type d -name "*" -exec chmod a+rx {} \;', log = self.log)
+      # check if 'dirname' is set'
+      if dirname:
+        config.base.Configure.executeShellCommand('cd '+root+'; chmod -R a+r '+dirname+';find  '+dirname + ' -type d -name "*" -exec chmod a+rx {} \;', log = self.log)
+      else:
+        self.logPrintBox('WARNING: Could not determine dirname extracted by '+localFile+' to fix file permissions')
     except RuntimeError, e:
       raise RuntimeError('Error changing permissions for '+dirname+' obtained from '+localFile+ ' : '+str(e))
     os.unlink(localFile)

config/PETSc/Configure.py

       build_type = 'legacy build'
     desc.append(' Configure stage complete. Now build PETSc libraries with (%s):' % build_type)
     desc.append('   make PETSC_DIR='+self.petscdir.dir+' PETSC_ARCH='+self.arch.arch+' all')
-    desc.append(' or (experimental with python):')
-    desc.append('   PETSC_DIR='+self.petscdir.dir+' PETSC_ARCH='+self.arch.arch+' ./config/builder.py')
     desc.append('xxx=========================================================================xxx')
     return '\n'.join(desc)+'\n'
 
     config.base.Configure.setupDependencies(self, framework)
     self.setCompilers  = framework.require('config.setCompilers',       self)
     self.arch          = framework.require('PETSc.utilities.arch',      self.setCompilers)
-    self.petscdir      = framework.require('PETSc.utilities.petscdir',  self.setCompilers)
+    self.petscdir      = framework.require('PETSc.utilities.petscdir',  self.arch)
+    self.installdir    = framework.require('PETSc.utilities.installDir',self)
     self.languages     = framework.require('PETSc.utilities.languages', self.setCompilers)
     self.debugging     = framework.require('PETSc.utilities.debugging', self.setCompilers)
     self.CHUD          = framework.require('PETSc.utilities.CHUD',      self)
     self.atomics       = framework.require('config.atomics',            self)
     self.make          = framework.require('config.packages.make',      self)
     self.blasLapack    = framework.require('config.packages.BlasLapack',self)
+    self.externalpackagesdir = framework.require('PETSc.utilities.externalpackagesdir',self)
+
     if os.path.isdir(os.path.join('config', 'PETSc')):
       for d in ['utilities', 'packages']:
         for utility in os.listdir(os.path.join('config', 'PETSc', d)):
             utilityObj.headerPrefix       = self.headerPrefix
             utilityObj.archProvider       = self.arch
             utilityObj.languageProvider   = self.languages
-            utilityObj.installDirProvider = self.petscdir
+            utilityObj.installDirProvider = self.installdir
+            utilityObj.externalPackagesDirProvider = self.externalpackagesdir
             setattr(self, utilityName.lower(), utilityObj)
 
     for package in config.packages.all:
         packageObj                    = framework.require('config.packages.'+package, self)
         packageObj.archProvider       = self.arch
         packageObj.languageProvider   = self.languages
-        packageObj.installDirProvider = self.petscdir
+        packageObj.installDirProvider = self.installdir
+        packageObj.externalPackagesDirProvider = self.externalpackagesdir
         setattr(self, package.lower(), packageObj)
     # Force blaslapack to depend on scalarType so precision is set before BlasLapack is built
     framework.require('PETSc.utilities.scalarTypes', self.f2cblaslapack)
       self.addDefine('DIR_SEPARATOR','\'\\\\\'')
       self.addDefine('REPLACE_DIR_SEPARATOR','\'/\'')
       self.addDefine('CANNOT_START_DEBUGGER',1)
+      (petscdir,error,status) = self.executeShellCommand('cygpath -w '+self.petscdir.dir)
+      self.addDefine('DIR','"'+petscdir.replace('\\','\\\\')+'"')
     else:
       self.addDefine('PATH_SEPARATOR','\':\'')
       self.addDefine('REPLACE_DIR_SEPARATOR','\'\\\\\'')
       self.addDefine('DIR_SEPARATOR','\'/\'')
+      self.addDefine('DIR', '"'+self.petscdir.dir+'"')
 
     return
 
     import sys
     scriptName = os.path.join(self.arch.arch,'conf', 'reconfigure-'+self.arch.arch+'.py')
     args = dict([(nargs.Arg.parseArgument(arg)[0], arg) for arg in self.framework.clArgs])
+    if 'with-clean' in args:
+      del args['with-clean']
     if 'configModules' in args:
       if nargs.Arg.parseArgument(args['configModules'])[1] == 'PETSc.Configure':
         del args['configModules']

config/PETSc/package.py

     self.scalartypes    = framework.require('PETSc.utilities.scalarTypes',self)
     self.libraryOptions = framework.require('PETSc.utilities.libraryOptions', self)
     self.petscdir       = framework.require('PETSc.utilities.petscdir', self.setCompilers)
+    self.petscclone     = framework.require('PETSc.utilities.petscclone',self.setCompilers)
     return
 
   def consistencyChecks(self):

config/PETSc/packages/ams.py

-import PETSc.package
-import os
-
-class Configure(PETSc.package.NewPackage):
-  def __init__(self, framework):
-    PETSc.package.NewPackage.__init__(self, framework)
-    self.gitcommit = '3c24ac8df967279c3ceafa5c39fc230af30c63c4'
-    self.giturls   = ['https://bitbucket.org/petsc/ams.git']
-    self.download  = ['https://bitbucket.org/petsc/ams/get/master.tar.gz',
-                      'http://ftp.mcs.anl.gov/pub/petsc/externalpackages/ams-dev.tar.gz']
-    self.functions = ['AMS_Memory_create']
-    self.includes  = ['ams.h']
-    self.liblist   = [['libamspub.a']]
-    return
-
-  def setupDependencies(self, framework):
-    PETSc.package.NewPackage.setupDependencies(self, framework)
-    self.java       = framework.require('PETSc.packages.java',self)
-    self.deps       = [self.mpi]
-    return
-
-  def Install(self):
-    import os
-
-    g = open(os.path.join(self.packageDir,'makeinc'),'w')
-    g.write('AR           = '+self.setCompilers.AR+' '+self.setCompilers.AR_FLAGS+'\n')
-    g.write('RANLIB       = '+self.setCompilers.RANLIB+'\n')
-    # should use the BuildSystem defined RM, MV
-    g.write('RM           = rm -f\n')
-    g.write('MV           = mv -f\n')
-    self.setCompilers.pushLanguage('C')
-    g.write('CC           = '+self.setCompilers.getCompiler()+' '+self.setCompilers.getCompilerFlags()+'\n')
-    g.write('CLINKER      = ${CC}\n')
-    if self.setCompilers.isDarwin():
-      g.write('LINKSHARED   = ${CC} -dynamiclib -single_module -multiply_defined suppress -undefined dynamic_lookup\n')
-    else:
-      g.write('LINKSHARED   = ${CC} -dynamiclib\n')
-    if hasattr(self.java,'javac'):
-      if self.setCompilers.isDarwin():
-        g.write('JAVA_INCLUDES   =  -I/System/Library/Frameworks/JavaVM.framework/Headers/../../CurrentJDK/Headers\n')
-      else:
-        g.write('JAVA_INCLUDES   =  \n')
-      g.write('JAVAC           = '+getattr(self.java, 'javac'))
-    g.close()
-    self.setCompilers.popLanguage()
-
-    if self.installNeeded('makeinc'):
-      try:
-        self.logPrintBox('Compiling ams; this may take several minutes')
-        if not os.path.isdir(os.path.join(self.installDir,'java')):
-          os.mkdir(os.path.join(self.installDir,'java'))
-        output,err,ret = PETSc.package.NewPackage.executeShellCommand('cd '+self.packageDir+' &&  make all && cp lib/* '+os.path.join(self.installDir,'lib')+' && cp -r java/gov '+os.path.join(self.installDir,'java')+' &&  cp -f include/*.h '+os.path.join(self.installDir,self.includedir)+'/.', timeout=2500, log = self.framework.log)
-      except RuntimeError, e:
-        raise RuntimeError('Error running make on ams: '+str(e))
-      self.postInstall(output+err,'makeinc')
-    return self.installDir
-
-
-  def configureLibrary(self):
-    PETSc.package.NewPackage.configureLibrary(self)
-    self.addDefine('AMS_DIR', '"'+os.path.dirname(self.include[0])+'"')
-    self.addMakeMacro('AMS_DIR', '"'+os.path.dirname(self.include[0])+'"')

config/PETSc/packages/c2html.py

       self.framework.logPrint("Not checking c2html on user request\n")
       return
 
-    if self.petscdir.isClone:
+    if self.petscclone.isClone:
       self.framework.logPrint('PETSc clone, checking for c2html\n')
       self.getExecutable('c2html', getFullPath = 1)
 

config/PETSc/packages/clique.py

       if os.path.isdir(folder):
         import shutil
         shutil.rmtree(folder)
-        os.mkdir(folder)
+      os.mkdir(folder)
       try:
         self.logPrintBox('Configuring Clique; this may take several minutes')
         output1,err1,ret1  = PETSc.package.NewPackage.executeShellCommand('cd '+folder+' && '+self.cmake.cmake+' .. '+args, timeout=900, log = self.framework.log)

config/PETSc/packages/cmake.py

         raise RuntimeError('Error running configure on cmake: '+str(e))
       try:
         self.logPrintBox('Compiling CMake; this may take several minutes')
-        output,err,ret  = PETSc.package.NewPackage.executeShellCommand('cd '+self.packageDir+' && make && make install && make clean', timeout=2500, log = self.framework.log)
+        output,err,ret  = PETSc.package.NewPackage.executeShellCommand('cd '+self.packageDir+' && '+self.make.make_jnp+' && '+self.make.make+' install && '+self.make.make+' clean', timeout=2500, log = self.framework.log)
       except RuntimeError, e:
         raise RuntimeError('Error running make; make install on cmake: '+str(e))
       self.postInstall(output+err,'cmake.args')

config/PETSc/packages/ctetgen.py

 class Configure(PETSc.package.NewPackage):
   def __init__(self, framework):
     PETSc.package.NewPackage.__init__(self, framework)
-    self.gitcommit         = '6ed398f4e75cc071360bebaaf575ce249477d61f'
+    self.gitcommit         = '6952da917114e8c3788a9f22df1b7aaa21335a13'
     self.giturls           = ['https://bitbucket.org/petsc/ctetgen.git']
     self.download          = ['http://ftp.mcs.anl.gov/pub/petsc/externalpackages/ctetgen-0.1.tar.gz']
     self.functions         = []
 
   def setupDependencies(self, framework):
     PETSc.package.NewPackage.setupDependencies(self, framework)
+    framework.require('PETSc.packages.openmp',self)
     self.deps       = []
     return
 

config/PETSc/packages/elemental.py

       if os.path.isdir(folder):
         import shutil
         shutil.rmtree(folder)
-        os.mkdir(folder)
+      os.mkdir(folder)
       try:
         self.logPrintBox('Configuring Elemental; this may take several minutes')
         output1,err1,ret1  = PETSc.package.NewPackage.executeShellCommand('cd '+folder+' && '+self.cmake.cmake+' .. '+args, timeout=900, log = self.framework.log)

config/PETSc/packages/hypre.py

 
   def setupDependencies(self, framework):
     PETSc.package.NewPackage.setupDependencies(self, framework)
+    self.compilerFlags   = framework.require('config.compilerFlags', self)
     self.blasLapack = framework.require('config.packages.BlasLapack',self)
     self.deps       = [self.mpi,self.blasLapack]
     return
     args.append('--with-fmangle-blas='+mang)
     args.append('--with-fmangle-lapack='+mang)
 
+    if self.compilerFlags.debugging:
+      args.append('--with-print-errors')
+
     args.append('--without-babel')
     args.append('--without-mli')
     args.append('--without-fei')

config/PETSc/packages/lgrind.py

   def configure(self):
     import os
     '''Determine whether the Lgrind exist or not'''
-    if self.petscdir.isClone:
+    if self.petscclone.isClone:
       if self.framework.argDB['with-lgrind']:
         self.framework.logPrint('PETSc clone, checking for Lgrind\n')
         self.installDir  = os.path.join(self.petscdir.dir,self.arch)

config/PETSc/packages/metis.py

       if os.path.isdir(folder):
         import shutil
         shutil.rmtree(folder)
-        os.mkdir(folder)
+      os.mkdir(folder)
 
       try:
         self.logPrintBox('Configuring METIS; this may take several minutes')

config/PETSc/packages/openmp.py

         ompflag = flag
         break
     self.setCompilers.addCompilerFlag(ompflag)
-    if self.setCompilers.checkLinkerFlag(ompflag):
-      self.setCompilers.addLinkerFlag(ompflag)
     self.setCompilers.popLanguage()
     if hasattr(self.compilers, 'FC'):
       self.setCompilers.pushLanguage('FC')
     if hasattr(self.compilers, 'CXX'):