Skip to content

Commit

Permalink
Docs section and firedrake-install tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjward committed Nov 18, 2024
1 parent 506f253 commit 8334937
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 27 deletions.
62 changes: 45 additions & 17 deletions docs/source/download.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ gives a full list of update options. For instance additional Firedrake
packages can be installed into an existing Firedrake installation using
``firedrake-update``.

.. _system-requirements:

System requirements
-------------------

Expand Down Expand Up @@ -227,6 +229,49 @@ type::

You should now be able to run ``firedrake-update``.

Installing Firedrake with pip (experimental, Linux only)
--------------------------------------------------------

Firedrake is working towards having support for binary installs. As such there is experimental support for installing Firedrake using ``pip``, avoiding the need for a ``firedrake-install`` script. At present only Linux is tested using this install method.

Requirements
~~~~~~~~~~~~

* All the system requirements listed in :ref:`system-requirements`.
* A Firedrake-compatible PETSc installation (using our `fork of PETSc <https://github.com/firedrakeproject/petsc.git>`_). The set of flags passed to PETSc can be retrieved by passing the command ``--show-petsc-configure-options`` to ``firedrake-install``.
* The following environment variables to be set:

* ``PETSC_DIR`` and ``PETSC_ARCH`` to point to the correct location for the PETSc installation.
* ``HDF5_DIR`` to ``$PETSC_DIR/$PETSC_ARCH``.
* ``CC`` and ``MPICC`` to point to the ``mpicc`` compiler wrapper.
* ``CXX`` to point to the ``mpicxx`` compiler wrapper.
* ``MPI_HOME`` to point to the location of the MPI library (e.g. ``/opt/mpich``).

Installation
~~~~~~~~~~~~

Having set up this environment, Firedrake can now be installed (into a virtual environment) with the command::

pip install --no-binary mpi4py,h5py git+https://github.com/firedrakeproject/firedrake.git


Removing Firedrake
------------------
Firedrake and its dependencies can be removed by deleting the Firedrake
install directory. This is usually the ``firedrake`` subdirectory
created after having run ``firedrake-install``. Note that this will not
undo the installation of any system packages which are Firedrake
dependencies: removing these might affect subsequently installed
packages for which these are also dependencies.

.. _Paraview: http://www.paraview.org
.. _venv: https://docs.python.org/3/tutorial/venv.html
.. _homebrew: https://brew.sh/
.. _PETSc: https://www.mcs.anl.gov/petsc/
.. _discussions: https://github.com/firedrakeproject/firedrake/discussions
.. _issue: https://github.com/firedrakeproject/firedrake/issues
.. _WSL: https://github.com/firedrakeproject/firedrake/wiki/Installing-on-Windows-Subsystem-for-Linux

Visualisation software
----------------------

Expand Down Expand Up @@ -254,20 +299,3 @@ and can be built by executing::

This will generate the HTML documentation (this website) on your local
machine.

Removing Firedrake
------------------
Firedrake and its dependencies can be removed by deleting the Firedrake
install directory. This is usually the ``firedrake`` subdirectory
created after having run ``firedrake-install``. Note that this will not
undo the installation of any system packages which are Firedrake
dependencies: removing these might affect subsequently installed
packages for which these are also dependencies.

.. _Paraview: http://www.paraview.org
.. _venv: https://docs.python.org/3/tutorial/venv.html
.. _homebrew: https://brew.sh/
.. _PETSc: https://www.mcs.anl.gov/petsc/
.. _discussions: https://github.com/firedrakeproject/firedrake/discussions
.. _issue: https://github.com/firedrakeproject/firedrake/issues
.. _WSL: https://github.com/firedrakeproject/firedrake/wiki/Installing-on-Windows-Subsystem-for-Linux
17 changes: 7 additions & 10 deletions firedrake/scripts/firedrake-install
Original file line number Diff line number Diff line change
Expand Up @@ -1387,7 +1387,7 @@ def build_update_script():


if args.rebuild_script:
os.chdir(os.path.dirname(os.path.realpath(__file__)) + ("/../.."))
os.chdir(os.path.dirname(os.path.realpath(__file__)) + ("/../../.."))

build_update_script()

Expand Down Expand Up @@ -1787,9 +1787,8 @@ if mode == "install":
packages.remove("petsc")
except ValueError:
log.warning("PETSc wasn't in dependencies list")

# Need to install petsc first in order to resolve hdf5 dependency.
if not args.honour_petsc_dir:
else:
# Need to install petsc first in order to resolve hdf5 dependency.
with environment(**compiler_env):
with pipargs("--no-deps"):
packages.remove("petsc")
Expand Down Expand Up @@ -1854,11 +1853,6 @@ if mode == "install":
with pipargs("--no-deps"), environment(**compiler_env, **link_env):
install("firedrake/")

# Work around easy-install.pth bug.
try:
packages.remove("petsc")
except ValueError:
pass
packages.remove("petsc4py")

else:
Expand Down Expand Up @@ -1906,7 +1900,10 @@ else:
clean("slepc4py")
shutil.move("slepc4py", "slepc4py_old")

packages.remove("petsc")
try:
packages.remove("petsc")
except ValueError:
log.warning("PETSc wasn't in dependencies list")
packages.remove("petsc4py")

if args.clean:
Expand Down

0 comments on commit 8334937

Please sign in to comment.