Skip to content

Commit 9ee0522

Browse files
committed
Snapshot of additional changes
Signed-off-by: tldahlgren <dahlgren1@llnl.gov>
1 parent f6b3a19 commit 9ee0522

1 file changed

Lines changed: 31 additions & 28 deletions

File tree

tutorial_packaging.rst

Lines changed: 31 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,9 @@ 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
149+
up in your browser since you can copy-and-paste some of the values from it.
150+
149151
.. note::
150152

151153
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 +160,7 @@ The resulting package should contain the following information:
158160
:caption: mpileaks/package.py (from tutorial/examples/packaging/1.package.py)
159161
:lines: 5-
160162
:language: python
161-
:emphasize-lines: 5,7,10,12
163+
:emphasize-lines: 6,8,11,13
162164

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

171173
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.
174+
You should see the information derived from the package now includes the description, homepage, maintainer, and license we provided.
173175

174176
Also notice it shows:
175177

176178
* the preferred version derived from the code;
177179
* 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.
180+
* the ``gmake`` and ``gnuconfig`` build dependencies inherited from ``AutotoolsPackage``; and
181+
* both the link and run dependencies are currently ``None``.
180182

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

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

191193
Now we're ready to start filling in the build recipe.
192194

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

204210
.. note::
205211

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

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

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

225230
.. note::
226231

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``.
232+
The ``mpi`` dependency is different from the other two in that it is a *virtual dependency*.
233+
That means Spack must satisfy the dependency with a package that *provides* the ``mpi`` interface, such as ``openmpi`` or ``mvapich2``.
231234

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

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

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

245-
We see that Spack has now identified and built all of our dependencies.
248+
We see that Spack identified and built all of our dependencies.
246249
It found that:
247250

248251
* the ``openmpi`` package will satisfy our ``mpi`` dependency;
249252
* ``adept-utils`` is a concrete dependency; and
250253
* ``callpath`` is a concrete dependency.
251254

252-
We are still not able to build the package.
255+
But we are still not able to build the package.
253256

254257
------------------------
255258
Debugging Package Builds

0 commit comments

Comments
 (0)