Commits

Jed Brown committed b9bb745 Merge

Merge subtree BuildSystem-3.2 patches/bugfixes into maint-3.2

* commit '1992e2d3411445b225ba065d5c8921f1023c98a7':
also reconginze '-MDd' as a windows compiler option for blaslapack NOOPT
#97680 update mkl detection with gnu compilers
tree 86958722a6ad parent 68f86ff9dcfa author Satish Balay <balay@mcs.anl.gov> 1317743831 18000 committer Satish Balay <balay@mcs.anl.gov> 1317743831 18000 revision 2735 branch default
added check for lsame() to BlasLapack.py
Fixed bad remove of library
f2cblaslapack should always build single/double precision routines. [for superlu_dist]
Fix for library list construction for a package
f2cblaslapack needs -lm [otherwise its setting PETSC_MISSING_LAPACK_* flags]
#86303 enable --download-f2cblaslapack on windows
Added tag release-3.2 for changeset 16a648a4b957

Comments (0)

Files changed (6)

config/BuildSystem/.hgtags

 08d1a842beeb60886d02ca2e9fb49deac27b64cc release-2.3.3
 e2ee09c1d244ce7c7009364bec161d3a4a71a10b release-3.0.0
 e7987146764be982e7ab2822301e836c54438a20 release-3.1
+16a648a4b95789443cb53c4a66689a0d9ba28a7b release-3.2

config/BuildSystem/config/package.py

     for libSet in self.liblist:
       libs = []
       # add full path only to the first library in the list
-      if not self.libdir == directory and len(libSet) > 0:
-        libs.append(os.path.join(directory, libSet[0]))
+      if len(libSet) > 0:
+        if not self.libdir == directory:
+          libs.append(os.path.join(directory, libSet[0]))
+        else:
+          libs.append(libSet[0])
       for library in libSet[1:]:
         # if the library name doesn't start with lib - then add the fullpath
         if library.startswith('lib') or self.libdir == directory:

config/BuildSystem/config/packages/BlasLapack.py

     if self.f2cblaslapack.found:
       self.f2c = 1
       libDir = self.f2cblaslapack.libDir
-      yield ('f2cblaslapack',os.path.join(libDir,'libf2cblas.a') , os.path.join(libDir,'libf2clapack.a'), 0)
+      f2cLibs = [os.path.join(libDir,'libf2cblas.a')]
+      if self.libraries.math:
+        f2cLibs = f2cLibs+self.libraries.math
+      yield ('f2cblaslapack', f2cLibs, os.path.join(libDir,'libf2clapack.a'), 0)
       raise RuntimeError('--download-f2cblaslapack libraries cannot be used')
     if 'with-blas-lib' in self.framework.argDB and not 'with-lapack-lib' in self.framework.argDB:
       raise RuntimeError('If you use the --with-blas-lib=<lib> you must also use --with-lapack-lib=<lib> option')
       # Some new MKL 11/12 variations
       for libdir in ['',os.path.join('lib','32'),os.path.join('lib','ia32')]:
         yield ('User specified MKL11/12 Linux32', None, [os.path.join(dir,libdir,'libmkl_intel.a'),'mkl_intel_thread','mkl_core','iomp5','pthread'],1)
+        yield ('User specified MKL11/12 Linux32', None, [os.path.join(dir,libdir,'libmkl_intel.a'),'mkl_gnu_thread','mkl_core','gomp','pthread'],1) #gnu
       for libdir in ['',os.path.join('lib','em64t'),os.path.join('lib','intel64')]:
         yield ('User specified MKL11/12 Linux64', None, [os.path.join(dir,libdir,'libmkl_intel_lp64.a'),'mkl_intel_thread','mkl_core','iomp5','pthread'],1)
+        yield ('User specified MKL11/12 Linux64', None, [os.path.join(dir,libdir,'libmkl_intel_lp64.a'),'mkl_gnu_thread','mkl_core','gomp','pthread'],1) #gnu
       # Older Linux MKL checks
       yield ('User specified MKL Linux-x86 lib dir', None, [os.path.join(dir, 'libmkl_lapack.a'), 'libmkl_def.a', 'guide', 'pthread'], 1)
       yield ('User specified MKL Linux-x86 lib dir', None, [os.path.join(dir, 'libmkl_lapack.a'), 'libmkl_def.a', 'guide', 'vml','pthread'], 1)
     return ''
 
   def getWindowsNonOptFlags(self,cflags):
