[petsc-dev] Configure changes

Satish Balay balay at mcs.anl.gov
Tue Sep 28 23:19:08 CDT 2010


its a bit hacky.

I tried to use package.py:getInstallDir() - to get packageDir set
properly. The rest of the changes are fixes to get this working.. [and
eliminating some of the work getInstallDir() does].

attaching the patch..

Satish


>>>>>>>>>>>
*******************************************************************************
        CONFIGURATION CRASH  (Please send configure.log to petsc-maint at mcs.anl.gov)
*******************************************************************************
'Configure' object has no attribute 'packageDir'  File "./configure", line 273, in petsc_configure
    framework.configure(out = sys.stdout)
  File "/home/balay/tmp/petsc-dev/config/BuildSystem/config/framework.py", line 966, in configure
    child.configure()
  File "/home/balay/tmp/petsc-dev/config/BuildSystem/config/packages/BlasLapack.py", line 551, in configure
    self.executeTest(self.configureLibrary)
  File "/home/balay/tmp/petsc-dev/config/BuildSystem/config/base.py", line 115, in executeTest
    ret = apply(test, args,kargs)
  File "/home/balay/tmp/petsc-dev/config/BuildSystem/config/packages/BlasLapack.py", line 463, in
configureLibrary
    for (name, blasLibrary, lapackLibrary, self.useCompatibilityLibs) in self.generateGuesses():
  File "/home/balay/tmp/petsc-dev/config/BuildSystem/config/packages/BlasLapack.py", line 174, in
generateGuesses
    libdir = self.downLoadBlasLapack('f','f')
  File "/home/balay/tmp/petsc-dev/config/BuildSystem/config/packages/BlasLapack.py", line 423, in
downLoadBlasLapack
    if not self.installNeeded('tmpmakefile'):
  File "/home/balay/tmp/petsc-dev/config/BuildSystem/config/package.py", line 306, in installNeeded
    makefile      = os.path.join(self.packageDir, mkfile)


On Wed, 29 Sep 2010, Matthew Knepley wrote:

> What was your blas fix? I am in Frankfurt airport and have trouble looking.
-------------- next part --------------
tree 3297c34c6592
parent 49ac92f038c4
author Satish Balay <balay at mcs.anl.gov> 1285701275 18000
committer Satish Balay <balay at mcs.anl.gov> 1285701275 18000
revision 2520
branch default

fix --download-f-blas-lapack as its currently broken. It still needs proper reorganization
diff --git a/config/packages/BlasLapack.py b/config/packages/BlasLapack.py
--- a/config/packages/BlasLapack.py
+++ b/config/packages/BlasLapack.py
@@ -142,13 +142,11 @@
       raise RuntimeError('You cannot set both the library containing BLAS/LAPACK with --with-blas-lapack-lib=<lib>\nand the directory to search with --with-blas-lapack-dir=<dir>')
 
     if self.framework.argDB['download-c-blas-lapack']:
-      self.download= 'http://ftp.mcs.anl.gov/pub/petsc/externalpackages/f2cblaslapack-3.1.1.tar.gz'
-      self.downloadname = 'c-blas-lapack'
-      self.downloaddirname = 'f2cblaslapack-3.1.1'
+      self.download= ['http://ftp.mcs.anl.gov/pub/petsc/externalpackages/f2cblaslapack-3.1.1.tar.gz']
+      self.downloadname = 'f2cblaslapack-3.1.1'
     elif self.framework.argDB['download-f-blas-lapack']:
-      self.download= 'http://ftp.mcs.anl.gov/pub/petsc/externalpackages/fblaslapack-3.1.1.tar.gz'
-      self.downloadname = 'f-blas-lapack'
-      self.downloaddirname = 'fblaslapack-3.1.1'
+      self.download= ['http://ftp.mcs.anl.gov/pub/petsc/externalpackages/fblaslapack-3.1.1.tar.gz']
+      self.downloadname = 'fblaslapack-3.1.1'
 
     if self.framework.argDB['download-c-blas-lapack'] == 1 or isinstance(self.framework.argDB['download-c-blas-lapack'], str):
       if isinstance(self.framework.argDB['download-c-blas-lapack'], str):
@@ -310,6 +308,9 @@
       yield ('Downloaded BLAS/LAPACK library', os.path.join(libdir,'libfblas.a'), os.path.join(libdir,'libflapack.a'), 1)
     return
 
+  def Install(self):
+    return self.installDir
+
   def getSharedFlag(self,cflags):
     for flag in ['-PIC', '-fPIC', '-KPIC', '-qpic']:
       if cflags.find(flag) >=0: return flag
@@ -332,37 +333,16 @@
     return ''
 
   def downLoadBlasLapack(self, f2c, l):
