FEniCS
Installing FEniCS
The following
Step 0 (Optional): Clean out your environment
Before installing FEniCS, you might want to remove previous installations of petsc4py/FEniCS, in order to prevent conflicts when installing.
- Remove directories that contain previous installations of petsc4py/fenics. Directories can be removed by typing
rm -rf directory_name
.
- Previous installations of petsc4py/FEniCs might have data in hidden directories. Hidden directories can be seen by typing
ls -a
. Spend some time looking through hidden directories and remove anything associated with previous petsc4py/FEniCS installations.
- Check the environment variables (they can be listed with the
penv
command) and remove anything that points to previous installations of petsc4py/FEniCS.
Step 1 (Optional): Install petsc4py
Installing petsc4py is not required if you just want to use standalone FEniCS. However, petsc4py is needed in order to directly interface with PETSc, if that is something you wish to do.
To install petsc4py on Graham, first go to your home directory by typing cd $HOME
. Then, run the following script:
module purge
module load hdf5-mpi/1.8.18 boost eigen python/3.5 scipy-stack/2017b petsc/3.8.2 fftw-mpi/3.3.6 mpi4py
git clone https://bitbucket.org/petsc/petsc4py.git
cd petsc4py
git fetch && git checkout maint-3.8
python setup.py build
python setup.py install --user
export PYTHONPATH=$HOME/.local/lib/python3.5/site-packages:$PYTHONPATH
When the script completes, petsc4py should be installed. The contents of the script are based on the official petsc4py installation instructions (https://www.mcs.anl.gov/petsc/petsc4py-current/docs/usrman/install.html), so consider looking there if something goes wrong.