Skip to content

Commit

Permalink
Fix get_petsc_dir (#622)
Browse files Browse the repository at this point in the history
This previously relied on the old petsc Python package which we no
longer use.
  • Loading branch information
connorjward authored Jul 21, 2021
1 parent 82279dc commit dd5d060
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pyop2/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,11 @@ def get_petsc_dir():
return (dir, dir + arch)
except KeyError:
try:
import petsc
return (petsc.get_petsc_dir(), )
import petsc4py
config = petsc4py.get_config()
petsc_dir = config["PETSC_DIR"]
petsc_arch = config["PETSC_ARCH"]
return petsc_dir, petsc_dir + petsc_arch
except ImportError:
sys.exit("""Error: Could not find PETSc library.
Expand Down

0 comments on commit dd5d060

Please sign in to comment.