Installation#
Install from PyPI using pip#
You can use pip to install slepc4py and its dependencies.
If you have a working MPI implementation and the mpicc compiler
wrapper is on your search path, it is highly recommended to install
mpi4py first:
$ python -m pip install mpi4py
Ensure you have NumPy and petsc4py installed:
$ python -m pip install numpy petsc petsc4py
Finally, install slepc4py:
$ python -m pip install slepc slepc4py
If you already have working PETSc and SLEPc installs, set environment
variables SLEPC_DIR and PETSC_DIR (and perhaps
PETSC_ARCH for non-prefix installs) to appropriate values
and next use pip:
$ export SLEPC_DIR=/path/to/slepc
$ export PETSC_DIR=/path/to/petsc
$ export PETSC_ARCH=arch-linux2-c-opt
$ python -m pip install petsc4py slepc4py
Install from the SLEPc source tree#
If you also want to install petsc4py from the PETSc source tree, follow the instructions in the petsc4py installation page.
Set the PETSC_DIR and PETSC_ARCH
environment variables, as well as SLEPC_DIR.
Follow the instructions to build SLEPc. Then
cd to the top of the SLEPc source tree and run:
$ python -m pip install src/binding/slepc4py
The installation of slepc4py supports multiple PETSC_ARCH
in the form of a colon separated list:
$ PETSC_ARCH='arch-0:...:arch-N' python -m pip install src/binding/slepc4py
If you are cross-compiling, and the numpy module cannot be loaded on
your build host, then before invoking pip, set the
NUMPY_INCLUDE environment variable to the path that would be returned
by import numpy; numpy.get_include():
$ export NUMPY_INCLUDE=/usr/lib/pythonX/site-packages/numpy/core/include