This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Configuring Dolfin with Slepc4Py

+1 vote

I'm solving an eigenvalue problem using SLEPcEigenSolver and I want to set the preconditioner.

In a previous question the solution was to use the following to set the preconditioner by:

eps = eigensolver.eps()
st = eps.getST()
st.setType('sinvert')
ksp = st.getKSP()
ksp.setType('preonly')
pc = ksp.getPC()
pc.setType('lu')
pc.setFactorSolverPackage('mumps')

Unfortunately, when I try this with both the development version and the stable version for Ubuntu, I get the error:

*** Error:   Unable to access SLEPcEigenSolver objects in python.
*** Reason:  dolfin must be configured with slepc4py enabled.

Both slepc and slepc4py are installed on my system. How do I configure dolfin to use them? Do I need to build it from source or is there a better way?

closed with the note: Solved
asked Nov 13, 2015 by jb803 FEniCS Novice (200 points)
closed Nov 16, 2015 by jb803

Yes, you must build DOLFIN from source and enable slepc4py when you configure DOLFIN. How did you install FEniCS?

Thanks. I built it from source over the weekend and it now works perfectly. I had installed FEniCS 1.6.0 from the Ubuntu PPAs.

...