-    self.framework.log.write('Downloading '+self.downloaddirname+'\n')
-    if self.framework.externalPackagesDir is None:
-      packages = os.path.abspath('externalpackages')
-    else:
-      packages = self.framework.externalPackagesDir
-    if not os.path.isdir(packages):
-      os.mkdir(packages)
     if f2c == 'f':
       self.setCompilers.pushLanguage('FC')
       if config.setCompilers.Configure.isNAG(self.setCompilers.getLinker()):
         raise RuntimeError('Cannot compile fortran blaslapack with NAG compiler - install blas/lapack compiled with g77 instead')
       self.setCompilers.popLanguage()
-    libdir = os.path.join(self.defaultInstallDir,self.arch,'lib')
-    confdir = os.path.join(self.defaultInstallDir,self.arch,'conf')
-    if not os.path.isdir(os.path.join(packages,self.downloaddirname)):
-      self.framework.log.write('Actually need to ftp '+self.downloaddirname+'\n')
+    self.getInstallDir()
+    libdir = self.libDir
+    confdir = self.confDir
+    blasDir = self.packageDir
 
-      import retrieval
-      retriever = retrieval.Retriever(self.sourceControl, argDB = self.framework.argDB)
-      retriever.setup()
-          
-      try:
-        retriever.genericRetrieve(self.download,packages,self.downloadname)
-      except RuntimeError, e:
-        raise RuntimeError(e)
-      self.framework.actions.addArgument('BLAS/LAPACK', 'Download', 'Downloaded PETSc '+self.downloaddirname + ' into '+os.path.dirname(libdir))
-    else:
-      self.framework.log.write('Found '+self.downloaddirname+', do not need to download\n')
-    if not os.path.isdir(libdir):
-      os.mkdir(libdir)
-    blasDir = os.path.join(packages,self.downloaddirname)
     g = open(os.path.join(blasDir,'tmpmakefile'),'w')
     f = open(os.path.join(blasDir,'makefile'),'r')    
     line = f.readline()
@@ -427,11 +407,11 @@
       self.logPrintBox('Compiling '+l.upper()+'BLASLAPACK; this may take several minutes')
       output,err,ret  = config.base.Configure.executeShellCommand('cd '+blasDir+' && make -f tmpmakefile cleanblaslapck cleanlib && make -f tmpmakefile', timeout=2500, log = self.framework.log)
     except RuntimeError, e:
-      raise RuntimeError('Error running make on '+self.downloaddirname+': '+str(e))
+      raise RuntimeError('Error running make on '+blasDir+': '+str(e))
     try:
       output,err,ret  = config.base.Configure.executeShellCommand('cd '+blasDir+' && mv -f lib'+f2c+'blas.'+self.setCompilers.AR_LIB_SUFFIX+' lib'+f2c+'lapack.'+self.setCompilers.AR_LIB_SUFFIX+' '+ libdir, timeout=30, log = self.framework.log)
     except RuntimeError, e:
-      raise RuntimeError('Error moving '+self.downloaddirname+' libraries: '+str(e))
+      raise RuntimeError('Error moving '+blasDir+' libraries: '+str(e))
 
     if self.framework.argDB['with-iphone']:
       # Build version of C BLAS/LAPACK suitable for the iPhone
@@ -444,14 +424,14 @@
       try:
         output,err,ret  = config.base.Configure.executeShellCommand('cd '+os.path.join(blasDir,'BlasLapack')+' && xcodebuild -configuration '+debug, timeout=3000, log = self.framework.log)
       except RuntimeError, e:
-        raise RuntimeError('Error making iPhone version of BLAS/LAPACK on '+self.downloaddirname+': '+str(e))
+        raise RuntimeError('Error making iPhone version of BLAS/LAPACK on '+blasDir+': '+str(e))
       try:
         output,err,ret  = config.base.Configure.executeShellCommand('mv -f '+os.path.join(blasDir,'BlasLapack','build',debugdir,'libBlasLapack.a')+' '+libdir, timeout=30, log = self.framework.log)
       except RuntimeError, e:
-        raise RuntimeError('Error copying iPhone version of BLAS/LAPACK libraries on '+self.downloaddirname+': '+str(e))
+        raise RuntimeError('Error copying iPhone version of BLAS/LAPACK libraries on '+blasDir+': '+str(e))
       
     try:
-      output,err,ret  = config.base.Configure.executeShellCommand('cd '+blasDir+' && cp -f tmpmakefile '+os.path.join(confdir,self.package), timeout=30, log = self.framework.log)
+      output,err,ret  = config.base.Configure.executeShellCommand('cd '+blasDir+' && cp -f tmpmakefile '+os.path.join(self.confDir, self.name), timeout=30, log = self.framework.log)
     except RuntimeError, e:
       pass
     return libdir


More information about the petsc-dev mailing list