You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -299,9 +267,14 @@ In this section, we'll learn how to enforce that all the packages in our environ
299
267
300
268
We can customize the selection of the ``mpi`` provider using `concretization preferences <https://spack.readthedocs.io/en/latest/build_settings.html#concretization-preferences>`_ to change the behavior of the concretizer.
301
269
302
-
Let's start by examining our environment's configuration using ``spack config get``:
270
+
.. note::
271
+
272
+
Before proceeding, make sure your ``EDITOR`` environment variable
273
+
is set to the path of your preferred text editor.
274
+
275
+
Let's start by examining our environment's configuration using ``spack config edit``:
The output shows the special ``spack.yaml`` configuration file that Spack uses to store environment configurations.
@@ -331,14 +304,9 @@ The ``concretizer:unify:true`` setting controls how Spack resolves dependencies
331
304
Editing environment configuration
332
305
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
333
306
334
-
.. note::
307
+
Let's edit ``spack.yaml`` to *require* ``mpich`` as our ``mpi`` provider.
335
308
336
-
Before proceeding, make sure your ``EDITOR`` environment variable
337
-
is set to the path of your preferred text editor.
338
-
339
-
Let's edit ``spack.yaml`` to *require* ``mpich`` as our ``mpi`` provider using ``spack config edit``.
340
-
341
-
You should now have the above file open in your editor.
309
+
You should have the above file open in your editor.
342
310
Change it to include the ``packages:mpi:require`` entry below:
343
311
344
312
.. code-block:: yaml
@@ -388,10 +356,23 @@ Let's run ``spack concretize --force`` (or ``-f`` in short) to make Spack re-con
388
356
389
357
All the specs are now concrete **and** ready to be installed with ``mpich`` as the MPI implementation.
390
358
391
-
Re-concretization is sometimes also necessary when creating an environment *incrementally* with unification enabled.
392
-
Spack makes sure that already concretized specs in the environment are not modified when adding something new.
393
359
394
-
Adding and installing specs one by one leads to greedy concretization.
360
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
361
+
Creating an environment incrementally
362
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
363
+
364
+
We can also add and install specs to an environment incrementally. For example:
365
+
366
+
.. code-block:: console
367
+
368
+
$ spack install --add python
369
+
$ spack install --add py-numpy@1.20
370
+
371
+
If we create environments incrementally, Spack ensures that already installed roots are not re-concretized.
372
+
So, adding specs to an environment at a later point in time will not cause existing packages to rebuild.
373
+
374
+
Adding and installing specs incrementally leads to greedy concretization, meaning that the environment may concain different package versions compared to an environment created all at once.
375
+
395
376
When you first install ``python`` in an environment, Spack will pick a recent version for it.
396
377
If you then add ``py-numpy``, it may be in conflict with the ``python`` version already installed, and fail to concretize:
397
378
@@ -403,6 +384,16 @@ The solution is to re-concretize the environment as a whole, which causes ``pyth
0 commit comments