Skip to content

Commit bb89a05

Browse files
committed
Snapshot of additional changes
Signed-off-by: tldahlgren <dahlgren1@llnl.gov>
1 parent 1221dd1 commit bb89a05

1 file changed

Lines changed: 30 additions & 28 deletions

File tree

tutorial_packaging.rst

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Spack will look at the contents of the tarball and generate a package when we ru
7373

7474
You should now be in your text editor of choice, with the ``package.py`` file open for editing.
7575

76-
Your ``package.py`` file should reside in the ``tutorial-mpileaks`` subdirectory of your tutorial repository's ``packages`` directory, i.e., ``./repos/spack_repo/tutorial/packages/tutorial_mpileaks/package.py``.
76+
Your ``package.py`` file should reside in the ``tutorial-mpileaks`` subdirectory of your tutorial repository's ``packages`` directory, i.e., ``/home/spack/repos/spack_repo/tutorial/packages/tutorial_mpileaks/package.py``.
7777

7878
Take a moment to look over the file.
7979

@@ -85,8 +85,8 @@ As we can see from the skeleton contents, the Spack template:
8585
* provides an example homepage URL;
8686
* shows how to specify a list of package maintainers;
8787
* provides a template for the license;
88-
* specifies the version directive, with checksum, for the software;
89-
* listed the inferred language and other build dependencies;
88+
* specifies the version directive with the checksum;
89+
* lists the inferred language and other build dependencies;
9090
* provides a skeleton for another dependency;
9191
* provides a preliminary implementation of the ``autoreconf`` method; and
9292
* provides a skeleton ``configure_args`` method.
@@ -98,7 +98,8 @@ As we can see from the skeleton contents, the Spack template:
9898

9999
.. note::
100100

101-
The ``maintainers`` field is a comma-separated list of **GitHub user name** for those people who are willing to be notified when a change is made to the package and given an opportunity to review the changes.
101+
The `maintainers directive <https://spack.readthedocs.io/en/latest/packaging_guide_creation.html#maintainers>`_ holds a comma-separated list of **GitHub user name** for those accounts willing to be notified when a change is made to the package.
102+
They will be given an opportunity to review the changes.
102103
This information is useful for developers who maintain a Spack package for their own software and/or rely on software maintained by others.
103104

104105
Since we are providing a ``url``, we can confirm the checksum, or ``sha256`` calculation.
@@ -107,31 +108,29 @@ Exit your editor to return to the command line and use the ``spack checksum`` co
107108
.. literalinclude:: outputs/packaging/checksum-mpileaks-1.out
108109
:language: console
109110

110-
Note the entire ``version`` directive is provided for your convenience.
111+
where the entire ``version`` directive is provided for your convenience.
111112

112-
We will now fill in the provided placeholders as we:
113-
114-
* document some information about this package;
115-
* add dependencies; and
116-
* add the configuration arguments needed to build the package.
117-
118-
For the moment, though, let's see what Spack does with the skeleton by trying to install the package using the ``spack install`` command:
113+
Before proceeding with changes, let's see what Spack does with the skeleton by trying to install the package using the ``spack install`` command:
119114

120115
.. literalinclude:: outputs/packaging/install-mpileaks-1.out
121116
:language: console
122117

123118
The build was unsuccessful.
124119
The error indicates ``configure`` is unable to find the installation location of a dependency.
125120

126-
Let's start to customize the package for our software.
121+
We will now fill in the provided placeholders and customize the package for the software as we:
122+
123+
* document some information about this package;
124+
* add dependencies; and
125+
* add the configuration arguments needed to build the package.
127126

128127
----------------------------
129128
Adding Package Documentation
130129
----------------------------
131130

132131
First, let's fill in the documentation.
133132

134-
Bring mpileaks' ``package.py`` file back into your ``$EDITOR`` with the ``spack edit`` command:
133+
Bring mpileaks' ``package.py`` file back up in your ``$EDITOR`` with the ``spack edit`` command:
135134

136135
.. code-block:: console
137136
@@ -146,6 +145,8 @@ Let's make the following changes:
146145
* uncomment the ``maintainers`` directive and add your GitHub user name; and
147146
* add the license of the project along with your GitHub user name.
148147

148+
It helps to have the `mpileaks <https://github.com/LLNL/mpileaks>`_ repository up in your browser since you can copy-and-paste some of the values from it.
149+
149150
.. note::
150151

