summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2019-09-17 18:41:18 +0200
committerTodd Gamblin <tgamblin@llnl.gov>2019-09-20 00:51:37 -0700
commit7daf8609914d929bbce7cfe8e17e40fc4ae1e01a (patch)
tree081b48178965ba8e60f40e719af53a93843863bf /lib
parent3c4322bf1abb7af691179434652188b64e90e4dc (diff)
downloadspack-7daf8609914d929bbce7cfe8e17e40fc4ae1e01a.tar.gz
spack-7daf8609914d929bbce7cfe8e17e40fc4ae1e01a.tar.bz2
spack-7daf8609914d929bbce7cfe8e17e40fc4ae1e01a.tar.xz
spack-7daf8609914d929bbce7cfe8e17e40fc4ae1e01a.zip
targets: adjust packages to use new specific targets semantics
Seamless translation from 'target=<generic>' to either - target.family == <generic> (in methods) - 'target=<generic>:' (in directives) Also updated docs to show ranges in directives.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/docs/packaging_guide.rst14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/spack/docs/packaging_guide.rst b/lib/spack/docs/packaging_guide.rst
index 1505b9a097..5adb996232 100644
--- a/lib/spack/docs/packaging_guide.rst
+++ b/lib/spack/docs/packaging_guide.rst
@@ -410,6 +410,8 @@ For tarball downloads, Spack can currently support checksums using the
MD5, SHA-1, SHA-224, SHA-256, SHA-384, and SHA-512 algorithms. It
determines the algorithm to use based on the hash length.
+.. _versions-and-fetching:
+
---------------------
Versions and fetching
---------------------
@@ -3290,7 +3292,17 @@ Within directives each of the names above can be used to match a particular targ
# This patch is only applied on icelake microarchitectures
patch("icelake.patch", when="target=icelake")
-in a similar way to what we have seen before for ``platform`` and ``os``.
+It's also possible to select all the architectures belonging to the same family
+using an open range:
+
+.. code-block:: python
+
+ class Julia(Package):
+ # This patch is applied on all x86_64 microarchitectures.
+ # The trailing colon that denotes an open range of targets
+ patch("generic_x86_64.patch", when="target=x86_64:")
+
+in a way that resembles what was shown in :ref:`versions-and-fetching` for versions.
Where ``target`` objects really shine though is when they are used in methods
called at configure, build or install time. In that case we can test targets
for supported features, for instance: