コード例 #1
0
def install(dest_dir, prefix=None, dry_run=False):
    log.info('PETSc: install')
    if prefix is None:
        prefix = dest_dir
    options = [
        '--destDir=' + dest_dir,
        '--prefix='  + prefix,
        ]
    log.info('install options:')
    for opt in options:
        log.info(' '*4 + opt)
    # Run PETSc installer
    if dry_run: return
    use_install_py = True
    if use_install_py:
        import install
        install.Installer(options).run()
        import logger
        logger.Logger.defaultLog = None
    else:
        make = find_executable('make')
        status = os.system(" ".join(
                [make, 'install', 'DESTDIR='+dest_dir]
                ))
        if status != 0: raise RuntimeError(status)
コード例 #2
0
def install(dry_run=False):
    log.info('PETSc: install')
    # Run PETSc installer
    if dry_run: return
    use_install_py = False
    if use_install_py:
        import install
        install.Installer().run()
        import logger
        logger.Logger.defaultLog = None
    else:
        make = find_executable('make')
        command = [make, 'install']
        status = os.system(" ".join(command))
        if status != 0: raise RuntimeError(status)