Commits

Satish Balay committed 4e3b5a0

#116216 give an error if PETSC_DIR/externalpackages is used for --with-package-dir

  • Participants
  • Parent commits 7a2bc18

Comments (0)

Files changed (2)

File config/package.py

 
     if 'with-'+self.package+'-dir' in self.framework.argDB:
       d = self.framework.argDB['with-'+self.package+'-dir']
+      # error if package-dir is in externalpackages
+      if os.path.realpath(d).find(os.path.realpath(self.externalPackagesDir)) >=0:
+        fakeExternalPackagesDir = d.replace(os.path.realpath(d).replace(os.path.realpath(self.externalPackagesDir),''),'')
+        raise RuntimeError('Bad option: '+'--with-'+self.package+'-dir='+self.framework.argDB['with-'+self.package+'-dir']+'\n'+
+                           fakeExternalPackagesDir+' is reserved for --download-pacakge scratch space. \n'+
+                           'Do not install software in this location.')
       for l in self.generateLibList(os.path.join(d, self.libdir)):
         yield('User specified root directory '+self.PACKAGE, d, l, self.getIncludeDirs(d, self.includedir))
       for l in self.generateLibList(os.path.join(d, self.altlibdir)):

File config/packages/BlasLapack.py

     # Try specified installation root
     if 'with-blas-lapack-dir' in self.framework.argDB:
       dir = self.framework.argDB['with-blas-lapack-dir']
+      # error if package-dir is in externalpackages
+      if os.path.realpath(dir).find(os.path.realpath(self.externalPackagesDir)) >=0:
+        fakeExternalPackagesDir = dir.replace(os.path.realpath(dir).replace(os.path.realpath(self.externalPackagesDir),''),'')
+        raise RuntimeError('Bad option: '+'--with-blas-lapack-dir='+self.framework.argDB['with-blas-lapack-dir']+'\n'+
+                           fakeExternalPackagesDir+' is reserved for --download-pacakge scratch space. \n'+
+                           'Do not install software in this location.')
       if not (len(dir) > 2 and dir[1] == ':') :
         dir = os.path.abspath(dir)
       self.framework.log.write('Looking for BLAS/LAPACK in user specified directory: '+dir+'\n')