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
Copy file name to clipboardExpand all lines: tutorial_packaging.rst
+18-17Lines changed: 18 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,14 +22,14 @@ Spack packages are installation scripts, which are essentially recipes for build
22
22
23
23
They define properties and behavior of the build, such as:
24
24
25
-
* where to find and how to retrieve the software;
26
-
* its dependencies;
27
-
* options (variants) for building from source;
28
-
* known build constraints (conflicts);
29
-
* known requirements (requires); and
30
-
* build commands.
25
+
* where to find and how to `retrieve the software<https://spack.readthedocs.io/en/latest/packaging_guide_creation.html#fetching-from-code-repositories>`_;
26
+
* its `dependencies<https://spack.readthedocs.io/en/latest/packaging_guide_creation.html#dependencies>`_;
27
+
* options (`variants<https://spack.readthedocs.io/en/latest/packaging_guide_creation.html#variants>`_) for building from source;
28
+
* known build constraints (`conflicts<https://spack.readthedocs.io/en/latest/packaging_guide_creation.html#conflicts>`_);
29
+
* known requirements (`requires<https://spack.readthedocs.io/en/latest/packaging_guide_creation.html#requires>`_); and
They can also define checks of the installed software that can be performed after the installation.
32
+
They can also define `checks<https://spack.readthedocs.io/en/latest/packaging_guide_testing.html>`_ of the installed software that can be performed after the installation.
33
33
34
34
Once we've specified a package's recipe, users can ask Spack to build the software with different features on any of the supported systems.
35
35
@@ -52,17 +52,18 @@ Creating the Package File
52
52
53
53
.. note::
54
54
55
-
Before proceeding, make sure your ``VISUAL`` or ``EDITOR`` environment variable is set to the name or path of your preferred text editor.
55
+
Before proceeding, make sure your ``SPACK_EDITOR``, ``VISUAL``, or ``EDITOR`` environment variable is set to the name or path of your preferred text editor.
56
+
Details can be found at `<https://spack.readthedocs.io/en/latest/packaging_guide_creation.html#controlling-the-editor>`_.
56
57
57
58
58
59
Suppose you want to install software that depends on mpileaks but found Spack did not already have a built-in package for it.
59
60
This means you are going to have to create one.
60
61
61
62
Spack's *create* command builds a new package from a template by taking the location of the package's source code and using it to:
62
63
63
-
* fetch the code;
64
+
* `fetch the code<https://spack.readthedocs.io/en/latest/packaging_guide_creation.html#fetching-from-code-repositories>`_;
64
65
* create a package skeleton; and
65
-
* open the file in your editor of choice.
66
+
* open the file in your `editor of choice<https://spack.readthedocs.io/en/latest/packaging_guide_creation.html#controlling-the-editor>`_.
66
67
67
68
The ``mpileaks`` source code is available in a tarball in the software's repository (https://github.com/LLNL/mpileaks).
68
69
Spack will look at the contents of the tarball and generate a package when we run ``spack create`` with the URL:
@@ -79,16 +80,16 @@ Take a moment to look over the file.
79
80
As we can see from the skeleton contents, the Spack template:
80
81
81
82
* provides information on the commands for installing and editing the package;
82
-
* imports and inherits from the inferred build system package;
83
+
* imports and inherits from the inferred `build system package<https://spack.readthedocs.io/en/latest/build_systems.html>`_;
83
84
* provides a docstring template;
84
85
* provides an example homepage URL;
85
-
* shows how to specify a list of package maintainers;
86
-
* provides a template for the license;
87
-
* specifies the version directive with the checksum;
88
-
* lists the inferred language and other build dependencies;
86
+
* shows how to specify a list of package `maintainers<https://spack.readthedocs.io/en/latest/packaging_guide_creation.html#maintainers>`_;
87
+
* provides a template for the `license<https://spack.readthedocs.io/en/latest/packaging_guide_creation.html#license-information>`_;
88
+
* specifies the `version directive <https://spack.readthedocs.io/en/latest/packaging_guide_creation.html#versions-and-urls>`_ with the `checksum<https://spack.readthedocs.io/en/latest/packaging_guide_creation.html#checksum-verification>`_;
89
+
* lists the inferred language and other build `dependencies<https://spack.readthedocs.io/en/latest/packaging_guide_creation.html#dependencies>`_;
89
90
* provides a skeleton for another dependency;
90
-
* provides a preliminary implementation of the ``autoreconf`` method; and
91
-
* provides a skeleton ``configure_args`` method.
91
+
* provides a preliminary implementation of the `autoreconf method<https://spack.readthedocs.io/en/latest/build_systems/autotoolspackage.html#using-a-custom-autoreconf-phase>`_; and
92
+
* provides a skeleton `configure_args method<https://spack.readthedocs.io/en/latest/build_systems/autotoolspackage.html#adding-flags-to-configure>`_.
0 commit comments