-    for flag in ['-MT','-MTd','-MD','-threads']:
+    for flag in ['-MT','-MTd','-MD','-MDd','-threads']:
       if cflags.find(flag) >=0: return flag
     return ''
 
         self.compilers.LIBS = oldLibs
     return
 
+  def checklsame(self):
+    ''' Do the BLAS/LAPACK libraries have a valid lsame() function with correction binding. Lion and xcode 4.2 do not'''
+    routine = 'lsame';
+    if self.f2c:
+      if self.mangling == 'underscore':
+        routine = routine + '_'
+    else:
+      routine = self.compilers.mangleFortranFunction(routine)
+    if not self.libraries.check(self.dlib,routine,fortranMangle = 0):
+      self.addDefine('MISSING_LAPACK_'+routine, 1)
+
+
+
   def checkForRoutine(self,routine):
     ''' used by other packages to see if a BLAS routine is available
         This is not really correct because other packages do not (usually) know about f2cblasLapack'''
     else:
       return self.libraries.check(self.dlib,routine,fortranMangle = hasattr(self.compilers, 'FC'))
 
+
+
   def configure(self):
     self.executeTest(self.configureLibrary)
     self.executeTest(self.checkESSL)
     self.executeTest(self.checkPESSL)
     self.executeTest(self.checkMissing)
+    self.executeTest(self.checklsame)
     return
 
 if __name__ == '__main__':

config/BuildSystem/config/packages/f2cblaslapack.py

     config.package.Package.__init__(self, framework)
     self.download         = ['http://ftp.mcs.anl.gov/pub/petsc/externalpackages/f2cblaslapack-3.1.1.q.tar.gz']
     self.double           = 0
+    self.worksonWindows   = 1
+    self.downloadonWindows= 1
 
   def setupDependencies(self, framework):
     config.package.Package.setupDependencies(self, framework)
     return ''
 
   def getWindowsNonOptFlags(self,cflags):
-    for flag in ['-MT','-MTd','-MD','-threads']:
+    for flag in ['-MT','-MTd','-MD','-MDd','-threads']:
       if cflags.find(flag) >=0: return flag
     return ''
 
   def Install(self):
     import os
 
-    precision = self.defaultPrecision
-    if precision == '__float128': precision = 'quad'
+    make_target = 'single double'
+    if self.defaultPrecision == '__float128': make_target += ' quad'
 
     libdir = self.libDir
     confdir = self.confDir
 
     try:
       self.logPrintBox('Compiling BLASLAPACK; this may take several minutes')
-      output,err,ret  = config.base.Configure.executeShellCommand('cd '+blasDir+' && make -f tmpmakefile cleanblaslapck cleanlib && make -f tmpmakefile '+precision, timeout=2500, log = self.framework.log)
+      output,err,ret  = config.base.Configure.executeShellCommand('cd '+blasDir+' && make -f tmpmakefile cleanblaslapck cleanlib && make -f tmpmakefile '+make_target, timeout=2500, log = self.framework.log)
     except RuntimeError, e:
       raise RuntimeError('Error running make on '+blasDir+': '+str(e))
     try:

config/BuildSystem/config/setCompilers.py

             self.dynamicLibraries = 1
             self.logPrint('Using dynamic linker '+self.dynamicLinker+' with flags '+str(self.dynamicLibraryFlags)+' and library extension '+self.dynamicLibraryExt)
             break
-          os.remove(oldLib)
         if os.path.isfile(self.linkerObj): os.remove(self.linkerObj)
         del self.dynamicLinker
     return

config/BuildSystem/config/types.py

       self.framework.log.write(typeName+' found\n')
     return found
 
+  def check__int64(self):
+    '''Checks if __int64 exists. This is primarily for windows.'''
+    if self.check('__int64'):
+      self.addDefine('HAVE___INT64',1)
+    return
+
   def checkSizeTypes(self):
     '''Checks for types associated with sizes, such as size_t.'''
     self.check('size_t', 'int')
     return
 
   def configure(self):
+    self.executeTest(self.check__int64)
     self.executeTest(self.checkSizeTypes)
     self.executeTest(self.checkFileTypes)
     self.executeTest(self.checkIntegerTypes)