예제 #1
0
def get_petsc_dir():
    PETSC_DIR = os.environ.get('PETSC_DIR')
    if PETSC_DIR: return PETSC_DIR
    try:
        import petsc
        PETSC_DIR = petsc.get_petsc_dir()
    except ImportError:
        log.warn("PETSC_DIR not specified")
        PETSC_DIR = os.path.join(os.path.sep, 'usr', 'local', 'petsc')
    return PETSC_DIR
예제 #2
0
def get_petsc_dir():
    PETSC_DIR = os.environ.get('PETSC_DIR')
    if PETSC_DIR: return PETSC_DIR
    try:
        import petsc
        PETSC_DIR = petsc.get_petsc_dir()
    except ImportError:
        log.warn("PETSC_DIR not specified")
        PETSC_DIR = os.path.join(os.path.sep, 'usr', 'local', 'petsc')
    return PETSC_DIR
예제 #3
0
파일: utils.py 프로젝트: joshcc3/PyOP2
def get_petsc_dir():
    try:
        return os.environ['PETSC_DIR']
    except KeyError:
        try:
            import petsc
            return petsc.get_petsc_dir()
        except ImportError:
            sys.exit("""Error: Could not find PETSc library.

Set the environment variable PETSC_DIR to your local PETSc base
directory or install PETSc from PyPI: pip install petsc""")
예제 #4
0
 def get_petsc_dir(petsc_dir):
     if not petsc_dir: return None
     petsc_dir = os.path.expandvars(petsc_dir)
     if not petsc_dir or '$PETSC_DIR' in petsc_dir:
         try:
             import petsc
             petsc_dir = petsc.get_petsc_dir()
         except ImportError:
             log.warn("PETSC_DIR not specified")
             return None
     petsc_dir = os.path.expanduser(petsc_dir)
     petsc_dir = os.path.abspath(petsc_dir)
     return config.chk_petsc_dir(petsc_dir)
예제 #5
0
 def get_petsc_dir(petsc_dir):
     if not petsc_dir: return None
     petsc_dir = os.path.expandvars(petsc_dir)
     if not petsc_dir or '$PETSC_DIR' in petsc_dir:
         try:
             import petsc
             petsc_dir = petsc.get_petsc_dir()
         except ImportError:
             log.warn("PETSC_DIR not specified")
             return None
     petsc_dir = os.path.expanduser(petsc_dir)
     petsc_dir = os.path.abspath(petsc_dir)
     return config.chk_petsc_dir(petsc_dir)
예제 #6
0
파일: setup.py 프로젝트: OP2/PyOP2
def get_petsc_dir():
    try:
        arch = '/' + env.get('PETSC_ARCH', '')
        dir = env['PETSC_DIR']
        return (dir, dir + arch)
    except KeyError:
        try:
            import petsc
            return (petsc.get_petsc_dir(), )
        except ImportError:
            sys.exit("""Error: Could not find PETSc library.

Set the environment variable PETSC_DIR to your local PETSc base
directory or install PETSc from PyPI: pip install petsc""")
예제 #7
0
def get_petsc_dir():
    try:
        arch = '/' + env.get('PETSC_ARCH', '')
        dir = env['PETSC_DIR']
        return (dir, dir + arch)
    except KeyError:
        try:
            import petsc
            return (petsc.get_petsc_dir(), )
        except ImportError:
            sys.exit("""Error: Could not find PETSc library.

Set the environment variable PETSC_DIR to your local PETSc base
directory or install PETSc from PyPI: pip install petsc""")
예제 #8
0
파일: setup.py 프로젝트: wence-/ssc
def get_petsc_dir():
    try:
        petsc_arch = env.get('PETSC_ARCH', '')
        petsc_dir = env['PETSC_DIR']
        if petsc_arch:
            return (petsc_dir, path.join(petsc_dir, petsc_arch))
        return (petsc_dir,)
    except KeyError:
        try:
            import petsc
            return (petsc.get_petsc_dir(), )
        except ImportError:
            sys.exit("""Error: Could not find PETSc library.

Set the environment variable PETSC_DIR / PETSC_ARCH to your local
PETSc base directory or install PETSc via pip.""")
예제 #9
0
def get_petsc_dir():
    try:
        petsc_arch = env.get('PETSC_ARCH', '')
        petsc_dir = env['PETSC_DIR']
        if petsc_arch:
            return (petsc_dir, path.join(petsc_dir, petsc_arch))
        return (petsc_dir, )
    except KeyError:
        try:
            import petsc
            return (petsc.get_petsc_dir(), )
        except ImportError:
            sys.exit("""Error: Could not find PETSc library.
Set the environment variable PETSC_DIR to your local PETSc base
directory or install PETSc from PyPI as described in the manual:
http://firedrakeproject.org/obtaining_pyop2.html#petsc
""")
예제 #10
0
파일: setup.py 프로젝트: jshipton/firedrake
def get_petsc_dir():
    try:
        petsc_arch = env.get('PETSC_ARCH', '')
        petsc_dir = env['PETSC_DIR']
        if petsc_arch:
            return (petsc_dir, path.join(petsc_dir, petsc_arch))
        return (petsc_dir,)
    except KeyError:
        try:
            import petsc
            return (petsc.get_petsc_dir(), )
        except ImportError:
            sys.exit("""Error: Could not find PETSc library.

Set the environment variable PETSC_DIR to your local PETSc base
directory or install PETSc from PyPI as described in the manual:

http://firedrakeproject.org/obtaining_pyop2.html#petsc
""")