From c7beac295d01825505545d0ab0ff0c26a56cb84e Mon Sep 17 00:00:00 2001
From: Todd Gamblin <tgamblin@llnl.gov>
Date: Wed, 18 Dec 2013 11:36:55 -0800
Subject: [PATCH] More on installing with virtual packages

---
 lib/spack/docs/basic_usage.rst | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/lib/spack/docs/basic_usage.rst b/lib/spack/docs/basic_usage.rst
index ae591920db..1118160adf 100644
--- a/lib/spack/docs/basic_usage.rst
+++ b/lib/spack/docs/basic_usage.rst
@@ -436,6 +436,35 @@ package, e.g. if an application needs MPI-2 functions, it can depend
 on ``mpi@2:`` to indicate that it needs some implementation that
 provides MPI-2 functions.
 
+
+Constraining virtual packages
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+When installing a package that depends on a virtual package, you can
+opt to specify the particular provider you want to use, or you can let
+Spack pick.  For example, if you just type this::
+
+   spack install mpileaks
+
+Then spack will pick a provider for you according to site policies.
+If you really want a particular version, say mpich, then you could
+run this instead::
+
+   spack install mpileaks ^mpich
+
+This forces spack to use some version of ``mpich`` for its
+implementation.  As always, you can be even more specific and require
+a particular ``mpich`` version::
+
+   spack install mpileaks ^mpich@3
+
+In this case, ``mpileaks`` only needs MPI-1 commands, so any MPI
+implementation will do.  If another package depends on ``mpi@2`` and
+you try to give it an insufficient MPI implementation (e.g., one that
+provides only ``mpi@:1``), then Spack will raise an error.  Likewise,
+if you try to plug in some package that doesn't provide MPI, Spack
+will raise an error.
+
 ``spack providers``
 ~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-- 
GitLab