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: docs/2022-CSC_and_LO/2_Using/2_02_creating_easyconfig_files.md
+85-64Lines changed: 85 additions & 64 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,8 +45,8 @@ Reasons to consider implementing a software-specific easyblock rather than using
45
45
46
46
- 'critical' values for easyconfig parameters required to make installation succeed;
47
47
*For example, the [easyblock for bowtie2](https://github.com/easybuilders/easybuild-easyblocks/blob/develop/easybuild/easyblocks/b/bowtie2.py)
48
-
defines a number of variables used in the Makefile are specified on the make command line to ensure that the right
49
-
compilers are used.*
48
+
defines a number of variables used in the Makefile on the make command line to ensure that the right
49
+
compilers are used (look for the `build_step` in the easyblock).*
50
50
- toolchain-specific aspects of the build and installation procedure (e.g., configure options);
51
51
*For example, the [easyblock for CP2K](https://github.com/easybuilders/easybuild-easyblocks/blob/develop/easybuild/easyblocks/c/cp2k.py)
52
52
will add several compiler options when compiling with gcc and gfortran, including the infamous
@@ -172,58 +172,6 @@ We will cover the most commonly used ones here, but keep in mind that these are
172
172
A full overview of all known easyconfig parameters can be obtained via "`eb --avail-easyconfig-params`"
173
173
or just "`eb -a`" for short, or can be consulted in the [EasyBuild documentation](https://docs.easybuild.io/en/latest/version-specific/easyconfig_parameters.html).
174
174
175
-
#### Sources, patches, and checksums
176
-
177
-
In most easyconfig files you will see that a list of source files is specified via the `sources`
178
-
easyconfig parameter, usually combined
179
-
with one or more URLs where these sources can be downloaded specified via `source_urls`.
180
-
There also may be patch files listed (specified via `patches`),
181
-
and checksums for both the source files and patches (specified via `checksums`).
182
-
183
-
The `sources` easyconfig parameter is commonly defined but it is *not* mandatory,
184
-
because some easyconfig files only specify bundles of software packages and hence only
185
-
serve to generate a module file.
186
-
187
-
Here is an example of how these easyconfig parameters can be specified:
Each of these require a *list* of values, so even if there is only a single source file or download URL
203
-
you must use square brackets as shown in the example. The default value for each of these is an empty list (`[]`).
204
-
205
-
Some things worth pointing out here:
206
-
207
-
* The download URLs specified via `source_urls` do *not* include the name of the file, that is added
208
-
automatically by EasyBuild when it tries to download the file (only if it's not available already.)
209
-
* If multiple download URLs are specified, they are each tried once in order until the download of the source file was
210
-
successful. This can be useful to include backup locations where source files can be downloaded from.
211
-
* Names of source files and patches should not include hardcoded software versions, they usually use a
212
-
template value like `%(version)s` instead:
213
-
```python
214
-
sources = ['example-%(version)s-src.tar.gz']
215
-
```
216
-
EasyBuild will use the value of the `version` easyconfig parameter to determine the actual name of the source
217
-
file. This way the software version is only specified in one place and the easyconfig file is easier to
218
-
update to other software versions. A list of template values can be consulted via the EasyBuild command
219
-
line via the `--avail-easyconfig-templates` option, or in the [EasyBuild documentation](https://docs.easybuild.io/en/latest/version-specific/easyconfig_templates.html).
220
-
* Source files can also be specified in ways other than just using a filename, see the
221
-
[EasyBuild documentation](https://docs.easybuild.io/en/latest/Writing_easyconfig_files.html#common-easyconfig-param-sources-alt) for more information.
222
-
It is also possible to download a given commit from a GitHub repository.
223
-
* Specified checksums are usually SHA256 checksum values, but
224
-
[other types are also supported](https://docs.easybuild.io/en/latest/Writing_easyconfig_files.html?highlight=checksums#checksums).
225
-
226
-
227
175
#### Easyblock
228
176
229
177
The easyblock that should be used for the installation can be specified via the `easyblock` easyconfig parameter.
@@ -277,6 +225,58 @@ prefix_opt* Prefix command line option for configure script ('--pref
277
225
tar_config_opts* Override tar settings as determined by configure. [default: False]
278
226
```
279
227
228
+
#### Sources, patches, and checksums
229
+
230
+
In most easyconfig files you will see that a list of source files is specified via the `sources`
231
+
easyconfig parameter, usually combined
232
+
with one or more URLs where these sources can be downloaded specified via `source_urls`.
233
+
There also may be patch files listed (specified via `patches`),
234
+
and checksums for both the source files and patches (specified via `checksums`).
235
+
236
+
The `sources` easyconfig parameter is commonly defined but it is *not* mandatory,
237
+
because some easyconfig files only specify bundles of software packages and hence only
238
+
serve to generate a module file.
239
+
240
+
Here is an example of how these easyconfig parameters can be specified:
Each of these require a *list* of values, so even if there is only a single source file or download URL
256
+
you must use square brackets as shown in the example. The default value for each of these is an empty list (`[]`).
257
+
258
+
Some things worth pointing out here:
259
+
260
+
* The download URLs specified via `source_urls`do*not* include the name of the file, that is added
261
+
automatically by EasyBuild when it tries to download the file (only if it's not available already.)
262
+
* If multiple download URLs are specified, they are each tried once in order until the download of the source file was
263
+
successful. This can be useful to include backup locations where source files can be downloaded from.
264
+
* Names of source files and patches should not include hardcoded software versions, they usually use a
265
+
template value like `%(version)s` instead:
266
+
```python
267
+
sources = ['example-%(version)s-src.tar.gz']
268
+
```
269
+
EasyBuild will use the value of the `version` easyconfig parameter to determine the actual name of the source
270
+
file. This way the software version is only specified in one place and the easyconfig file is easier to
271
+
update to other software versions. A list of template values can be consulted via the EasyBuild command
272
+
line via the `--avail-easyconfig-templates` option, or in the [EasyBuild documentation](https://docs.easybuild.io/en/latest/version-specific/easyconfig_templates.html).
273
+
* Source files can also be specified in ways other than just using a filename, see the
274
+
[EasyBuild documentation](https://docs.easybuild.io/en/latest/Writing_easyconfig_files.html#common-easyconfig-param-sources-alt) for more information.
275
+
It is also possible to download a given commit from a GitHub repository.
276
+
* Specified checksums are usually SHA256 checksum values, but
277
+
[other types are also supported](https://docs.easybuild.io/en/latest/Writing_easyconfig_files.html?highlight=checksums#checksums).
278
+
279
+
280
280
#### Dependencies
281
281
282
282
You will often need to list one or more [dependencies](../../1_Intro/1_05_terminology/#dependencies) that are required
@@ -306,24 +306,21 @@ builddependencies = [
306
306
]
307
307
308
308
dependencies = [
309
-
('Python', '3.8.2'),
310
-
('HDF5', '1.10.6'),
311
-
('SciPy-bundle', '2020.03', '-Python-%(pyver)s'),
309
+
('cray-hdf5', EXTERNAL_MODULE),
310
+
('cray-netcdf', EXTERNAL_MODULE),
311
+
('GSL', '2.7''),
312
+
('ANTLR', '2.7.7', '-python3'),
312
313
]
313
314
```
314
315
315
316
Both `builddependencies` and `dependencies` require a list of tuples,
316
317
each of which specifying one dependency.
317
318
The name and version of a dependency is specified with a 2-tuple (a tuple with two string values).
318
319
319
-
In some cases additional information may have to be provided, as is shown in the example above for the `SciPy-bundle`
320
+
In some cases additional information may have to be provided, as is shown in the example above for the `ANTLR`
320
321
dependency where a 3rd value is specified corresponding to the `versionsuffix` value of this dependency.
321
322
If this is not specified, it is assumed to be the empty string (`''`).
322
323
323
-
Note how we use the '`%(pyver)s'` template value in the `SciPy-bundle` dependency
324
-
specification, to avoid hardcoding the Python version in different places. (Though this
325
-
specific parameter is less useful on LUMI as we currently try to build on top of `cray-python`.)
326
-
327
324
The `buildtools` build dependency shows that there is a fourth parameter specifying the toolchain
328
325
used forthat dependency and is needed if that toolchain is different from the one usedin the example.
329
326
As it is not possible to load several Cray toolchains together (they are not in a hierarchical relation)
@@ -332,10 +329,34 @@ toolchain. Here also we use a template, `%(toolchain_version)s` which - as its n
332
329
to the version of the toolchain, as we version our `buildtools` modules after the version of the Cray
333
330
toolchains for which they are intended.
334
331
332
+
When using the HPE Cray PE based toolchains, another type of dependency comes in:
333
+
[external modules](../2_03_external_modules) (discussed in the next section) that
334
+
are used to interface with modules provided by the HPE Cray PE but could also be
335
+
used to interfact with other modules that do not contain the metadata that EasyBuild
336
+
includes in module files that it generates. (EasyBuild sets a number of EasyBuild-specific
337
+
environment variables in each module, including one pointing to the installation directory
338
+
and one specifying the version of the packages.)
339
+
340
+
Another example (with modules taken from the EasyBuild common toolchains, not from a repository
341
+
on LUMI) is
342
+
343
+
```python
344
+
dependencies = [
345
+
('Python', '3.9.6'),
346
+
('HDF5', '1.12.1'),
347
+
('SciPy-bundle', '2021.10', '-Python-%(pyver)s'),
348
+
]
349
+
```
350
+
351
+
Note how we use the '`%(pyver)s'` template value in the `SciPy-bundle` dependency
352
+
specification, to avoid hardcoding the Python version in different places. (Though this
353
+
specific parameter is less useful on LUMI as we currently try to build on top of `cray-python`.)
354
+
335
355
See also the [EasyBuild documentation](https://docs.easybuild.io/en/latest/Writing_easyconfig_files.html#dependencies)
336
356
for additional options on specifying dependencies. That page specifies two more dependency types:
337
357
338
-
*`hiddendependencies` are currently not used on LUMI, and if we would use them in the future, it will likely
358
+
*`hiddendependencies` are currently not used on LUMI nor in the easyconfigs included with EasyBuild,
359
+
and if we would use them in the future, it will likely
339
360
be through a way that does not require this parameter.
340
361
*`osdependencies` can be used to let EasyBuild check if certain needed OS packages are installed.
341
362
See, e.g., the [easyconfigs for the `buildtools` package](https://github.com/Lumi-supercomputer/LUMI-SoftwareStack/tree/main/easybuild/easyconfigs/b/buildtools)
0 commit comments