[petsc-users] Running moose/scripts/update_and_rebuild_petsc.sh on HPC

Alexander Lindsay alexlindsay239 at gmail.com
Thu Jan 30 15:57:58 CST 2020


Tomas,  make sure you're always using "reply all" when the PETSc users list
is involved...

On Thu, Jan 30, 2020 at 1:52 PM Tomas Mondragon <
tom.alex.mondragon at gmail.com> wrote:

> I altered the problematic part of the getExecutable method in
> petsc/config/BuildSystem/config/base.py just to get over this obstacle.
>
>   def getExecutable(self, names, path = [], getFullPath = 0,
> useDefaultPath = 0, resultName = '', setMakeMacro = 1):
>
>     '''Search for an executable in the list names
>
>        - Each name in the list is tried for each entry in the path until a
> name is located, then it stops
>
>        - If found, the path is stored in the variable "name", or
> "resultName" if given
>
>        - By default, a make macro "resultName" will hold the path'''
>
>     found = 0
>
>     if isinstance(names,str) and names.startswith('/'):
>
>       path = os.path.dirname(names)
>
>       names = os.path.basename(names)
>
>
>     if isinstance(names, str):
>
>       names = [names]
>
>     if isinstance(path, str):
>
>       path = path.split(os.path.pathsep)
>
>     if not len(path):
>
>       useDefaultPath = 1
>
>
>     def getNames(name, resultName):
>
>       import re
>
>       prog = re.match(r'(.*?)(?<!\\)(\s.*)',name)
>
>       if prog:
>
>         name = prog.group(1)
>
>         options = prog.group(2)
>
>       else:
>
>         options = ''
>
>       if not resultName:
>
>         varName = name
>
>       else:
>
>         varName = resultName
>
>       return name, options, varName
>
>
>     varName = names[0]
>
>     varPath = ''
>
>     for d in path:
>
>       for name in names:
>
>         name, options, varName = getNames(name, resultName)
>
>         if self.checkExecutable(d, name):
>
>           found = 1
>
>           getFullPath = 1
>
>           varPath = d
>
>           break
>
>       if found: break
>
>     if useDefaultPath and not found:
>
>       for d in os.environ['PATH'].split(os.path.pathsep):
>
>         for name in names:
>
>           name, options, varName = getNames(name, resultName)
>
>           if self.checkExecutable(d, name):
>
>             found = 1
>
>             varPath = d
>
>             break
>
>         if found: break
>
>     if not found:
>
>       dirs = self.argDB['with-executables-search-path']
>
>       if not isinstance(dirs, list): dirs = [dirs]
>
>       for d in dirs:
>
>         for name in names:
>
>           name, options, varName = getNames(name, resultName)
>
>           if self.checkExecutable(d, name):
>
>             found = 1
>
>             getFullPath = 1
>
>             varPath = d
>
>             break
>
>         if found: break
>
>
>     if found:
>
>       if getFullPath:
>
>         setattr(self, varName, os.path.abspath(os.path.join(varPath,
> name))+options)
>
>       else:
>
>         setattr(self, varName, name+options)
>
>       if setMakeMacro:
>
>         self.addMakeMacro(varName.upper(), getattr(self, varName))
>
>     else:
>
>       self.logWrite('  Unable to find programs '+str(names)+' providing
> listing of each search directory to help debug\n')
>
>       self.logWrite('    Path provided in Python program\n')
>
>       for d in path:
>
>         if os.path.isdir(d):
>
>           try:
>
>             self.logWrite('      '+str(os.listdir(d))+'\n')
>
>           except OSError as e:
>
>             self.logWrite('      '+e.strerror+'\n')
>
>         else:
>
>           self.logWrite('      Warning '+d+' is not a directory\n')
>
>       if useDefaultPath:
>
>         if os.environ['PATH'].split(os.path.pathsep):
>
>           self.logWrite('    Path provided by default path\n')
>
>           for d in os.environ['PATH'].split(os.path.pathsep):
>
>             if os.path.isdir(d):
>
>               try:
>
>                 self.logWrite('      '+str(os.listdir(d))+'\n')
>
>               except OSError as e:
>
>                 self.logWrite('      '+e.strerror+'\n')
>
>             else:
>
>               self.logWrite('      Warning '+d+' is not a directory\n')
>
>       dirs = self.argDB['with-executables-search-path']
>
>       if not isinstance(dirs, list): dirs = [dirs]
>
>       if dirs:
>
>         self.logWrite('    Path provided by --with-executables-search-path
> \n')
>
>         for d in dirs:
>
>           if os.path.isdir(d):
>
>             try:
>
>               self.logWrite('      '+str(os.listdir(d))+'\n')
>
>             except OSError as e:
>
>               self.logWrite('      '+e.strerror+'\n')
>
>           else:
>
>             self.logWrite('      Warning '+d+' is not a directory\n')
>
>     return found
>
> I wasn't able to figure out why lgrind was being searched for, but running
> configure that wasn't just lgrind that sets of this bit of code, c2html
> does as well.
>
> Anyhow, with this fix, I was able to get configure to continue on until it
> failed to compile parmetis. Looking at configure.log it looks like it's
> because of a bad path to libmetis.
>
> On Thursday, January 30, 2020 at 10:54:21 AM UTC-6, Tomas Mondragon wrote:
>>
>> Configuration log is attached
>>
> --
> You received this message because you are subscribed to the Google Groups
> "moose-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to moose-users+unsubscribe at googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/moose-users/4d3bfd39-d68b-40d1-af4a-536f24860035%40googlegroups.com
> <https://groups.google.com/d/msgid/moose-users/4d3bfd39-d68b-40d1-af4a-536f24860035%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200130/2fd5852c/attachment-0001.html>


More information about the petsc-users mailing list