diff --git a/.gitignore b/.gitignore index 089f35d42..2d3b4296b 100644 --- a/.gitignore +++ b/.gitignore @@ -6,11 +6,9 @@ PyOP2.egg-info *.py[cdo] # Extension modules -computeind.c -computeind.so -sparsity.cpp sparsity.so - +sparsity.c +sparsity.cpython*.so # Docs pyop2.coffee.rst pyop2.rst diff --git a/pyop2/utils.py b/pyop2/utils.py index 85190e7d9..0fc59901d 100644 --- a/pyop2/utils.py +++ b/pyop2/utils.py @@ -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.