151152
We will exclude the ``Copyright`` clause and license identifier in the remainder of the package snippets here to reduce the length of the tutorial documentation; however, the copyright **is required** for packages contributed back to Spack.
@@ -158,7 +159,7 @@ The resulting package should contain the following information:
158159
:caption: mpileaks/package.py (from tutorial/examples/packaging/1.package.py)
159160
:lines: 5-
160161
:language: python
161-
:emphasize-lines: 5,7,10,12
162+
:emphasize-lines: 6,8,11,13
162163

163164
At this point we've only updated key documentation within the package.
164165
It won't help us build the software; however, the information is now available for review.
@@ -169,14 +170,14 @@ Let's enter the ``spack info`` command for the package:
169170
:language: console
170171

171172
Take a moment to look over the output.
172-
You should see the information derived from the package includes the description, homepage, maintainer, and license we provided.
173+
You should see the information derived from the package now includes the description, homepage, maintainer, and license we provided.
173174

174175
Also notice it shows:
175176

176177
* the preferred version derived from the code;
177178
* the default Autotools package installation phases;
178-
* the ``gnuconfig`` build dependency inherited from ``AutotoolsPackage``; and
179-
* both the link and run dependencies are ``None`` at this point.
179+
* the ``gmake`` and ``gnuconfig`` build dependencies inherited from ``AutotoolsPackage``; and
180+
* both the link and run dependencies are currently ``None``.
180181

181182
As we fill in more information about the package, the ``spack info`` command will become more informative.
182183

@@ -190,6 +191,10 @@ As we fill in more information about the package, the ``spack info`` command wil
190191

191192
Now we're ready to start filling in the build recipe.
192193

194+
.. note::
195+
196+
Refer to the `style guide <https://spack.readthedocs.io/en/latest/packaging_guide_creation.html#style-guidelines-for-packages>`_ for more information.
197+
193198
-------------------
194199
Adding Dependencies
195200
-------------------
@@ -203,8 +208,7 @@ The ``mpileaks`` software relies on three third-party libraries:
203208

204209
.. note::
205210

206-
Fortunately, all of these dependencies are built-in packages in Spack;
207-
otherwise, we would have to create packages for them as well.
211+
Fortunately, all of these dependencies are built-in packages in Spack; otherwise, we would have to create packages for them as well.
208212

209213
Bring mpileaks' ``package.py`` file back up in your ``$EDITOR`` with the ``spack edit`` command:
210214

@@ -224,13 +228,11 @@ Adding dependencies tells Spack that it must ensure these packages are installed
224228

225229
.. note::
226230

227-
The ``mpi`` dependency is different from the other two in that it is
228-
a *virtual dependency*. That means Spack must satisfy the dependency
229-
with a package that *provides* the ``mpi`` interface, such as ``openmpi``
230-
or ``mvapich2``.
231+
The ``mpi`` dependency is different from the other two in that it is a *virtual dependency*.
232+
That means Spack must satisfy the dependency with a package that *provides* the ``mpi`` interface, such as ``openmpi`` or ``mvapich2``.
231233

232-
We call such packages **providers**. More information on virtual dependencies
233-
can be found in the *Packaging Guide* linked at the bottom of this tutorial.
234+
We call such packages `providers <https://spack.readthedocs.io/en/latest/packaging_guide_creation.html#provides>`_.
235+
More information on virtual dependencies can be found in the *Packaging Guide* linked at the bottom of this tutorial.
234236

235237
Let's check that dependencies are effectively built when we try to install ``tutorial-mpileaks``:
236238

@@ -242,14 +244,14 @@ Let's check that dependencies are effectively built when we try to install ``tut
242244
This command may take a while to run and may produce more output if
243245
you don't already have an MPI installed or configured in Spack.
244246

245-
We see that Spack has now identified and built all of our dependencies.
247+
We see that Spack identified and built all of our dependencies.
246248
It found that:
247249

248250
* the ``openmpi`` package will satisfy our ``mpi`` dependency;
249251
* ``adept-utils`` is a concrete dependency; and
250252
* ``callpath`` is a concrete dependency.
251253

252-
We are still not able to build the package.
254+
But we are still not able to build the package.
253255

254256
------------------------
255257
Debugging Package Builds

0 commit comments

Comments
 (0)