From 8e762442661c28b3885327105d9d919fdcd929f4 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Thu, 4 Nov 2021 22:47:20 -0700 Subject: docs for experimental `--reuse` argument to `spack install` Add docs for `--reuse`, along with a warning that it will likely be removed and refactored. --- lib/spack/docs/basic_usage.rst | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/lib/spack/docs/basic_usage.rst b/lib/spack/docs/basic_usage.rst index 379e58324d..091b18f6b8 100644 --- a/lib/spack/docs/basic_usage.rst +++ b/lib/spack/docs/basic_usage.rst @@ -188,6 +188,34 @@ configuration a **spec**. In the commands above, ``mpileaks`` and ``mpileaks@3.0.4`` are both valid *specs*. We'll talk more about how you can use them to customize an installation in :ref:`sec-specs`. +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Reusing installed dependencies +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. warning:: + + The ``--reuse`` option described here is experimental, and it will + likely be replaced with a different option and configuration settings + in the next Spack release. + +By default, when you run ``spack install``, Spack tries to build a new +version of the package you asked for, along with updated versions of +its dependencies. This gets you the latest versions and configurations, +but it can result in unwanted rebuilds if you update Spack frequently. + +If you want Spack to try hard to reuse existing installations as dependencies, +you can add the ``--reuse`` option: + +.. code-block:: console + + $ spack install --reuse mpich + +This will not do anything if ``mpich`` is already installed. If ``mpich`` +is not installed, but dependencies like ``hwloc`` and ``libfabric`` are, +the ``mpich`` will be build with the installed versions, if possible. +You can use the :ref:`spack spec -I ` command to see what +will be reused and what will be built before you install. + .. _cmd-spack-uninstall: ^^^^^^^^^^^^^^^^^^^ -- cgit v1.2.3-70-g09d2