How to use the petsc.get_config function in petsc

To help you get started, we’ve selected a few petsc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github underworldcode / underworld2 / setup.py View on Github external
mpicxx = conf.get('mpicxx')
    except AttributeError:
        mpicc  = os.environ.get('MPICC')  or find_executable('mpicc')
        mpicxx = os.environ.get('MPICXX') or find_executable('mpicxx')
    if mpicc:
        options.append('--cc='+mpicc)
    if mpicxx:
        options.append('--cxx='+mpicxx)
    options.extend(split_quoted( os.environ.get('UW_CONFIGURE_OPTIONS', '')) )

    if 'PETSC_DIR' in os.environ:
        options.append('--petsc-dir='+os.environ['PETSC_DIR'])
    else:
        try:
            import petsc
            options.append('--petsc-dir='+petsc.get_config()['PETSC_DIR'])
        except:
            pass

    log.info('configure options:')
    for opt in options:
        log.info(' '*4 + opt)
    # Run UW configure
    if dry_run: return
    python = find_executable('python3')
    command = [python, './configure.py'] + options
    status = os.system(" ".join(command))
    if status != 0: raise RuntimeError(status)

petsc

PETSc: Portable, Extensible Toolkit for Scientific Computation

BSD-2-Clause
Latest version published 21 days ago

Package Health Score

60 / 100
Full package analysis