Compare commits
164 Commits
cws/simmod
...
v0.13.4-sh
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c7ffdf5367 | ||
![]() |
3f954b8157 | ||
![]() |
cdcd3dcedd | ||
![]() |
7c1083916a | ||
![]() |
c07bbe1a25 | ||
![]() |
85032c6224 | ||
![]() |
7b7898a69c | ||
![]() |
84c5d76eae | ||
![]() |
bcd47f0bd6 | ||
![]() |
cb6a959cdb | ||
![]() |
32cd12bff7 | ||
![]() |
7021965159 | ||
![]() |
5c5743ca33 | ||
![]() |
034a7662ac | ||
![]() |
e6b6ac5898 | ||
![]() |
35037bf088 | ||
![]() |
d14c245411 | ||
![]() |
6e2ad01f20 | ||
![]() |
ef9b5a8f74 | ||
![]() |
4921ed29d5 | ||
![]() |
f4c720e902 | ||
![]() |
0a71b1d5ac | ||
![]() |
3593a7be6a | ||
![]() |
e4d2cf4441 | ||
![]() |
911e51bd89 | ||
![]() |
6ec8aea6f7 | ||
![]() |
5b11f7aa4c | ||
![]() |
97e46981b9 | ||
![]() |
873ac5e890 | ||
![]() |
4d7dae5716 | ||
![]() |
b19f0fafcc | ||
![]() |
11b1bdd119 | ||
![]() |
f749821dc2 | ||
![]() |
5abb20dcab | ||
![]() |
0c233bdd0f | ||
![]() |
0f171c7ded | ||
![]() |
b4c7520dd8 | ||
![]() |
9ab7d8f01d | ||
![]() |
a7ad344c2a | ||
![]() |
deb2d3745c | ||
![]() |
ff96ec430b | ||
![]() |
d4a959736a | ||
![]() |
5ba51a0be0 | ||
![]() |
27e1140df7 | ||
![]() |
7ab6af8a3b | ||
![]() |
0e6e93eaac | ||
![]() |
38f8bdd2bb | ||
![]() |
8e45a3fc2f | ||
![]() |
c22af99b04 | ||
![]() |
fc3a909fbc | ||
![]() |
9665754eae | ||
![]() |
0f9f9f3a85 | ||
![]() |
777a5682a6 | ||
![]() |
8994b4aab6 | ||
![]() |
98ec366470 | ||
![]() |
c61f4d7c82 | ||
![]() |
811b304230 | ||
![]() |
8f0c9ad409 | ||
![]() |
6a423a5d8a | ||
![]() |
23c37063bd | ||
![]() |
478f3a5a99 | ||
![]() |
02afb30990 | ||
![]() |
06e3f15e47 | ||
![]() |
f13ce3540d | ||
![]() |
7ae34087e3 | ||
![]() |
f0fea97e88 | ||
![]() |
54893197ed | ||
![]() |
80da1d50d1 | ||
![]() |
944c5d75cd | ||
![]() |
9ef4bc9d50 | ||
![]() |
a2af432833 | ||
![]() |
aefed311af | ||
![]() |
6ffacddcf4 | ||
![]() |
e17824f82f | ||
![]() |
57ca47f035 | ||
![]() |
4532a56b4e | ||
![]() |
86e69a48a2 | ||
![]() |
2508295d81 | ||
![]() |
1a041c051a | ||
![]() |
2262ca2e67 | ||
![]() |
2269771a91 | ||
![]() |
7f32574dd8 | ||
![]() |
d15ac30f62 | ||
![]() |
1f41347ab8 | ||
![]() |
1f4f01103b | ||
![]() |
8f46fcb512 | ||
![]() |
2d3b973ebc | ||
![]() |
7e62e0f27f | ||
![]() |
ea0db4c0f9 | ||
![]() |
0afc68e60b | ||
![]() |
8ad25d5013 | ||
![]() |
e90db68321 | ||
![]() |
9e96b89f02 | ||
![]() |
b4dae1b7fd | ||
![]() |
9e9adf1d2f | ||
![]() |
de9255247a | ||
![]() |
de5d3e3229 | ||
![]() |
e621aafc77 | ||
![]() |
c53427c98d | ||
![]() |
7a75148d1b | ||
![]() |
4210520c9d | ||
![]() |
4f3fb50ae7 | ||
![]() |
7660659107 | ||
![]() |
fcca2a518b | ||
![]() |
23e1cd7775 | ||
![]() |
58e794e95a | ||
![]() |
7ed59ed835 | ||
![]() |
512726ae5b | ||
![]() |
20851a6e6c | ||
![]() |
92bbbb9659 | ||
![]() |
5f2f2bfb84 | ||
![]() |
9b63f72d6b | ||
![]() |
4c60f01bae | ||
![]() |
cd08308463 | ||
![]() |
fe69997043 | ||
![]() |
1584a6e3c6 | ||
![]() |
c393880852 | ||
![]() |
bbe9e6bf54 | ||
![]() |
d7a00b71d4 | ||
![]() |
6775d2546a | ||
![]() |
8a154333f2 | ||
![]() |
5e637a04fd | ||
![]() |
0213869439 | ||
![]() |
22e9a9792a | ||
![]() |
4f23da9d26 | ||
![]() |
f9430e2fd4 | ||
![]() |
a2f86d5d18 | ||
![]() |
0efab6637c | ||
![]() |
2b11694b94 | ||
![]() |
088798a727 | ||
![]() |
bddbb1c22e | ||
![]() |
92f447cf1c | ||
![]() |
96f266c3e3 | ||
![]() |
d5093c20c5 | ||
![]() |
2064241c37 | ||
![]() |
721742b764 | ||
![]() |
c45bf153d8 | ||
![]() |
b98e5e66e7 | ||
![]() |
3d18bf345f | ||
![]() |
f8e9cf4081 | ||
![]() |
98e0f8b89b | ||
![]() |
263275b7ea | ||
![]() |
3e13002d7f | ||
![]() |
654e5cc924 | ||
![]() |
04a72c1834 | ||
![]() |
53cf6eb194 | ||
![]() |
5a7f186176 | ||
![]() |
987adfa9c9 | ||
![]() |
e476bb1400 | ||
![]() |
dc12233610 | ||
![]() |
29d21a0a5d | ||
![]() |
762f505da5 | ||
![]() |
8e1c326174 | ||
![]() |
0bac5d527d | ||
![]() |
79256eeb5c | ||
![]() |
de760942f2 | ||
![]() |
860641bfab | ||
![]() |
673e55f14d | ||
![]() |
54777a4f3e | ||
![]() |
db36e66592 | ||
![]() |
0d36e94407 | ||
![]() |
92c3b5b8b2 | ||
![]() |
71220a3656 | ||
![]() |
09bd29d816 |
20
.codecov.yml
20
.codecov.yml
@@ -5,7 +5,7 @@ coverage:
|
||||
status:
|
||||
project:
|
||||
default:
|
||||
threshold: 0.2%
|
||||
threshold: 0.3%
|
||||
|
||||
ignore:
|
||||
- lib/spack/spack/test/.*
|
||||
@@ -14,21 +14,3 @@ ignore:
|
||||
- share/spack/qa/.*
|
||||
|
||||
comment: off
|
||||
|
||||
# Inline codecov annotations make the code hard to read, and they add
|
||||
# annotations in files that seemingly have nothing to do with the PR.
|
||||
github_checks:
|
||||
annotations: false
|
||||
|
||||
# Attempt to fix "Missing base commit" messages in the codecov UI.
|
||||
# Because we do not run full tests on package PRs, package PRs' merge
|
||||
# commits on `develop` don't have coverage info. It appears that
|
||||
# codecov will give you an error if the pseudo-base's coverage data
|
||||
# doesn't all apply properly to the real PR base.
|
||||
#
|
||||
# See here for docs:
|
||||
# https://docs.codecov.com/docs/comparing-commits#pseudo-comparison
|
||||
# See here for another potential solution:
|
||||
# https://community.codecov.com/t/2480/15
|
||||
codecov:
|
||||
allow_coverage_offsets: true
|
||||
|
36
.coveragerc
Normal file
36
.coveragerc
Normal file
@@ -0,0 +1,36 @@
|
||||
# -*- conf -*-
|
||||
# .coveragerc to control coverage.py
|
||||
[run]
|
||||
parallel = True
|
||||
concurrency = multiprocessing
|
||||
branch = True
|
||||
source = lib
|
||||
omit =
|
||||
lib/spack/spack/test/*
|
||||
lib/spack/docs/*
|
||||
lib/spack/external/*
|
||||
share/spack/qa/*
|
||||
|
||||
[report]
|
||||
# Regexes for lines to exclude from consideration
|
||||
exclude_lines =
|
||||
# Have to re-enable the standard pragma
|
||||
pragma: no cover
|
||||
|
||||
# Don't complain about missing debug-only code:
|
||||
def __repr__
|
||||
if self\.debug
|
||||
|
||||
# Don't complain if tests don't hit defensive assertion code:
|
||||
raise AssertionError
|
||||
raise NotImplementedError
|
||||
|
||||
# Don't complain if non-runnable code isn't run:
|
||||
if 0:
|
||||
if False:
|
||||
if __name__ == .__main__.:
|
||||
|
||||
ignore_errors = True
|
||||
|
||||
[html]
|
||||
directory = htmlcov
|
@@ -8,4 +8,4 @@ share/spack/dotkit/*
|
||||
share/spack/lmod/*
|
||||
share/spack/modules/*
|
||||
lib/spack/spack/test/*
|
||||
var/spack/cache/*
|
||||
|
||||
|
45
.flake8
45
.flake8
@@ -27,47 +27,6 @@
|
||||
# - N813: camelcase imported as lowercase
|
||||
# - N814: camelcase imported as constant
|
||||
#
|
||||
# F4: pyflakes import checks, these are now checked by mypy more precisely
|
||||
# - F403: from module import *
|
||||
# - F405: undefined name or from *
|
||||
#
|
||||
# Black ignores, these are incompatible with black style and do not follow PEP-8
|
||||
# - E203: white space around slice operators can be required, ignore : warn
|
||||
# - W503: see above, already ignored for line-breaks
|
||||
#
|
||||
[flake8]
|
||||
ignore = E129,E221,E241,E272,E731,W503,W504,F999,N801,N813,N814,F403,F405
|
||||
max-line-length = 88
|
||||
|
||||
# F4: Import
|
||||
# - F405: `name` may be undefined, or undefined from star imports: `module`
|
||||
#
|
||||
# F8: Name
|
||||
# - F821: undefined name `name`
|
||||
#
|
||||
per-file-ignores =
|
||||
var/spack/repos/*/package.py:F405,F821
|
||||
|
||||
# exclude things we usually do not want linting for.
|
||||
# These still get linted when passed explicitly, as when spack flake8 passes
|
||||
# them on the command line.
|
||||
exclude =
|
||||
.git
|
||||
etc/
|
||||
opt/
|
||||
share/
|
||||
var/spack/cache/
|
||||
var/spack/gpg*/
|
||||
var/spack/junit-report/
|
||||
var/spack/mock-configs/
|
||||
lib/spack/external
|
||||
__pycache__
|
||||
var
|
||||
|
||||
format = spack
|
||||
|
||||
[flake8:local-plugins]
|
||||
report =
|
||||
spack = flake8_formatter:SpackFormatter
|
||||
paths =
|
||||
./share/spack/qa/
|
||||
ignore = E129,E221,E241,E272,E731,W503,W504,F999,N801,N813,N814
|
||||
max-line-length = 79
|
||||
|
24
.flake8_packages
Normal file
24
.flake8_packages
Normal file
@@ -0,0 +1,24 @@
|
||||
# -*- conf -*-
|
||||
# flake8 settings for Spack package files.
|
||||
#
|
||||
# This should include all the same exceptions that we use for core files.
|
||||
#
|
||||
# In Spack packages, we also allow the single `from spack import *`
|
||||
# wildcard import and dependencies can set globals for their
|
||||
# dependents. So we add exceptions for checks related to undefined names.
|
||||
#
|
||||
# Note that we also add *per-line* exemptions for certain patterns in the
|
||||
# `spack flake8` command. This is where F403 for `from spack import *`
|
||||
# is added (beause we *only* allow that wildcard).
|
||||
#
|
||||
# See .flake8 for regular exceptions.
|
||||
#
|
||||
# F4: Import
|
||||
# - F405: `name` may be undefined, or undefined from star imports: `module`
|
||||
#
|
||||
# F8: Name
|
||||
# - F821: undefined name `name`
|
||||
#
|
||||
[flake8]
|
||||
ignore = E129,E221,E241,E272,E731,W503,W504,F405,F821,F999,N801,N813,N814
|
||||
max-line-length = 79
|
2
.gitattributes
vendored
2
.gitattributes
vendored
@@ -1,3 +1 @@
|
||||
*.py diff=python
|
||||
*.lp linguist-language=Prolog
|
||||
lib/spack/external/* linguist-vendored
|
||||
|
49
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
49
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Report a bug in the core of Spack (command not working as expected, etc.)
|
||||
labels: bug
|
||||
---
|
||||
|
||||
|
||||
*Explain, in a clear and concise way, the command you ran and the result you were trying to achieve.
|
||||
Example: "I ran Spack find to list all the installed packages and..."*
|
||||
|
||||
|
||||
|
||||
### Steps to reproduce the issue
|
||||
|
||||
```console
|
||||
$ spack <command1> <spec>
|
||||
$ spack <command2> <spec>
|
||||
...
|
||||
```
|
||||
|
||||
### Error Message
|
||||
|
||||
If Spack reported an error, provide the error message. If it did not report an error
|
||||
but the output appears incorrect, provide the incorrect output. If there was no error
|
||||
message and no output but the result is incorrect, describe how it does not match
|
||||
what you expect. To provide more information you might re-run the commands with
|
||||
the additional -d/--stacktrace flags:
|
||||
```console
|
||||
$ spack -d --stacktrace <command1> <spec>
|
||||
$ spack -d --stacktrace <command2> <spec>
|
||||
...
|
||||
```
|
||||
that activate the full debug output.
|
||||
|
||||
|
||||
### Information on your system
|
||||
|
||||
This includes:
|
||||
|
||||
1. which platform you are using
|
||||
2. any relevant configuration detail (custom `packages.yaml` or `modules.yaml`, etc.)
|
||||
|
||||
-----
|
||||
|
||||
We encourage you to try, as much as possible, to reduce your problem to the minimal example that still reproduces the issue. That would help us a lot in fixing it quickly and effectively!
|
||||
|
||||
If you want to ask a question about the tool (how to use it, what it can currently do, etc.), try the `#general` channel on our Slack first. We have a welcoming community and chances are you'll get your reply faster and without opening an issue.
|
||||
|
||||
Other than that, thanks for taking the time to contribute to Spack!
|
58
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
58
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@@ -1,58 +0,0 @@
|
||||
name: "\U0001F41E Bug report"
|
||||
description: Report a bug in the core of Spack (command not working as expected, etc.)
|
||||
labels: [bug, triage]
|
||||
body:
|
||||
- type: textarea
|
||||
id: reproduce
|
||||
attributes:
|
||||
label: Steps to reproduce
|
||||
description: |
|
||||
Explain, in a clear and concise way, the command you ran and the result you were trying to achieve.
|
||||
Example: "I ran `spack find` to list all the installed packages and ..."
|
||||
placeholder: |
|
||||
```console
|
||||
$ spack <command1> <spec>
|
||||
$ spack <command2> <spec>
|
||||
...
|
||||
```
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: error
|
||||
attributes:
|
||||
label: Error message
|
||||
description: |
|
||||
If Spack reported an error, provide the error message. If it did not report an error but the output appears incorrect, provide the incorrect output. If there was no error message and no output but the result is incorrect, describe how it does not match what you expect.
|
||||
placeholder: |
|
||||
```console
|
||||
$ spack --debug --stacktrace <command>
|
||||
```
|
||||
- type: textarea
|
||||
id: information
|
||||
attributes:
|
||||
label: Information on your system
|
||||
description: Please include the output of `spack debug report`
|
||||
validations:
|
||||
required: true
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
If you have any relevant configuration detail (custom `packages.yaml` or `modules.yaml`, etc.) you can add that here as well.
|
||||
- type: checkboxes
|
||||
id: checks
|
||||
attributes:
|
||||
label: General information
|
||||
options:
|
||||
- label: I have run `spack debug report` and reported the version of Spack/Python/Platform
|
||||
required: true
|
||||
- label: I have searched the issues of this repo and believe this is not a duplicate
|
||||
required: true
|
||||
- label: I have run the failing commands in debug mode and reported the output
|
||||
required: true
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
We encourage you to try, as much as possible, to reduce your problem to the minimal example that still reproduces the issue. That would help us a lot in fixing it quickly and effectively!
|
||||
If you want to ask a question about the tool (how to use it, what it can currently do, etc.), try the `#general` channel on [our Slack](https://slack.spack.io/) first. We have a welcoming community and chances are you'll get your reply faster and without opening an issue.
|
||||
|
||||
Other than that, thanks for taking the time to contribute to Spack!
|
78
.github/ISSUE_TEMPLATE/build_error.md
vendored
Normal file
78
.github/ISSUE_TEMPLATE/build_error.md
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
---
|
||||
name: Build error
|
||||
about: Some package in Spack didn't build correctly
|
||||
labels: "build-error"
|
||||
---
|
||||
|
||||
*Thanks for taking the time to report this build failure. To proceed with the
|
||||
report please:*
|
||||
1. Title the issue "Installation issue: <name-of-the-package>".
|
||||
2. Provide the information required below.
|
||||
3. Remove the template instructions before posting the issue.
|
||||
|
||||
We encourage you to try, as much as possible, to reduce your problem to the minimal example that still reproduces the issue. That would help us a lot in fixing it quickly and effectively!
|
||||
|
||||
|
||||
---
|
||||
|
||||
### Steps to reproduce the issue
|
||||
|
||||
```console
|
||||
$ spack install <spec> # Fill in the exact spec you are using
|
||||
... # and the relevant part of the error message
|
||||
```
|
||||
|
||||
### Platform and user environment
|
||||
|
||||
Please report your OS here:
|
||||
```commandline
|
||||
$ uname -a
|
||||
Linux nuvolari 4.15.0-29-generic #31-Ubuntu SMP Tue Jul 17 15:39:52 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
|
||||
$ lsb_release -d
|
||||
Description: Ubuntu 18.04.1 LTS
|
||||
```
|
||||
and, if relevant, post or attach:
|
||||
|
||||
- `packages.yaml`
|
||||
- `compilers.yaml`
|
||||
|
||||
to the issue
|
||||
|
||||
### Additional information
|
||||
|
||||
Sometimes the issue benefits from additional details. In these cases there are
|
||||
a few things we can suggest doing. First of all, you can post the full output of:
|
||||
```console
|
||||
$ spack spec --install-status <spec>
|
||||
...
|
||||
```
|
||||
to show people whether Spack installed a faulty software or if it was not able to
|
||||
build it at all.
|
||||
|
||||
If your build didn't make it past the configure stage, Spack as also commands to parse
|
||||
logs and report error and warning messages:
|
||||
```console
|
||||
$ spack log-parse --show=errors,warnings <file-to-parse>
|
||||
```
|
||||
You might want to run this command on the `config.log` or any other similar file
|
||||
found in the stage directory:
|
||||
```console
|
||||
$ spack location -s <spec>
|
||||
```
|
||||
In case in `config.log` there are other settings that you think might be the cause
|
||||
of the build failure, you can consider attaching the file to this issue.
|
||||
|
||||
Rebuilding the package with the following options:
|
||||
```console
|
||||
$ spack -d install -j 1 <spec>
|
||||
...
|
||||
```
|
||||
will provide additional debug information. After the failure you will find two files in the current directory:
|
||||
|
||||
1. `spack-cc-<spec>.in`, which contains details on the command given in input
|
||||
to Spack's compiler wrapper
|
||||
1. `spack-cc-<spec>.out`, which contains the command used to compile / link the
|
||||
failed object after Spack's compiler wrapper did its processing
|
||||
|
||||
You can post or attach those files to provide maintainers with more information on what
|
||||
is causing the failure.
|
74
.github/ISSUE_TEMPLATE/build_error.yml
vendored
74
.github/ISSUE_TEMPLATE/build_error.yml
vendored
@@ -1,74 +0,0 @@
|
||||
name: "\U0001F4A5 Build error"
|
||||
description: Some package in Spack didn't build correctly
|
||||
title: "Installation issue: "
|
||||
labels: [build-error]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thanks for taking the time to report this build failure. To proceed with the report please:
|
||||
1. Title the issue `Installation issue: <name-of-the-package>`.
|
||||
2. Provide the information required below.
|
||||
|
||||
We encourage you to try, as much as possible, to reduce your problem to the minimal example that still reproduces the issue. That would help us a lot in fixing it quickly and effectively!
|
||||
- type: textarea
|
||||
id: reproduce
|
||||
attributes:
|
||||
label: Steps to reproduce the issue
|
||||
description: |
|
||||
Fill in the console output from the exact spec you are trying to build.
|
||||
value: |
|
||||
```console
|
||||
$ spack spec -I <spec>
|
||||
...
|
||||
```
|
||||
- type: textarea
|
||||
id: error
|
||||
attributes:
|
||||
label: Error message
|
||||
description: |
|
||||
Please post the error message from spack inside the `<details>` tag below:
|
||||
value: |
|
||||
<details><summary>Error message</summary><pre>
|
||||
...
|
||||
</pre></details>
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: information
|
||||
attributes:
|
||||
label: Information on your system
|
||||
description: Please include the output of `spack debug report`.
|
||||
validations:
|
||||
required: true
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
If you have any relevant configuration detail (custom `packages.yaml` or `modules.yaml`, etc.) you can add that here as well.
|
||||
- type: textarea
|
||||
id: additional_information
|
||||
attributes:
|
||||
label: Additional information
|
||||
description: |
|
||||
Please upload the following files:
|
||||
* **`spack-build-out.txt`**
|
||||
* **`spack-build-env.txt`**
|
||||
|
||||
They should be present in the stage directory of the failing build. Also upload any `config.log` or similar file if one exists.
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Some packages have maintainers who have volunteered to debug build failures. Run `spack maintainers <name-of-the-package>` and **@mention** them here if they exist.
|
||||
- type: checkboxes
|
||||
id: checks
|
||||
attributes:
|
||||
label: General information
|
||||
options:
|
||||
- label: I have run `spack debug report` and reported the version of Spack/Python/Platform
|
||||
required: true
|
||||
- label: I have run `spack maintainers <name-of-the-package>` and **@mentioned** any maintainers
|
||||
required: true
|
||||
- label: I have uploaded the build log and environment files
|
||||
required: true
|
||||
- label: I have searched the issues of this repo and believe this is not a duplicate
|
||||
required: true
|
1
.github/ISSUE_TEMPLATE/config.yml
vendored
1
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1 +0,0 @@
|
||||
blank_issues_enabled: true
|
28
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
28
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest adding a feature that is not yet in Spack
|
||||
labels: feature
|
||||
|
||||
---
|
||||
|
||||
*Please add a concise summary of your suggestion here.*
|
||||
|
||||
### Rationale
|
||||
|
||||
*Is your feature request related to a problem? Please describe it!*
|
||||
|
||||
### Description
|
||||
|
||||
*Describe the solution you'd like and the alternatives you have considered.*
|
||||
|
||||
|
||||
### Additional information
|
||||
*Add any other context about the feature request here.*
|
||||
|
||||
|
||||
-----
|
||||
|
||||
|
||||
If you want to ask a question about the tool (how to use it, what it can currently do, etc.), try the `#general` channel on our Slack first. We have a welcoming community and chances are you'll get your reply faster and without opening an issue.
|
||||
|
||||
Other than that, thanks for taking the time to contribute to Spack!
|
41
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
41
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
@@ -1,41 +0,0 @@
|
||||
name: "\U0001F38A Feature request"
|
||||
description: Suggest adding a feature that is not yet in Spack
|
||||
labels: [feature]
|
||||
body:
|
||||
- type: textarea
|
||||
id: summary
|
||||
attributes:
|
||||
label: Summary
|
||||
description: Please add a concise summary of your suggestion here.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: rationale
|
||||
attributes:
|
||||
label: Rationale
|
||||
description: Is your feature request related to a problem? Please describe it!
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: Description
|
||||
description: Describe the solution you'd like and the alternatives you have considered.
|
||||
- type: textarea
|
||||
id: additional_information
|
||||
attributes:
|
||||
label: Additional information
|
||||
description: Add any other context about the feature request here.
|
||||
- type: checkboxes
|
||||
id: checks
|
||||
attributes:
|
||||
label: General information
|
||||
options:
|
||||
- label: I have run `spack --version` and reported the version of Spack
|
||||
required: true
|
||||
- label: I have searched the issues of this repo and believe this is not a duplicate
|
||||
required: true
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
If you want to ask a question about the tool (how to use it, what it can currently do, etc.), try the `#general` channel on [our Slack](https://slack.spack.io/) first. We have a welcoming community and chances are you'll get your reply faster and without opening an issue.
|
||||
|
||||
Other than that, thanks for taking the time to contribute to Spack!
|
6
.github/actions/add-maintainers-as-reviewers/Dockerfile
vendored
Normal file
6
.github/actions/add-maintainers-as-reviewers/Dockerfile
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
FROM python:3.7-alpine
|
||||
|
||||
RUN pip install pygithub
|
||||
|
||||
ADD entrypoint.py /entrypoint.py
|
||||
ENTRYPOINT ["/entrypoint.py"]
|
85
.github/actions/add-maintainers-as-reviewers/entrypoint.py
vendored
Executable file
85
.github/actions/add-maintainers-as-reviewers/entrypoint.py
vendored
Executable file
@@ -0,0 +1,85 @@
|
||||
#!/usr/bin/env python
|
||||
#
|
||||
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
"""Maintainer review action.
|
||||
|
||||
This action checks which packages have changed in a PR, and adds their
|
||||
maintainers to the pull request for review.
|
||||
"""
|
||||
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
|
||||
from github import Github
|
||||
|
||||
|
||||
def spack(*args):
|
||||
"""Run the spack executable with arguments, and return the output split.
|
||||
|
||||
This does just enough to run `spack pkg` and `spack maintainers`, the
|
||||
two commands used by this action.
|
||||
"""
|
||||
github_workspace = os.environ['GITHUB_WORKSPACE']
|
||||
spack = os.path.join(github_workspace, 'bin', 'spack')
|
||||
output = subprocess.check_output([spack] + list(args))
|
||||
split = re.split(r'\s*', output.decode('utf-8').strip())
|
||||
return [s for s in split if s]
|
||||
|
||||
|
||||
def main():
|
||||
# get these first so that we'll fail early
|
||||
token = os.environ['GITHUB_TOKEN']
|
||||
event_path = os.environ['GITHUB_EVENT_PATH']
|
||||
|
||||
with open(event_path) as file:
|
||||
data = json.load(file)
|
||||
|
||||
# make sure it's a pull_request event
|
||||
assert 'pull_request' in data
|
||||
|
||||
# only request reviews on open, edit, or reopen
|
||||
action = data['action']
|
||||
if action not in ('opened', 'edited', 'reopened'):
|
||||
return
|
||||
|
||||
# get data from the event payload
|
||||
pr_data = data['pull_request']
|
||||
base_branch_name = pr_data['base']['ref']
|
||||
full_repo_name = pr_data['base']['repo']['full_name']
|
||||
pr_number = pr_data['number']
|
||||
requested_reviewers = pr_data['requested_reviewers']
|
||||
author = pr_data['user']['login']
|
||||
|
||||
# get a list of packages that this PR modified
|
||||
changed_pkgs = spack(
|
||||
'pkg', 'changed', '--type', 'ac', '%s...' % base_branch_name)
|
||||
|
||||
# get maintainers for all modified packages
|
||||
maintainers = set()
|
||||
for pkg in changed_pkgs:
|
||||
pkg_maintainers = set(spack('maintainers', pkg))
|
||||
maintainers |= pkg_maintainers
|
||||
|
||||
# remove any maintainers who are already on the PR, and the author,
|
||||
# as you can't review your own PR)
|
||||
maintainers -= set(requested_reviewers)
|
||||
maintainers -= set([author])
|
||||
|
||||
if not maintainers:
|
||||
return
|
||||
|
||||
# request reviews from each maintainer
|
||||
gh = Github(token)
|
||||
repo = gh.get_repo(full_repo_name)
|
||||
pr = repo.get_pull(pr_number)
|
||||
pr.create_review_request(list(maintainers))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
7
.github/dependabot.yml
vendored
7
.github/dependabot.yml
vendored
@@ -1,7 +0,0 @@
|
||||
version: 2
|
||||
updates:
|
||||
# Maintain dependencies for GitHub Actions
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
344
.github/workflows/bootstrap.yml
vendored
344
.github/workflows/bootstrap.yml
vendored
@@ -1,344 +0,0 @@
|
||||
name: Bootstrapping
|
||||
|
||||
on:
|
||||
# This Workflow can be triggered manually
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
branches:
|
||||
- develop
|
||||
- releases/**
|
||||
paths-ignore:
|
||||
# Don't run if we only modified packages in the
|
||||
# built-in repository or documentation
|
||||
- 'var/spack/repos/builtin/**'
|
||||
- '!var/spack/repos/builtin/packages/clingo-bootstrap/**'
|
||||
- '!var/spack/repos/builtin/packages/clingo/**'
|
||||
- '!var/spack/repos/builtin/packages/python/**'
|
||||
- '!var/spack/repos/builtin/packages/re2c/**'
|
||||
- 'lib/spack/docs/**'
|
||||
schedule:
|
||||
# nightly at 2:16 AM
|
||||
- cron: '16 2 * * *'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_number }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
|
||||
fedora-clingo-sources:
|
||||
runs-on: ubuntu-latest
|
||||
container: "fedora:latest"
|
||||
if: github.repository == 'spack/spack'
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
dnf install -y \
|
||||
bzip2 curl file gcc-c++ gcc gcc-gfortran git gnupg2 gzip \
|
||||
make patch unzip which xz python3 python3-devel tree \
|
||||
cmake bison bison-devel libstdc++-static
|
||||
- name: Checkout
|
||||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
|
||||
- name: Setup non-root user
|
||||
run: |
|
||||
# See [1] below
|
||||
git config --global --add safe.directory /__w/spack/spack
|
||||
useradd spack-test && mkdir -p ~spack-test
|
||||
chown -R spack-test . ~spack-test
|
||||
- name: Setup repo
|
||||
shell: runuser -u spack-test -- bash {0}
|
||||
run: |
|
||||
git --version
|
||||
git fetch --unshallow
|
||||
. .github/workflows/setup_git.sh
|
||||
- name: Bootstrap clingo
|
||||
shell: runuser -u spack-test -- bash {0}
|
||||
run: |
|
||||
source share/spack/setup-env.sh
|
||||
spack bootstrap untrust github-actions-v0.2
|
||||
spack external find cmake bison
|
||||
spack -d solve zlib
|
||||
tree ~/.spack/bootstrap/store/
|
||||
|
||||
ubuntu-clingo-sources:
|
||||
runs-on: ubuntu-latest
|
||||
container: "ubuntu:latest"
|
||||
if: github.repository == 'spack/spack'
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
env:
|
||||
DEBIAN_FRONTEND: noninteractive
|
||||
run: |
|
||||
apt-get update -y && apt-get upgrade -y
|
||||
apt-get install -y \
|
||||
bzip2 curl file g++ gcc gfortran git gnupg2 gzip \
|
||||
make patch unzip xz-utils python3 python3-dev tree \
|
||||
cmake bison
|
||||
- name: Checkout
|
||||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
|
||||
- name: Setup non-root user
|
||||
run: |
|
||||
# See [1] below
|
||||
git config --global --add safe.directory /__w/spack/spack
|
||||
useradd spack-test && mkdir -p ~spack-test
|
||||
chown -R spack-test . ~spack-test
|
||||
- name: Setup repo
|
||||
shell: runuser -u spack-test -- bash {0}
|
||||
run: |
|
||||
git --version
|
||||
git fetch --unshallow
|
||||
. .github/workflows/setup_git.sh
|
||||
- name: Bootstrap clingo
|
||||
shell: runuser -u spack-test -- bash {0}
|
||||
run: |
|
||||
source share/spack/setup-env.sh
|
||||
spack bootstrap untrust github-actions-v0.2
|
||||
spack external find cmake bison
|
||||
spack -d solve zlib
|
||||
tree ~/.spack/bootstrap/store/
|
||||
|
||||
ubuntu-clingo-binaries-and-patchelf:
|
||||
runs-on: ubuntu-latest
|
||||
container: "ubuntu:latest"
|
||||
if: github.repository == 'spack/spack'
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
env:
|
||||
DEBIAN_FRONTEND: noninteractive
|
||||
run: |
|
||||
apt-get update -y && apt-get upgrade -y
|
||||
apt-get install -y \
|
||||
bzip2 curl file g++ gcc gfortran git gnupg2 gzip \
|
||||
make patch unzip xz-utils python3 python3-dev tree
|
||||
- name: Checkout
|
||||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
|
||||
- name: Setup non-root user
|
||||
run: |
|
||||
# See [1] below
|
||||
git config --global --add safe.directory /__w/spack/spack
|
||||
useradd spack-test && mkdir -p ~spack-test
|
||||
chown -R spack-test . ~spack-test
|
||||
- name: Setup repo
|
||||
shell: runuser -u spack-test -- bash {0}
|
||||
run: |
|
||||
git --version
|
||||
git fetch --unshallow
|
||||
. .github/workflows/setup_git.sh
|
||||
- name: Bootstrap clingo
|
||||
shell: runuser -u spack-test -- bash {0}
|
||||
run: |
|
||||
source share/spack/setup-env.sh
|
||||
spack -d solve zlib
|
||||
tree ~/.spack/bootstrap/store/
|
||||
|
||||
opensuse-clingo-sources:
|
||||
runs-on: ubuntu-latest
|
||||
container: "opensuse/leap:latest"
|
||||
if: github.repository == 'spack/spack'
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
# Harden CI by applying the workaround described here: https://www.suse.com/support/kb/doc/?id=000019505
|
||||
zypper update -y || zypper update -y
|
||||
zypper install -y \
|
||||
bzip2 curl file gcc-c++ gcc gcc-fortran tar git gpg2 gzip \
|
||||
make patch unzip which xz python3 python3-devel tree \
|
||||
cmake bison
|
||||
- name: Checkout
|
||||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
|
||||
- name: Setup repo
|
||||
run: |
|
||||
# See [1] below
|
||||
git config --global --add safe.directory /__w/spack/spack
|
||||
git --version
|
||||
git fetch --unshallow
|
||||
. .github/workflows/setup_git.sh
|
||||
- name: Bootstrap clingo
|
||||
run: |
|
||||
source share/spack/setup-env.sh
|
||||
spack bootstrap untrust github-actions-v0.2
|
||||
spack external find cmake bison
|
||||
spack -d solve zlib
|
||||
tree ~/.spack/bootstrap/store/
|
||||
|
||||
macos-clingo-sources:
|
||||
runs-on: macos-latest
|
||||
if: github.repository == 'spack/spack'
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
brew install cmake bison@2.7 tree
|
||||
- name: Checkout
|
||||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
|
||||
- name: Bootstrap clingo
|
||||
run: |
|
||||
source share/spack/setup-env.sh
|
||||
export PATH=/usr/local/opt/bison@2.7/bin:$PATH
|
||||
spack bootstrap untrust github-actions-v0.2
|
||||
spack external find --not-buildable cmake bison
|
||||
spack -d solve zlib
|
||||
tree ~/.spack/bootstrap/store/
|
||||
|
||||
macos-clingo-binaries:
|
||||
runs-on: ${{ matrix.macos-version }}
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ['3.5', '3.6', '3.7', '3.8', '3.9', '3.10']
|
||||
macos-version: ['macos-10.15', 'macos-11', 'macos-12']
|
||||
if: github.repository == 'spack/spack'
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
brew install tree
|
||||
- name: Checkout
|
||||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
|
||||
- uses: actions/setup-python@c4e89fac7e8767b327bbad6cb4d859eda999cf08
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Bootstrap clingo
|
||||
run: |
|
||||
source share/spack/setup-env.sh
|
||||
spack bootstrap untrust spack-install
|
||||
spack -d solve zlib
|
||||
tree ~/.spack/bootstrap/store/
|
||||
|
||||
ubuntu-clingo-binaries:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ['2.7', '3.5', '3.6', '3.7', '3.8', '3.9', '3.10']
|
||||
if: github.repository == 'spack/spack'
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
|
||||
- uses: actions/setup-python@c4e89fac7e8767b327bbad6cb4d859eda999cf08
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Setup repo
|
||||
run: |
|
||||
git --version
|
||||
git fetch --unshallow
|
||||
. .github/workflows/setup_git.sh
|
||||
- name: Bootstrap clingo
|
||||
run: |
|
||||
source share/spack/setup-env.sh
|
||||
spack bootstrap untrust spack-install
|
||||
spack -d solve zlib
|
||||
tree ~/.spack/bootstrap/store/
|
||||
|
||||
ubuntu-gnupg-binaries:
|
||||
runs-on: ubuntu-latest
|
||||
container: "ubuntu:latest"
|
||||
if: github.repository == 'spack/spack'
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
env:
|
||||
DEBIAN_FRONTEND: noninteractive
|
||||
run: |
|
||||
apt-get update -y && apt-get upgrade -y
|
||||
apt-get install -y \
|
||||
bzip2 curl file g++ gcc patchelf gfortran git gzip \
|
||||
make patch unzip xz-utils python3 python3-dev tree
|
||||
- name: Checkout
|
||||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
|
||||
- name: Setup non-root user
|
||||
run: |
|
||||
# See [1] below
|
||||
git config --global --add safe.directory /__w/spack/spack
|
||||
useradd spack-test && mkdir -p ~spack-test
|
||||
chown -R spack-test . ~spack-test
|
||||
- name: Setup repo
|
||||
shell: runuser -u spack-test -- bash {0}
|
||||
run: |
|
||||
git --version
|
||||
git fetch --unshallow
|
||||
. .github/workflows/setup_git.sh
|
||||
- name: Bootstrap GnuPG
|
||||
shell: runuser -u spack-test -- bash {0}
|
||||
run: |
|
||||
source share/spack/setup-env.sh
|
||||
spack bootstrap untrust spack-install
|
||||
spack -d gpg list
|
||||
tree ~/.spack/bootstrap/store/
|
||||
|
||||
ubuntu-gnupg-sources:
|
||||
runs-on: ubuntu-latest
|
||||
container: "ubuntu:latest"
|
||||
if: github.repository == 'spack/spack'
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
env:
|
||||
DEBIAN_FRONTEND: noninteractive
|
||||
run: |
|
||||
apt-get update -y && apt-get upgrade -y
|
||||
apt-get install -y \
|
||||
bzip2 curl file g++ gcc patchelf gfortran git gzip \
|
||||
make patch unzip xz-utils python3 python3-dev tree \
|
||||
gawk
|
||||
- name: Checkout
|
||||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
|
||||
- name: Setup non-root user
|
||||
run: |
|
||||
# See [1] below
|
||||
git config --global --add safe.directory /__w/spack/spack
|
||||
useradd spack-test && mkdir -p ~spack-test
|
||||
chown -R spack-test . ~spack-test
|
||||
- name: Setup repo
|
||||
shell: runuser -u spack-test -- bash {0}
|
||||
run: |
|
||||
git --version
|
||||
git fetch --unshallow
|
||||
. .github/workflows/setup_git.sh
|
||||
- name: Bootstrap GnuPG
|
||||
shell: runuser -u spack-test -- bash {0}
|
||||
run: |
|
||||
source share/spack/setup-env.sh
|
||||
spack solve zlib
|
||||
spack bootstrap untrust github-actions-v0.2
|
||||
spack -d gpg list
|
||||
tree ~/.spack/bootstrap/store/
|
||||
|
||||
macos-gnupg-binaries:
|
||||
runs-on: macos-latest
|
||||
if: github.repository == 'spack/spack'
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
brew install tree
|
||||
# Remove GnuPG since we want to bootstrap it
|
||||
sudo rm -rf /usr/local/bin/gpg
|
||||
- name: Checkout
|
||||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
|
||||
- name: Bootstrap GnuPG
|
||||
run: |
|
||||
source share/spack/setup-env.sh
|
||||
spack bootstrap untrust spack-install
|
||||
spack -d gpg list
|
||||
tree ~/.spack/bootstrap/store/
|
||||
|
||||
macos-gnupg-sources:
|
||||
runs-on: macos-latest
|
||||
if: github.repository == 'spack/spack'
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
brew install gawk tree
|
||||
# Remove GnuPG since we want to bootstrap it
|
||||
sudo rm -rf /usr/local/bin/gpg
|
||||
- name: Checkout
|
||||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
|
||||
- name: Bootstrap GnuPG
|
||||
run: |
|
||||
source share/spack/setup-env.sh
|
||||
spack solve zlib
|
||||
spack bootstrap untrust github-actions-v0.2
|
||||
spack -d gpg list
|
||||
tree ~/.spack/bootstrap/store/
|
||||
|
||||
|
||||
# [1] Distros that have patched git to resolve CVE-2022-24765 (e.g. Ubuntu patching v2.25.1)
|
||||
# introduce breaking behaviorso we have to set `safe.directory` in gitconfig ourselves.
|
||||
# See:
|
||||
# - https://github.blog/2022-04-12-git-security-vulnerability-announced/
|
||||
# - https://github.com/actions/checkout/issues/760
|
||||
# - http://changelogs.ubuntu.com/changelogs/pool/main/g/git/git_2.25.1-1ubuntu3.3/changelog
|
120
.github/workflows/build-containers.yml
vendored
120
.github/workflows/build-containers.yml
vendored
@@ -1,120 +0,0 @@
|
||||
name: Containers
|
||||
|
||||
on:
|
||||
# This Workflow can be triggered manually
|
||||
workflow_dispatch:
|
||||
# Build new Spack develop containers nightly.
|
||||
schedule:
|
||||
- cron: '34 0 * * *'
|
||||
# Run on pull requests that modify this file
|
||||
pull_request:
|
||||
branches:
|
||||
- develop
|
||||
paths:
|
||||
- '.github/workflows/build-containers.yml'
|
||||
- 'share/spack/docker/*'
|
||||
- 'share/templates/container/*'
|
||||
- 'lib/spack/spack/container/*'
|
||||
# Let's also build & tag Spack containers on releases.
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_number }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
deploy-images:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
packages: write
|
||||
strategy:
|
||||
# Even if one container fails to build we still want the others
|
||||
# to continue their builds.
|
||||
fail-fast: false
|
||||
# A matrix of Dockerfile paths, associated tags, and which architectures
|
||||
# they support.
|
||||
matrix:
|
||||
# Meaning of the various items in the matrix list
|
||||
# 0: Container name (e.g. ubuntu-bionic)
|
||||
# 1: Platforms to build for
|
||||
# 2: Base image (e.g. ubuntu:18.04)
|
||||
dockerfile: [[amazon-linux, 'linux/amd64,linux/arm64', 'amazonlinux:2'],
|
||||
[centos7, 'linux/amd64,linux/arm64,linux/ppc64le', 'centos:7'],
|
||||
[centos-stream, 'linux/amd64,linux/arm64,linux/ppc64le', 'centos:stream'],
|
||||
[leap15, 'linux/amd64,linux/arm64,linux/ppc64le', 'opensuse/leap:15'],
|
||||
[ubuntu-bionic, 'linux/amd64,linux/arm64,linux/ppc64le', 'ubuntu:18.04'],
|
||||
[ubuntu-focal, 'linux/amd64,linux/arm64,linux/ppc64le', 'ubuntu:20.04'],
|
||||
[ubuntu-jammy, 'linux/amd64,linux/arm64,linux/ppc64le', 'ubuntu:22.04']]
|
||||
name: Build ${{ matrix.dockerfile[0] }}
|
||||
if: github.repository == 'spack/spack'
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # @v2
|
||||
|
||||
- name: Set Container Tag Normal (Nightly)
|
||||
run: |
|
||||
container="${{ matrix.dockerfile[0] }}:latest"
|
||||
echo "container=${container}" >> $GITHUB_ENV
|
||||
echo "versioned=${container}" >> $GITHUB_ENV
|
||||
|
||||
# On a new release create a container with the same tag as the release.
|
||||
- name: Set Container Tag on Release
|
||||
if: github.event_name == 'release'
|
||||
run: |
|
||||
versioned="${{matrix.dockerfile[0]}}:${GITHUB_REF##*/}"
|
||||
echo "versioned=${versioned}" >> $GITHUB_ENV
|
||||
|
||||
- name: Generate the Dockerfile
|
||||
env:
|
||||
SPACK_YAML_OS: "${{ matrix.dockerfile[2] }}"
|
||||
run: |
|
||||
.github/workflows/generate_spack_yaml_containerize.sh
|
||||
. share/spack/setup-env.sh
|
||||
mkdir -p dockerfiles/${{ matrix.dockerfile[0] }}
|
||||
spack containerize --last-stage=bootstrap | tee dockerfiles/${{ matrix.dockerfile[0] }}/Dockerfile
|
||||
printf "Preparing to build ${{ env.container }} from dockerfiles/${{ matrix.dockerfile[0] }}/Dockerfile"
|
||||
if [ ! -f "dockerfiles/${{ matrix.dockerfile[0] }}/Dockerfile" ]; then
|
||||
printf "dockerfiles/${{ matrix.dockerfile[0] }}/Dockerfile does not exist"
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
- name: Upload Dockerfile
|
||||
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8
|
||||
with:
|
||||
name: dockerfiles
|
||||
path: dockerfiles
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@8b122486cedac8393e77aa9734c3528886e4a1a8 # @v1
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@dc7b9719a96d48369863986a06765841d7ea23f6 # @v1
|
||||
|
||||
- name: Log in to GitHub Container Registry
|
||||
uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b # @v1
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Log in to DockerHub
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b # @v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Build & Deploy ${{ matrix.dockerfile[0] }}
|
||||
uses: docker/build-push-action@e551b19e49efd4e98792db7592c17c09b89db8d8 # @v2
|
||||
with:
|
||||
context: dockerfiles/${{ matrix.dockerfile[0] }}
|
||||
platforms: ${{ matrix.dockerfile[1] }}
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
tags: |
|
||||
spack/${{ env.container }}
|
||||
spack/${{ env.versioned }}
|
||||
ghcr.io/spack/${{ env.container }}
|
||||
ghcr.io/spack/${{ env.versioned }}
|
7
.github/workflows/execute_installer.ps1
vendored
7
.github/workflows/execute_installer.ps1
vendored
@@ -1,7 +0,0 @@
|
||||
$ proc = Start-Process ${{ env.spack_installer }}\spack.exe "/install /quiet" -Passthru
|
||||
$handle = $proc.Handle # cache proc.Handle
|
||||
$proc.WaitForExit();
|
||||
|
||||
if ($proc.ExitCode -ne 0) {
|
||||
Write-Warning "$_ exited with status code $($proc.ExitCode)"
|
||||
}
|
@@ -1,9 +0,0 @@
|
||||
#!/bin/bash
|
||||
(echo "spack:" \
|
||||
&& echo " specs: []" \
|
||||
&& echo " container:" \
|
||||
&& echo " format: docker" \
|
||||
&& echo " images:" \
|
||||
&& echo " os: \"${SPACK_YAML_OS}\"" \
|
||||
&& echo " spack:" \
|
||||
&& echo " ref: ${GITHUB_REF}") > spack.yaml
|
8
.github/workflows/install_spack.sh
vendored
8
.github/workflows/install_spack.sh
vendored
@@ -1,8 +0,0 @@
|
||||
#!/usr/bin/env sh
|
||||
. share/spack/setup-env.sh
|
||||
echo -e "config:\n build_jobs: 2" > etc/spack/config.yaml
|
||||
spack config add "packages:all:target:[x86_64]"
|
||||
spack compiler find
|
||||
spack compiler info apple-clang
|
||||
spack debug report
|
||||
spack solve zlib
|
57
.github/workflows/linux_build_tests.yaml
vendored
Normal file
57
.github/workflows/linux_build_tests.yaml
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
name: linux builds
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- develop
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
- develop
|
||||
paths-ignore:
|
||||
# Don't run if we only modified packages in the built-in repository
|
||||
- 'var/spack/repos/builtin/**'
|
||||
- '!var/spack/repos/builtin/packages/lz4/**'
|
||||
- '!var/spack/repos/builtin/packages/mpich/**'
|
||||
- '!var/spack/repos/builtin/packages/tut/**'
|
||||
- '!var/spack/repos/builtin/packages/py-setuptools/**'
|
||||
- '!var/spack/repos/builtin/packages/openjpeg/**'
|
||||
- '!var/spack/repos/builtin/packages/r-rcpp/**'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
package: [lz4, mpich, tut, py-setuptools, openjpeg, r-rcpp]
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Cache ccache's store
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.ccache
|
||||
key: ccache-build-${{ matrix.package }}
|
||||
restore-keys: |
|
||||
ccache-build-${{ matrix.package }}
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: 3.8
|
||||
- name: Install System Packages
|
||||
run: |
|
||||
sudo apt-get -yqq install ccache gfortran perl perl-base r-base r-base-core r-base-dev findutils openssl libssl-dev libpciaccess-dev
|
||||
R --version
|
||||
perl --version
|
||||
- name: Copy Configuration
|
||||
run: |
|
||||
ccache -M 300M && ccache -z
|
||||
# Set up external deps for build tests, b/c they take too long to compile
|
||||
cp share/spack/qa/configuration/*.yaml etc/spack/
|
||||
- name: Run the build test
|
||||
run: |
|
||||
. share/spack/setup-env.sh
|
||||
SPEC=${{ matrix.package }} share/spack/qa/run-build-tests
|
||||
ccache -s
|
71
.github/workflows/macos_python.yml
vendored
71
.github/workflows/macos_python.yml
vendored
@@ -1,71 +0,0 @@
|
||||
# These are nightly package tests for macOS
|
||||
# focus areas:
|
||||
# - initial user experience
|
||||
# - scientific python stack
|
||||
name: macOS builds nightly
|
||||
|
||||
on:
|
||||
schedule:
|
||||
# nightly at 1 AM
|
||||
- cron: '0 1 * * *'
|
||||
pull_request:
|
||||
branches:
|
||||
- develop
|
||||
paths:
|
||||
# Run if we modify this yaml file
|
||||
- '.github/workflows/macos_python.yml'
|
||||
# TODO: run if we touch any of the recipes involved in this
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_number }}
|
||||
cancel-in-progress: true
|
||||
|
||||
# GitHub Action Limits
|
||||
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
|
||||
|
||||
jobs:
|
||||
install_gcc:
|
||||
name: gcc with clang
|
||||
if: github.repository == 'spack/spack'
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # @v2
|
||||
- uses: actions/setup-python@c4e89fac7e8767b327bbad6cb4d859eda999cf08 # @v2
|
||||
with:
|
||||
python-version: 3.9
|
||||
- name: spack install
|
||||
run: |
|
||||
. .github/workflows/install_spack.sh
|
||||
# 9.2.0 is the latest version on which we apply homebrew patch
|
||||
spack install -v --fail-fast gcc@11.2.0 %apple-clang
|
||||
|
||||
install_jupyter_clang:
|
||||
name: jupyter
|
||||
if: github.repository == 'spack/spack'
|
||||
runs-on: macos-latest
|
||||
timeout-minutes: 700
|
||||
steps:
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # @v2
|
||||
- uses: actions/setup-python@c4e89fac7e8767b327bbad6cb4d859eda999cf08 # @v2
|
||||
with:
|
||||
python-version: 3.9
|
||||
- name: spack install
|
||||
run: |
|
||||
. .github/workflows/install_spack.sh
|
||||
spack install -v --fail-fast py-jupyterlab %apple-clang
|
||||
|
||||
install_scipy_clang:
|
||||
name: scipy, mpl, pd
|
||||
if: github.repository == 'spack/spack'
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # @v2
|
||||
- uses: actions/setup-python@c4e89fac7e8767b327bbad6cb4d859eda999cf08 # @v2
|
||||
with:
|
||||
python-version: 3.9
|
||||
- name: spack install
|
||||
run: |
|
||||
. .github/workflows/install_spack.sh
|
||||
spack install -v --fail-fast py-scipy %apple-clang
|
||||
spack install -v --fail-fast py-matplotlib %apple-clang
|
||||
spack install -v --fail-fast py-pandas %apple-clang
|
30
.github/workflows/minimum_python_versions.yaml
vendored
Normal file
30
.github/workflows/minimum_python_versions.yaml
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
name: python version check
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- develop
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
- develop
|
||||
jobs:
|
||||
validate:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: 3.7
|
||||
- name: Install Python Packages
|
||||
run: |
|
||||
pip install --upgrade pip
|
||||
pip install --upgrade vermin
|
||||
- name: Minimum Version (Spack's Core)
|
||||
run: vermin --backport argparse -t=2.6- -t=3.5- -v lib/spack/spack/ lib/spack/llnl/ bin/
|
||||
- name: Minimum Version (Repositories)
|
||||
run: vermin --backport argparse -t=2.6- -t=3.5- -v var/spack/repos
|
12
.github/workflows/setup_git.ps1
vendored
12
.github/workflows/setup_git.ps1
vendored
@@ -1,12 +0,0 @@
|
||||
# (c) 2021 Lawrence Livermore National Laboratory
|
||||
|
||||
Set-Location spack
|
||||
|
||||
git config --global user.email "spack@example.com"
|
||||
git config --global user.name "Test User"
|
||||
git config --global core.longpaths true
|
||||
|
||||
if ($(git branch --show-current) -ne "develop")
|
||||
{
|
||||
git branch develop origin/develop
|
||||
}
|
8
.github/workflows/setup_git.sh
vendored
8
.github/workflows/setup_git.sh
vendored
@@ -1,8 +0,0 @@
|
||||
#!/bin/bash -e
|
||||
git config --global user.email "spack@example.com"
|
||||
git config --global user.name "Test User"
|
||||
|
||||
# create a local pr base branch
|
||||
if [[ -n $GITHUB_BASE_REF ]]; then
|
||||
git fetch origin "${GITHUB_BASE_REF}:${GITHUB_BASE_REF}"
|
||||
fi
|
4
.github/workflows/system_shortcut_check.ps1
vendored
4
.github/workflows/system_shortcut_check.ps1
vendored
@@ -1,4 +0,0 @@
|
||||
param ($systemFolder, $shortcut)
|
||||
|
||||
$start = [System.Environment]::GetFolderPath("$systemFolder")
|
||||
Invoke-Item "$start\Programs\Spack\$shortcut"
|
361
.github/workflows/unit_tests.yaml
vendored
361
.github/workflows/unit_tests.yaml
vendored
@@ -1,361 +0,0 @@
|
||||
name: linux tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
- releases/**
|
||||
pull_request:
|
||||
branches:
|
||||
- develop
|
||||
- releases/**
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_number }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
# Validate that the code can be run on all the Python versions
|
||||
# supported by Spack
|
||||
validate:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # @v2
|
||||
- uses: actions/setup-python@c4e89fac7e8767b327bbad6cb4d859eda999cf08 # @v2
|
||||
with:
|
||||
python-version: '3.10'
|
||||
- name: Install Python Packages
|
||||
run: |
|
||||
pip install --upgrade pip
|
||||
pip install --upgrade vermin
|
||||
- name: vermin (Spack's Core)
|
||||
run: vermin --backport argparse --violations --backport typing -t=2.7- -t=3.5- -vvv lib/spack/spack/ lib/spack/llnl/ bin/
|
||||
- name: vermin (Repositories)
|
||||
run: vermin --backport argparse --violations --backport typing -t=2.7- -t=3.5- -vvv var/spack/repos
|
||||
# Run style checks on the files that have been changed
|
||||
style:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # @v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-python@c4e89fac7e8767b327bbad6cb4d859eda999cf08 # @v2
|
||||
with:
|
||||
python-version: '3.10'
|
||||
- name: Install Python packages
|
||||
run: |
|
||||
pip install --upgrade pip six setuptools types-six
|
||||
- name: Setup git configuration
|
||||
run: |
|
||||
# Need this for the git tests to succeed.
|
||||
git --version
|
||||
. .github/workflows/setup_git.sh
|
||||
- name: Run style tests
|
||||
run: |
|
||||
share/spack/qa/run-style-tests
|
||||
# Check which files have been updated by the PR
|
||||
changes:
|
||||
runs-on: ubuntu-latest
|
||||
# Set job outputs to values from filter step
|
||||
outputs:
|
||||
core: ${{ steps.filter.outputs.core }}
|
||||
packages: ${{ steps.filter.outputs.packages }}
|
||||
with_coverage: ${{ steps.coverage.outputs.with_coverage }}
|
||||
steps:
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # @v2
|
||||
if: ${{ github.event_name == 'push' }}
|
||||
with:
|
||||
fetch-depth: 0
|
||||
# For pull requests it's not necessary to checkout the code
|
||||
- uses: dorny/paths-filter@b2feaf19c27470162a626bd6fa8438ae5b263721
|
||||
id: filter
|
||||
with:
|
||||
# See https://github.com/dorny/paths-filter/issues/56 for the syntax used below
|
||||
filters: |
|
||||
core:
|
||||
- './!(var/**)/**'
|
||||
packages:
|
||||
- 'var/**'
|
||||
# Some links for easier reference:
|
||||
#
|
||||
# "github" context: https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#github-context
|
||||
# job outputs: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idoutputs
|
||||
# setting environment variables from earlier steps: https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
|
||||
#
|
||||
- id: coverage
|
||||
# Run the subsequent jobs with coverage if core has been modified,
|
||||
# regardless of whether this is a pull request or a push to a branch
|
||||
run: |
|
||||
echo Core changes: ${{ steps.filter.outputs.core }}
|
||||
echo Event name: ${{ github.event_name }}
|
||||
if [ "${{ steps.filter.outputs.core }}" == "true" ]
|
||||
then
|
||||
echo "::set-output name=with_coverage::true"
|
||||
else
|
||||
echo "::set-output name=with_coverage::false"
|
||||
fi
|
||||
|
||||
# Run unit tests with different configurations on linux
|
||||
unittests:
|
||||
needs: [ validate, style, changes ]
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ['2.7', '3.5', '3.6', '3.7', '3.8', '3.9', '3.10']
|
||||
concretizer: ['clingo']
|
||||
include:
|
||||
- python-version: 2.7
|
||||
concretizer: original
|
||||
- python-version: 3.6
|
||||
concretizer: original
|
||||
- python-version: 3.9
|
||||
concretizer: original
|
||||
steps:
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # @v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-python@c4e89fac7e8767b327bbad6cb4d859eda999cf08 # @v2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Install System packages
|
||||
run: |
|
||||
sudo apt-get -y update
|
||||
# Needed for unit tests
|
||||
sudo apt-get -y install \
|
||||
coreutils cvs gfortran graphviz gnupg2 mercurial ninja-build \
|
||||
patchelf cmake bison libbison-dev kcov
|
||||
- name: Install Python packages
|
||||
run: |
|
||||
pip install --upgrade pip six setuptools pytest codecov "coverage[toml]<=6.2"
|
||||
# ensure style checks are not skipped in unit tests for python >= 3.6
|
||||
# note that true/false (i.e., 1/0) are opposite in conditions in python and bash
|
||||
if python -c 'import sys; sys.exit(not sys.version_info >= (3, 6))'; then
|
||||
pip install --upgrade flake8 isort>=4.3.5 mypy>=0.900 black
|
||||
fi
|
||||
- name: Pin pathlib for Python 2.7
|
||||
if: ${{ matrix.python-version == 2.7 }}
|
||||
run: |
|
||||
pip install -U pathlib2==2.3.6
|
||||
- name: Setup git configuration
|
||||
run: |
|
||||
# Need this for the git tests to succeed.
|
||||
git --version
|
||||
. .github/workflows/setup_git.sh
|
||||
- name: Bootstrap clingo
|
||||
if: ${{ matrix.concretizer == 'clingo' }}
|
||||
env:
|
||||
SPACK_PYTHON: python
|
||||
run: |
|
||||
. share/spack/setup-env.sh
|
||||
spack bootstrap untrust spack-install
|
||||
spack -v solve zlib
|
||||
- name: Run unit tests (full suite with coverage)
|
||||
if: ${{ needs.changes.outputs.with_coverage == 'true' }}
|
||||
env:
|
||||
SPACK_PYTHON: python
|
||||
COVERAGE: true
|
||||
SPACK_TEST_SOLVER: ${{ matrix.concretizer }}
|
||||
run: |
|
||||
share/spack/qa/run-unit-tests
|
||||
coverage combine
|
||||
coverage xml
|
||||
- name: Run unit tests (reduced suite without coverage)
|
||||
if: ${{ needs.changes.outputs.with_coverage == 'false' }}
|
||||
env:
|
||||
SPACK_PYTHON: python
|
||||
ONLY_PACKAGES: true
|
||||
SPACK_TEST_SOLVER: ${{ matrix.concretizer }}
|
||||
run: |
|
||||
share/spack/qa/run-unit-tests
|
||||
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # @v2.1.0
|
||||
if: ${{ needs.changes.outputs.with_coverage == 'true' }}
|
||||
with:
|
||||
flags: unittests,linux,${{ matrix.concretizer }}
|
||||
# Test shell integration
|
||||
shell:
|
||||
needs: [ validate, style, changes ]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # @v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-python@c4e89fac7e8767b327bbad6cb4d859eda999cf08 # @v2
|
||||
with:
|
||||
python-version: '3.10'
|
||||
- name: Install System packages
|
||||
run: |
|
||||
sudo apt-get -y update
|
||||
# Needed for shell tests
|
||||
sudo apt-get install -y coreutils kcov csh zsh tcsh fish dash bash
|
||||
- name: Install Python packages
|
||||
run: |
|
||||
pip install --upgrade pip six setuptools pytest codecov coverage[toml]==6.2
|
||||
- name: Setup git configuration
|
||||
run: |
|
||||
# Need this for the git tests to succeed.
|
||||
git --version
|
||||
. .github/workflows/setup_git.sh
|
||||
- name: Run shell tests (without coverage)
|
||||
if: ${{ needs.changes.outputs.with_coverage == 'false' }}
|
||||
run: |
|
||||
share/spack/qa/run-shell-tests
|
||||
- name: Run shell tests (with coverage)
|
||||
if: ${{ needs.changes.outputs.with_coverage == 'true' }}
|
||||
env:
|
||||
COVERAGE: true
|
||||
run: |
|
||||
share/spack/qa/run-shell-tests
|
||||
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # @v2.1.0
|
||||
if: ${{ needs.changes.outputs.with_coverage == 'true' }}
|
||||
with:
|
||||
flags: shelltests,linux
|
||||
|
||||
# Test RHEL8 UBI with platform Python. This job is run
|
||||
# only on PRs modifying core Spack
|
||||
rhel8-platform-python:
|
||||
needs: [ validate, style, changes ]
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ needs.changes.outputs.with_coverage == 'true' }}
|
||||
container: registry.access.redhat.com/ubi8/ubi
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
dnf install -y \
|
||||
bzip2 curl file gcc-c++ gcc gcc-gfortran git gnupg2 gzip \
|
||||
make patch tcl unzip which xz
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # @v2
|
||||
- name: Setup repo and non-root user
|
||||
run: |
|
||||
git --version
|
||||
git fetch --unshallow
|
||||
. .github/workflows/setup_git.sh
|
||||
useradd spack-test
|
||||
chown -R spack-test .
|
||||
- name: Run unit tests
|
||||
shell: runuser -u spack-test -- bash {0}
|
||||
run: |
|
||||
source share/spack/setup-env.sh
|
||||
spack -d solve zlib
|
||||
spack unit-test -k 'not cvs and not svn and not hg' -x --verbose
|
||||
# Test for the clingo based solver (using clingo-cffi)
|
||||
clingo-cffi:
|
||||
needs: [ validate, style, changes ]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # @v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-python@c4e89fac7e8767b327bbad6cb4d859eda999cf08 # @v2
|
||||
with:
|
||||
python-version: '3.10'
|
||||
- name: Install System packages
|
||||
run: |
|
||||
sudo apt-get -y update
|
||||
# Needed for unit tests
|
||||
sudo apt-get -y install \
|
||||
coreutils cvs gfortran graphviz gnupg2 mercurial ninja-build \
|
||||
patchelf kcov
|
||||
- name: Install Python packages
|
||||
run: |
|
||||
pip install --upgrade pip six setuptools pytest codecov coverage[toml]==6.2 clingo
|
||||
- name: Setup git configuration
|
||||
run: |
|
||||
# Need this for the git tests to succeed.
|
||||
git --version
|
||||
. .github/workflows/setup_git.sh
|
||||
- name: Run unit tests (full suite with coverage)
|
||||
if: ${{ needs.changes.outputs.with_coverage == 'true' }}
|
||||
env:
|
||||
COVERAGE: true
|
||||
SPACK_TEST_SOLVER: clingo
|
||||
run: |
|
||||
share/spack/qa/run-unit-tests
|
||||
coverage combine
|
||||
coverage xml
|
||||
- name: Run unit tests (reduced suite without coverage)
|
||||
if: ${{ needs.changes.outputs.with_coverage == 'false' }}
|
||||
env:
|
||||
ONLY_PACKAGES: true
|
||||
SPACK_TEST_SOLVER: clingo
|
||||
run: |
|
||||
share/spack/qa/run-unit-tests
|
||||
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # @v2.1.0
|
||||
if: ${{ needs.changes.outputs.with_coverage == 'true' }}
|
||||
with:
|
||||
flags: unittests,linux,clingo
|
||||
# Run unit tests on MacOS
|
||||
build:
|
||||
needs: [ validate, style, changes ]
|
||||
runs-on: macos-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: [3.8]
|
||||
steps:
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # @v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-python@c4e89fac7e8767b327bbad6cb4d859eda999cf08 # @v2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Install Python packages
|
||||
run: |
|
||||
pip install --upgrade pip six setuptools
|
||||
pip install --upgrade pytest codecov coverage[toml]==6.2
|
||||
- name: Setup Homebrew packages
|
||||
run: |
|
||||
brew install dash fish gcc gnupg2 kcov
|
||||
- name: Run unit tests
|
||||
env:
|
||||
SPACK_TEST_SOLVER: clingo
|
||||
run: |
|
||||
git --version
|
||||
. .github/workflows/setup_git.sh
|
||||
. share/spack/setup-env.sh
|
||||
$(which spack) bootstrap untrust spack-install
|
||||
$(which spack) solve zlib
|
||||
if [ "${{ needs.changes.outputs.with_coverage }}" == "true" ]
|
||||
then
|
||||
coverage run $(which spack) unit-test -x
|
||||
coverage combine
|
||||
coverage xml
|
||||
# Delete the symlink going from ./lib/spack/docs/_spack_root back to
|
||||
# the initial directory, since it causes ELOOP errors with codecov/actions@2
|
||||
rm lib/spack/docs/_spack_root
|
||||
else
|
||||
echo "ONLY PACKAGE RECIPES CHANGED [skipping coverage]"
|
||||
$(which spack) unit-test -x -m "not maybeslow" -k "package_sanity"
|
||||
fi
|
||||
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # @v2.1.0
|
||||
if: ${{ needs.changes.outputs.with_coverage == 'true' }}
|
||||
with:
|
||||
files: ./coverage.xml
|
||||
flags: unittests,macos
|
||||
|
||||
# Run audits on all the packages in the built-in repository
|
||||
package-audits:
|
||||
needs: [ validate, style, changes ]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # @v2
|
||||
- uses: actions/setup-python@c4e89fac7e8767b327bbad6cb4d859eda999cf08 # @v2
|
||||
with:
|
||||
python-version: '3.10'
|
||||
- name: Install Python packages
|
||||
run: |
|
||||
pip install --upgrade pip six setuptools pytest codecov coverage[toml]==6.2
|
||||
- name: Package audits (with coverage)
|
||||
if: ${{ needs.changes.outputs.with_coverage == 'true' }}
|
||||
run: |
|
||||
. share/spack/setup-env.sh
|
||||
coverage run $(which spack) audit packages
|
||||
coverage combine
|
||||
coverage xml
|
||||
- name: Package audits (without coverage)
|
||||
if: ${{ needs.changes.outputs.with_coverage == 'false' }}
|
||||
run: |
|
||||
. share/spack/setup-env.sh
|
||||
$(which spack) audit packages
|
||||
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # @v2.1.0
|
||||
if: ${{ needs.changes.outputs.with_coverage == 'true' }}
|
||||
with:
|
||||
flags: unittests,linux,audits
|
193
.github/workflows/windows_python.yml
vendored
193
.github/workflows/windows_python.yml
vendored
@@ -1,193 +0,0 @@
|
||||
name: windows tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
- releases/**
|
||||
pull_request:
|
||||
branches:
|
||||
- develop
|
||||
- releases/**
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_number }}
|
||||
cancel-in-progress: true
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell:
|
||||
powershell Invoke-Expression -Command ".\share\spack\qa\windows_test_setup.ps1"; {0}
|
||||
jobs:
|
||||
validate:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
|
||||
- uses: actions/setup-python@c4e89fac7e8767b327bbad6cb4d859eda999cf08
|
||||
with:
|
||||
python-version: 3.9
|
||||
- name: Install Python Packages
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install --upgrade vermin
|
||||
- name: vermin (Spack's Core)
|
||||
run: vermin --backport argparse --backport typing -t='2.7-' -t='3.5-' -v spack/lib/spack/spack/ spack/lib/spack/llnl/ spack/bin/
|
||||
- name: vermin (Repositories)
|
||||
run: vermin --backport argparse --backport typing -t='2.7-' -t='3.5-' -v spack/var/spack/repos
|
||||
# Run style checks on the files that have been changed
|
||||
style:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-python@c4e89fac7e8767b327bbad6cb4d859eda999cf08
|
||||
with:
|
||||
python-version: 3.9
|
||||
- name: Install Python packages
|
||||
run: |
|
||||
python -m pip install --upgrade pip six setuptools flake8 isort>=4.3.5 mypy>=0.800 black pywin32 types-python-dateutil
|
||||
- name: Create local develop
|
||||
run: |
|
||||
.\spack\.github\workflows\setup_git.ps1
|
||||
- name: Run style tests
|
||||
run: |
|
||||
spack style
|
||||
- name: Verify license headers
|
||||
run: |
|
||||
python spack\bin\spack license verify
|
||||
unittest:
|
||||
needs: [ validate, style ]
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-python@c4e89fac7e8767b327bbad6cb4d859eda999cf08
|
||||
with:
|
||||
python-version: 3.9
|
||||
- name: Install Python packages
|
||||
run: |
|
||||
python -m pip install --upgrade pip six pywin32 setuptools codecov coverage
|
||||
- name: Create local develop
|
||||
run: |
|
||||
.\spack\.github\workflows\setup_git.ps1
|
||||
- name: Unit Test
|
||||
run: |
|
||||
echo F|xcopy .\spack\share\spack\qa\configuration\windows_config.yaml $env:USERPROFILE\.spack\windows\config.yaml
|
||||
spack unit-test --verbose --ignore=lib/spack/spack/test/cmd
|
||||
unittest-cmd:
|
||||
needs: [ validate, style ]
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-python@c4e89fac7e8767b327bbad6cb4d859eda999cf08
|
||||
with:
|
||||
python-version: 3.9
|
||||
- name: Install Python packages
|
||||
run: |
|
||||
python -m pip install --upgrade pip six pywin32 setuptools codecov coverage
|
||||
- name: Create local develop
|
||||
run: |
|
||||
.\spack\.github\workflows\setup_git.ps1
|
||||
- name: Command Unit Test
|
||||
run: |
|
||||
echo F|xcopy .\spack\share\spack\qa\configuration\windows_config.yaml $env:USERPROFILE\.spack\windows\config.yaml
|
||||
spack unit-test lib/spack/spack/test/cmd --verbose
|
||||
buildtest:
|
||||
needs: [ validate, style ]
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-python@c4e89fac7e8767b327bbad6cb4d859eda999cf08
|
||||
with:
|
||||
python-version: 3.9
|
||||
- name: Install Python packages
|
||||
run: |
|
||||
python -m pip install --upgrade pip six pywin32 setuptools codecov coverage
|
||||
- name: Build Test
|
||||
run: |
|
||||
spack compiler find
|
||||
echo F|xcopy .\spack\share\spack\qa\configuration\windows_config.yaml $env:USERPROFILE\.spack\windows\config.yaml
|
||||
spack external find cmake
|
||||
spack external find ninja
|
||||
spack install abseil-cpp
|
||||
generate-installer-test:
|
||||
needs: [ validate, style ]
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Disable Windows Symlinks
|
||||
run: |
|
||||
git config --global core.symlinks false
|
||||
shell:
|
||||
powershell
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-python@c4e89fac7e8767b327bbad6cb4d859eda999cf08
|
||||
with:
|
||||
python-version: 3.9
|
||||
- name: Install Python packages
|
||||
run: |
|
||||
python -m pip install --upgrade pip six pywin32 setuptools codecov coverage
|
||||
- name: Add Light and Candle to Path
|
||||
run: |
|
||||
$env:WIX >> $GITHUB_PATH
|
||||
- name: Run Installer
|
||||
run: |
|
||||
.\spack\share\spack\qa\setup_spack.ps1
|
||||
spack make-installer -s spack -g SILENT pkg
|
||||
echo "installer_root=$((pwd).Path)" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
|
||||
env:
|
||||
ProgressPreference: SilentlyContinue
|
||||
- uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8
|
||||
with:
|
||||
name: Windows Spack Installer Bundle
|
||||
path: ${{ env.installer_root }}\pkg\Spack.exe
|
||||
- uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8
|
||||
with:
|
||||
name: Windows Spack Installer
|
||||
path: ${{ env.installer_root}}\pkg\Spack.msi
|
||||
execute-installer:
|
||||
needs: generate-installer-test
|
||||
runs-on: windows-latest
|
||||
defaults:
|
||||
run:
|
||||
shell: pwsh
|
||||
steps:
|
||||
- uses: actions/setup-python@c4e89fac7e8767b327bbad6cb4d859eda999cf08
|
||||
with:
|
||||
python-version: 3.9
|
||||
- name: Install Python packages
|
||||
run: |
|
||||
python -m pip install --upgrade pip six pywin32 setuptools codecov coverage
|
||||
- name: Setup installer directory
|
||||
run: |
|
||||
mkdir -p spack_installer
|
||||
echo "spack_installer=$((pwd).Path)\spack_installer" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: Windows Spack Installer Bundle
|
||||
path: ${{ env.spack_installer }}
|
||||
- name: Execute Bundled Installer
|
||||
run: |
|
||||
$proc = Start-Process ${{ env.spack_installer }}\spack.exe "/install /quiet" -Passthru
|
||||
$handle = $proc.Handle # cache proc.Handle
|
||||
$proc.WaitForExit();
|
||||
$LASTEXITCODE
|
||||
env:
|
||||
ProgressPreference: SilentlyContinue
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: Windows Spack Installer
|
||||
path: ${{ env.spack_installer }}
|
||||
- name: Execute MSI
|
||||
run: |
|
||||
$proc = Start-Process ${{ env.spack_installer }}\spack.msi "/quiet" -Passthru
|
||||
$handle = $proc.Handle # cache proc.Handle
|
||||
$proc.WaitForExit();
|
||||
$LASTEXITCODE
|
518
.gitignore
vendored
518
.gitignore
vendored
@@ -1,515 +1,29 @@
|
||||
##########################
|
||||
# Spack-specific ignores #
|
||||
##########################
|
||||
|
||||
/db
|
||||
/var/spack/stage
|
||||
/var/spack/cache
|
||||
/var/spack/environments
|
||||
/var/spack/repos/*/index.yaml
|
||||
/var/spack/repos/*/lock
|
||||
*.pyc
|
||||
/opt
|
||||
*~
|
||||
.DS_Store
|
||||
.idea
|
||||
# Ignore everything in /etc/spack except /etc/spack/defaults
|
||||
/etc/spack/*
|
||||
!/etc/spack/defaults
|
||||
/etc/spackconfig
|
||||
/share/spack/dotkit
|
||||
/share/spack/modules
|
||||
/share/spack/lmod
|
||||
# Debug logs
|
||||
spack-db.*
|
||||
/TAGS
|
||||
*.swp
|
||||
/htmlcov
|
||||
.coverage
|
||||
\#*
|
||||
.#*
|
||||
lib/spack/spack/test/.cache
|
||||
/bin/spackc
|
||||
*.in.log
|
||||
*.out.log
|
||||
|
||||
###########################
|
||||
# Python-specific ignores #
|
||||
###########################
|
||||
|
||||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
|
||||
# C extensions
|
||||
*.so
|
||||
|
||||
# Distribution / packaging
|
||||
.Python
|
||||
build/
|
||||
develop-eggs/
|
||||
dist/
|
||||
downloads/
|
||||
eggs/
|
||||
.eggs/
|
||||
#lib/
|
||||
#lib64/
|
||||
parts/
|
||||
sdist/
|
||||
#var/
|
||||
wheels/
|
||||
share/python-wheels/
|
||||
*.egg-info/
|
||||
.installed.cfg
|
||||
*.egg
|
||||
MANIFEST
|
||||
|
||||
# PyInstaller
|
||||
# Usually these files are written by a python script from a template
|
||||
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
||||
*.manifest
|
||||
*.spec
|
||||
|
||||
# Installer logs
|
||||
pip-log.txt
|
||||
pip-delete-this-directory.txt
|
||||
|
||||
# Unit test / coverage reports
|
||||
htmlcov/
|
||||
.tox/
|
||||
.nox/
|
||||
.coverage
|
||||
.coverage.*
|
||||
.cache
|
||||
nosetests.xml
|
||||
coverage.xml
|
||||
*.cover
|
||||
*.py,cover
|
||||
.hypothesis/
|
||||
.pytest_cache/
|
||||
cover/
|
||||
|
||||
# Translations
|
||||
*.mo
|
||||
*.pot
|
||||
|
||||
# Django stuff:
|
||||
*.log
|
||||
local_settings.py
|
||||
db.sqlite3
|
||||
db.sqlite3-journal
|
||||
|
||||
# Flask stuff:
|
||||
instance/
|
||||
.webassets-cache
|
||||
|
||||
# Scrapy stuff:
|
||||
.scrapy
|
||||
|
||||
# Sphinx documentation
|
||||
docs/_build/
|
||||
|
||||
# PyBuilder
|
||||
.pybuilder/
|
||||
target/
|
||||
|
||||
# Jupyter Notebook
|
||||
.ipynb_checkpoints
|
||||
|
||||
# IPython
|
||||
profile_default/
|
||||
ipython_config.py
|
||||
|
||||
# pyenv
|
||||
# For a library or package, you might want to ignore these files since the code is
|
||||
# intended to run in multiple environments; otherwise, check them in:
|
||||
# .python-version
|
||||
|
||||
# pipenv
|
||||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
||||
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
||||
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
||||
# install all needed dependencies.
|
||||
#Pipfile.lock
|
||||
|
||||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
||||
__pypackages__/
|
||||
|
||||
# Celery stuff
|
||||
celerybeat-schedule
|
||||
celerybeat.pid
|
||||
|
||||
# SageMath parsed files
|
||||
*.sage.py
|
||||
|
||||
# Environments
|
||||
.env
|
||||
.venv
|
||||
env/
|
||||
venv/
|
||||
ENV/
|
||||
env.bak/
|
||||
venv.bak/
|
||||
!/lib/spack/env
|
||||
|
||||
# Spyder project settings
|
||||
.spyderproject
|
||||
.spyproject
|
||||
|
||||
# Rope project settings
|
||||
.ropeproject
|
||||
|
||||
# mkdocs documentation
|
||||
/site
|
||||
|
||||
# mypy
|
||||
.mypy_cache/
|
||||
.dmypy.json
|
||||
dmypy.json
|
||||
|
||||
# Pyre type checker
|
||||
.pyre/
|
||||
|
||||
# pytype static type analyzer
|
||||
.pytype/
|
||||
|
||||
# Cython debug symbols
|
||||
cython_debug/
|
||||
|
||||
########################
|
||||
# Vim-specific ignores #
|
||||
########################
|
||||
|
||||
# Swap
|
||||
[._]*.s[a-v][a-z]
|
||||
!*.svg # comment out if you don't need vector files
|
||||
[._]*.sw[a-p]
|
||||
[._]s[a-rt-v][a-z]
|
||||
[._]ss[a-gi-z]
|
||||
[._]sw[a-p]
|
||||
|
||||
# Session
|
||||
Session.vim
|
||||
Sessionx.vim
|
||||
|
||||
# Temporary
|
||||
.netrwhist
|
||||
*~
|
||||
# Auto-generated tag files
|
||||
tags
|
||||
# Persistent undo
|
||||
[._]*.un~
|
||||
|
||||
##########################
|
||||
# Emacs-specific ignores #
|
||||
##########################
|
||||
|
||||
*~
|
||||
\#*\#
|
||||
/.emacs.desktop
|
||||
/.emacs.desktop.lock
|
||||
*.elc
|
||||
auto-save-list
|
||||
tramp
|
||||
.\#*
|
||||
|
||||
# Org-mode
|
||||
.org-id-locations
|
||||
*_archive
|
||||
|
||||
# flymake-mode
|
||||
*_flymake.*
|
||||
|
||||
# eshell files
|
||||
/eshell/history
|
||||
/eshell/lastdir
|
||||
|
||||
# zsh byte-compiled files
|
||||
*.zwc
|
||||
|
||||
# elpa packages
|
||||
/elpa/
|
||||
|
||||
# reftex files
|
||||
*.rel
|
||||
|
||||
# AUCTeX auto folder
|
||||
/auto/
|
||||
|
||||
# cask packages
|
||||
.cask/
|
||||
dist/
|
||||
|
||||
# Flycheck
|
||||
flycheck_*.el
|
||||
|
||||
# server auth directory
|
||||
/server/
|
||||
|
||||
# projectiles files
|
||||
.projectile
|
||||
|
||||
# directory configuration
|
||||
.dir-locals.el
|
||||
|
||||
# network security
|
||||
/network-security.data
|
||||
|
||||
############################
|
||||
# Eclipse-specific ignores #
|
||||
############################
|
||||
|
||||
.metadata
|
||||
#bin/
|
||||
tmp/
|
||||
*.tmp
|
||||
*.bak
|
||||
*.swp
|
||||
*~.nib
|
||||
local.properties
|
||||
.settings/
|
||||
.loadpath
|
||||
.recommenders
|
||||
|
||||
# External tool builders
|
||||
.externalToolBuilders/
|
||||
|
||||
# Locally stored "Eclipse launch configurations"
|
||||
*.launch
|
||||
|
||||
# PyDev specific (Python IDE for Eclipse)
|
||||
*.pydevproject
|
||||
|
||||
# CDT-specific (C/C++ Development Tooling)
|
||||
.cproject
|
||||
|
||||
# CDT- autotools
|
||||
.autotools
|
||||
|
||||
# Java annotation processor (APT)
|
||||
.factorypath
|
||||
|
||||
# PDT-specific (PHP Development Tools)
|
||||
.buildpath
|
||||
|
||||
# sbteclipse plugin
|
||||
.target
|
||||
|
||||
# Tern plugin
|
||||
.tern-project
|
||||
|
||||
# TeXlipse plugin
|
||||
.texlipse
|
||||
|
||||
# STS (Spring Tool Suite)
|
||||
.springBeans
|
||||
|
||||
# Code Recommenders
|
||||
.recommenders/
|
||||
|
||||
# Annotation Processing
|
||||
.apt_generated/
|
||||
.apt_generated_test/
|
||||
|
||||
# Scala IDE specific (Scala & Java development for Eclipse)
|
||||
.cache-main
|
||||
.scala_dependencies
|
||||
.worksheet
|
||||
|
||||
# Uncomment this line if you wish to ignore the project description file.
|
||||
# Typically, this file would be tracked if it contains build/dependency configurations:
|
||||
#.project
|
||||
|
||||
##################################
|
||||
# Visual Studio-specific ignores #
|
||||
##################################
|
||||
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
*.code-workspace
|
||||
|
||||
# Local History for Visual Studio Code
|
||||
.history/
|
||||
|
||||
#################################
|
||||
# Sublime Text-specific ignores #
|
||||
#################################
|
||||
|
||||
# Cache files for Sublime Text
|
||||
*.tmlanguage.cache
|
||||
*.tmPreferences.cache
|
||||
*.stTheme.cache
|
||||
|
||||
# Workspace files are user-specific
|
||||
*.sublime-workspace
|
||||
|
||||
# Project files should be checked into the repository, unless a significant
|
||||
# proportion of contributors will probably not be using Sublime Text
|
||||
# *.sublime-project
|
||||
|
||||
# SFTP configuration file
|
||||
sftp-config.json
|
||||
sftp-config-alt*.json
|
||||
|
||||
# Package control specific files
|
||||
Package Control.last-run
|
||||
Package Control.ca-list
|
||||
Package Control.ca-bundle
|
||||
Package Control.system-ca-bundle
|
||||
Package Control.cache/
|
||||
Package Control.ca-certs/
|
||||
Package Control.merged-ca-bundle
|
||||
Package Control.user-ca-bundle
|
||||
oscrypto-ca-bundle.crt
|
||||
bh_unicode_properties.cache
|
||||
|
||||
# Sublime-github package stores a github token in this file
|
||||
# https://packagecontrol.io/packages/sublime-github
|
||||
GitHub.sublime-settings
|
||||
|
||||
##############################
|
||||
# JetBrains-specific ignores #
|
||||
##############################
|
||||
|
||||
# Ignore the entire folder since it may conatin more files than
|
||||
# just the ones listed below
|
||||
.idea/
|
||||
|
||||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
|
||||
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
|
||||
|
||||
# User-specific stuff
|
||||
.idea/**/workspace.xml
|
||||
.idea/**/tasks.xml
|
||||
.idea/**/usage.statistics.xml
|
||||
.idea/**/dictionaries
|
||||
.idea/**/shelf
|
||||
|
||||
# Generated files
|
||||
.idea/**/contentModel.xml
|
||||
|
||||
# Sensitive or high-churn files
|
||||
.idea/**/dataSources/
|
||||
.idea/**/dataSources.ids
|
||||
.idea/**/dataSources.local.xml
|
||||
.idea/**/sqlDataSources.xml
|
||||
.idea/**/dynamic.xml
|
||||
.idea/**/uiDesigner.xml
|
||||
.idea/**/dbnavigator.xml
|
||||
|
||||
# Gradle
|
||||
.idea/**/gradle.xml
|
||||
.idea/**/libraries
|
||||
|
||||
# Gradle and Maven with auto-import
|
||||
# When using Gradle or Maven with auto-import, you should exclude module files,
|
||||
# since they will be recreated, and may cause churn. Uncomment if using
|
||||
# auto-import.
|
||||
# .idea/artifacts
|
||||
# .idea/compiler.xml
|
||||
# .idea/jarRepositories.xml
|
||||
# .idea/modules.xml
|
||||
# .idea/*.iml
|
||||
# .idea/modules
|
||||
# *.iml
|
||||
# *.ipr
|
||||
|
||||
# CMake
|
||||
cmake-build-*/
|
||||
|
||||
# Mongo Explorer plugin
|
||||
.idea/**/mongoSettings.xml
|
||||
|
||||
# File-based project format
|
||||
*.iws
|
||||
|
||||
# IntelliJ
|
||||
out/
|
||||
|
||||
# mpeltonen/sbt-idea plugin
|
||||
.idea_modules/
|
||||
|
||||
# JIRA plugin
|
||||
atlassian-ide-plugin.xml
|
||||
|
||||
# Cursive Clojure plugin
|
||||
.idea/replstate.xml
|
||||
|
||||
# Crashlytics plugin (for Android Studio and IntelliJ)
|
||||
com_crashlytics_export_strings.xml
|
||||
crashlytics.properties
|
||||
crashlytics-build.properties
|
||||
fabric.properties
|
||||
|
||||
# Editor-based Rest Client
|
||||
.idea/httpRequests
|
||||
|
||||
# Android studio 3.1+ serialized cache file
|
||||
.idea/caches/build_file_checksums.ser
|
||||
|
||||
##########################
|
||||
# macOS-specific ignores #
|
||||
##########################
|
||||
|
||||
# General
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
|
||||
# Icon must end with two \r
|
||||
Icon
|
||||
|
||||
# Thumbnails
|
||||
._*
|
||||
|
||||
# Files that might appear in the root of a volume
|
||||
.DocumentRevisions-V100
|
||||
.fseventsd
|
||||
.Spotlight-V100
|
||||
.TemporaryItems
|
||||
.Trashes
|
||||
.VolumeIcon.icns
|
||||
.com.apple.timemachine.donotpresent
|
||||
|
||||
# Directories potentially created on remote AFP share
|
||||
.AppleDB
|
||||
.AppleDesktop
|
||||
Network Trash Folder
|
||||
Temporary Items
|
||||
.apdisk
|
||||
|
||||
##########################
|
||||
# Linux-specific ignores #
|
||||
##########################
|
||||
|
||||
*~
|
||||
|
||||
# temporary files which can be created if a process still has a handle open of a deleted file
|
||||
.fuse_hidden*
|
||||
|
||||
# KDE directory preferences
|
||||
.directory
|
||||
|
||||
# Linux trash folder which might appear on any partition or disk
|
||||
.Trash-*
|
||||
|
||||
# .nfs files are created when an open file is removed but is still being accessed
|
||||
.nfs*
|
||||
|
||||
############################
|
||||
# Windows-specific ignores #
|
||||
############################
|
||||
|
||||
# Windows thumbnail cache files
|
||||
Thumbs.db
|
||||
Thumbs.db:encryptable
|
||||
ehthumbs.db
|
||||
ehthumbs_vista.db
|
||||
|
||||
# Dump file
|
||||
*.stackdump
|
||||
|
||||
# Folder config file
|
||||
[Dd]esktop.ini
|
||||
|
||||
# Recycle Bin used on file shares
|
||||
$RECYCLE.BIN/
|
||||
|
||||
# Windows Installer files
|
||||
*.cab
|
||||
*.msi
|
||||
*.msix
|
||||
*.msm
|
||||
*.msp
|
||||
|
||||
# Windows shortcuts
|
||||
*.lnk
|
||||
*.orig
|
||||
|
7
.mailmap
7
.mailmap
@@ -3,8 +3,7 @@ Adam Moody <moody20@llnl.gov> Adam T. Moody
|
||||
Alfredo Gimenez <gimenez1@llnl.gov> Alfredo Gimenez <alfredo.gimenez@gmail.com>
|
||||
Alfredo Gimenez <gimenez1@llnl.gov> Alfredo Adolfo Gimenez <alfredo.gimenez@gmail.com>
|
||||
Andrew Williams <williamsa89@cardiff.ac.uk> Andrew Williams <andrew@alshain.org.uk>
|
||||
Axel Huebl <axelhuebl@lbl.gov> Axel Huebl <a.huebl@hzdr.de>
|
||||
Axel Huebl <axelhuebl@lbl.gov> Axel Huebl <axel.huebl@plasma.ninja>
|
||||
Axel Huebl <a.huebl@hzdr.de> Axel Huebl <axel.huebl@plasma.ninja>
|
||||
Ben Boeckel <ben.boeckel@kitware.com> Ben Boeckel <mathstuf@gmail.com>
|
||||
Ben Boeckel <ben.boeckel@kitware.com> Ben Boeckel <mathstuf@users.noreply.github.com>
|
||||
Benedikt Hegner <hegner@cern.ch> Benedikt Hegner <benedikt.hegner@cern.ch>
|
||||
@@ -21,8 +20,8 @@ Geoffrey Oxberry <oxberry1@llnl.gov> Geoffrey Oxberry
|
||||
Glenn Johnson <glenn-johnson@uiowa.edu> Glenn Johnson <gjohnson@argon-ohpc.hpc.uiowa.edu>
|
||||
Glenn Johnson <glenn-johnson@uiowa.edu> Glenn Johnson <glennpj@gmail.com>
|
||||
Gregory Becker <becker33@llnl.gov> Gregory Becker <becker33.llnl.gov>
|
||||
Gregory Becker <becker33@llnl.gov> Gregory Becker <becker33.llnl.gov>
|
||||
Gregory Becker <becker33@llnl.gov> Gregory Becker <becker33@llnl.gov>
|
||||
Gregory Becker <becker33@llnl.gov> becker33 <becker33.llnl.gov>
|
||||
Gregory Becker <becker33@llnl.gov> becker33 <becker33@llnl.gov>
|
||||
Gregory L. Lee <lee218@llnl.gov> Greg Lee <lee218@llnl.gov>
|
||||
Gregory L. Lee <lee218@llnl.gov> Gregory L. Lee <lee218@cab687.llnl.gov>
|
||||
Gregory L. Lee <lee218@llnl.gov> Gregory L. Lee <lee218@cab690.llnl.gov>
|
||||
|
@@ -2,7 +2,6 @@ version: 2
|
||||
|
||||
sphinx:
|
||||
configuration: lib/spack/docs/conf.py
|
||||
fail_on_warning: true
|
||||
|
||||
python:
|
||||
version: 3.7
|
||||
|
168
.travis.yml
Normal file
168
.travis.yml
Normal file
@@ -0,0 +1,168 @@
|
||||
#=============================================================================
|
||||
# Project settings
|
||||
#=============================================================================
|
||||
# Only build master and develop on push; do not build every branch.
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- develop
|
||||
- /^releases\/.*$/
|
||||
|
||||
#=============================================================================
|
||||
# Build matrix
|
||||
#=============================================================================
|
||||
|
||||
dist: xenial
|
||||
|
||||
jobs:
|
||||
fast_finish: true
|
||||
include:
|
||||
- stage: 'style checks'
|
||||
python: '3.8'
|
||||
os: linux
|
||||
language: python
|
||||
env: TEST_SUITE=flake8
|
||||
# Shell integration with module files
|
||||
- python: '3.8'
|
||||
os: linux
|
||||
language: python
|
||||
env: [ TEST_SUITE=bootstrap ]
|
||||
- stage: 'unit tests + documentation'
|
||||
python: '2.6'
|
||||
dist: trusty
|
||||
os: linux
|
||||
language: python
|
||||
env: [ TEST_SUITE=unit, COVERAGE=true ]
|
||||
- python: '2.7'
|
||||
os: linux
|
||||
language: python
|
||||
env: [ TEST_SUITE=unit, COVERAGE=true ]
|
||||
- python: '3.5'
|
||||
os: linux
|
||||
language: python
|
||||
env: TEST_SUITE=unit
|
||||
- python: '3.6'
|
||||
os: linux
|
||||
language: python
|
||||
env: TEST_SUITE=unit
|
||||
- python: '3.7'
|
||||
os: linux
|
||||
language: python
|
||||
env: TEST_SUITE=unit
|
||||
- python: '3.8'
|
||||
os: linux
|
||||
language: python
|
||||
env: [ TEST_SUITE=unit, COVERAGE=true ]
|
||||
- python: '3.8'
|
||||
os: linux
|
||||
language: python
|
||||
env: TEST_SUITE=doc
|
||||
- os: osx
|
||||
language: generic
|
||||
env: [ TEST_SUITE=unit, PYTHON_VERSION=2.7, COVERAGE=true ]
|
||||
if: type != pull_request
|
||||
|
||||
stages:
|
||||
- 'style checks'
|
||||
- 'unit tests + documentation'
|
||||
|
||||
|
||||
#=============================================================================
|
||||
# Environment
|
||||
#=============================================================================
|
||||
|
||||
# Docs need graphviz to build
|
||||
addons:
|
||||
# for Linux builds, we use APT
|
||||
apt:
|
||||
packages:
|
||||
- ccache
|
||||
- cmake
|
||||
- gfortran
|
||||
- graphviz
|
||||
- gnupg2
|
||||
- kcov
|
||||
- mercurial
|
||||
- ninja-build
|
||||
- perl
|
||||
- perl-base
|
||||
- realpath
|
||||
- r-base
|
||||
- r-base-core
|
||||
- r-base-dev
|
||||
- zsh
|
||||
# for Mac builds, we use Homebrew
|
||||
homebrew:
|
||||
packages:
|
||||
- python@2
|
||||
- gcc
|
||||
- gnupg2
|
||||
- ccache
|
||||
- dash
|
||||
- kcov
|
||||
update: true
|
||||
|
||||
# ~/.ccache needs to be cached directly as Travis is not taking care of it
|
||||
# (possibly because we use 'language: python' and not 'language: c')
|
||||
cache:
|
||||
pip: true
|
||||
ccache: true
|
||||
directories:
|
||||
- ~/.ccache
|
||||
|
||||
# Work around Travis's lack of support for Python on OSX
|
||||
before_install:
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
|
||||
pip2 install --upgrade pip;
|
||||
pip2 install virtualenv;
|
||||
virtualenv venv;
|
||||
source venv/bin/activate;
|
||||
fi
|
||||
- ccache -M 2G && ccache -z
|
||||
|
||||
# Install various dependencies
|
||||
install:
|
||||
- pip install --upgrade pip
|
||||
- pip install --upgrade six
|
||||
- pip install --upgrade setuptools
|
||||
- pip install --upgrade codecov coverage==4.5.4
|
||||
- pip install --upgrade flake8
|
||||
- pip install --upgrade pep8-naming
|
||||
- if [[ "$TEST_SUITE" == "doc" ]]; then
|
||||
pip install --upgrade -r lib/spack/docs/requirements.txt;
|
||||
fi
|
||||
|
||||
before_script:
|
||||
# Need this for the git tests to succeed.
|
||||
- git config --global user.email "spack@example.com"
|
||||
- git config --global user.name "Test User"
|
||||
|
||||
# Need this to be able to compute the list of changed files
|
||||
- git fetch origin ${TRAVIS_BRANCH}:${TRAVIS_BRANCH}
|
||||
|
||||
#=============================================================================
|
||||
# Building
|
||||
#=============================================================================
|
||||
script:
|
||||
- share/spack/qa/run-$TEST_SUITE-tests
|
||||
|
||||
after_success:
|
||||
- ccache -s
|
||||
- case "$TEST_SUITE" in
|
||||
unit)
|
||||
if [[ "$COVERAGE" == "true" ]]; then
|
||||
codecov --env PYTHON_VERSION
|
||||
--required
|
||||
--flags "${TEST_SUITE}${TRAVIS_OS_NAME}";
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
#=============================================================================
|
||||
# Notifications
|
||||
#=============================================================================
|
||||
notifications:
|
||||
email:
|
||||
recipients: tgamblin@llnl.gov
|
||||
on_success: change
|
||||
on_failure: always
|
881
CHANGELOG.md
881
CHANGELOG.md
@@ -1,878 +1,3 @@
|
||||
# v0.18.0 (2022-05-28)
|
||||
|
||||
`v0.18.0` is a major feature release.
|
||||
|
||||
## Major features in this release
|
||||
|
||||
1. **Concretizer now reuses by default**
|
||||
|
||||
`spack install --reuse` was introduced in `v0.17.0`, and `--reuse`
|
||||
is now the default concretization mode. Spack will try hard to
|
||||
resolve dependencies using installed packages or binaries (#30396).
|
||||
|
||||
To avoid reuse and to use the latest package configurations, (the
|
||||
old default), you can use `spack install --fresh`, or add
|
||||
configuration like this to your environment or `concretizer.yaml`:
|
||||
|
||||
```yaml
|
||||
concretizer:
|
||||
reuse: false
|
||||
```
|
||||
|
||||
2. **Finer-grained hashes**
|
||||
|
||||
Spack hashes now include `link`, `run`, *and* `build` dependencies,
|
||||
as well as a canonical hash of package recipes. Previously, hashes
|
||||
only included `link` and `run` dependencies (though `build`
|
||||
dependencies were stored by environments). We coarsened the hash to
|
||||
reduce churn in user installations, but the new default concretizer
|
||||
behavior mitigates this concern and gets us reuse *and* provenance.
|
||||
You will be able to see the build dependencies of new installations
|
||||
with `spack find`. Old installations will not change and their
|
||||
hashes will not be affected. (#28156, #28504, #30717, #30861)
|
||||
|
||||
3. **Improved error messages**
|
||||
|
||||
Error handling with the new concretizer is now done with
|
||||
optimization criteria rather than with unsatisfiable cores, and
|
||||
Spack reports many more details about conflicting constraints.
|
||||
(#30669)
|
||||
|
||||
4. **Unify environments when possible**
|
||||
|
||||
Environments have thus far supported `concretization: together` or
|
||||
`concretization: separately`. These have been replaced by a new
|
||||
preference in `concretizer.yaml`:
|
||||
|
||||
```yaml
|
||||
concretizer:
|
||||
unify: [true|false|when_possible]
|
||||
```
|
||||
|
||||
`concretizer:unify:when_possible` will *try* to resolve a fully
|
||||
unified environment, but if it cannot, it will create multiple
|
||||
configurations of some packages where it has to. For large
|
||||
environments that previously had to be concretized separately, this
|
||||
can result in a huge speedup (40-50x). (#28941)
|
||||
|
||||
5. **Automatically find externals on Cray machines**
|
||||
|
||||
Spack can now automatically discover installed packages in the Cray
|
||||
Programming Environment by running `spack external find` (or `spack
|
||||
external read-cray-manifest` to *only* query the PE). Packages from
|
||||
the PE (e.g., `cray-mpich` are added to the database with full
|
||||
dependency information, and compilers from the PE are added to
|
||||
`compilers.yaml`. Available with the June 2022 release of the Cray
|
||||
Programming Environment. (#24894, #30428)
|
||||
|
||||
6. **New binary format and hardened signing**
|
||||
|
||||
Spack now has an updated binary format, with improvements for
|
||||
security. The new format has a detached signature file, and Spack
|
||||
verifies the signature before untarring or decompressing the binary
|
||||
package. The previous format embedded the signature in a `tar`
|
||||
file, which required the client to run `tar` *before* verifying
|
||||
(#30750). Spack can still install from build caches using the old
|
||||
format, but we encourage users to switch to the new format going
|
||||
forward.
|
||||
|
||||
Production GitLab pipelines have been hardened to securely sign
|
||||
binaries. There is now a separate signing stage so that signing
|
||||
keys are never exposed to build system code, and signing keys are
|
||||
ephemeral and only live as long as the signing pipeline stage.
|
||||
(#30753)
|
||||
|
||||
7. **Bootstrap mirror generation**
|
||||
|
||||
The `spack bootstrap mirror` command can automatically create a
|
||||
mirror for bootstrapping the concretizer and other needed
|
||||
dependencies in an air-gapped environment. (#28556)
|
||||
|
||||
8. **Nascent Windows support**
|
||||
|
||||
Spack now has initial support for Windows. Spack core has been
|
||||
refactored to run in the Windows environment, and a small number of
|
||||
packages can now build for Windows. More details are
|
||||
[in the documentation](https://spack.rtfd.io/en/latest/getting_started.html#spack-on-windows)
|
||||
(#27021, #28385, many more)
|
||||
|
||||
9. **Makefile generation**
|
||||
|
||||
`spack env depfile` can be used to generate a `Makefile` from an
|
||||
environment, which can be used to build packages the environment
|
||||
in parallel on a single node. e.g.:
|
||||
|
||||
```console
|
||||
spack -e myenv env depfile > Makefile
|
||||
make
|
||||
```
|
||||
|
||||
Spack propagates `gmake` jobserver information to builds so that
|
||||
their jobs can share cores. (#30039, #30254, #30302, #30526)
|
||||
|
||||
10. **New variant features**
|
||||
|
||||
In addition to being conditional themselves, variants can now have
|
||||
[conditional *values*](https://spack.readthedocs.io/en/latest/packaging_guide.html#conditional-possible-values)
|
||||
that are only possible for certain configurations of a package. (#29530)
|
||||
|
||||
Variants can be
|
||||
[declared "sticky"](https://spack.readthedocs.io/en/latest/packaging_guide.html#sticky-variants),
|
||||
which prevents them from being enabled or disabled by the
|
||||
concretizer. Sticky variants must be set explicitly by users
|
||||
on the command line or in `packages.yaml`. (#28630)
|
||||
|
||||
* Allow conditional possible values in variants
|
||||
* Add a "sticky" property to variants
|
||||
|
||||
|
||||
## Other new features of note
|
||||
|
||||
* Environment views can optionally link only `run` dependencies
|
||||
with `link:run` (#29336)
|
||||
* `spack external find --all` finds library-only packages in
|
||||
addition to build dependencies (#28005)
|
||||
* Customizable `config:license_dir` option (#30135)
|
||||
* `spack external find --path PATH` takes a custom search path (#30479)
|
||||
* `spack spec` has a new `--format` argument like `spack find` (#27908)
|
||||
* `spack concretize --quiet` skips printing concretized specs (#30272)
|
||||
* `spack info` now has cleaner output and displays test info (#22097)
|
||||
* Package-level submodule option for git commit versions (#30085, #30037)
|
||||
* Using `/hash` syntax to refer to concrete specs in an environment
|
||||
now works even if `/hash` is not installed. (#30276)
|
||||
|
||||
## Major internal refactors
|
||||
|
||||
* full hash (see above)
|
||||
* new develop versioning scheme `0.19.0-dev0`
|
||||
* Allow for multiple dependencies/dependents from the same package (#28673)
|
||||
* Splice differing virtual packages (#27919)
|
||||
|
||||
## Performance Improvements
|
||||
|
||||
* Concretization of large environments with `unify: when_possible` is
|
||||
much faster than concretizing separately (#28941, see above)
|
||||
* Single-pass view generation algorithm is 2.6x faster (#29443)
|
||||
|
||||
## Archspec improvements
|
||||
|
||||
* `oneapi` and `dpcpp` flag support (#30783)
|
||||
* better support for `M1` and `a64fx` (#30683)
|
||||
|
||||
## Removals and Deprecations
|
||||
|
||||
* Spack no longer supports Python `2.6` (#27256)
|
||||
* Removed deprecated `--run-tests` option of `spack install`;
|
||||
use `spack test` (#30461)
|
||||
* Removed deprecated `spack flake8`; use `spack style` (#27290)
|
||||
|
||||
* Deprecate `spack:concretization` config option; use
|
||||
`concretizer:unify` (#30038)
|
||||
* Deprecate top-level module configuration; use module sets (#28659)
|
||||
* `spack activate` and `spack deactivate` are deprecated in favor of
|
||||
environments; will be removed in `0.19.0` (#29430; see also `link:run`
|
||||
in #29336 above)
|
||||
|
||||
## Notable Bugfixes
|
||||
|
||||
* Fix bug that broke locks with many parallel builds (#27846)
|
||||
* Many bugfixes and consistency improvements for the new concretizer
|
||||
and `--reuse` (#30357, #30092, #29835, #29933, #28605, #29694, #28848)
|
||||
|
||||
## Packages
|
||||
|
||||
* `CMakePackage` uses `CMAKE_INSTALL_RPATH_USE_LINK_PATH` (#29703)
|
||||
* Refactored `lua` support: `lua-lang` virtual supports both
|
||||
`lua` and `luajit` via new `LuaPackage` build system(#28854)
|
||||
* PythonPackage: now installs packages with `pip` (#27798)
|
||||
* Python: improve site_packages_dir handling (#28346)
|
||||
* Extends: support spec, not just package name (#27754)
|
||||
* `find_libraries`: search for both .so and .dylib on macOS (#28924)
|
||||
* Use stable URLs and `?full_index=1` for all github patches (#29239)
|
||||
|
||||
## Spack community stats
|
||||
|
||||
* 6,416 total packages, 458 new since `v0.17.0`
|
||||
* 219 new Python packages
|
||||
* 60 new R packages
|
||||
* 377 people contributed to this release
|
||||
* 337 committers to packages
|
||||
* 85 committers to core
|
||||
|
||||
|
||||
# v0.17.2 (2022-04-13)
|
||||
|
||||
### Spack bugfixes
|
||||
* Fix --reuse with upstreams set in an environment (#29680)
|
||||
* config add: fix parsing of validator error to infer type from oneOf (#29475)
|
||||
* Fix spack -C command_line_scope used in conjunction with other flags (#28418)
|
||||
* Use Spec.constrain to construct spec lists for stacks (#28783)
|
||||
* Fix bug occurring when searching for inherited patches in packages (#29574)
|
||||
* Fixed a few bugs when manipulating symlinks (#28318, #29515, #29636)
|
||||
* Fixed a few minor bugs affecting command prompt, terminal title and argument completion (#28279, #28278, #28939, #29405, #29070, #29402)
|
||||
* Fixed a few bugs affecting the spack ci command (#29518, #29419)
|
||||
* Fix handling of Intel compiler environment (#29439)
|
||||
* Fix a few edge cases when reindexing the DB (#28764)
|
||||
* Remove "Known issues" from documentation (#29664)
|
||||
* Other miscellaneous bugfixes (0b72e070583fc5bcd016f5adc8a84c99f2b7805f, #28403, #29261)
|
||||
|
||||
# v0.17.1 (2021-12-23)
|
||||
|
||||
### Spack Bugfixes
|
||||
* Allow locks to work under high contention (#27846)
|
||||
* Improve errors messages from clingo (#27707 #27970)
|
||||
* Respect package permissions for sbang (#25764)
|
||||
* Fix --enable-locks behavior (#24675)
|
||||
* Fix log-format reporter ignoring install errors (#25961)
|
||||
* Fix overloaded argparse keys (#27379)
|
||||
* Allow style commands to run with targets other than "develop" (#27472)
|
||||
* Log lock messages to debug level, instead of verbose level (#27408)
|
||||
* Handle invalid unicode while logging (#21447)
|
||||
* spack audit: fix API calls to variants (#27713)
|
||||
* Provide meaningful message for empty environment installs (#28031)
|
||||
* Added opensuse leap containers to spack containerize (#27837)
|
||||
* Revert "patches: make re-applied patches idempotent" (#27625)
|
||||
* MANPATH can use system defaults (#21682)
|
||||
* Add "setdefault" subcommand to `spack module tcl` (#14686)
|
||||
* Regenerate views when specs already installed (#28113)
|
||||
|
||||
### Package bugfixes
|
||||
* Fix external package detection for OpenMPI (#27255)
|
||||
* Update the UPC++ package to 2021.9.0 (#26996)
|
||||
* Added py-vermin v1.3.2 (#28072)
|
||||
|
||||
# v0.17.0 (2021-11-05)
|
||||
|
||||
`v0.17.0` is a major feature release.
|
||||
|
||||
## Major features in this release
|
||||
|
||||
1. **New concretizer is now default**
|
||||
The new concretizer introduced as an experimental feature in `v0.16.0`
|
||||
is now the default (#25502). The new concretizer is based on the
|
||||
[clingo](https://github.com/potassco/clingo) logic programming system,
|
||||
and it enables us to do much higher quality and faster dependency solving
|
||||
The old concretizer is still available via the `concretizer: original`
|
||||
setting, but it is deprecated and will be removed in `v0.18.0`.
|
||||
|
||||
2. **Binary Bootstrapping**
|
||||
To make it easier to use the new concretizer and binary packages,
|
||||
Spack now bootstraps `clingo` and `GnuPG` from public binaries. If it
|
||||
is not able to bootstrap them from binaries, it installs them from
|
||||
source code. With these changes, you should still be able to clone Spack
|
||||
and start using it almost immediately. (#21446, #22354, #22489, #22606,
|
||||
#22720, #22720, #23677, #23946, #24003, #25138, #25607, #25964, #26029,
|
||||
#26399, #26599).
|
||||
|
||||
3. **Reuse existing packages (experimental)**
|
||||
The most wanted feature from our
|
||||
[2020 user survey](https://spack.io/spack-user-survey-2020/) and
|
||||
the most wanted Spack feature of all time (#25310). `spack install`,
|
||||
`spack spec`, and `spack concretize` now have a `--reuse` option, which
|
||||
causes Spack to minimize the number of rebuilds it does. The `--reuse`
|
||||
option will try to find existing installations and binary packages locally
|
||||
and in registered mirrors, and will prefer to use them over building new
|
||||
versions. This will allow users to build from source *far* less than in
|
||||
prior versions of Spack. This feature will continue to be improved, with
|
||||
configuration options and better CLI expected in `v0.17.1`. It will become
|
||||
the *default* concretization mode in `v0.18.0`.
|
||||
|
||||
4. **Better error messages**
|
||||
We have improved the error messages generated by the new concretizer by
|
||||
using *unsatisfiable cores*. Spack will now print a summary of the types
|
||||
of constraints that were violated to make a spec unsatisfiable (#26719).
|
||||
|
||||
5. **Conditional variants**
|
||||
Variants can now have a `when="<spec>"` clause, allowing them to be
|
||||
conditional based on the version or other attributes of a package (#24858).
|
||||
|
||||
6. **Git commit versions**
|
||||
In an environment and on the command-line, you can now provide a full,
|
||||
40-character git commit as a version for any package with a top-level
|
||||
`git` URL. e.g., `spack install hdf5@45bb27f58240a8da7ebb4efc821a1a964d7712a8`.
|
||||
Spack will compare the commit to tags in the git repository to understand
|
||||
what versions it is ahead of or behind.
|
||||
|
||||
7. **Override local config and cache directories**
|
||||
You can now set `SPACK_DISABLE_LOCAL_CONFIG` to disable the `~/.spack` and
|
||||
`/etc/spack` configuration scopes. `SPACK_USER_CACHE_PATH` allows you to
|
||||
move caches out of `~/.spack`, as well (#27022, #26735). This addresses
|
||||
common problems where users could not isolate CI environments from local
|
||||
configuration.
|
||||
|
||||
8. **Improvements to Spack Containerize**
|
||||
For added reproducibility, you can now pin the Spack version used by
|
||||
`spack containerize` (#21910). The container build will only build
|
||||
with the Spack version pinned at build recipe creation instead of the
|
||||
latest Spack version.
|
||||
|
||||
9. **New commands for dealing with tags**
|
||||
The `spack tags` command allows you to list tags on packages (#26136), and you
|
||||
can list tests and filter tags with `spack test list` (#26842).
|
||||
|
||||
## Other new features of note
|
||||
|
||||
* Copy and relocate environment views as stand-alone installations (#24832)
|
||||
* `spack diff` command can diff two installed specs (#22283, #25169)
|
||||
* `spack -c <config>` can set one-off config parameters on CLI (#22251)
|
||||
* `spack load --list` is an alias for `spack find --loaded` (#27184)
|
||||
* `spack gpg` can export private key with `--secret` (#22557)
|
||||
* `spack style` automatically bootstraps dependencies (#24819)
|
||||
* `spack style --fix` automatically invokes `isort` (#24071)
|
||||
* build dependencies can be installed from build caches with `--include-build-deps` (#19955)
|
||||
* `spack audit` command for checking package constraints (#23053)
|
||||
* Spack can now fetch from `CVS` repositories (yep, really) (#23212)
|
||||
* `spack monitor` lets you upload analysis about installations to a
|
||||
[spack monitor server](https://github.com/spack/spack-monitor) (#23804, #24321,
|
||||
#23777, #25928))
|
||||
* `spack python --path` shows which `python` Spack is using (#22006)
|
||||
* `spack env activate --temp` can create temporary environments (#25388)
|
||||
* `--preferred` and `--latest` options for `spack checksum` (#25830)
|
||||
* `cc` is now pure posix and runs on Alpine (#26259)
|
||||
* `SPACK_PYTHON` environment variable sets which `python` spack uses (#21222)
|
||||
* `SPACK_SKIP_MODULES` lets you source `setup-env.sh` faster if you don't need modules (#24545)
|
||||
|
||||
## Major internal refactors
|
||||
|
||||
* `spec.yaml` files are now `spec.json`, yielding a large speed improvement (#22845)
|
||||
* Splicing allows Spack specs to store mixed build provenance (#20262)
|
||||
* More extensive hooks API for installations (#21930)
|
||||
* New internal API for getting the active environment (#25439)
|
||||
|
||||
## Performance Improvements
|
||||
|
||||
* Parallelize separate concretization in environments; Previously 55 min E4S solve
|
||||
now takes 2.5 min (#26264)
|
||||
* Drastically improve YamlFilesystemView file removal performance via batching (#24355)
|
||||
* Speed up spec comparison (#21618)
|
||||
* Speed up environment activation (#25633)
|
||||
|
||||
## Archspec improvements
|
||||
* support for new generic `x86_64_v2`, `x86_64_v3`, `x86_64_v4` targets
|
||||
(see [archspec#31](https://github.com/archspec/archspec-json/pull/31))
|
||||
* `spack arch --generic` lets you get the best generic architecture for
|
||||
your node (#27061)
|
||||
* added support for aocc (#20124), `arm` compiler on `graviton2` (#24904)
|
||||
and on `a64fx` (#24524),
|
||||
|
||||
## Infrastructure, buildcaches, and services
|
||||
|
||||
* Add support for GCS Bucket Mirrors (#26382)
|
||||
* Add `spackbot` to help package maintainers with notifications. See
|
||||
[spack.github.io/spackbot](https://spack.github.io/spackbot/)
|
||||
* Reproducible pipeline builds with `spack ci rebuild` (#22887)
|
||||
* Removed redundant concretizations from GitLab pipeline generation (#26622)
|
||||
* Spack CI no longer generates jobs for unbuilt specs (#20435)
|
||||
* Every pull request pipeline has its own buildcache (#25529)
|
||||
* `--no-add` installs only specified specs and only if already present in… (#22657)
|
||||
* Add environment-aware `spack buildcache sync` command (#25470)
|
||||
* Binary cache installation speedups and improvements (#19690, #20768)
|
||||
|
||||
## Deprecations and Removals
|
||||
|
||||
* `spack setup` was deprecated in v0.16.0, and has now been removed.
|
||||
Use `spack develop` and `spack dev-build`.
|
||||
* Remove unused `--dependencies` flag from `spack load` (#25731)
|
||||
* Remove stubs for `spack module [refresh|find|rm|loads]`, all of which
|
||||
were deprecated in 2018.
|
||||
|
||||
## Notable Bugfixes
|
||||
|
||||
* Deactivate previous env before activating new one (#25409)
|
||||
* Many fixes to error codes from `spack install` (#21319, #27012, #25314)
|
||||
* config add: infer type based on JSON schema validation errors (#27035)
|
||||
* `spack config edit` now works even if `spack.yaml` is broken (#24689)
|
||||
|
||||
## Packages
|
||||
|
||||
* Allow non-empty version ranges like `1.1.0:1.1` (#26402)
|
||||
* Remove `.99`'s from many version ranges (#26422)
|
||||
* Python: use platform-specific site packages dir (#25998)
|
||||
* `CachedCMakePackage` for using *.cmake initial config files (#19316)
|
||||
* `lua-lang` allows swapping `lua` and `luajit` (#22492)
|
||||
* Better support for `ld.gold` and `ld.lld` (#25626)
|
||||
* build times are now stored as metadata in `$prefix/.spack` (#21179)
|
||||
* post-install tests can be reused in smoke tests (#20298)
|
||||
* Packages can use `pypi` attribute to infer `homepage`/`url`/`list_url` (#17587)
|
||||
* Use gnuconfig package for `config.guess` file replacement (#26035)
|
||||
* patches: make re-applied patches idempotent (#26784)
|
||||
|
||||
## Spack community stats
|
||||
|
||||
* 5969 total packages, 920 new since `v0.16.0`
|
||||
* 358 new Python packages, 175 new R packages
|
||||
* 513 people contributed to this release
|
||||
* 490 committers to packages
|
||||
* 105 committers to core
|
||||
* Lots of GPU updates:
|
||||
* ~77 CUDA-related commits
|
||||
* ~66 AMD-related updates
|
||||
* ~27 OneAPI-related commits
|
||||
* 30 commits from AMD toolchain support
|
||||
* `spack test` usage in packages is increasing
|
||||
* 1669 packages with tests (mostly generic python tests)
|
||||
* 93 packages with their own tests
|
||||
|
||||
|
||||
# v0.16.3 (2021-09-21)
|
||||
|
||||
* clang/llvm: fix version detection (#19978)
|
||||
* Fix use of quotes in Python build system (#22279)
|
||||
* Cray: fix extracting paths from module files (#23472)
|
||||
* Use AWS CloudFront for source mirror (#23978)
|
||||
* Ensure all roots of an installed environment are marked explicit in db (#24277)
|
||||
* Fix fetching for Python 3.8 and 3.9 (#24686)
|
||||
* locks: only open lockfiles once instead of for every lock held (#24794)
|
||||
* Remove the EOL centos:6 docker image
|
||||
|
||||
# v0.16.2 (2021-05-22)
|
||||
|
||||
* Major performance improvement for `spack load` and other commands. (#23661)
|
||||
* `spack fetch` is now environment-aware. (#19166)
|
||||
* Numerous fixes for the new, `clingo`-based concretizer. (#23016, #23307,
|
||||
#23090, #22896, #22534, #20644, #20537, #21148)
|
||||
* Supoprt for automatically bootstrapping `clingo` from source. (#20652, #20657
|
||||
#21364, #21446, #21913, #22354, #22444, #22460, #22489, #22610, #22631)
|
||||
* Python 3.10 support: `collections.abc` (#20441)
|
||||
* Fix import issues by using `__import__` instead of Spack package importe.
|
||||
(#23288, #23290)
|
||||
* Bugfixes and `--source-dir` argument for `spack location`. (#22755, #22348,
|
||||
#22321)
|
||||
* Better support for externals in shared prefixes. (#22653)
|
||||
* `spack build-env` now prefers specs defined in the active environment.
|
||||
(#21642)
|
||||
* Remove erroneous warnings about quotes in `from_sourcing_files`. (#22767)
|
||||
* Fix clearing cache of `InternalConfigScope`. (#22609)
|
||||
* Bugfix for active when pkg is already active error. (#22587)
|
||||
* Make `SingleFileScope` able to repopulate the cache after clearing it.
|
||||
(#22559)
|
||||
* Channelflow: Fix the package. (#22483)
|
||||
* More descriptive error message for bugs in `package.py` (#21811)
|
||||
* Use package-supplied `autogen.sh`. (#20319)
|
||||
* Respect `-k/verify-ssl-false` in `_existing_url` method. (#21864)
|
||||
|
||||
|
||||
# v0.16.1 (2021-02-22)
|
||||
|
||||
This minor release includes a new feature and associated fixes:
|
||||
* intel-oneapi support through new packages (#20411, #20686, #20693, #20717,
|
||||
#20732, #20808, #21377, #21448)
|
||||
|
||||
This release also contains bug fixes/enhancements for:
|
||||
* HIP/ROCm support (#19715, #20095)
|
||||
* concretization (#19988, #20020, #20082, #20086, #20099, #20102, #20128,
|
||||
#20182, #20193, #20194, #20196, #20203, #20247, #20259, #20307, #20362,
|
||||
#20383, #20423, #20473, #20506, #20507, #20604, #20638, #20649, #20677,
|
||||
#20680, #20790)
|
||||
* environment install reporting fix (#20004)
|
||||
* avoid import in ABI compatibility info (#20236)
|
||||
* restore ability of dev-build to skip patches (#20351)
|
||||
* spack find -d spec grouping (#20028)
|
||||
* spack smoke test support (#19987, #20298)
|
||||
* macOS fixes (#20038, #21662)
|
||||
* abstract spec comparisons (#20341)
|
||||
* continuous integration (#17563)
|
||||
* performance improvements for binary relocation (#19690, #20768)
|
||||
* additional sanity checks for variants in builtin packages (#20373)
|
||||
* do not pollute auto-generated configuration files with empty lists or
|
||||
dicts (#20526)
|
||||
|
||||
plus assorted documentation (#20021, #20174) and package bug fixes/enhancements
|
||||
(#19617, #19933, #19986, #20006, #20097, #20198, #20794, #20906, #21411).
|
||||
|
||||
|
||||
# v0.16.0 (2020-11-18)
|
||||
|
||||
`v0.16.0` is a major feature release.
|
||||
|
||||
## Major features in this release
|
||||
|
||||
1. **New concretizer (experimental)** Our new backtracking concretizer is
|
||||
now in Spack as an experimental feature. You will need to install
|
||||
`clingo@master+python` and set `concretizer: clingo` in `config.yaml`
|
||||
to use it. The original concretizer is not exhaustive and is not
|
||||
guaranteed to find a solution if one exists. We encourage you to use
|
||||
the new concretizer and to report any bugs you find with it. We
|
||||
anticipate making the new concretizer the default and including all
|
||||
required dependencies for it in Spack `v0.17`. For more details, see
|
||||
#19501.
|
||||
|
||||
2. **spack test (experimental)** Users can add `test()` methods to their
|
||||
packages to run smoke tests on installations with the new `spack test`
|
||||
command (the old `spack test` is now `spack unit-test`). `spack test`
|
||||
is environment-aware, so you can `spack install` an environment and
|
||||
`spack test run` smoke tests on all of its packages. Historical test
|
||||
logs can be perused with `spack test results`. Generic smoke tests for
|
||||
MPI implementations, C, C++, and Fortran compilers as well as specific
|
||||
smoke tests for 18 packages. This is marked experimental because the
|
||||
test API (`self.run_test()`) is likely to be change, but we encourage
|
||||
users to upstream tests, and we will maintain and refactor any that
|
||||
are added to mainline packages (#15702).
|
||||
|
||||
3. **spack develop** New `spack develop` command allows you to develop
|
||||
several packages at once within a Spack environment. Running
|
||||
`spack develop foo@v1` and `spack develop bar@v2` will check
|
||||
out specific versions of `foo` and `bar` into subdirectories, which you
|
||||
can then build incrementally with `spack install ` (#15256).
|
||||
|
||||
4. **More parallelism** Spack previously installed the dependencies of a
|
||||
_single_ spec in parallel. Entire environments can now be installed in
|
||||
parallel, greatly accelerating builds of large environments. get
|
||||
parallelism from individual specs. Spack now parallelizes entire
|
||||
environment builds (#18131).
|
||||
|
||||
5. **Customizable base images for spack containerize**
|
||||
`spack containerize` previously only output a `Dockerfile` based
|
||||
on `ubuntu`. You may now specify any base image of your choosing (#15028).
|
||||
|
||||
6. **more external finding** `spack external find` was added in `v0.15`,
|
||||
but only `cmake` had support. `spack external find` can now find
|
||||
`bison`, `cuda`, `findutils`, `flex`, `git`, `lustre` `m4`, `mpich`,
|
||||
`mvapich2`, `ncurses`, `openmpi`, `perl`, `spectrum-mpi`, `tar`, and
|
||||
`texinfo` on your system and add them automatically to
|
||||
`packages.yaml`.
|
||||
|
||||
7. **Support aocc, nvhpc, and oneapi compilers** We are aggressively
|
||||
pursuing support for the newest vendor compilers, especially those for
|
||||
the U.S. exascale and pre-exascale systems. Compiler classes and
|
||||
auto-detection for `aocc`, `nvhpc`, `oneapi` are now in Spack (#19345,
|
||||
#19294, #19330).
|
||||
|
||||
## Additional new features of note
|
||||
|
||||
* New `spack mark` command can be used to designate packages as explicitly
|
||||
installed, so that `spack gc` will not garbage-collect them (#16662).
|
||||
* `install_tree` can be customized with Spack's projection format (#18341)
|
||||
* `sbang` now lives in the `install_tree` so that all users can access it (#11598)
|
||||
* `csh` and `tcsh` users no longer need to set `SPACK_ROOT` before
|
||||
sourcing `setup-env.csh` (#18225)
|
||||
* Spec syntax now supports `variant=*` syntax for finding any package
|
||||
that has a particular variant (#19381).
|
||||
* Spack respects `SPACK_GNUPGHOME` variable for custom GPG directories (#17139)
|
||||
* Spack now recognizes Graviton chips
|
||||
|
||||
## Major refactors
|
||||
|
||||
* Use spawn instead of fork on Python >= 3.8 on macOS (#18205)
|
||||
* Use indexes for public build caches (#19101, #19117, #19132, #19141, #19209)
|
||||
* `sbang` is an external package now (https://github.com/spack/sbang, #19582)
|
||||
* `archspec` is an external package now (https://github.com/archspec/archspec, #19600)
|
||||
|
||||
## Deprecations and Removals
|
||||
|
||||
* `spack bootstrap` was deprecated in v0.14.0, and has now been removed.
|
||||
* `spack setup` is deprecated as of v0.16.0.
|
||||
* What was `spack test` is now called `spack unit-test`. `spack test` is
|
||||
now the smoke testing feature in (2) above.
|
||||
|
||||
## Bugfixes
|
||||
|
||||
Some of the most notable bugfixes in this release include:
|
||||
|
||||
* Better warning messages for deprecated syntax in `packages.yaml` (#18013)
|
||||
* `buildcache list --allarch` now works properly (#17827)
|
||||
* Many fixes and tests for buildcaches and binary relcoation (#15687,
|
||||
*#17455, #17418, #17455, #15687, #18110)
|
||||
|
||||
## Package Improvements
|
||||
|
||||
Spack now has 5050 total packages, 720 of which were added since `v0.15`.
|
||||
|
||||
* ROCm packages (`hip`, `aomp`, more) added by AMD (#19957, #19832, others)
|
||||
* Many improvements for ARM support
|
||||
* `llvm-flang`, `flang`, and `f18` removed, as `llvm` has real `flang`
|
||||
support since Flang was merged to LLVM mainline
|
||||
* Emerging support for `spack external find` and `spack test` in packages.
|
||||
|
||||
## Infrastructure
|
||||
|
||||
* Major infrastructure improvements to pipelines on `gitlab.spack.io`
|
||||
* Support for testing PRs from forks (#19248) is being enabled for all
|
||||
forks to enable rolling, up-to-date binary builds on `develop`
|
||||
|
||||
|
||||
# v0.15.4 (2020-08-12)
|
||||
|
||||
This release contains one feature addition:
|
||||
|
||||
* Users can set `SPACK_GNUPGHOME` to override Spack's GPG path (#17139)
|
||||
|
||||
Several bugfixes for CUDA, binary packaging, and `spack -V`:
|
||||
|
||||
* CUDA package's `.libs` method searches for `libcudart` instead of `libcuda` (#18000)
|
||||
* Don't set `CUDAHOSTCXX` in environments that contain CUDA (#17826)
|
||||
* `buildcache create`: `NoOverwriteException` is a warning, not an error (#17832)
|
||||
* Fix `spack buildcache list --allarch` (#17884)
|
||||
* `spack -V` works with `releases/latest` tag and shallow clones (#17884)
|
||||
|
||||
And fixes for GitHub Actions and tests to ensure that CI passes on the
|
||||
release branch (#15687, #17279, #17328, #17377, #17732).
|
||||
|
||||
# v0.15.3 (2020-07-28)
|
||||
|
||||
This release contains the following bugfixes:
|
||||
|
||||
* Fix handling of relative view paths (#17721)
|
||||
* Fixes for binary relocation (#17418, #17455)
|
||||
* Fix redundant printing of error messages in build environment (#17709)
|
||||
|
||||
It also adds a support script for Spack tutorials:
|
||||
|
||||
* Add a tutorial setup script to share/spack (#17705, #17722)
|
||||
|
||||
# v0.15.2 (2020-07-23)
|
||||
|
||||
This minor release includes two new features:
|
||||
|
||||
* Spack install verbosity is decreased, and more debug levels are added (#17546)
|
||||
* The $spack/share/spack/keys directory contains public keys that may be optionally trusted for public binary mirrors (#17684)
|
||||
|
||||
This release also includes several important fixes:
|
||||
|
||||
* MPICC and related variables are now cleand in the build environment (#17450)
|
||||
* LLVM flang only builds CUDA offload components when +cuda (#17466)
|
||||
* CI pipelines no longer upload user environments that can contain secrets to the internet (#17545)
|
||||
* CI pipelines add bootstrapped compilers to the compiler config (#17536)
|
||||
* `spack buildcache list` does not exit on first failure and lists later mirrors (#17565)
|
||||
* Apple's "gcc" executable that is an apple-clang compiler does not generate a gcc compiler config (#17589)
|
||||
* Mixed compiler toolchains are merged more naturally across different compiler suffixes (#17590)
|
||||
* Cray Shasta platforms detect the OS properly (#17467)
|
||||
* Additional more minor fixes.
|
||||
|
||||
# v0.15.1 (2020-07-10)
|
||||
|
||||
This minor release includes several important fixes:
|
||||
|
||||
* Fix shell support on Cray (#17386)
|
||||
* Fix use of externals installed with other Spack instances (#16954)
|
||||
* Fix gcc+binutils build (#9024)
|
||||
* Fixes for usage of intel-mpi (#17378 and #17382)
|
||||
* Fixes to Autotools config.guess detection (#17333 and #17356)
|
||||
* Update `spack install` message to prompt user when an environment is not
|
||||
explicitly activated (#17454)
|
||||
|
||||
This release also adds a mirror for all sources that are
|
||||
fetched in Spack (#17077). It is expected to be useful when the
|
||||
official website for a Spack package is unavailable.
|
||||
|
||||
# v0.15.0 (2020-06-28)
|
||||
|
||||
`v0.15.0` is a major feature release.
|
||||
|
||||
## Major Features in this release
|
||||
|
||||
1. **Cray support** Spack will now work properly on Cray "Cluster"
|
||||
systems (non XC systems) and after a `module purge` command on Cray
|
||||
systems. See #12989
|
||||
|
||||
2. **Virtual package configuration** Virtual packages are allowed in
|
||||
packages.yaml configuration. This allows users to specify a virtual
|
||||
package as non-buildable without needing to specify for each
|
||||
implementation. See #14934
|
||||
|
||||
3. **New config subcommands** This release adds `spack config add` and
|
||||
`spack config remove` commands to add to and remove from yaml
|
||||
configuration files from the CLI. See #13920
|
||||
|
||||
4. **Environment activation** Anonymous environments are **no longer**
|
||||
automatically activated in the current working directory. To activate
|
||||
an environment from a `spack.yaml` file in the current directory, use
|
||||
the `spack env activate .` command. This removes a concern that users
|
||||
were too easily polluting their anonymous environments with accidental
|
||||
installations. See #17258
|
||||
|
||||
5. **Apple clang compiler** The clang compiler and the apple-clang
|
||||
compiler are now separate compilers in Spack. This allows Spack to
|
||||
improve support for the apple-clang compiler. See #17110
|
||||
|
||||
6. **Finding external packages** Spack packages can now support an API
|
||||
for finding external installations. This allows the `spack external
|
||||
find` command to automatically add installations of those packages to
|
||||
the user's configuration. See #15158
|
||||
|
||||
|
||||
## Additional new features of note
|
||||
|
||||
* support for using Spack with the fish shell (#9279)
|
||||
* `spack load --first` option to load first match (instead of prompting user) (#15622)
|
||||
* support the Cray cce compiler both new and classic versions (#17256, #12989)
|
||||
* `spack dev-build` command:
|
||||
* supports stopping before a specified phase (#14699)
|
||||
* supports automatically launching a shell in the build environment (#14887)
|
||||
* `spack install --fail-fast` allows builds to fail at the first error (rather than best-effort) (#15295)
|
||||
* environments: SpecList references can be dereferenced as compiler or dependency constraints (#15245)
|
||||
* `spack view` command: new support for a copy/relocate view type (#16480)
|
||||
* ci pipelines: see documentation for several improvements
|
||||
* `spack mirror -a` command now supports excluding packages (#14154)
|
||||
* `spack buildcache create` is now environment-aware (#16580)
|
||||
* module generation: more flexible format for specifying naming schemes (#16629)
|
||||
* lmod module generation: packages can be configured as core specs for lmod hierarchy (#16517)
|
||||
|
||||
## Deprecations and Removals
|
||||
|
||||
The following commands were deprecated in v0.13.0, and have now been removed:
|
||||
|
||||
* `spack configure`
|
||||
* `spack build`
|
||||
* `spack diy`
|
||||
|
||||
The following commands were deprecated in v0.14.0, and will be removed in the next major release:
|
||||
|
||||
* `spack bootstrap`
|
||||
|
||||
## Bugfixes
|
||||
|
||||
Some of the most notable bugfixes in this release include:
|
||||
|
||||
* Spack environments can now contain the string `-h` (#15429)
|
||||
* The `spack install` gracefully handles being backgrounded (#15723, #14682)
|
||||
* Spack uses `-isystem` instead of `-I` in cases that the underlying build system does as well (#16077)
|
||||
* Spack no longer prints any specs that cannot be safely copied into a Spack command (#16462)
|
||||
* Incomplete Spack environments containing python no longer cause problems (#16473)
|
||||
* Several improvements to binary package relocation
|
||||
|
||||
## Package Improvements
|
||||
|
||||
The Spack project is constantly engaged in routine maintenance,
|
||||
bugfixes, and improvements for the package ecosystem. Of particular
|
||||
note in this release are the following:
|
||||
|
||||
* Spack now contains 4339 packages. There are 430 newly supported packages in v0.15.0
|
||||
* GCC now builds properly on ARM architectures (#17280)
|
||||
* Python: patched to support compiling mixed C/C++ python modules through distutils (#16856)
|
||||
* improvements to pytorch and py-tensorflow packages
|
||||
* improvements to major MPI implementations: mvapich2, mpich, openmpi, and others
|
||||
|
||||
## Spack Project Management:
|
||||
|
||||
* Much of the Spack CI infrastructure has moved from Travis to GitHub Actions (#16610, #14220, #16345)
|
||||
* All merges to the `develop` branch run E4S CI pipeline (#16338)
|
||||
* New `spack debug report` command makes reporting bugs easier (#15834)
|
||||
|
||||
# v0.14.2 (2020-04-15)
|
||||
|
||||
This is a minor release on the `0.14` series. It includes performance
|
||||
improvements and bug fixes:
|
||||
|
||||
* Improvements to how `spack install` handles foreground/background (#15723)
|
||||
* Major performance improvements for reading the package DB (#14693, #15777)
|
||||
* No longer check for the old `index.yaml` database file (#15298)
|
||||
* Properly activate environments with '-h' in the name (#15429)
|
||||
* External packages have correct `.prefix` in environments/views (#15475)
|
||||
* Improvements to computing env modifications from sourcing files (#15791)
|
||||
* Bugfix on Cray machines when getting `TERM` env variable (#15630)
|
||||
* Avoid adding spurious `LMOD` env vars to Intel modules (#15778)
|
||||
* Don't output [+] for mock installs run during tests (#15609)
|
||||
|
||||
# v0.14.1 (2020-03-20)
|
||||
|
||||
This is a bugfix release on top of `v0.14.0`. Specific fixes include:
|
||||
|
||||
* several bugfixes for parallel installation (#15339, #15341, #15220, #15197)
|
||||
* `spack load` now works with packages that have been renamed (#14348)
|
||||
* bugfix for `suite-sparse` installation (#15326)
|
||||
* deduplicate identical suffixes added to module names (#14920)
|
||||
* fix issues with `configure_args` during module refresh (#11084)
|
||||
* increased test coverage and test fixes (#15237, #15354, #15346)
|
||||
* remove some unused code (#15431)
|
||||
|
||||
# v0.14.0 (2020-02-23)
|
||||
|
||||
`v0.14.0` is a major feature release, with 3 highlighted features:
|
||||
|
||||
1. **Distributed builds.** Multiple Spack instances will now coordinate
|
||||
properly with each other through locks. This works on a single node
|
||||
(where you've called `spack` several times) or across multiple nodes
|
||||
with a shared filesystem. For example, with SLURM, you could build
|
||||
`trilinos` and its dependencies on 2 24-core nodes, with 3 Spack
|
||||
instances per node and 8 build jobs per instance, with `srun -N 2 -n 6
|
||||
spack install -j 8 trilinos`. This requires a filesystem with locking
|
||||
enabled, but not MPI or any other library for parallelism.
|
||||
|
||||
2. **Build pipelines.** You can also build in parallel through Gitlab
|
||||
CI. Simply create a Spack environment and push it to Gitlab to build
|
||||
on Gitlab runners. Pipeline support is now integrated into a single
|
||||
`spack ci` command, so setting it up is easier than ever. See the
|
||||
[Pipelines section](https://spack.readthedocs.io/en/v0.14.0/pipelines.html)
|
||||
in the docs.
|
||||
|
||||
3. **Container builds.** The new `spack containerize` command allows you
|
||||
to create a Docker or Singularity recipe from any Spack environment.
|
||||
There are options to customize the build if you need them. See the
|
||||
[Container Images section](https://spack.readthedocs.io/en/latest/containers.html)
|
||||
in the docs.
|
||||
|
||||
In addition, there are several other new commands, many bugfixes and
|
||||
improvements, and `spack load` no longer requires modules, so you can use
|
||||
it the same way on your laptop or on your supercomputer.
|
||||
|
||||
Spack grew by over 300 packages since our last release in November 2019,
|
||||
and the project grew to over 500 contributors. Thanks to all of you for
|
||||
making yet another great release possible. Detailed notes below.
|
||||
|
||||
## Major new core features
|
||||
* Distributed builds: spack instances coordinate and build in parallel (#13100)
|
||||
* New `spack ci` command to manage CI pipelines (#12854)
|
||||
* Generate container recipes from environments: `spack containerize` (#14202)
|
||||
* `spack load` now works without using modules (#14062, #14628)
|
||||
* Garbage collect old/unused installations with `spack gc` (#13534)
|
||||
* Configuration files all set environment modifications the same way (#14372,
|
||||
[docs](https://spack.readthedocs.io/en/v0.14.0/configuration.html#environment-modifications))
|
||||
* `spack commands --format=bash` auto-generates completion (#14393, #14607)
|
||||
* Packages can specify alternate fetch URLs in case one fails (#13881)
|
||||
|
||||
## Improvements
|
||||
* Improved locking for concurrency with environments (#14676, #14621, #14692)
|
||||
* `spack test` sends args to `pytest`, supports better listing (#14319)
|
||||
* Better support for aarch64 and cascadelake microarch (#13825, #13780, #13820)
|
||||
* Archspec is now a separate library (see https://github.com/archspec/archspec)
|
||||
* Many improvements to the `spack buildcache` command (#14237, #14346,
|
||||
#14466, #14467, #14639, #14642, #14659, #14696, #14698, #14714, #14732,
|
||||
#14929, #15003, #15086, #15134)
|
||||
|
||||
## Selected Bugfixes
|
||||
* Compilers now require an exact match on version (#8735, #14730, #14752)
|
||||
* Bugfix for patches that specified specific versions (#13989)
|
||||
* `spack find -p` now works in environments (#10019, #13972)
|
||||
* Dependency queries work correctly in `spack find` (#14757)
|
||||
* Bugfixes for locking upstream Spack instances chains (#13364)
|
||||
* Fixes for PowerPC clang optimization flags (#14196)
|
||||
* Fix for issue with compilers and specific microarchitectures (#13733, #14798)
|
||||
|
||||
## New commands and options
|
||||
* `spack ci` (#12854)
|
||||
* `spack containerize` (#14202)
|
||||
* `spack gc` (#13534)
|
||||
* `spack load` accepts `--only package`, `--only dependencies` (#14062, #14628)
|
||||
* `spack commands --format=bash` (#14393)
|
||||
* `spack commands --update-completion` (#14607)
|
||||
* `spack install --with-cache` has new option: `--no-check-signature` (#11107)
|
||||
* `spack test` now has `--list`, `--list-long`, and `--list-names` (#14319)
|
||||
* `spack install --help-cdash` moves CDash help out of the main help (#13704)
|
||||
|
||||
## Deprecations
|
||||
* `spack release-jobs` has been rolled into `spack ci`
|
||||
* `spack bootstrap` will be removed in a future version, as it is no longer
|
||||
needed to set up modules (see `spack load` improvements above)
|
||||
|
||||
## Documentation
|
||||
* New section on building container images with Spack (see
|
||||
[docs](https://spack.readthedocs.io/en/latest/containers.html))
|
||||
* New section on using `spack ci` command to build pipelines (see
|
||||
[docs](https://spack.readthedocs.io/en/latest/pipelines.html))
|
||||
* Document how to add conditional dependencies (#14694)
|
||||
* Document how to use Spack to replace Homebrew/Conda (#13083, see
|
||||
[docs](https://spack.readthedocs.io/en/latest/workflows.html#using-spack-to-replace-homebrew-conda))
|
||||
|
||||
## Important package changes
|
||||
* 3,908 total packages (345 added since 0.13.0)
|
||||
* Added first cut at a TensorFlow package (#13112)
|
||||
* We now build R without "recommended" packages, manage them w/Spack (#12015)
|
||||
* Elpa and OpenBLAS now leverage microarchitecture support (#13655, #14380)
|
||||
* Fix `octave` compiler wrapper usage (#14726)
|
||||
* Enforce that packages in `builtin` aren't missing dependencies (#13949)
|
||||
|
||||
|
||||
# v0.13.4 (2020-02-07)
|
||||
|
||||
This release contains several bugfixes:
|
||||
@@ -891,8 +16,8 @@ RHEL8.
|
||||
* mirror bugfixes: symlinks, duplicate patches, and exception handling (#13789)
|
||||
* don't try to fetch `BundlePackages` (#13908)
|
||||
* avoid re-fetching patches already added to a mirror (#13908)
|
||||
* avoid re-fetching already added patches (#13908)
|
||||
* avoid re-fetching already added patches (#13908)
|
||||
* avoid re-fetching alread added patches (#13908)
|
||||
* avoid re-fetching alread added patches (#13908)
|
||||
* allow repeated invocations of `spack mirror create` on the same dir (#13908)
|
||||
* bugfix for RHEL8 when `python` is unavailable (#14252)
|
||||
* improve concretization performance in environments (#14190)
|
||||
@@ -1199,4 +324,4 @@ version of all the changes since `v0.9.1`.
|
||||
- Switched from `nose` to `pytest` for unit tests.
|
||||
- Unit tests take 1 minute now instead of 8
|
||||
- Massively expanded documentation
|
||||
- Docs are now hosted on [spack.readthedocs.io](https://spack.readthedocs.io)
|
||||
- Docs are now hosted on [spack.readthedocs.io](http://spack.readthedocs.io)
|
||||
|
58
CITATION.cff
58
CITATION.cff
@@ -1,58 +0,0 @@
|
||||
# If you are referencing Spack in a publication, please cite the SC'15 paper
|
||||
# described here.
|
||||
#
|
||||
# Here's the raw citation:
|
||||
#
|
||||
# Todd Gamblin, Matthew P. LeGendre, Michael R. Collette, Gregory L. Lee,
|
||||
# Adam Moody, Bronis R. de Supinski, and W. Scott Futral.
|
||||
# The Spack Package Manager: Bringing Order to HPC Software Chaos.
|
||||
# In Supercomputing 2015 (SC’15), Austin, Texas, November 15-20 2015. LLNL-CONF-669890.
|
||||
#
|
||||
# Or, in BibTeX:
|
||||
#
|
||||
# @inproceedings{Gamblin_The_Spack_Package_2015,
|
||||
# address = {Austin, Texas, USA},
|
||||
# author = {Gamblin, Todd and LeGendre, Matthew and
|
||||
# Collette, Michael R. and Lee, Gregory L. and
|
||||
# Moody, Adam and de Supinski, Bronis R. and Futral, Scott},
|
||||
# doi = {10.1145/2807591.2807623},
|
||||
# month = {November 15-20},
|
||||
# note = {LLNL-CONF-669890},
|
||||
# series = {Supercomputing 2015 (SC’15)},
|
||||
# title = {{The Spack Package Manager: Bringing Order to HPC Software Chaos}},
|
||||
# url = {https://github.com/spack/spack},
|
||||
# year = {2015}
|
||||
# }
|
||||
#
|
||||
# And here's the CITATION.cff format:
|
||||
#
|
||||
cff-version: 1.2.0
|
||||
message: "If you are referencing Spack in a publication, please cite the paper below."
|
||||
preferred-citation:
|
||||
type: conference-paper
|
||||
doi: "10.1145/2807591.2807623"
|
||||
url: "https://github.com/spack/spack"
|
||||
authors:
|
||||
- family-names: "Gamblin"
|
||||
given-names: "Todd"
|
||||
- family-names: "LeGendre"
|
||||
given-names: "Matthew"
|
||||
- family-names: "Collette"
|
||||
given-names: "Michael R."
|
||||
- family-names: "Lee"
|
||||
given-names: "Gregory L."
|
||||
- family-names: "Moody"
|
||||
given-names: "Adam"
|
||||
- family-names: "de Supinski"
|
||||
given-names: "Bronis R."
|
||||
- family-names: "Futral"
|
||||
given-names: "Scott"
|
||||
title: "The Spack Package Manager: Bringing Order to HPC Software Chaos"
|
||||
conference:
|
||||
name: "Supercomputing 2015 (SC’15)"
|
||||
city: "Austin"
|
||||
region: "Texas"
|
||||
country: "USA"
|
||||
month: November 15-20
|
||||
year: 2015
|
||||
notes: LLNL-CONF-669890
|
44
COPYRIGHT
44
COPYRIGHT
@@ -28,28 +28,14 @@ text in the license header:
|
||||
|
||||
External Packages
|
||||
-------------------
|
||||
|
||||
Spack bundles most external dependencies in lib/spack/external. It also
|
||||
includes the sbang tool directly in bin/sbang. These packages are covered
|
||||
by various permissive licenses. A summary listing follows. See the
|
||||
license included with each package for full details.
|
||||
|
||||
PackageName: altgraph
|
||||
PackageHomePage: https://altgraph.readthedocs.io/en/latest/index.html
|
||||
PackageLicenseDeclared: MIT
|
||||
Spack bundles its external dependencies in lib/spack/external. These
|
||||
packages are covered by various permissive licenses. A summary listing
|
||||
follows. See the license included with each package for full details.
|
||||
|
||||
PackageName: argparse
|
||||
PackageHomePage: https://pypi.python.org/pypi/argparse
|
||||
PackageLicenseDeclared: Python-2.0
|
||||
|
||||
PackageName: astunparse
|
||||
PackageHomePage: https://github.com/simonpercivall/astunparse
|
||||
PackageLicenseDeclared: Python-2.0
|
||||
|
||||
PackageName: attrs
|
||||
PackageHomePage: https://github.com/python-attrs/attrs
|
||||
PackageLicenseDeclared: MIT
|
||||
|
||||
PackageName: ctest_log_parser
|
||||
PackageHomePage: https://github.com/Kitware/CMake
|
||||
PackageLicenseDeclared: BSD-3-Clause
|
||||
@@ -58,8 +44,8 @@ PackageName: distro
|
||||
PackageHomePage: https://pypi.python.org/pypi/distro
|
||||
PackageLicenseDeclared: Apache-2.0
|
||||
|
||||
PackageName: functools32
|
||||
PackageHomePage: https://github.com/MiCHiLU/python-functools32
|
||||
PackageName: functools
|
||||
PackageHomePage: https://github.com/python/cpython/blob/2.7/Lib/functools.py
|
||||
PackageLicenseDeclared: Python-2.0
|
||||
|
||||
PackageName: jinja2
|
||||
@@ -70,10 +56,6 @@ PackageName: jsonschema
|
||||
PackageHomePage: https://pypi.python.org/pypi/jsonschema
|
||||
PackageLicenseDeclared: MIT
|
||||
|
||||
PackageName: macholib
|
||||
PackageHomePage: https://macholib.readthedocs.io/en/latest/index.html
|
||||
PackageLicenseDeclared: MIT
|
||||
|
||||
PackageName: markupsafe
|
||||
PackageHomePage: https://pypi.python.org/pypi/MarkupSafe
|
||||
PackageLicenseDeclared: BSD-3-Clause
|
||||
@@ -86,10 +68,6 @@ PackageName: py
|
||||
PackageHomePage: https://pypi.python.org/pypi/py
|
||||
PackageLicenseDeclared: MIT
|
||||
|
||||
PackageName: pyrsistent
|
||||
PackageHomePage: http://github.com/tobgu/pyrsistent
|
||||
PackageLicenseDeclared: MIT
|
||||
|
||||
PackageName: pytest
|
||||
PackageHomePage: https://pypi.python.org/pypi/pytest
|
||||
PackageLicenseDeclared: MIT
|
||||
@@ -98,10 +76,14 @@ PackageName: ruamel.yaml
|
||||
PackageHomePage: https://yaml.readthedocs.io/
|
||||
PackageLicenseDeclared: MIT
|
||||
|
||||
PackageName: sbang
|
||||
PackageHomePage: https://github.com/spack/sbang
|
||||
PackageLicenseDeclared: Apache-2.0 OR MIT
|
||||
|
||||
PackageName: six
|
||||
PackageHomePage: https://pypi.python.org/pypi/six
|
||||
PackageLicenseDeclared: MIT
|
||||
|
||||
PackageName: macholib
|
||||
PackageHomePage: https://macholib.readthedocs.io/en/latest/index.html
|
||||
PackageLicenseDeclared: MIT
|
||||
|
||||
PackageName: altgraph
|
||||
PackageHomePage: https://altgraph.readthedocs.io/en/latest/index.html
|
||||
PackageLicenseDeclared: MIT
|
||||
|
27
LICENSE-MIT
27
LICENSE-MIT
@@ -1,21 +1,20 @@
|
||||
MIT License
|
||||
Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
|
||||
Copyright (c) 2013-2022 LLNS, LLC and other Spack Project Developers.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the "Software"),
|
||||
to deal in the Software without restriction, including without limitation
|
||||
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
and/or sell copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
|
61
README.md
61
README.md
@@ -1,12 +1,10 @@
|
||||
# <img src="https://cdn.rawgit.com/spack/spack/develop/share/spack/logo/spack-logo.svg" width="64" valign="middle" alt="Spack"/> Spack
|
||||
|
||||
[](https://github.com/spack/spack/actions)
|
||||
[](https://github.com/spack/spack/actions/workflows/bootstrap.yml)
|
||||
[](https://github.com/spack/spack/actions?query=workflow%3A%22macOS+builds+nightly%22)
|
||||
[](https://travis-ci.org/spack/spack)
|
||||
[](https://github.com/spack/spack/actions)
|
||||
[](https://codecov.io/gh/spack/spack)
|
||||
[](https://github.com/spack/spack/actions/workflows/build-containers.yml)
|
||||
[](https://spack.readthedocs.io)
|
||||
[](https://slack.spack.io)
|
||||
[](https://spackpm.herokuapp.com)
|
||||
|
||||
Spack is a multi-platform package manager that builds and installs
|
||||
multiple versions and configurations of software. It works on Linux,
|
||||
@@ -21,29 +19,27 @@ builds of the same package. With Spack, you can build your software
|
||||
*all* the ways you want to.
|
||||
|
||||
See the
|
||||
[Feature Overview](https://spack.readthedocs.io/en/latest/features.html)
|
||||
[Feature Overview](http://spack.readthedocs.io/en/latest/features.html)
|
||||
for examples and highlights.
|
||||
|
||||
To install spack and your first package, make sure you have Python.
|
||||
Then:
|
||||
|
||||
$ git clone -c feature.manyFiles=true https://github.com/spack/spack.git
|
||||
$ git clone https://github.com/spack/spack.git
|
||||
$ cd spack/bin
|
||||
$ ./spack install zlib
|
||||
|
||||
Documentation
|
||||
----------------
|
||||
|
||||
[**Full documentation**](https://spack.readthedocs.io/) is available, or
|
||||
[**Full documentation**](http://spack.readthedocs.io/) is available, or
|
||||
run `spack help` or `spack help --all`.
|
||||
|
||||
For a cheat sheet on Spack syntax, run `spack help --spec`.
|
||||
|
||||
Tutorial
|
||||
----------------
|
||||
|
||||
We maintain a
|
||||
[**hands-on tutorial**](https://spack.readthedocs.io/en/latest/tutorial.html).
|
||||
[**hands-on tutorial**](http://spack.readthedocs.io/en/latest/tutorial.html).
|
||||
It covers basic to advanced usage, packaging, developer features, and large HPC
|
||||
deployments. You can do all of the exercises on your own laptop using a
|
||||
Docker container.
|
||||
@@ -61,7 +57,7 @@ packages to bugfixes, documentation, or even new core features.
|
||||
Resources:
|
||||
|
||||
* **Slack workspace**: [spackpm.slack.com](https://spackpm.slack.com).
|
||||
To get an invitation, visit [slack.spack.io](https://slack.spack.io).
|
||||
To get an invitation, [**click here**](https://spackpm.herokuapp.com).
|
||||
* **Mailing list**: [groups.google.com/d/forum/spack](https://groups.google.com/d/forum/spack)
|
||||
* **Twitter**: [@spackpm](https://twitter.com/spackpm). Be sure to
|
||||
`@mention` us!
|
||||
@@ -75,33 +71,15 @@ When you send your request, make ``develop`` the destination branch on the
|
||||
|
||||
Your PR must pass Spack's unit tests and documentation tests, and must be
|
||||
[PEP 8](https://www.python.org/dev/peps/pep-0008/) compliant. We enforce
|
||||
these guidelines with our CI process. To run these tests locally, and for
|
||||
helpful tips on git, see our
|
||||
[Contribution Guide](https://spack.readthedocs.io/en/latest/contribution_guide.html).
|
||||
these guidelines with [Travis CI](https://travis-ci.org/spack/spack). To
|
||||
run these tests locally, and for helpful tips on git, see our
|
||||
[Contribution Guide](http://spack.readthedocs.io/en/latest/contribution_guide.html).
|
||||
|
||||
Spack's `develop` branch has the latest contributions. Pull requests
|
||||
should target `develop`, and users who want the latest package versions,
|
||||
features, etc. can use `develop`.
|
||||
|
||||
Releases
|
||||
--------
|
||||
|
||||
For multi-user site deployments or other use cases that need very stable
|
||||
software installations, we recommend using Spack's
|
||||
[stable releases](https://github.com/spack/spack/releases).
|
||||
|
||||
Each Spack release series also has a corresponding branch, e.g.
|
||||
`releases/v0.14` has `0.14.x` versions of Spack, and `releases/v0.13` has
|
||||
`0.13.x` versions. We backport important bug fixes to these branches but
|
||||
we do not advance the package versions or make other changes that would
|
||||
change the way Spack concretizes dependencies within a release branch.
|
||||
So, you can base your Spack deployment on a release branch and `git pull`
|
||||
to get fixes, without the package churn that comes with `develop`.
|
||||
|
||||
The latest release is always available with the `releases/latest` tag.
|
||||
|
||||
See the [docs on releases](https://spack.readthedocs.io/en/latest/developer_guide.html#releases)
|
||||
for more details.
|
||||
Spack uses a rough approximation of the
|
||||
[Git Flow](http://nvie.com/posts/a-successful-git-branching-model/)
|
||||
branching model. The ``develop`` branch contains the latest
|
||||
contributions, and ``master`` is always tagged and points to the latest
|
||||
stable release.
|
||||
|
||||
Code of Conduct
|
||||
------------------------
|
||||
@@ -122,12 +100,9 @@ If you are referencing Spack in a publication, please cite the following paper:
|
||||
|
||||
* Todd Gamblin, Matthew P. LeGendre, Michael R. Collette, Gregory L. Lee,
|
||||
Adam Moody, Bronis R. de Supinski, and W. Scott Futral.
|
||||
[**The Spack Package Manager: Bringing Order to HPC Software Chaos**](https://www.computer.org/csdl/proceedings/sc/2015/3723/00/2807623.pdf).
|
||||
[**The Spack Package Manager: Bringing Order to HPC Software Chaos**](http://www.computer.org/csdl/proceedings/sc/2015/3723/00/2807623.pdf).
|
||||
In *Supercomputing 2015 (SC’15)*, Austin, Texas, November 15-20 2015. LLNL-CONF-669890.
|
||||
|
||||
On GitHub, you can copy this citation in APA or BibTeX format via the "Cite this repository"
|
||||
button. Or, see the comments in `CITATION.cff` for the raw BibTeX.
|
||||
|
||||
License
|
||||
----------------
|
||||
|
||||
@@ -145,4 +120,4 @@ See [LICENSE-MIT](https://github.com/spack/spack/blob/develop/LICENSE-MIT),
|
||||
|
||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
LLNL-CODE-811652
|
||||
LLNL-CODE-647188
|
||||
|
25
SECURITY.md
25
SECURITY.md
@@ -1,25 +0,0 @@
|
||||
# Security Policy
|
||||
|
||||
## Supported Versions
|
||||
|
||||
We provide security updates for the following releases.
|
||||
For more on Spack's release structure, see
|
||||
[`README.md`](https://github.com/spack/spack#releases).
|
||||
|
||||
|
||||
| Version | Supported |
|
||||
| ------- | ------------------ |
|
||||
| develop | :white_check_mark: |
|
||||
| 0.17.x | :white_check_mark: |
|
||||
| 0.16.x | :white_check_mark: |
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
To report a vulnerability or other security
|
||||
issue, email maintainers@spack.io.
|
||||
|
||||
You can expect to hear back within two days.
|
||||
If your security issue is accepted, we will do
|
||||
our best to release a fix within a week. If
|
||||
fixing the issue will take longer than this,
|
||||
we will discuss timeline options with you.
|
@@ -1,20 +0,0 @@
|
||||
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
|
||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
|
||||
def getpywin():
|
||||
try:
|
||||
import win32con # noqa
|
||||
except ImportError:
|
||||
subprocess.check_call(
|
||||
[sys.executable, "-m", "pip", "-q", "install", "--upgrade", "pip"])
|
||||
subprocess.check_call(
|
||||
[sys.executable, "-m", "pip", "-q", "install", "pywin32"])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
getpywin()
|
165
bin/sbang
165
bin/sbang
@@ -1,103 +1,114 @@
|
||||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
|
||||
# sbang project developers. See the top-level COPYRIGHT file for details.
|
||||
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
#
|
||||
# `sbang`: Run scripts with long shebang lines.
|
||||
#
|
||||
# Many operating systems limit the length and number of possible
|
||||
# arguments in shebang lines, making it hard to use interpreters that are
|
||||
# deep in the directory hierarchy or require special arguments.
|
||||
# Many operating systems limit the length of shebang lines, making it
|
||||
# hard to use interpreters that are deep in the directory hierarchy.
|
||||
# `sbang` can run such scripts, either as a shebang interpreter, or
|
||||
# directly on the command line.
|
||||
#
|
||||
# To use, put the long shebang on the second line of your script, and
|
||||
# make sbang the interpreter, like this:
|
||||
# Usage
|
||||
# -----------------------------
|
||||
# Suppose you have a script, long-shebang.sh, like this:
|
||||
#
|
||||
# #!/bin/sh /path/to/sbang
|
||||
# #!/long/path/to/real/interpreter with arguments
|
||||
# 1 #!/very/long/path/to/some/interpreter
|
||||
# 2
|
||||
# 3 echo "success!"
|
||||
#
|
||||
# `sbang` will run the real interpreter with the script as its argument.
|
||||
# Invoking this script will result in an error on some OS's. On
|
||||
# Linux, you get this:
|
||||
#
|
||||
# See https://github.com/spack/sbang for more details.
|
||||
# $ ./long-shebang.sh
|
||||
# -bash: ./long: /very/long/path/to/some/interp: bad interpreter:
|
||||
# No such file or directory
|
||||
#
|
||||
# On Mac OS X, the system simply assumes the interpreter is the shell
|
||||
# and tries to run with it, which is likely not what you want.
|
||||
#
|
||||
#
|
||||
# `sbang` on the command line
|
||||
# -----------------------------
|
||||
# You can use `sbang` in two ways. The first is to use it directly,
|
||||
# from the command line, like this:
|
||||
#
|
||||
# $ sbang ./long-shebang.sh
|
||||
# success!
|
||||
#
|
||||
#
|
||||
# `sbang` as the interpreter
|
||||
# -----------------------------
|
||||
# You can also use `sbang` *as* the interpreter for your script. Put
|
||||
# `#!/bin/bash /path/to/sbang` on line 1, and move the original
|
||||
# shebang to line 2 of the script:
|
||||
#
|
||||
# 1 #!/bin/bash /path/to/sbang
|
||||
# 2 #!/long/path/to/real/interpreter with arguments
|
||||
# 3
|
||||
# 4 echo "success!"
|
||||
#
|
||||
# $ ./long-shebang.sh
|
||||
# success!
|
||||
#
|
||||
# On Linux, you could shorten line 1 to `#!/path/to/sbang`, but other
|
||||
# operating systems like Mac OS X require the interpreter to be a
|
||||
# binary, so it's best to use `sbang` as a `bash` argument.
|
||||
# Obviously, for this to work, `sbang` needs to have a short enough
|
||||
# path that *it* will run without hitting OS limits.
|
||||
#
|
||||
# For Lua, scripts the second line can't start with #!, as # is not
|
||||
# the comment character in lua (even though lua ignores #! on the
|
||||
# *first* line of a script). So, instrument a lua script like this,
|
||||
# using -- instead of # on the second line:
|
||||
#
|
||||
# 1 #!/bin/bash /path/to/sbang
|
||||
# 2 --!/long/path/to/lua with arguments
|
||||
# 3
|
||||
# 4 print "success!"
|
||||
#
|
||||
# How it works
|
||||
# -----------------------------
|
||||
# `sbang` is a very simple bash script. It looks at the first two
|
||||
# lines of a script argument and runs the last line starting with
|
||||
# `#!`, with the script as an argument. It also forwards arguments.
|
||||
#
|
||||
|
||||
# Generic error handling
|
||||
die() {
|
||||
echo "$@" 1>&2;
|
||||
exit 1
|
||||
}
|
||||
|
||||
# set SBANG_DEBUG to make the script print what would normally be executed.
|
||||
exec="exec"
|
||||
if [ -n "${SBANG_DEBUG}" ]; then
|
||||
exec="echo "
|
||||
fi
|
||||
|
||||
# First argument is the script we want to actually run.
|
||||
script="$1"
|
||||
|
||||
# ensure that the script actually exists
|
||||
if [ -z "$script" ]; then
|
||||
die "error: sbang requires exactly one argument"
|
||||
elif [ ! -f "$script" ]; then
|
||||
die "$script: no such file or directory"
|
||||
fi
|
||||
|
||||
# Search the first two lines of script for interpreters.
|
||||
lines=0
|
||||
while read -r line && [ $lines -ne 2 ]; do
|
||||
if [ "${line#\#!}" != "$line" ]; then
|
||||
shebang_line="${line#\#!}"
|
||||
elif [ "${line#//!}" != "$line" ]; then # // comments
|
||||
shebang_line="${line#//!}"
|
||||
elif [ "${line#--!}" != "$line" ]; then # -- lua comments
|
||||
shebang_line="${line#--!}"
|
||||
elif [ "${line#<?php\ }" != "$line" ]; then # php comments
|
||||
shebang_line="${line#<?php\ \#!}"
|
||||
shebang_line="${shebang_line%\ ?>}"
|
||||
while read line && ((lines < 2)) ; do
|
||||
if [[ "$line" = '#!'* ]]; then
|
||||
interpreter="${line#\#!}"
|
||||
elif [[ "$line" = '//!'*node* ]]; then
|
||||
interpreter="${line#//!}"
|
||||
elif [[ "$line" = '--!'*lua* ]]; then
|
||||
interpreter="${line#--!}"
|
||||
fi
|
||||
lines=$((lines+1))
|
||||
done < "$script"
|
||||
# this is ineeded for scripts with sbang parameter
|
||||
# like ones in intltool
|
||||
# #!/<spack-long-path>/perl -w
|
||||
# this is the interpreter line with all the parameters as a vector
|
||||
interpreter_v=(${interpreter})
|
||||
# this is the single interpreter path
|
||||
interpreter_f="${interpreter_v[0]}"
|
||||
|
||||
# error if we did not find any interpreter
|
||||
if [ -z "$shebang_line" ]; then
|
||||
die "error: sbang found no interpreter in $script"
|
||||
fi
|
||||
|
||||
# parse out the interpreter and first argument
|
||||
IFS=' ' read -r interpreter arg1 rest <<EOF
|
||||
$shebang_line
|
||||
EOF
|
||||
|
||||
# Determine if the interpreter is a particular program, accounting for the
|
||||
# '#!/usr/bin/env PROGRAM' convention. So:
|
||||
#
|
||||
# interpreter_is perl
|
||||
#
|
||||
# will be true for '#!/usr/bin/perl' and '#!/usr/bin/env perl'
|
||||
interpreter_is() {
|
||||
if [ "${interpreter##*/}" = "$1" ]; then
|
||||
return 0
|
||||
elif [ "$interpreter" = "/usr/bin/env" ] && [ "$arg1" = "$1" ]; then
|
||||
return 0
|
||||
# Invoke any interpreter found, or raise an error if none was found.
|
||||
if [[ -n "$interpreter_f" ]]; then
|
||||
if [[ "${interpreter_f##*/}" = "perl"* ]]; then
|
||||
exec $interpreter -x "$@"
|
||||
else
|
||||
return 1
|
||||
exec $interpreter "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
if interpreter_is "sbang"; then
|
||||
die "error: refusing to re-execute sbang to avoid infinite loop."
|
||||
fi
|
||||
|
||||
# Finally invoke the real shebang line
|
||||
# ruby and perl need -x to ignore the first line of input (the sbang line)
|
||||
#
|
||||
if interpreter_is perl || interpreter_is ruby; then
|
||||
# shellcheck disable=SC2086
|
||||
$exec $shebang_line -x "$@"
|
||||
else
|
||||
# shellcheck disable=SC2086
|
||||
$exec $shebang_line "$@"
|
||||
echo "error: sbang found no interpreter in $script"
|
||||
exit 1
|
||||
fi
|
||||
|
64
bin/spack
64
bin/spack
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
# -*- python -*-
|
||||
#
|
||||
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
@@ -10,13 +10,9 @@
|
||||
# Following line is a shell no-op, and starts a multi-line Python comment.
|
||||
# See https://stackoverflow.com/a/47886254
|
||||
""":"
|
||||
# prefer SPACK_PYTHON environment variable, python3, python, then python2
|
||||
SPACK_PREFERRED_PYTHONS="python3 python python2 /usr/libexec/platform-python"
|
||||
for cmd in "${SPACK_PYTHON:-}" ${SPACK_PREFERRED_PYTHONS}; do
|
||||
if command -v > /dev/null "$cmd"; then
|
||||
export SPACK_PYTHON="$(command -v "$cmd")"
|
||||
exec "${SPACK_PYTHON}" "$0" "$@"
|
||||
fi
|
||||
# prefer python3, then python, then python2
|
||||
for cmd in python3 python python2; do
|
||||
command -v > /dev/null $cmd && exec $cmd $0 "$@"
|
||||
done
|
||||
|
||||
echo "==> Error: spack could not find a python interpreter!" >&2
|
||||
@@ -28,18 +24,12 @@ exit 1
|
||||
from __future__ import print_function
|
||||
|
||||
import os
|
||||
import os.path
|
||||
import sys
|
||||
|
||||
min_python3 = (3, 5)
|
||||
|
||||
if sys.version_info[:2] < (2, 7) or (
|
||||
sys.version_info[:2] >= (3, 0) and sys.version_info[:2] < min_python3
|
||||
):
|
||||
if sys.version_info[:2] < (2, 6):
|
||||
v_info = sys.version_info[:3]
|
||||
msg = "Spack requires Python 2.7 or %d.%d or higher " % min_python3
|
||||
msg += "You are running spack with Python %d.%d.%d." % v_info
|
||||
sys.exit(msg)
|
||||
sys.exit("Spack requires Python 2.6 or higher."
|
||||
"This is Python %d.%d.%d." % v_info)
|
||||
|
||||
# Find spack's location and its prefix.
|
||||
spack_file = os.path.realpath(os.path.expanduser(__file__))
|
||||
@@ -52,8 +42,8 @@ sys.path.insert(0, spack_lib_path)
|
||||
# Add external libs
|
||||
spack_external_libs = os.path.join(spack_lib_path, "external")
|
||||
|
||||
if sys.version_info[:2] <= (2, 7):
|
||||
sys.path.insert(0, os.path.join(spack_external_libs, "py2"))
|
||||
if sys.version_info[:2] == (2, 6):
|
||||
sys.path.insert(0, os.path.join(spack_external_libs, 'py26'))
|
||||
|
||||
sys.path.insert(0, spack_external_libs)
|
||||
|
||||
@@ -63,36 +53,12 @@ sys.path.insert(0, spack_external_libs)
|
||||
# Briefly: ruamel.yaml produces a .pth file when installed with pip that
|
||||
# makes the site installed package the preferred one, even though sys.path
|
||||
# is modified to point to another version of ruamel.yaml.
|
||||
if "ruamel.yaml" in sys.modules:
|
||||
del sys.modules["ruamel.yaml"]
|
||||
if 'ruamel.yaml' in sys.modules:
|
||||
del sys.modules['ruamel.yaml']
|
||||
|
||||
if "ruamel" in sys.modules:
|
||||
del sys.modules["ruamel"]
|
||||
|
||||
# The following code is here to avoid failures when updating
|
||||
# the develop version, due to spurious argparse.pyc files remaining
|
||||
# in the libs/spack/external directory, see:
|
||||
# https://github.com/spack/spack/pull/25376
|
||||
# TODO: Remove in v0.18.0 or later
|
||||
try:
|
||||
import argparse
|
||||
except ImportError:
|
||||
argparse_pyc = os.path.join(spack_external_libs, 'argparse.pyc')
|
||||
if not os.path.exists(argparse_pyc):
|
||||
raise
|
||||
try:
|
||||
os.remove(argparse_pyc)
|
||||
import argparse # noqa
|
||||
except Exception:
|
||||
msg = ('The file\n\n\t{0}\n\nis corrupted and cannot be deleted by Spack. '
|
||||
'Either delete it manually or ask some administrator to '
|
||||
'delete it for you.')
|
||||
print(msg.format(argparse_pyc))
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
import spack.main # noqa
|
||||
if 'ruamel' in sys.modules:
|
||||
del sys.modules['ruamel']
|
||||
|
||||
# Once we've set up the system path, run the spack main method
|
||||
if __name__ == "__main__":
|
||||
sys.exit(spack.main.main())
|
||||
import spack.main # noqa
|
||||
sys.exit(spack.main.main())
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
@@ -22,4 +22,4 @@
|
||||
#
|
||||
# This is compatible across platforms.
|
||||
#
|
||||
exec /usr/bin/env spack python "$@"
|
||||
/usr/bin/env spack python "$@"
|
||||
|
223
bin/spack.bat
223
bin/spack.bat
@@ -1,223 +0,0 @@
|
||||
:: Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
|
||||
:: Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
::
|
||||
:: SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
::#######################################################################
|
||||
::
|
||||
:: This file is part of Spack and sets up the spack environment for batch,
|
||||
:: This includes environment modules and lmod support,
|
||||
:: and it also puts spack in your path. The script also checks that at least
|
||||
:: module support exists, and provides suggestions if it doesn't. Source
|
||||
:: it like this:
|
||||
::
|
||||
:: . /path/to/spack/install/spack_cmd.bat
|
||||
::
|
||||
@echo off
|
||||
|
||||
set spack=%SPACK_ROOT%\bin\spack
|
||||
|
||||
::#######################################################################
|
||||
:: This is a wrapper around the spack command that forwards calls to
|
||||
:: 'spack load' and 'spack unload' to shell functions. This in turn
|
||||
:: allows them to be used to invoke environment modules functions.
|
||||
::
|
||||
:: 'spack load' is smarter than just 'load' because it converts its
|
||||
:: arguments into a unique Spack spec that is then passed to module
|
||||
:: commands. This allows the user to use packages without knowing all
|
||||
:: their installation details.
|
||||
::
|
||||
:: e.g., rather than requiring a full spec for libelf, the user can type:
|
||||
::
|
||||
:: spack load libelf
|
||||
::
|
||||
:: This will first find the available libelf module file and use a
|
||||
:: matching one. If there are two versions of libelf, the user would
|
||||
:: need to be more specific, e.g.:
|
||||
::
|
||||
:: spack load libelf@0.8.13
|
||||
::
|
||||
:: This is very similar to how regular spack commands work and it
|
||||
:: avoids the need to come up with a user-friendly naming scheme for
|
||||
:: spack module files.
|
||||
::#######################################################################
|
||||
|
||||
:_sp_shell_wrapper
|
||||
set "_sp_flags="
|
||||
set "_sp_args="
|
||||
set "_sp_subcommand="
|
||||
setlocal enabledelayedexpansion
|
||||
:: commands have the form '[flags] [subcommand] [args]'
|
||||
:: flags will always start with '-', e.g. --help or -V
|
||||
:: subcommands will never start with '-'
|
||||
:: everything after the subcommand is an arg
|
||||
for %%x in (%*) do (
|
||||
set t="%%~x"
|
||||
if "!t:~0,1!" == "-" (
|
||||
if defined _sp_subcommand (
|
||||
:: We already have a subcommand, processing args now
|
||||
set "_sp_args=!_sp_args! !t!"
|
||||
) else (
|
||||
set "_sp_flags=!_sp_flags! !t!"
|
||||
shift
|
||||
)
|
||||
) else if not defined _sp_subcommand (
|
||||
set "_sp_subcommand=!t!"
|
||||
shift
|
||||
) else (
|
||||
set "_sp_args=!_sp_args! !t!"
|
||||
shift
|
||||
)
|
||||
)
|
||||
|
||||
:: --help, -h and -V flags don't require further output parsing.
|
||||
:: If we encounter, execute and exit
|
||||
if defined _sp_flags (
|
||||
if NOT "%_sp_flags%"=="%_sp_flags:-h=%" (
|
||||
python "%spack%" %_sp_flags%
|
||||
exit /B 0
|
||||
) else if NOT "%_sp_flags%"=="%_sp_flags:--help=%" (
|
||||
python "%spack%" %_sp_flags%
|
||||
exit /B 0
|
||||
) else if NOT "%_sp_flags%"=="%_sp_flags:-V=%" (
|
||||
python "%spack%" %_sp_flags%
|
||||
exit /B 0
|
||||
)
|
||||
)
|
||||
:: pass parsed variables outside of local scope. Need to do
|
||||
:: this because delayedexpansion can only be set by setlocal
|
||||
echo %_sp_flags%>flags
|
||||
echo %_sp_args%>args
|
||||
echo %_sp_subcommand%>subcmd
|
||||
endlocal
|
||||
set /p _sp_subcommand=<subcmd
|
||||
set /p _sp_flags=<flags
|
||||
set /p _sp_args=<args
|
||||
set str_subcommand=%_sp_subcommand:"='%
|
||||
set str_flags=%_sp_flags:"='%
|
||||
set str_args=%_sp_args:"='%
|
||||
if "%str_subcommand%"=="ECHO is off." (set "_sp_subcommand=")
|
||||
if "%str_flags%"=="ECHO is off." (set "_sp_flags=")
|
||||
if "%str_args%"=="ECHO is off." (set "_sp_args=")
|
||||
del subcmd
|
||||
del flags
|
||||
del args
|
||||
|
||||
:: Filter out some commands. For any others, just run the command.
|
||||
if "%_sp_subcommand%" == "cd" (
|
||||
goto :case_cd
|
||||
) else if "%_sp_subcommand%" == "env" (
|
||||
goto :case_env
|
||||
) else if "%_sp_subcommand%" == "load" (
|
||||
goto :case_load
|
||||
) else if "%_sp_subcommand%" == "unload" (
|
||||
goto :case_load
|
||||
) else (
|
||||
goto :default_case
|
||||
)
|
||||
|
||||
::#######################################################################
|
||||
|
||||
:case_cd
|
||||
:: Check for --help or -h
|
||||
:: TODO: This is not exactly the same as setup-env.
|
||||
:: In setup-env, '--help' or '-h' must follow the cd
|
||||
:: Here, they may be anywhere in the args
|
||||
if defined _sp_args (
|
||||
if NOT "%_sp_args%"=="%_sp_args:--help=%" (
|
||||
python "%spack%" cd -h
|
||||
goto :end_switch
|
||||
) else if NOT "%_sp_args%"=="%_sp_args:-h=%" (
|
||||
python "%spack%" cd -h
|
||||
goto :end_switch
|
||||
)
|
||||
)
|
||||
|
||||
for /F "tokens=* USEBACKQ" %%F in (
|
||||
`python "%spack%" location %_sp_args%`) do (
|
||||
set "LOC=%%F"
|
||||
)
|
||||
for %%Z in ("%LOC%") do if EXIST %%~sZ\NUL (cd /d "%LOC%")
|
||||
goto :end_switch
|
||||
|
||||
:case_env
|
||||
:: If no args or args contain --bat or -h/--help: just execute.
|
||||
if NOT defined _sp_args (
|
||||
goto :default_case
|
||||
)else if NOT "%_sp_args%"=="%_sp_args:--help=%" (
|
||||
goto :default_case
|
||||
) else if NOT "%_sp_args%"=="%_sp_args: -h=%" (
|
||||
goto :default_case
|
||||
) else if NOT "%_sp_args%"=="%_sp_args:--bat=%" (
|
||||
goto :default_case
|
||||
) else if NOT "%_sp_args%"=="%_sp_args:deactivate=%" (
|
||||
for /f "tokens=* USEBACKQ" %%I in (
|
||||
`call python "%spack%" %_sp_flags% env deactivate --bat %_sp_args:deactivate=%`
|
||||
) do %%I
|
||||
) else if NOT "%_sp_args%"=="%_sp_args:activate=%" (
|
||||
for /f "tokens=* USEBACKQ" %%I in (
|
||||
`call python "%spack%" %_sp_flags% env activate --bat %_sp_args:activate=%`
|
||||
) do %%I
|
||||
) else (
|
||||
goto :default_case
|
||||
)
|
||||
goto :end_switch
|
||||
|
||||
:case_load
|
||||
:: If args contain --sh, --csh, or -h/--help: just execute.
|
||||
if defined _sp_args (
|
||||
if NOT "%_sp_args%"=="%_sp_args:--help=%" (
|
||||
goto :default_case
|
||||
) else if NOT "%_sp_args%"=="%_sp_args: -h=%" (
|
||||
goto :default_case
|
||||
) else if NOT "%_sp_args%"=="%_sp_args:--bat=%" (
|
||||
goto :default_case
|
||||
)
|
||||
)
|
||||
|
||||
for /f "tokens=* USEBACKQ" %%I in (
|
||||
`python "%spack%" %_sp_flags% %_sp_subcommand% --bat %_sp_args%`) do %%I
|
||||
)
|
||||
goto :end_switch
|
||||
|
||||
:case_unload
|
||||
goto :case_load
|
||||
|
||||
:default_case
|
||||
python "%spack%" %_sp_flags% %_sp_subcommand% %_sp_args%
|
||||
goto :end_switch
|
||||
|
||||
:end_switch
|
||||
exit /B %ERRORLEVEL%
|
||||
|
||||
|
||||
::########################################################################
|
||||
:: Prepends directories to path, if they exist.
|
||||
:: pathadd /path/to/dir # add to PATH
|
||||
:: or pathadd OTHERPATH /path/to/dir # add to OTHERPATH
|
||||
::########################################################################
|
||||
|
||||
:_spack_pathadd
|
||||
set "_pa_varname=PATH"
|
||||
set "_pa_new_path=%~1"
|
||||
if NOT "%~2" == "" (
|
||||
set "_pa_varname=%~1"
|
||||
set "_pa_new_path=%~2"
|
||||
)
|
||||
set "_pa_oldvalue=%_pa_varname%"
|
||||
for %%Z in ("%_pa_new_path%") do if EXIST %%~sZ\NUL (
|
||||
if defined %_pa_oldvalue% (
|
||||
set "_pa_varname=%_pa_new_path%:%_pa_oldvalue%"
|
||||
) else (
|
||||
set "_pa_varname=%_pa_new_path%"
|
||||
)
|
||||
)
|
||||
exit /b 0
|
||||
|
||||
:: set module system roots
|
||||
:_sp_multi_pathadd
|
||||
for %%I in (%~2) do (
|
||||
for %%Z in (%_sp_compatible_sys_types%) do (
|
||||
:pathadd "%~1" "%%I\%%Z"
|
||||
)
|
||||
)
|
||||
exit /B %ERRORLEVEL%
|
@@ -1,72 +0,0 @@
|
||||
@ECHO OFF
|
||||
setlocal EnableDelayedExpansion
|
||||
:: (c) 2021 Lawrence Livermore National Laboratory
|
||||
:: To use this file independently of Spack's installer, execute this script in its directory, or add the
|
||||
:: associated bin directory to your PATH. Invoke to launch Spack Shell.
|
||||
::
|
||||
:: source_dir/spack/bin/spack_cmd.bat
|
||||
::
|
||||
pushd %~dp0..
|
||||
set SPACK_ROOT=%CD%
|
||||
pushd %CD%\..
|
||||
set spackinstdir=%CD%
|
||||
popd
|
||||
|
||||
|
||||
:: Check if Python is on the PATH
|
||||
if not defined python_pf_ver (
|
||||
(for /f "delims=" %%F in ('where python.exe') do (
|
||||
set "python_pf_ver=%%F"
|
||||
goto :found_python
|
||||
) ) 2> NUL
|
||||
)
|
||||
:found_python
|
||||
if not defined python_pf_ver (
|
||||
:: If not, look for Python from the Spack installer
|
||||
:get_builtin
|
||||
(for /f "tokens=*" %%g in ('dir /b /a:d "!spackinstdir!\Python*"') do (
|
||||
set "python_ver=%%g")) 2> NUL
|
||||
|
||||
if not defined python_ver (
|
||||
echo Python was not found on your system.
|
||||
echo Please install Python or add Python to your PATH.
|
||||
) else (
|
||||
set "py_path=!spackinstdir!\!python_ver!"
|
||||
set "py_exe=!py_path!\python.exe"
|
||||
)
|
||||
goto :exitpoint
|
||||
) else (
|
||||
:: Python is already on the path
|
||||
set "py_exe=!python_pf_ver!"
|
||||
(for /F "tokens=* USEBACKQ" %%F in (
|
||||
`"!py_exe!" --version`) do (set "output=%%F")) 2>NUL
|
||||
if not "!output:Microsoft Store=!"=="!output!" goto :get_builtin
|
||||
goto :exitpoint
|
||||
)
|
||||
:exitpoint
|
||||
|
||||
set "PATH=%SPACK_ROOT%\bin\;%PATH%"
|
||||
if defined py_path (
|
||||
set "PATH=%py_path%;%PATH%"
|
||||
)
|
||||
|
||||
if defined py_exe (
|
||||
"%py_exe%" "%SPACK_ROOT%\bin\haspywin.py"
|
||||
"%py_exe%" "%SPACK_ROOT%\bin\spack" external find python >NUL
|
||||
)
|
||||
|
||||
set "EDITOR=notepad"
|
||||
|
||||
DOSKEY spacktivate=spack env activate $*
|
||||
|
||||
@echo **********************************************************************
|
||||
@echo ** Spack Package Manager
|
||||
@echo **********************************************************************
|
||||
|
||||
IF "%1"=="" GOTO CONTINUE
|
||||
set
|
||||
GOTO:EOF
|
||||
|
||||
:continue
|
||||
set PROMPT=[spack] %PROMPT%
|
||||
%comspec% /k
|
@@ -1,10 +0,0 @@
|
||||
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
$Env:SPACK_PS1_PATH="$PSScriptRoot\..\share\spack\setup-env.ps1"
|
||||
& (Get-Process -Id $pid).Path -NoExit {
|
||||
. $Env:SPACK_PS1_PATH ;
|
||||
Push-Location $ENV:SPACK_ROOT
|
||||
}
|
@@ -1,22 +0,0 @@
|
||||
bootstrap:
|
||||
# If set to false Spack will not bootstrap missing software,
|
||||
# but will instead raise an error.
|
||||
enable: true
|
||||
# Root directory for bootstrapping work. The software bootstrapped
|
||||
# by Spack is installed in a "store" subfolder of this root directory
|
||||
root: $user_cache_path/bootstrap
|
||||
# Methods that can be used to bootstrap software. Each method may or
|
||||
# may not be able to bootstrap all the software that Spack needs,
|
||||
# depending on its type.
|
||||
sources:
|
||||
- name: 'github-actions-v0.2'
|
||||
metadata: $spack/share/spack/bootstrap/github-actions-v0.2
|
||||
- name: 'github-actions-v0.1'
|
||||
metadata: $spack/share/spack/bootstrap/github-actions-v0.1
|
||||
- name: 'spack-install'
|
||||
metadata: $spack/share/spack/bootstrap/spack-install
|
||||
trusted:
|
||||
# By default we trust bootstrapping from sources and from binaries
|
||||
# produced on Github via the workflow
|
||||
github-actions-v0.2: true
|
||||
spack-install: true
|
@@ -1,36 +0,0 @@
|
||||
# -------------------------------------------------------------------------
|
||||
# This is the default spack configuration file.
|
||||
#
|
||||
# Settings here are versioned with Spack and are intended to provide
|
||||
# sensible defaults out of the box. Spack maintainers should edit this
|
||||
# file to keep it current.
|
||||
#
|
||||
# Users can override these settings by editing
|
||||
# `$SPACK_ROOT/etc/spack/concretizer.yaml`, `~/.spack/concretizer.yaml`,
|
||||
# or by adding a `concretizer:` section to an environment.
|
||||
# -------------------------------------------------------------------------
|
||||
concretizer:
|
||||
# Whether to consider installed packages or packages from buildcaches when
|
||||
# concretizing specs. If `true`, we'll try to use as many installs/binaries
|
||||
# as possible, rather than building. If `false`, we'll always give you a fresh
|
||||
# concretization.
|
||||
reuse: true
|
||||
# Options that tune which targets are considered for concretization. The
|
||||
# concretization process is very sensitive to the number targets, and the time
|
||||
# needed to reach a solution increases noticeably with the number of targets
|
||||
# considered.
|
||||
targets:
|
||||
# Determine whether we want to target specific or generic microarchitectures.
|
||||
# An example of the first kind might be for instance "skylake" or "bulldozer",
|
||||
# while generic microarchitectures are for instance "aarch64" or "x86_64_v4".
|
||||
granularity: microarchitectures
|
||||
# If "false" allow targets that are incompatible with the current host (for
|
||||
# instance concretize with target "icelake" while running on "haswell").
|
||||
# If "true" only allow targets that are compatible with the host.
|
||||
host_compatible: true
|
||||
# When "true" concretize root specs of environments together, so that each unique
|
||||
# package in an environment corresponds to one concrete spec. This ensures
|
||||
# environments can always be activated. When "false" perform concretization separately
|
||||
# on each root spec, allowing different versions and variants of the same package in
|
||||
# an environment.
|
||||
unify: false
|
@@ -16,25 +16,23 @@
|
||||
config:
|
||||
# This is the path to the root of the Spack install tree.
|
||||
# You can use $spack here to refer to the root of the spack instance.
|
||||
install_tree:
|
||||
root: $spack/opt/spack
|
||||
projections:
|
||||
all: "${ARCHITECTURE}/${COMPILERNAME}-${COMPILERVER}/${PACKAGE}-${VERSION}-${HASH}"
|
||||
# install_tree can include an optional padded length (int or boolean)
|
||||
# default is False (do not pad)
|
||||
# if padded_length is True, Spack will pad as close to the system max path
|
||||
# length as possible
|
||||
# if padded_length is an integer, Spack will pad to that many characters,
|
||||
# assuming it is higher than the length of the install_tree root.
|
||||
# padded_length: 128
|
||||
install_tree: ~/.spack/opt/spack
|
||||
|
||||
|
||||
# Locations where templates should be found
|
||||
template_dirs:
|
||||
- $spack/share/spack/templates
|
||||
|
||||
# Directory where licenses should be located
|
||||
license_dir: $spack/etc/spack/licenses
|
||||
|
||||
# Default directory layout
|
||||
install_path_scheme: "${ARCHITECTURE}/${COMPILERNAME}-${COMPILERVER}/${PACKAGE}-${VERSION}-${HASH}"
|
||||
|
||||
|
||||
# Locations where different types of modules should be installed.
|
||||
module_roots:
|
||||
tcl: ~/.spack/share/spack/modules
|
||||
lmod: ~/.spack/share/spack/lmod
|
||||
|
||||
|
||||
# Temporary locations Spack can try to use for builds.
|
||||
#
|
||||
@@ -45,8 +43,8 @@ config:
|
||||
# (i.e., ``$TMP` or ``$TMPDIR``).
|
||||
#
|
||||
# Another option that prevents conflicts and potential permission issues is
|
||||
# to specify `$user_cache_path/stage`, which ensures each user builds in their
|
||||
# home directory.
|
||||
# to specify `~/.spack/stage`, which ensures each user builds in their home
|
||||
# directory.
|
||||
#
|
||||
# A more traditional path uses the value of `$spack/var/spack/stage`, which
|
||||
# builds directly inside Spack's instance without staging them in a
|
||||
@@ -63,28 +61,18 @@ config:
|
||||
# identifies Spack staging to avoid accidentally wiping out non-Spack work.
|
||||
build_stage:
|
||||
- $tempdir/$user/spack-stage
|
||||
- $user_cache_path/stage
|
||||
- ~/.spack/stage
|
||||
# - $spack/var/spack/stage
|
||||
|
||||
# Directory in which to run tests and store test results.
|
||||
# Tests will be stored in directories named by date/time and package
|
||||
# name/hash.
|
||||
test_stage: $user_cache_path/test
|
||||
|
||||
# Cache directory for already downloaded source tarballs and archived
|
||||
# repositories. This can be purged with `spack clean --downloads`.
|
||||
source_cache: $spack/var/spack/cache
|
||||
source_cache: ~/.spack/var/spack/cache
|
||||
|
||||
|
||||
# Cache directory for miscellaneous files, like the package index.
|
||||
# This can be purged with `spack clean --misc-cache`
|
||||
misc_cache: $user_cache_path/cache
|
||||
|
||||
|
||||
# Timeout in seconds used for downloading sources etc. This only applies
|
||||
# to the connection phase and can be increased for slow connections or
|
||||
# servers. 0 means no timeout.
|
||||
connect_timeout: 10
|
||||
misc_cache: ~/.spack/cache
|
||||
|
||||
|
||||
# If this is false, tools like curl that use SSL will not verify
|
||||
@@ -103,7 +91,7 @@ config:
|
||||
# If set to true, Spack will attempt to build any compiler on the spec
|
||||
# that is not already available. If set to False, Spack will only use
|
||||
# compilers already configured in compilers.yaml
|
||||
install_missing_compilers: false
|
||||
install_missing_compilers: False
|
||||
|
||||
|
||||
# If set to true, Spack will always check checksums after downloading
|
||||
@@ -111,11 +99,6 @@ config:
|
||||
checksum: true
|
||||
|
||||
|
||||
# If set to true, Spack will fetch deprecated versions without warning.
|
||||
# If false, Spack will raise an error when trying to install a deprecated version.
|
||||
deprecated: false
|
||||
|
||||
|
||||
# If set to true, `spack install` and friends will NOT clean
|
||||
# potentially harmful variables from the build environment. Use wisely.
|
||||
dirty: false
|
||||
@@ -137,18 +120,12 @@ config:
|
||||
# enabling locks.
|
||||
locks: true
|
||||
|
||||
# The default url fetch method to use.
|
||||
# If set to 'curl', Spack will require curl on the user's system
|
||||
# If set to 'urllib', Spack will use python built-in libs to fetch
|
||||
url_fetch_method: urllib
|
||||
|
||||
# The maximum number of jobs to use for the build system (e.g. `make`), when
|
||||
# the -j flag is not given on the command line. Defaults to 16 when not set.
|
||||
# Note that the maximum number of jobs is limited by the number of cores
|
||||
# available, taking thread affinity into account when supported. For instance:
|
||||
# - With `build_jobs: 16` and 4 cores available `spack install` will run `make -j4`
|
||||
# - With `build_jobs: 16` and 32 cores available `spack install` will run `make -j16`
|
||||
# - With `build_jobs: 2` and 4 cores available `spack install -j6` will run `make -j6`
|
||||
# The maximum number of jobs to use when running `make` in parallel,
|
||||
# always limited by the number of cores available. For instance:
|
||||
# - If set to 16 on a 4 cores machine `spack install` will run `make -j4`
|
||||
# - If set to 16 on a 18 cores machine `spack install` will run `make -j16`
|
||||
# If not set, Spack will use all available cores up to 16.
|
||||
# build_jobs: 16
|
||||
|
||||
|
||||
@@ -156,27 +133,11 @@ config:
|
||||
ccache: false
|
||||
|
||||
|
||||
# The concretization algorithm to use in Spack. Options are:
|
||||
#
|
||||
# 'clingo': Uses a logic solver under the hood to solve DAGs with full
|
||||
# backtracking and optimization for user preferences. Spack will
|
||||
# try to bootstrap the logic solver, if not already available.
|
||||
#
|
||||
# 'original': Spack's original greedy, fixed-point concretizer. This
|
||||
# algorithm can make decisions too early and will not backtrack
|
||||
# sufficiently for many specs. This will soon be deprecated in
|
||||
# favor of clingo.
|
||||
#
|
||||
# See `concretizer.yaml` for more settings you can fine-tune when
|
||||
# using clingo.
|
||||
concretizer: clingo
|
||||
|
||||
|
||||
# How long to wait to lock the Spack installation database. This lock is used
|
||||
# when Spack needs to manage its own package metadata and all operations are
|
||||
# expected to complete within the default time limit. The timeout should
|
||||
# therefore generally be left untouched.
|
||||
db_lock_timeout: 3
|
||||
db_lock_timeout: 120
|
||||
|
||||
|
||||
# How long to wait when attempting to modify a package (e.g. to install it).
|
||||
@@ -186,18 +147,7 @@ config:
|
||||
# never succeed.
|
||||
package_lock_timeout: null
|
||||
|
||||
|
||||
# Control whether Spack embeds RPATH or RUNPATH attributes in ELF binaries.
|
||||
# Has no effect on macOS. DO NOT MIX these within the same install tree.
|
||||
# See the Spack documentation for details.
|
||||
shared_linking: 'rpath'
|
||||
|
||||
|
||||
# Set to 'false' to allow installation on filesystems that doesn't allow setgid bit
|
||||
# manipulation by unprivileged user (e.g. AFS)
|
||||
allow_sgid: true
|
||||
|
||||
# Whether to set the terminal title to display status information during
|
||||
# building and installing packages. This gives information about Spack's
|
||||
# current progress as well as the current and total number of packages.
|
||||
terminal_title: false
|
||||
|
@@ -1,21 +0,0 @@
|
||||
# -------------------------------------------------------------------------
|
||||
# This is the default configuration for Spack's module file generation.
|
||||
#
|
||||
# Settings here are versioned with Spack and are intended to provide
|
||||
# sensible defaults out of the box. Spack maintainers should edit this
|
||||
# file to keep it current.
|
||||
#
|
||||
# Users can override these settings by editing the following files.
|
||||
#
|
||||
# Per-spack-instance settings (overrides defaults):
|
||||
# $SPACK_ROOT/etc/spack/modules.yaml
|
||||
#
|
||||
# Per-user settings (overrides default and site settings):
|
||||
# ~/.spack/modules.yaml
|
||||
# -------------------------------------------------------------------------
|
||||
modules:
|
||||
prefix_inspections:
|
||||
lib:
|
||||
- LD_LIBRARY_PATH
|
||||
lib64:
|
||||
- LD_LIBRARY_PATH
|
@@ -16,6 +16,8 @@
|
||||
modules:
|
||||
prefix_inspections:
|
||||
lib:
|
||||
- DYLD_LIBRARY_PATH
|
||||
- DYLD_FALLBACK_LIBRARY_PATH
|
||||
lib64:
|
||||
- DYLD_LIBRARY_PATH
|
||||
- DYLD_FALLBACK_LIBRARY_PATH
|
||||
|
@@ -15,27 +15,13 @@
|
||||
# -------------------------------------------------------------------------
|
||||
packages:
|
||||
all:
|
||||
compiler:
|
||||
- apple-clang
|
||||
- clang
|
||||
- gcc
|
||||
- intel
|
||||
compiler: [clang, gcc, intel]
|
||||
providers:
|
||||
elf: [libelf]
|
||||
fuse: [macfuse]
|
||||
unwind: [apple-libunwind]
|
||||
uuid: [apple-libuuid]
|
||||
apple-libunwind:
|
||||
buildable: false
|
||||
externals:
|
||||
paths:
|
||||
# Apple bundles libunwind version 35.3 with macOS 10.9 and later,
|
||||
# although the version number used here isn't critical
|
||||
- spec: apple-libunwind@35.3
|
||||
prefix: /usr
|
||||
apple-libuuid:
|
||||
buildable: false
|
||||
externals:
|
||||
# Apple bundles libuuid in libsystem_c version 1353.100.2,
|
||||
# although the version number used here isn't critical
|
||||
- spec: apple-libuuid@1353.100.2
|
||||
prefix: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
|
||||
apple-libunwind@35.3: /usr
|
||||
buildable: False
|
||||
|
@@ -1,2 +0,0 @@
|
||||
mirrors:
|
||||
spack-public: https://mirror.spack.io
|
@@ -14,7 +14,8 @@
|
||||
# ~/.spack/modules.yaml
|
||||
# -------------------------------------------------------------------------
|
||||
modules:
|
||||
# Paths to check when creating modules for all module sets
|
||||
enable:
|
||||
- tcl
|
||||
prefix_inspections:
|
||||
bin:
|
||||
- PATH
|
||||
@@ -24,6 +25,12 @@ modules:
|
||||
- MANPATH
|
||||
share/aclocal:
|
||||
- ACLOCAL_PATH
|
||||
lib:
|
||||
- LIBRARY_PATH
|
||||
lib64:
|
||||
- LIBRARY_PATH
|
||||
include:
|
||||
- CPATH
|
||||
lib/pkgconfig:
|
||||
- PKG_CONFIG_PATH
|
||||
lib64/pkgconfig:
|
||||
@@ -33,23 +40,6 @@ modules:
|
||||
'':
|
||||
- CMAKE_PREFIX_PATH
|
||||
|
||||
# These are configurations for the module set named "default"
|
||||
default:
|
||||
# Where to install modules
|
||||
roots:
|
||||
tcl: $spack/share/spack/modules
|
||||
lmod: $spack/share/spack/lmod
|
||||
# What type of modules to use
|
||||
enable:
|
||||
- tcl
|
||||
|
||||
tcl:
|
||||
all:
|
||||
autoload: none
|
||||
|
||||
# Default configurations if lmod is enabled
|
||||
lmod:
|
||||
all:
|
||||
autoload: direct
|
||||
hierarchy:
|
||||
- mpi
|
||||
lmod:
|
||||
hierarchy:
|
||||
- mpi
|
||||
|
@@ -15,49 +15,34 @@
|
||||
# -------------------------------------------------------------------------
|
||||
packages:
|
||||
all:
|
||||
compiler: [gcc, intel, pgi, clang, xl, nag, fj, aocc]
|
||||
compiler: [gcc, intel, pgi, clang, xl, nag, fj]
|
||||
providers:
|
||||
awk: [gawk]
|
||||
blas: [openblas, amdblis]
|
||||
D: [ldc]
|
||||
awk: [gawk]
|
||||
blas: [openblas]
|
||||
daal: [intel-daal]
|
||||
elf: [elfutils]
|
||||
fftw-api: [fftw, amdfftw]
|
||||
flame: [libflame, amdlibflame]
|
||||
fuse: [libfuse]
|
||||
gl: [mesa+opengl, mesa18, opengl]
|
||||
fftw-api: [fftw]
|
||||
gl: [mesa+opengl, opengl]
|
||||
glx: [mesa+glx, opengl]
|
||||
glu: [mesa-glu, openglu]
|
||||
glx: [mesa+glx, mesa18+glx, opengl]
|
||||
golang: [gcc]
|
||||
iconv: [libiconv]
|
||||
ipp: [intel-ipp]
|
||||
java: [openjdk, jdk, ibm-java]
|
||||
jpeg: [libjpeg-turbo, libjpeg]
|
||||
lapack: [openblas, amdlibflame]
|
||||
libllvm: [llvm, llvm-amdgpu]
|
||||
lua-lang: [lua, lua-luajit-openresty, lua-luajit]
|
||||
luajit: [lua-luajit-openresty, lua-luajit]
|
||||
lapack: [openblas]
|
||||
mariadb-client: [mariadb-c-client, mariadb]
|
||||
mkl: [intel-mkl]
|
||||
mpe: [mpe2]
|
||||
mpi: [openmpi, mpich]
|
||||
mysql-client: [mysql, mariadb-c-client]
|
||||
opencl: [pocl]
|
||||
onedal: [intel-oneapi-dal]
|
||||
osmesa: [mesa+osmesa, mesa18+osmesa]
|
||||
pbs: [openpbs, torque]
|
||||
pil: [py-pillow]
|
||||
pkgconfig: [pkgconf, pkg-config]
|
||||
rpc: [libtirpc]
|
||||
scalapack: [netlib-scalapack, amdscalapack]
|
||||
sycl: [hipsycl]
|
||||
szip: [libaec, libszip]
|
||||
scalapack: [netlib-scalapack]
|
||||
szip: [libszip, libaec]
|
||||
tbb: [intel-tbb]
|
||||
unwind: [libunwind]
|
||||
uuid: [util-linux-uuid, libuuid]
|
||||
xxd: [xxd-standalone, vim]
|
||||
yacc: [bison, byacc]
|
||||
ziglang: [zig]
|
||||
permissions:
|
||||
read: world
|
||||
write: user
|
||||
|
7
etc/spack/defaults/upstreams.yaml
Normal file
7
etc/spack/defaults/upstreams.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
upstreams:
|
||||
global:
|
||||
install_tree: $spack/opt/spack
|
||||
modules:
|
||||
tcl: $spack/share/spack/modules
|
||||
lmod: $spack/share/spack/lmod
|
||||
dotkit: $spack/share/spack/dotkit
|
@@ -1,5 +0,0 @@
|
||||
config:
|
||||
locks: false
|
||||
concretizer: original
|
||||
build_stage::
|
||||
- '$spack/.staging'
|
@@ -2,7 +2,7 @@
|
||||
#
|
||||
|
||||
# You can set these variables from the command line.
|
||||
SPHINXOPTS = -W --keep-going
|
||||
SPHINXOPTS = -W
|
||||
SPHINXBUILD = sphinx-build
|
||||
PAPER =
|
||||
BUILDDIR = _build
|
||||
|
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0; url=https://spack.readthedocs.io/" />
|
||||
<meta http-equiv="refresh" content="0; url=http://spack.readthedocs.io/" />
|
||||
</head>
|
||||
<body>
|
||||
<p>
|
||||
This page has moved to <a href="https://spack.readthedocs.io/">https://spack.readthedocs.io/</a>
|
||||
This page has moved to <a href="http://spack.readthedocs.io/">http://spack.readthedocs.io/</a>
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -1,162 +0,0 @@
|
||||
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
|
||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
.. _analyze:
|
||||
|
||||
=======
|
||||
Analyze
|
||||
=======
|
||||
|
||||
|
||||
The analyze command is a front-end to various tools that let us analyze
|
||||
package installations. Each analyzer is a module for a different kind
|
||||
of analysis that can be done on a package installation, including (but not
|
||||
limited to) binary, log, or text analysis. Thus, the analyze command group
|
||||
allows you to take an existing package install, choose an analyzer,
|
||||
and extract some output for the package using it.
|
||||
|
||||
|
||||
-----------------
|
||||
Analyzer Metadata
|
||||
-----------------
|
||||
|
||||
For all analyzers, we write to an ``analyzers`` folder in ``~/.spack``, or the
|
||||
value that you specify in your spack config at ``config:analyzers_dir``.
|
||||
For example, here we see the results of running an analysis on zlib:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ tree ~/.spack/analyzers/
|
||||
└── linux-ubuntu20.04-skylake
|
||||
└── gcc-9.3.0
|
||||
└── zlib-1.2.11-sl7m27mzkbejtkrajigj3a3m37ygv4u2
|
||||
├── environment_variables
|
||||
│ └── spack-analyzer-environment-variables.json
|
||||
├── install_files
|
||||
│ └── spack-analyzer-install-files.json
|
||||
└── libabigail
|
||||
└── spack-analyzer-libabigail-libz.so.1.2.11.xml
|
||||
|
||||
|
||||
This means that you can always find analyzer output in this folder, and it
|
||||
is organized with the same logic as the package install it was run for.
|
||||
If you want to customize this top level folder, simply provide the ``--path``
|
||||
argument to ``spack analyze run``. The nested organization will be maintained
|
||||
within your custom root.
|
||||
|
||||
-----------------
|
||||
Listing Analyzers
|
||||
-----------------
|
||||
|
||||
If you aren't familiar with Spack's analyzers, you can quickly list those that
|
||||
are available:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack analyze list-analyzers
|
||||
install_files : install file listing read from install_manifest.json
|
||||
environment_variables : environment variables parsed from spack-build-env.txt
|
||||
config_args : config args loaded from spack-configure-args.txt
|
||||
libabigail : Application Binary Interface (ABI) features for objects
|
||||
|
||||
|
||||
In the above, the first three are fairly simple - parsing metadata files from
|
||||
a package install directory to save
|
||||
|
||||
-------------------
|
||||
Analyzing a Package
|
||||
-------------------
|
||||
|
||||
The analyze command, akin to install, will accept a package spec to perform
|
||||
an analysis for. The package must be installed. Let's walk through an example
|
||||
with zlib. We first ask to analyze it. However, since we have more than one
|
||||
install, we are asked to disambiguate:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack analyze run zlib
|
||||
==> Error: zlib matches multiple packages.
|
||||
Matching packages:
|
||||
fz2bs56 zlib@1.2.11%gcc@7.5.0 arch=linux-ubuntu18.04-skylake
|
||||
sl7m27m zlib@1.2.11%gcc@9.3.0 arch=linux-ubuntu20.04-skylake
|
||||
Use a more specific spec.
|
||||
|
||||
|
||||
We can then specify the spec version that we want to analyze:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack analyze run zlib/fz2bs56
|
||||
|
||||
If you don't provide any specific analyzer names, by default all analyzers
|
||||
(shown in the ``list-analyzers`` subcommand list) will be run. If an analyzer does not
|
||||
have any result, it will be skipped. For example, here is a result running for
|
||||
zlib:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ ls ~/.spack/analyzers/linux-ubuntu20.04-skylake/gcc-9.3.0/zlib-1.2.11-sl7m27mzkbejtkrajigj3a3m37ygv4u2/
|
||||
spack-analyzer-environment-variables.json
|
||||
spack-analyzer-install-files.json
|
||||
spack-analyzer-libabigail-libz.so.1.2.11.xml
|
||||
|
||||
If you want to run a specific analyzer, ask for it with `--analyzer`. Here we run
|
||||
spack analyze on libabigail (already installed) _using_ libabigail1
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack analyze run --analyzer abigail libabigail
|
||||
|
||||
|
||||
.. _analyze_monitoring:
|
||||
|
||||
----------------------
|
||||
Monitoring An Analysis
|
||||
----------------------
|
||||
|
||||
For any kind of analysis, you can
|
||||
use a `spack monitor <https://github.com/spack/spack-monitor>`_ "Spackmon"
|
||||
as a server to upload the same run metadata to. You can
|
||||
follow the instructions in the `spack monitor documentation <https://spack-monitor.readthedocs.org>`_
|
||||
to first create a server along with a username and token for yourself.
|
||||
You can then use this guide to interact with the server.
|
||||
|
||||
You should first export our spack monitor token and username to the environment:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ export SPACKMON_TOKEN=50445263afd8f67e59bd79bff597836ee6c05438
|
||||
$ export SPACKMON_USER=spacky
|
||||
|
||||
|
||||
By default, the host for your server is expected to be at ``http://127.0.0.1``
|
||||
with a prefix of ``ms1``, and if this is the case, you can simply add the
|
||||
``--monitor`` flag to the install command:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack analyze run --monitor wget
|
||||
|
||||
If you need to customize the host or the prefix, you can do that as well:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack analyze run --monitor --monitor-prefix monitor --monitor-host https://monitor-service.io wget
|
||||
|
||||
If your server doesn't have authentication, you can skip it:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack analyze run --monitor --monitor-disable-auth wget
|
||||
|
||||
Regardless of your choice, when you run analyze on an installed package (whether
|
||||
it was installed with ``--monitor`` or not, you'll see the results generating as they did
|
||||
before, and a message that the monitor server was pinged:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack analyze --monitor wget
|
||||
...
|
||||
==> Sending result for wget bin/wget to monitor.
|
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||
.. Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
|
||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
@@ -25,20 +25,6 @@ It is recommended that the following be put in your ``.bashrc`` file:
|
||||
|
||||
alias less='less -R'
|
||||
|
||||
If you do not see colorized output when using ``less -R`` it is because color
|
||||
is being disabled in the piped output. In this case, tell spack to force
|
||||
colorized output with a flag
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack --color always find | less -R
|
||||
|
||||
or an environment variable
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ SPACK_COLOR=always spack find | less -R
|
||||
|
||||
--------------------------
|
||||
Listing available packages
|
||||
--------------------------
|
||||
@@ -59,7 +45,7 @@ can install:
|
||||
.. command-output:: spack list
|
||||
:ellipsis: 10
|
||||
|
||||
There are thousands of them, so we've truncated the output above, but you
|
||||
There are thosands of them, so we've truncated the output above, but you
|
||||
can find a :ref:`full list here <package-list>`.
|
||||
Packages are listed by name in alphabetical order.
|
||||
A pattern to match with no wildcards, ``*`` or ``?``,
|
||||
@@ -138,27 +124,32 @@ If ``mpileaks`` depends on other packages, Spack will install the
|
||||
dependencies first. It then fetches the ``mpileaks`` tarball, expands
|
||||
it, verifies that it was downloaded without errors, builds it, and
|
||||
installs it in its own directory under ``$SPACK_ROOT/opt``. You'll see
|
||||
a number of messages from Spack, a lot of build output, and a message
|
||||
that the package is installed.
|
||||
a number of messages from spack, a lot of build output, and a message
|
||||
that the packages is installed:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack install mpileaks
|
||||
... dependency build output ...
|
||||
==> Installing mpileaks-1.0-ph7pbnhl334wuhogmugriohcwempqry2
|
||||
==> No binary for mpileaks-1.0-ph7pbnhl334wuhogmugriohcwempqry2 found: installing from source
|
||||
==> mpileaks: Executing phase: 'autoreconf'
|
||||
==> mpileaks: Executing phase: 'configure'
|
||||
==> mpileaks: Executing phase: 'build'
|
||||
==> mpileaks: Executing phase: 'install'
|
||||
[+] ~/spack/opt/linux-rhel7-broadwell/gcc-8.1.0/mpileaks-1.0-ph7pbnhl334wuhogmugriohcwempqry2
|
||||
==> Installing mpileaks
|
||||
==> mpich is already installed in ~/spack/opt/linux-debian7-x86_64/gcc@4.4.7/mpich@3.0.4.
|
||||
==> callpath is already installed in ~/spack/opt/linux-debian7-x86_64/gcc@4.4.7/callpath@1.0.2-5dce4318.
|
||||
==> adept-utils is already installed in ~/spack/opt/linux-debian7-x86_64/gcc@4.4.7/adept-utils@1.0-5adef8da.
|
||||
==> Trying to fetch from https://github.com/hpc/mpileaks/releases/download/v1.0/mpileaks-1.0.tar.gz
|
||||
######################################################################## 100.0%
|
||||
==> Staging archive: ~/spack/var/spack/stage/mpileaks@1.0%gcc@4.4.7 arch=linux-debian7-x86_64-59f6ad23/mpileaks-1.0.tar.gz
|
||||
==> Created stage in ~/spack/var/spack/stage/mpileaks@1.0%gcc@4.4.7 arch=linux-debian7-x86_64-59f6ad23.
|
||||
==> No patches needed for mpileaks.
|
||||
==> Building mpileaks.
|
||||
|
||||
... build output ...
|
||||
|
||||
==> Successfully installed mpileaks.
|
||||
Fetch: 2.16s. Build: 9.82s. Total: 11.98s.
|
||||
[+] ~/spack/opt/linux-debian7-x86_64/gcc@4.4.7/mpileaks@1.0-59f6ad23
|
||||
|
||||
The last line, with the ``[+]``, indicates where the package is
|
||||
installed.
|
||||
|
||||
Add the Spack debug option (one or more times) -- ``spack -d install
|
||||
mpileaks`` -- to get additional (and even more verbose) output.
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Building a specific version
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@@ -188,37 +179,6 @@ configuration a **spec**. In the commands above, ``mpileaks`` and
|
||||
``mpileaks@3.0.4`` are both valid *specs*. We'll talk more about how
|
||||
you can use them to customize an installation in :ref:`sec-specs`.
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Reusing installed dependencies
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
By default, when you run ``spack install``, Spack tries hard to reuse existing installations
|
||||
as dependencies, either from a local store or from remote buildcaches if configured.
|
||||
This minimizes unwanted rebuilds of common dependencies, in particular if
|
||||
you update Spack frequently.
|
||||
|
||||
In case you want the latest versions and configurations to be installed instead,
|
||||
you can add the ``--fresh`` option:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack install --fresh mpich
|
||||
|
||||
Reusing installations in this mode is "accidental", and happening only if
|
||||
there's a match between existing installations and what Spack would have installed
|
||||
anyhow.
|
||||
|
||||
You can use the ``spack spec -I mpich`` command to see what
|
||||
will be reused and what will be built before you install.
|
||||
|
||||
You can configure Spack to use the ``--fresh`` behavior by default in
|
||||
``concretizer.yaml``:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
concretizer:
|
||||
reuse: false
|
||||
|
||||
.. _cmd-spack-uninstall:
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
@@ -307,7 +267,7 @@ the ``spack gc`` ("garbage collector") command, which will uninstall all unneede
|
||||
-- linux-ubuntu18.04-broadwell / gcc@9.0.1 ----------------------
|
||||
hdf5@1.10.5 libiconv@1.16 libpciaccess@0.13.5 libszip@2.1.1 libxml2@2.9.9 mpich@3.3.2 openjpeg@2.3.1 xz@5.2.4 zlib@1.2.11
|
||||
|
||||
In the example above Spack went through all the packages in the package database
|
||||
In the example above Spack went through all the packages in the DB
|
||||
and removed everything that is not either:
|
||||
|
||||
1. A package installed upon explicit request of the user
|
||||
@@ -316,102 +276,6 @@ and removed everything that is not either:
|
||||
You can check :ref:`cmd-spack-find-metadata` to see how to query for explicitly installed packages
|
||||
or :ref:`dependency-types` for a more thorough treatment of dependency types.
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Marking packages explicit or implicit
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
By default, Spack will mark packages a user installs as explicitly installed,
|
||||
while all of its dependencies will be marked as implicitly installed. Packages
|
||||
can be marked manually as explicitly or implicitly installed by using
|
||||
``spack mark``. This can be used in combination with ``spack gc`` to clean up
|
||||
packages that are no longer required.
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack install m4
|
||||
==> 29005: Installing libsigsegv
|
||||
[...]
|
||||
==> 29005: Installing m4
|
||||
[...]
|
||||
|
||||
$ spack install m4 ^libsigsegv@2.11
|
||||
==> 39798: Installing libsigsegv
|
||||
[...]
|
||||
==> 39798: Installing m4
|
||||
[...]
|
||||
|
||||
$ spack find -d
|
||||
==> 4 installed packages
|
||||
-- linux-fedora32-haswell / gcc@10.1.1 --------------------------
|
||||
libsigsegv@2.11
|
||||
|
||||
libsigsegv@2.12
|
||||
|
||||
m4@1.4.18
|
||||
libsigsegv@2.12
|
||||
|
||||
m4@1.4.18
|
||||
libsigsegv@2.11
|
||||
|
||||
$ spack gc
|
||||
==> There are no unused specs. Spack's store is clean.
|
||||
|
||||
$ spack mark -i m4 ^libsigsegv@2.11
|
||||
==> m4@1.4.18 : marking the package implicit
|
||||
|
||||
$ spack gc
|
||||
==> The following packages will be uninstalled:
|
||||
|
||||
-- linux-fedora32-haswell / gcc@10.1.1 --------------------------
|
||||
5fj7p2o libsigsegv@2.11 c6ensc6 m4@1.4.18
|
||||
|
||||
==> Do you want to proceed? [y/N]
|
||||
|
||||
In the example above, we ended up with two versions of ``m4`` since they depend
|
||||
on different versions of ``libsigsegv``. ``spack gc`` will not remove any of
|
||||
the packages since both versions of ``m4`` have been installed explicitly
|
||||
and both versions of ``libsigsegv`` are required by the ``m4`` packages.
|
||||
|
||||
``spack mark`` can also be used to implement upgrade workflows. The following
|
||||
example demonstrates how the ``spack mark`` and ``spack gc`` can be used to
|
||||
only keep the current version of a package installed.
|
||||
|
||||
When updating Spack via ``git pull``, new versions for either ``libsigsegv``
|
||||
or ``m4`` might be introduced. This will cause Spack to install duplicates.
|
||||
Since we only want to keep one version, we mark everything as implicitly
|
||||
installed before updating Spack. If there is no new version for either of the
|
||||
packages, ``spack install`` will simply mark them as explicitly installed and
|
||||
``spack gc`` will not remove them.
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack install m4
|
||||
==> 62843: Installing libsigsegv
|
||||
[...]
|
||||
==> 62843: Installing m4
|
||||
[...]
|
||||
|
||||
$ spack mark -i -a
|
||||
==> m4@1.4.18 : marking the package implicit
|
||||
|
||||
$ git pull
|
||||
[...]
|
||||
|
||||
$ spack install m4
|
||||
[...]
|
||||
==> m4@1.4.18 : marking the package explicit
|
||||
[...]
|
||||
|
||||
$ spack gc
|
||||
==> There are no unused specs. Spack's store is clean.
|
||||
|
||||
When using this workflow for installations that contain more packages, care
|
||||
has to be taken to either only mark selected packages or issue ``spack install``
|
||||
for all packages that should be kept.
|
||||
|
||||
You can check :ref:`cmd-spack-find-metadata` to see how to query for explicitly
|
||||
or implicitly installed packages.
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Non-Downloadable Tarballs
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@@ -457,6 +321,85 @@ the tarballs in question to it (see :ref:`mirrors`):
|
||||
|
||||
$ spack install galahad
|
||||
|
||||
-----------------------------
|
||||
Deprecating insecure packages
|
||||
-----------------------------
|
||||
|
||||
``spack deprecate`` allows for the removal of insecure packages with
|
||||
minimal impact to their dependents.
|
||||
|
||||
.. warning::
|
||||
|
||||
The ``spack deprecate`` command is designed for use only in
|
||||
extraordinary circumstances. This is a VERY big hammer to be used
|
||||
with care.
|
||||
|
||||
The ``spack deprecate`` command will remove one package and replace it
|
||||
with another by replacing the deprecated package's prefix with a link
|
||||
to the deprecator package's prefix.
|
||||
|
||||
.. warning::
|
||||
|
||||
The ``spack deprecate`` command makes no promises about binary
|
||||
compatibility. It is up to the user to ensure the deprecator is
|
||||
suitable for the deprecated package.
|
||||
|
||||
Spack tracks concrete deprecated specs and ensures that no future packages
|
||||
concretize to a deprecated spec.
|
||||
|
||||
The first spec given to the ``spack deprecate`` command is the package
|
||||
to deprecate. It is an abstract spec that must describe a single
|
||||
installed package. The second spec argument is the deprecator
|
||||
spec. By default it must be an abstract spec that describes a single
|
||||
installed package, but with the ``-i/--install-deprecator`` it can be
|
||||
any abstract spec that Spack will install and then use as the
|
||||
deprecator. The ``-I/--no-install-deprecator`` option will ensure
|
||||
the default behavior.
|
||||
|
||||
By default, ``spack deprecate`` will deprecate all dependencies of the
|
||||
deprecated spec, replacing each by the dependency of the same name in
|
||||
the deprecator spec. The ``-d/--dependencies`` option will ensure the
|
||||
default, while the ``-D/--no-dependencies`` option will deprecate only
|
||||
the root of the deprecate spec in favor of the root of the deprecator
|
||||
spec.
|
||||
|
||||
``spack deprecate`` can use symbolic links or hard links. The default
|
||||
behavior is symbolic links, but the ``-l/--link-type`` flag can take
|
||||
options ``hard`` or ``soft``.
|
||||
|
||||
-----------------------
|
||||
Verifying installations
|
||||
-----------------------
|
||||
|
||||
The ``spack verify`` command can be used to verify the validity of
|
||||
Spack-installed packages any time after installation.
|
||||
|
||||
At installation time, Spack creates a manifest of every file in the
|
||||
installation prefix. For links, Spack tracks the mode, ownership, and
|
||||
destination. For directories, Spack tracks the mode, and
|
||||
ownership. For files, Spack tracks the mode, ownership, modification
|
||||
time, hash, and size. The Spack verify command will check, for every
|
||||
file in each package, whether any of those attributes have changed. It
|
||||
will also check for newly added files or deleted files from the
|
||||
installation prefix. Spack can either check all installed packages
|
||||
using the `-a,--all` or accept specs listed on the command line to
|
||||
verify.
|
||||
|
||||
The ``spack verify`` command can also verify for individual files that
|
||||
they haven't been altered since installation time. If the given file
|
||||
is not in a Spack installation prefix, Spack will report that it is
|
||||
not owned by any package. To check individual files instead of specs,
|
||||
use the ``-f,--files`` option.
|
||||
|
||||
Spack installation manifests are part of the tarball signed by Spack
|
||||
for binary package distribution. When installed from a binary package,
|
||||
Spack uses the packaged installation manifest instead of creating one
|
||||
at install time.
|
||||
|
||||
The ``spack verify`` command also accepts the ``-l,--local`` option to
|
||||
check only local packages (as opposed to those used transparently from
|
||||
``upstream`` spack instances) and the ``-j,--json`` option to output
|
||||
machine-readable json data for any errors.
|
||||
|
||||
-------------------------
|
||||
Seeing installed packages
|
||||
@@ -676,8 +619,8 @@ output metadata on specs and all dependencies as json:
|
||||
"target": "x86_64"
|
||||
},
|
||||
"compiler": {
|
||||
"name": "apple-clang",
|
||||
"version": "10.0.0"
|
||||
"name": "clang",
|
||||
"version": "10.0.0-apple"
|
||||
},
|
||||
"namespace": "builtin",
|
||||
"parameters": {
|
||||
@@ -725,242 +668,6 @@ structured the way you want:
|
||||
"hash": "zvaa4lhlhilypw5quj3akyd3apbq5gap"
|
||||
}
|
||||
|
||||
|
||||
^^^^^^^^^^^^^^
|
||||
``spack diff``
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
It's often the case that you have two versions of a spec that you need to
|
||||
disambiguate. Let's say that we've installed two variants of zlib, one with
|
||||
and one without the optimize variant:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack install zlib
|
||||
$ spack install zlib -optimize
|
||||
|
||||
When we do ``spack find`` we see the two versions.
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack find zlib
|
||||
==> 2 installed packages
|
||||
-- linux-ubuntu20.04-skylake / gcc@9.3.0 ------------------------
|
||||
zlib@1.2.11 zlib@1.2.11
|
||||
|
||||
|
||||
Let's now say that we want to uninstall zlib. We run the command, and hit a problem
|
||||
real quickly since we have two!
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack uninstall zlib
|
||||
==> Error: zlib matches multiple packages:
|
||||
|
||||
-- linux-ubuntu20.04-skylake / gcc@9.3.0 ------------------------
|
||||
efzjziy zlib@1.2.11 sl7m27m zlib@1.2.11
|
||||
|
||||
==> Error: You can either:
|
||||
a) use a more specific spec, or
|
||||
b) specify the spec by its hash (e.g. `spack uninstall /hash`), or
|
||||
c) use `spack uninstall --all` to uninstall ALL matching specs.
|
||||
|
||||
Oh no! We can see from the above that we have two different versions of zlib installed,
|
||||
and the only difference between the two is the hash. This is a good use case for
|
||||
``spack diff``, which can easily show us the "diff" or set difference
|
||||
between properties for two packages. Let's try it out.
|
||||
Since the only difference we see in the ``spack find`` view is the hash, let's use
|
||||
``spack diff`` to look for more detail. We will provide the two hashes:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack diff /efzjziy /sl7m27m
|
||||
==> Warning: This interface is subject to change.
|
||||
|
||||
--- zlib@1.2.11efzjziyc3dmb5h5u5azsthgbgog5mj7g
|
||||
+++ zlib@1.2.11sl7m27mzkbejtkrajigj3a3m37ygv4u2
|
||||
@@ variant_value @@
|
||||
- zlib optimize False
|
||||
+ zlib optimize True
|
||||
|
||||
|
||||
The output is colored, and written in the style of a git diff. This means that you
|
||||
can copy and paste it into a GitHub markdown as a code block with language "diff"
|
||||
and it will render nicely! Here is an example:
|
||||
|
||||
.. code-block:: md
|
||||
|
||||
```diff
|
||||
--- zlib@1.2.11/efzjziyc3dmb5h5u5azsthgbgog5mj7g
|
||||
+++ zlib@1.2.11/sl7m27mzkbejtkrajigj3a3m37ygv4u2
|
||||
@@ variant_value @@
|
||||
- zlib optimize False
|
||||
+ zlib optimize True
|
||||
```
|
||||
|
||||
Awesome! Now let's read the diff. It tells us that our first zlib was built with ``~optimize``
|
||||
(``False``) and the second was built with ``+optimize`` (``True``). You can't see it in the docs
|
||||
here, but the output above is also colored based on the content being an addition (+) or
|
||||
subtraction (-).
|
||||
|
||||
This is a small example, but you will be able to see differences for any attributes on the
|
||||
installation spec. Running ``spack diff A B`` means we'll see which spec attributes are on
|
||||
``B`` but not on ``A`` (green) and which are on ``A`` but not on ``B`` (red). Here is another
|
||||
example with an additional difference type, ``version``:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack diff python@2.7.8 python@3.8.11
|
||||
==> Warning: This interface is subject to change.
|
||||
|
||||
--- python@2.7.8/tsxdi6gl4lihp25qrm4d6nys3nypufbf
|
||||
+++ python@3.8.11/yjtseru4nbpllbaxb46q7wfkyxbuvzxx
|
||||
@@ variant_value @@
|
||||
- python patches a8c52415a8b03c0e5f28b5d52ae498f7a7e602007db2b9554df28cd5685839b8
|
||||
+ python patches 0d98e93189bc278fbc37a50ed7f183bd8aaf249a8e1670a465f0db6bb4f8cf87
|
||||
@@ version @@
|
||||
- openssl 1.0.2u
|
||||
+ openssl 1.1.1k
|
||||
- python 2.7.8
|
||||
+ python 3.8.11
|
||||
|
||||
Let's say that we were only interested in one kind of attribute above, ``version``.
|
||||
We can ask the command to only output this attribute. To do this, you'd add
|
||||
the ``--attribute`` for attribute parameter, which defaults to all. Here is how you
|
||||
would filter to show just versions:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack diff --attribute version python@2.7.8 python@3.8.11
|
||||
==> Warning: This interface is subject to change.
|
||||
|
||||
--- python@2.7.8/tsxdi6gl4lihp25qrm4d6nys3nypufbf
|
||||
+++ python@3.8.11/yjtseru4nbpllbaxb46q7wfkyxbuvzxx
|
||||
@@ version @@
|
||||
- openssl 1.0.2u
|
||||
+ openssl 1.1.1k
|
||||
- python 2.7.8
|
||||
+ python 3.8.11
|
||||
|
||||
And you can add as many attributes as you'd like with multiple `--attribute` arguments
|
||||
(for lots of attributes, you can use ``-a`` for short). Finally, if you want to view the
|
||||
data as json (and possibly pipe into an output file) just add ``--json``:
|
||||
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack diff --json python@2.7.8 python@3.8.11
|
||||
|
||||
|
||||
This data will be much longer because along with the differences for ``A`` vs. ``B`` and
|
||||
``B`` vs. ``A``, the JSON output also showsthe intersection.
|
||||
|
||||
|
||||
------------------------
|
||||
Using installed packages
|
||||
------------------------
|
||||
|
||||
There are several different ways to use Spack packages once you have
|
||||
installed them. As you've seen, spack packages are installed into long
|
||||
paths with hashes, and you need a way to get them into your path. The
|
||||
easiest way is to use :ref:`spack load <cmd-spack-load>`, which is
|
||||
described in the next section.
|
||||
|
||||
Some more advanced ways to use Spack packages include:
|
||||
|
||||
* :ref:`environments <environments>`, which you can use to bundle a
|
||||
number of related packages to "activate" all at once, and
|
||||
* :ref:`environment modules <modules>`, which are commonly used on
|
||||
supercomputing clusters. Spack generates module files for every
|
||||
installation automatically, and you can customize how this is done.
|
||||
|
||||
.. _cmd-spack-load:
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
``spack load / unload``
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
If you have :ref:`shell support <shell-support>` enabled you can use the
|
||||
``spack load`` command to quickly get a package on your ``PATH``.
|
||||
|
||||
For example this will add the ``mpich`` package built with ``gcc`` to
|
||||
your path:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack install mpich %gcc@4.4.7
|
||||
|
||||
# ... wait for install ...
|
||||
|
||||
$ spack load mpich %gcc@4.4.7
|
||||
$ which mpicc
|
||||
~/spack/opt/linux-debian7-x86_64/gcc@4.4.7/mpich@3.0.4/bin/mpicc
|
||||
|
||||
These commands will add appropriate directories to your ``PATH``,
|
||||
``MANPATH``, ``CPATH``, and ``LD_LIBRARY_PATH`` according to the
|
||||
:ref:`prefix inspections <customize-env-modifications>` defined in your
|
||||
modules configuration.
|
||||
When you no longer want to use a package, you can type unload or
|
||||
unuse similarly:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack unload mpich %gcc@4.4.7
|
||||
|
||||
|
||||
"""""""""""""""
|
||||
Ambiguous specs
|
||||
"""""""""""""""
|
||||
|
||||
If a spec used with load/unload or is ambiguous (i.e. more than one
|
||||
installed package matches it), then Spack will warn you:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack load libelf
|
||||
==> Error: libelf matches multiple packages.
|
||||
Matching packages:
|
||||
qmm4kso libelf@0.8.13%gcc@4.4.7 arch=linux-debian7-x86_64
|
||||
cd2u6jt libelf@0.8.13%intel@15.0.0 arch=linux-debian7-x86_64
|
||||
Use a more specific spec
|
||||
|
||||
You can either type the ``spack load`` command again with a fully
|
||||
qualified argument, or you can add just enough extra constraints to
|
||||
identify one package. For example, above, the key differentiator is
|
||||
that one ``libelf`` is built with the Intel compiler, while the other
|
||||
used ``gcc``. You could therefore just type:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack load libelf %intel
|
||||
|
||||
To identify just the one built with the Intel compiler. If you want to be
|
||||
*very* specific, you can load it by its hash. For example, to load the
|
||||
first ``libelf`` above, you would run:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack load /qmm4kso
|
||||
|
||||
To see which packages that you have loaded to your enviornment you would
|
||||
use ``spack find --loaded``.
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack find --loaded
|
||||
==> 2 installed packages
|
||||
-- linux-debian7 / gcc@4.4.7 ------------------------------------
|
||||
libelf@0.8.13
|
||||
|
||||
-- linux-debian7 / intel@15.0.0 ---------------------------------
|
||||
libelf@0.8.13
|
||||
|
||||
You can also use ``spack load --list`` to get the same output, but it
|
||||
does not have the full set of query options that ``spack find`` offers.
|
||||
|
||||
We'll learn more about Spack's spec syntax in the next section.
|
||||
|
||||
|
||||
.. _sec-specs:
|
||||
|
||||
--------------------
|
||||
@@ -980,11 +687,11 @@ Here is an example of a much longer spec than we've seen thus far:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
mpileaks @1.2:1.4 %gcc@4.7.5 +debug -qt target=x86_64 ^callpath @1.1 %gcc@4.7.2
|
||||
mpileaks @1.2:1.4 %gcc@4.7.5 +debug -qt arch=bgq_os ^callpath @1.1 %gcc@4.7.2
|
||||
|
||||
If provided to ``spack install``, this will install the ``mpileaks``
|
||||
library at some version between ``1.2`` and ``1.4`` (inclusive),
|
||||
built using ``gcc`` at version 4.7.5 for a generic ``x86_64`` architecture,
|
||||
built using ``gcc`` at version 4.7.5 for the Blue Gene/Q architecture,
|
||||
with debug options enabled, and without Qt support. Additionally, it
|
||||
says to link it with the ``callpath`` library (which it depends on),
|
||||
and to build callpath with ``gcc`` 4.7.2. Most specs will not be as
|
||||
@@ -1147,7 +854,7 @@ Variants are named options associated with a particular package. They are
|
||||
optional, as each package must provide default values for each variant it
|
||||
makes available. Variants can be specified using
|
||||
a flexible parameter syntax ``name=<value>``. For example,
|
||||
``spack install mercury debug=True`` will install mercury built with debug
|
||||
``spack install libelf debug=True`` will install libelf build with debug
|
||||
flags. The names of particular variants available for a package depend on
|
||||
what was provided by the package author. ``spack info <package>`` will
|
||||
provide information on what build variants are available.
|
||||
@@ -1155,11 +862,11 @@ provide information on what build variants are available.
|
||||
For compatibility with earlier versions, variants which happen to be
|
||||
boolean in nature can be specified by a syntax that represents turning
|
||||
options on and off. For example, in the previous spec we could have
|
||||
supplied ``mercury +debug`` with the same effect of enabling the debug
|
||||
supplied ``libelf +debug`` with the same effect of enabling the debug
|
||||
compile time option for the libelf package.
|
||||
|
||||
Depending on the package a variant may have any default value. For
|
||||
``mercury`` here, ``debug`` is ``False`` by default, and we turned it on
|
||||
``libelf`` here, ``debug`` is ``False`` by default, and we turned it on
|
||||
with ``debug=True`` or ``+debug``. If a variant is ``True`` by default
|
||||
you can turn it off by either adding ``-name`` or ``~name`` to the spec.
|
||||
|
||||
@@ -1210,7 +917,7 @@ contains any spaces. Any of ``cppflags=-O3``, ``cppflags="-O3"``,
|
||||
``cppflags='-O3'``, and ``cppflags="-O3 -fPIC"`` are acceptable, but
|
||||
``cppflags=-O3 -fPIC`` is not. Additionally, if the value of the
|
||||
compiler flags is not the last thing on the line, it must be followed
|
||||
by a space. The command ``spack install libelf cppflags="-O3"%intel``
|
||||
by a space. The commmand ``spack install libelf cppflags="-O3"%intel``
|
||||
will be interpreted as an attempt to set ``cppflags="-O3%intel"``.
|
||||
|
||||
The six compiler flags are injected in the order of implicit make commands
|
||||
@@ -1283,7 +990,7 @@ Normally users don't have to bother specifying the architecture if they
|
||||
are installing software for their current host, as in that case the
|
||||
values will be detected automatically. If you need fine-grained control
|
||||
over which packages use which targets (or over *all* packages' default
|
||||
target), see :ref:`package-preferences`.
|
||||
target), see :ref:`concretization-preferences`.
|
||||
|
||||
.. admonition:: Cray machines
|
||||
|
||||
@@ -1360,13 +1067,13 @@ of failing:
|
||||
In the snippet above, for instance, the microarchitecture was demoted to ``haswell`` when
|
||||
compiling with ``gcc@4.8`` since support to optimize for ``broadwell`` starts from ``gcc@4.9:``.
|
||||
|
||||
Finally, if Spack has no information to match compiler and target, it will
|
||||
Finally if Spack has no information to match compiler and target, it will
|
||||
proceed with the installation but avoid injecting any microarchitecture
|
||||
specific flags.
|
||||
|
||||
.. warning::
|
||||
|
||||
Currently, Spack doesn't print any warning to the user if it has no information
|
||||
Currently Spack doesn't print any warning to the user if it has no information
|
||||
on which optimization flags should be used for a given compiler. This behavior
|
||||
might change in the future.
|
||||
|
||||
@@ -1376,7 +1083,7 @@ specific flags.
|
||||
Virtual dependencies
|
||||
--------------------
|
||||
|
||||
The dependency graph for ``mpileaks`` we saw above wasn't *quite*
|
||||
The dependence graph for ``mpileaks`` we saw above wasn't *quite*
|
||||
accurate. ``mpileaks`` uses MPI, which is an interface that has many
|
||||
different implementations. Above, we showed ``mpileaks`` and
|
||||
``callpath`` depending on ``mpich``, which is one *particular*
|
||||
@@ -1519,90 +1226,6 @@ add a version specifier to the spec:
|
||||
Notice that the package versions that provide insufficient MPI
|
||||
versions are now filtered out.
|
||||
|
||||
|
||||
-----------------------------
|
||||
Deprecating insecure packages
|
||||
-----------------------------
|
||||
|
||||
``spack deprecate`` allows for the removal of insecure packages with
|
||||
minimal impact to their dependents.
|
||||
|
||||
.. warning::
|
||||
|
||||
The ``spack deprecate`` command is designed for use only in
|
||||
extraordinary circumstances. This is a VERY big hammer to be used
|
||||
with care.
|
||||
|
||||
The ``spack deprecate`` command will remove one package and replace it
|
||||
with another by replacing the deprecated package's prefix with a link
|
||||
to the deprecator package's prefix.
|
||||
|
||||
.. warning::
|
||||
|
||||
The ``spack deprecate`` command makes no promises about binary
|
||||
compatibility. It is up to the user to ensure the deprecator is
|
||||
suitable for the deprecated package.
|
||||
|
||||
Spack tracks concrete deprecated specs and ensures that no future packages
|
||||
concretize to a deprecated spec.
|
||||
|
||||
The first spec given to the ``spack deprecate`` command is the package
|
||||
to deprecate. It is an abstract spec that must describe a single
|
||||
installed package. The second spec argument is the deprecator
|
||||
spec. By default it must be an abstract spec that describes a single
|
||||
installed package, but with the ``-i/--install-deprecator`` it can be
|
||||
any abstract spec that Spack will install and then use as the
|
||||
deprecator. The ``-I/--no-install-deprecator`` option will ensure
|
||||
the default behavior.
|
||||
|
||||
By default, ``spack deprecate`` will deprecate all dependencies of the
|
||||
deprecated spec, replacing each by the dependency of the same name in
|
||||
the deprecator spec. The ``-d/--dependencies`` option will ensure the
|
||||
default, while the ``-D/--no-dependencies`` option will deprecate only
|
||||
the root of the deprecate spec in favor of the root of the deprecator
|
||||
spec.
|
||||
|
||||
``spack deprecate`` can use symbolic links or hard links. The default
|
||||
behavior is symbolic links, but the ``-l/--link-type`` flag can take
|
||||
options ``hard`` or ``soft``.
|
||||
|
||||
-----------------------
|
||||
Verifying installations
|
||||
-----------------------
|
||||
|
||||
The ``spack verify`` command can be used to verify the validity of
|
||||
Spack-installed packages any time after installation.
|
||||
|
||||
At installation time, Spack creates a manifest of every file in the
|
||||
installation prefix. For links, Spack tracks the mode, ownership, and
|
||||
destination. For directories, Spack tracks the mode, and
|
||||
ownership. For files, Spack tracks the mode, ownership, modification
|
||||
time, hash, and size. The Spack verify command will check, for every
|
||||
file in each package, whether any of those attributes have changed. It
|
||||
will also check for newly added files or deleted files from the
|
||||
installation prefix. Spack can either check all installed packages
|
||||
using the `-a,--all` or accept specs listed on the command line to
|
||||
verify.
|
||||
|
||||
The ``spack verify`` command can also verify for individual files that
|
||||
they haven't been altered since installation time. If the given file
|
||||
is not in a Spack installation prefix, Spack will report that it is
|
||||
not owned by any package. To check individual files instead of specs,
|
||||
use the ``-f,--files`` option.
|
||||
|
||||
Spack installation manifests are part of the tarball signed by Spack
|
||||
for binary package distribution. When installed from a binary package,
|
||||
Spack uses the packaged installation manifest instead of creating one
|
||||
at install time.
|
||||
|
||||
The ``spack verify`` command also accepts the ``-l,--local`` option to
|
||||
check only local packages (as opposed to those used transparently from
|
||||
``upstream`` spack instances) and the ``-j,--json`` option to output
|
||||
machine-readable json data for any errors.
|
||||
|
||||
|
||||
.. _extensions:
|
||||
|
||||
---------------------------
|
||||
Extensions & Python support
|
||||
---------------------------
|
||||
@@ -1610,7 +1233,8 @@ Extensions & Python support
|
||||
Spack's installation model assumes that each package will live in its
|
||||
own install prefix. However, certain packages are typically installed
|
||||
*within* the directory hierarchy of other packages. For example,
|
||||
`Python <https://www.python.org>`_ packages are typically installed in the
|
||||
modules in interpreted languages like `Python
|
||||
<https://www.python.org>`_ are typically installed in the
|
||||
``$prefix/lib/python-2.7/site-packages`` directory.
|
||||
|
||||
Spack has support for this type of installation as well. In Spack,
|
||||
@@ -1697,7 +1321,6 @@ and it will be added to the ``PYTHONPATH`` in your current shell:
|
||||
|
||||
Now ``import numpy`` will succeed for as long as you keep your current
|
||||
session open.
|
||||
The loaded packages can be checked using ``spack find --loaded``
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Loading Extensions via Modules
|
||||
@@ -1723,8 +1346,8 @@ Activating Extensions in a View
|
||||
|
||||
Another way to use extensions is to create a view, which merges the
|
||||
python installation along with the extensions into a single prefix.
|
||||
See :ref:`configuring_environment_views` for a more in-depth description
|
||||
of views.
|
||||
See :ref:`filesystem-views` for a more in-depth description of views and
|
||||
:ref:`cmd-spack-view` for usage of the ``spack view`` command.
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Activating Extensions Globally
|
||||
@@ -1787,12 +1410,12 @@ packages listed as activated:
|
||||
py-nose@1.3.4 py-numpy@1.9.1 py-setuptools@11.3.1
|
||||
|
||||
Now, when a user runs python, ``numpy`` will be available for import
|
||||
*without* the user having to explicitly load it. ``python@2.7.8`` now
|
||||
*without* the user having to explicitly loaded. ``python@2.7.8`` now
|
||||
acts like a system Python installation with ``numpy`` installed inside
|
||||
of it.
|
||||
|
||||
Spack accomplishes this by symbolically linking the *entire* prefix of
|
||||
the ``py-numpy`` package into the prefix of the ``python`` package. To the
|
||||
the ``py-numpy`` into the prefix of the ``python`` package. To the
|
||||
python interpreter, it looks like ``numpy`` is installed in the
|
||||
``site-packages`` directory.
|
||||
|
||||
@@ -1909,39 +1532,6 @@ This issue typically manifests with the error below:
|
||||
|
||||
A nicer error message is TBD in future versions of Spack.
|
||||
|
||||
---------------
|
||||
Troubleshooting
|
||||
---------------
|
||||
|
||||
The ``spack audit`` command:
|
||||
|
||||
.. command-output:: spack audit -h
|
||||
|
||||
can be used to detect a number of configuration issues. This command detects
|
||||
configuration settings which might not be strictly wrong but are not likely
|
||||
to be useful outside of special cases.
|
||||
|
||||
It can also be used to detect dependency issues with packages - for example
|
||||
cases where a package constrains a dependency with a variant that doesn't
|
||||
exist (in this case Spack could report the problem ahead of time but
|
||||
automatically performing the check would slow down most runs of Spack).
|
||||
|
||||
A detailed list of the checks currently implemented for each subcommand can be
|
||||
printed with:
|
||||
|
||||
.. command-output:: spack -v audit list
|
||||
|
||||
Depending on the use case, users might run the appropriate subcommands to obtain
|
||||
diagnostics. Issues, if found, are reported to stdout:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
% spack audit packages lammps
|
||||
PKG-DIRECTIVES: 1 issue found
|
||||
1. lammps: wrong variant in "conflicts" directive
|
||||
the variant 'adios' does not exist
|
||||
in /home/spack/spack/var/spack/repos/builtin/packages/lammps/package.py
|
||||
|
||||
|
||||
------------
|
||||
Getting Help
|
||||
|
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||
.. Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
|
||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
@@ -31,32 +31,9 @@ Build caches are created via:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack buildcache create <spec>
|
||||
$ spack buildcache create spec
|
||||
|
||||
|
||||
If you wanted to create a build cache in a local directory, you would provide
|
||||
the ``-d`` argument to target that directory, again also specifying the spec.
|
||||
Here is an example creating a local directory, "spack-cache" and creating
|
||||
build cache files for the "ninja" spec:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ mkdir -p ./spack-cache
|
||||
$ spack buildcache create -d ./spack-cache ninja
|
||||
==> Buildcache files will be output to file:///home/spackuser/spack/spack-cache/build_cache
|
||||
gpgconf: socketdir is '/run/user/1000/gnupg'
|
||||
gpg: using "E6DF6A8BD43208E4D6F392F23777740B7DBD643D" as default secret key for signing
|
||||
|
||||
Note that the targeted spec must already be installed. Once you have a build cache,
|
||||
you can add it as a mirror, discussed next.
|
||||
|
||||
.. warning::
|
||||
|
||||
Spack improved the format used for binary caches in v0.18. The entire v0.18 series
|
||||
will be able to verify and install binary caches both in the new and in the old format.
|
||||
Support for using the old format is expected to end in v0.19, so we advise users to
|
||||
recreate relevant buildcaches using Spack v0.18 or higher.
|
||||
|
||||
---------------------------------------
|
||||
Finding or installing build cache files
|
||||
---------------------------------------
|
||||
@@ -66,104 +43,19 @@ with:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack mirror add <name> <url>
|
||||
|
||||
|
||||
Note that the url can be a web url _or_ a local filesystem location. In the previous
|
||||
example, you might add the directory "spack-cache" and call it ``mymirror``:
|
||||
$ spack mirror add <name> <url>
|
||||
|
||||
Build caches are found via:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack mirror add mymirror ./spack-cache
|
||||
$ spack buildcache list
|
||||
|
||||
|
||||
You can see that the mirror is added with ``spack mirror list`` as follows:
|
||||
Build caches are installed via:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
|
||||
$ spack mirror list
|
||||
mymirror file:///home/spackuser/spack/spack-cache
|
||||
spack-public https://spack-llnl-mirror.s3-us-west-2.amazonaws.com/
|
||||
|
||||
|
||||
At this point, you've create a buildcache, but spack hasn't indexed it, so if
|
||||
you run ``spack buildcache list`` you won't see any results. You need to index
|
||||
this new build cache as follows:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack buildcache update-index -d spack-cache/
|
||||
|
||||
Now you can use list:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack buildcache list
|
||||
==> 1 cached build.
|
||||
-- linux-ubuntu20.04-skylake / gcc@9.3.0 ------------------------
|
||||
ninja@1.10.2
|
||||
|
||||
|
||||
Great! So now let's say you have a different spack installation, or perhaps just
|
||||
a different environment for the same one, and you want to install a package from
|
||||
that build cache. Let's first uninstall the actual library "ninja" to see if we can
|
||||
re-install it from the cache.
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack uninstall ninja
|
||||
|
||||
|
||||
And now reinstall from the buildcache
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack buildcache install ninja
|
||||
==> buildcache spec(s) matching ninja
|
||||
==> Fetching file:///home/spackuser/spack/spack-cache/build_cache/linux-ubuntu20.04-skylake/gcc-9.3.0/ninja-1.10.2/linux-ubuntu20.04-skylake-gcc-9.3.0-ninja-1.10.2-i4e5luour7jxdpc3bkiykd4imke3mkym.spack
|
||||
####################################################################################################################################### 100.0%
|
||||
==> Installing buildcache for spec ninja@1.10.2%gcc@9.3.0 arch=linux-ubuntu20.04-skylake
|
||||
gpgconf: socketdir is '/run/user/1000/gnupg'
|
||||
gpg: Signature made Tue 23 Mar 2021 10:16:29 PM MDT
|
||||
gpg: using RSA key E6DF6A8BD43208E4D6F392F23777740B7DBD643D
|
||||
gpg: Good signature from "spackuser (GPG created for Spack) <spackuser@noreply.users.github.com>" [ultimate]
|
||||
|
||||
|
||||
It worked! You've just completed a full example of creating a build cache with
|
||||
a spec of interest, adding it as a mirror, updating it's index, listing the contents,
|
||||
and finally, installing from it.
|
||||
|
||||
|
||||
Note that the above command is intended to install a particular package to a
|
||||
build cache you have created, and not to install a package from a build cache.
|
||||
For the latter, once a mirror is added, by default when you do ``spack install`` the ``--use-cache``
|
||||
flag is set, and you will install a package from a build cache if it is available.
|
||||
If you want to always use the cache, you can do:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack install --cache-only <package>
|
||||
|
||||
For example, to combine all of the commands above to add the E4S build cache
|
||||
and then install from it exclusively, you would do:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack mirror add E4S https://cache.e4s.io
|
||||
$ spack buildcache keys --install --trust
|
||||
$ spack install --cache-only <package>
|
||||
|
||||
We use ``--install`` and ``--trust`` to say that we are installing keys to our
|
||||
keyring, and trusting all downloaded keys.
|
||||
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
List of popular build caches
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
* `Extreme-scale Scientific Software Stack (E4S) <https://e4s-project.github.io/>`_: `build cache <https://oaciss.uoregon.edu/e4s/inventory.html>`_
|
||||
$ spack buildcache install
|
||||
|
||||
|
||||
----------
|
||||
|
@@ -1,160 +0,0 @@
|
||||
.. Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
|
||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
|
||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
.. _bootstrapping:
|
||||
|
||||
=============
|
||||
Bootstrapping
|
||||
=============
|
||||
|
||||
In the :ref:`Getting started <getting_started>` Section we already mentioned that
|
||||
Spack can bootstrap some of its dependencies, including ``clingo``. In fact, there
|
||||
is an entire command dedicated to the management of every aspect of bootstrapping:
|
||||
|
||||
.. command-output:: spack bootstrap --help
|
||||
|
||||
The first thing to know to understand bootstrapping in Spack is that each of
|
||||
Spack's dependencies is bootstrapped lazily; i.e. the first time it is needed and
|
||||
can't be found. You can readily check if any prerequisite for using Spack
|
||||
is missing by running:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
% spack bootstrap status
|
||||
Spack v0.17.1 - python@3.8
|
||||
|
||||
[FAIL] Core Functionalities
|
||||
[B] MISSING "clingo": required to concretize specs
|
||||
|
||||
[FAIL] Binary packages
|
||||
[B] MISSING "gpg2": required to sign/verify buildcaches
|
||||
|
||||
|
||||
Spack will take care of bootstrapping any missing dependency marked as [B]. Dependencies marked as [-] are instead required to be found on the system.
|
||||
|
||||
In the case of the output shown above Spack detected that both ``clingo`` and ``gnupg``
|
||||
are missing and it's giving detailed information on why they are needed and whether
|
||||
they can be bootstrapped. Running a command that concretize a spec, like:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
% spack solve zlib
|
||||
==> Bootstrapping clingo from pre-built binaries
|
||||
==> Fetching https://mirror.spack.io/bootstrap/github-actions/v0.1/build_cache/darwin-catalina-x86_64/apple-clang-12.0.0/clingo-bootstrap-spack/darwin-catalina-x86_64-apple-clang-12.0.0-clingo-bootstrap-spack-p5on7i4hejl775ezndzfdkhvwra3hatn.spack
|
||||
==> Installing "clingo-bootstrap@spack%apple-clang@12.0.0~docs~ipo+python build_type=Release arch=darwin-catalina-x86_64" from a buildcache
|
||||
[ ... ]
|
||||
|
||||
triggers the bootstrapping of clingo from pre-built binaries as expected.
|
||||
|
||||
-----------------------
|
||||
The Bootstrapping store
|
||||
-----------------------
|
||||
|
||||
The software installed for bootstrapping purposes is deployed in a separate store.
|
||||
Its location can be checked with the following command:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
% spack bootstrap root
|
||||
|
||||
It can also be changed with the same command by just specifying the newly desired path:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
% spack bootstrap root /opt/spack/bootstrap
|
||||
|
||||
You can check what is installed in the bootstrapping store at any time using:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
% spack find -b
|
||||
==> Showing internal bootstrap store at "/Users/spack/.spack/bootstrap/store"
|
||||
==> 11 installed packages
|
||||
-- darwin-catalina-x86_64 / apple-clang@12.0.0 ------------------
|
||||
clingo-bootstrap@spack libassuan@2.5.5 libgpg-error@1.42 libksba@1.5.1 pinentry@1.1.1 zlib@1.2.11
|
||||
gnupg@2.3.1 libgcrypt@1.9.3 libiconv@1.16 npth@1.6 python@3.8
|
||||
|
||||
In case it is needed you can remove all the software in the current bootstrapping store with:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
% spack clean -b
|
||||
==> Removing bootstrapped software and configuration in "/Users/spack/.spack/bootstrap"
|
||||
|
||||
% spack find -b
|
||||
==> Showing internal bootstrap store at "/Users/spack/.spack/bootstrap/store"
|
||||
==> 0 installed packages
|
||||
|
||||
--------------------------------------------
|
||||
Enabling and disabling bootstrapping methods
|
||||
--------------------------------------------
|
||||
|
||||
Bootstrapping is always performed by trying the methods listed by:
|
||||
|
||||
.. command-output:: spack bootstrap list
|
||||
|
||||
in the order they appear, from top to bottom. By default Spack is
|
||||
configured to try first bootstrapping from pre-built binaries and to
|
||||
fall-back to bootstrapping from sources if that failed.
|
||||
|
||||
If need be, you can disable bootstrapping altogether by running:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
% spack bootstrap disable
|
||||
|
||||
in which case it's your responsibility to ensure Spack runs in an
|
||||
environment where all its prerequisites are installed. You can
|
||||
also configure Spack to skip certain bootstrapping methods by *untrusting*
|
||||
them. For instance:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
% spack bootstrap untrust github-actions
|
||||
==> "github-actions" is now untrusted and will not be used for bootstrapping
|
||||
|
||||
tells Spack to skip trying to bootstrap from binaries. To add the "github-actions" method back you can:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
% spack bootstrap trust github-actions
|
||||
|
||||
There is also an option to reset the bootstrapping configuration to Spack's defaults:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
% spack bootstrap reset
|
||||
==> Bootstrapping configuration is being reset to Spack's defaults. Current configuration will be lost.
|
||||
Do you want to continue? [Y/n]
|
||||
%
|
||||
|
||||
----------------------------------------
|
||||
Creating a mirror for air-gapped systems
|
||||
----------------------------------------
|
||||
|
||||
Spack's default configuration for bootstrapping relies on the user having
|
||||
access to the internet, either to fetch pre-compiled binaries or source tarballs.
|
||||
Sometimes though Spack is deployed on air-gapped systems where such access is denied.
|
||||
|
||||
To help with similar situations Spack has a command that recreates, in a local folder
|
||||
of choice, a mirror containing the source tarballs and/or binary packages needed for
|
||||
bootstrapping.
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
% spack bootstrap mirror --binary-packages /opt/bootstrap
|
||||
==> Adding "clingo-bootstrap@spack+python %apple-clang target=x86_64" and dependencies to the mirror at /opt/bootstrap/local-mirror
|
||||
==> Adding "gnupg@2.3: %apple-clang target=x86_64" and dependencies to the mirror at /opt/bootstrap/local-mirror
|
||||
==> Adding "patchelf@0.13.1:0.13.99 %apple-clang target=x86_64" and dependencies to the mirror at /opt/bootstrap/local-mirror
|
||||
==> Adding binary packages from "https://github.com/alalazo/spack-bootstrap-mirrors/releases/download/v0.1-rc.2/bootstrap-buildcache.tar.gz" to the mirror at /opt/bootstrap/local-mirror
|
||||
|
||||
To register the mirror on the platform where it's supposed to be used run the following command(s):
|
||||
% spack bootstrap add --trust local-sources /opt/bootstrap/metadata/sources
|
||||
% spack bootstrap add --trust local-binaries /opt/bootstrap/metadata/binaries
|
||||
|
||||
|
||||
This command needs to be run on a machine with internet access and the resulting folder
|
||||
has to be moved over to the air-gapped system. Once the local sources are added using the
|
||||
commands suggested at the prompt, they can be used to bootstrap Spack.
|
@@ -1,13 +1,13 @@
|
||||
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||
.. Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
|
||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
.. _build-settings:
|
||||
|
||||
================================
|
||||
Package Settings (packages.yaml)
|
||||
================================
|
||||
===================
|
||||
Build Customization
|
||||
===================
|
||||
|
||||
Spack allows you to customize how your software is built through the
|
||||
``packages.yaml`` file. Using it, you can make Spack prefer particular
|
||||
@@ -57,13 +57,10 @@ directory. Here's an example of an external configuration:
|
||||
|
||||
packages:
|
||||
openmpi:
|
||||
externals:
|
||||
- spec: "openmpi@1.4.3%gcc@4.4.7 arch=linux-debian7-x86_64"
|
||||
prefix: /opt/openmpi-1.4.3
|
||||
- spec: "openmpi@1.4.3%gcc@4.4.7 arch=linux-debian7-x86_64+debug"
|
||||
prefix: /opt/openmpi-1.4.3-debug
|
||||
- spec: "openmpi@1.6.5%intel@10.1 arch=linux-debian7-x86_64"
|
||||
prefix: /opt/openmpi-1.6.5-intel
|
||||
paths:
|
||||
openmpi@1.4.3%gcc@4.4.7 arch=linux-x86_64-debian7: /opt/openmpi-1.4.3
|
||||
openmpi@1.4.3%gcc@4.4.7 arch=linux-x86_64-debian7+debug: /opt/openmpi-1.4.3-debug
|
||||
openmpi@1.6.5%intel@10.1 arch=linux-x86_64-debian7: /opt/openmpi-1.6.5-intel
|
||||
|
||||
This example lists three installations of OpenMPI, one built with GCC,
|
||||
one built with GCC and debug information, and another built with Intel.
|
||||
@@ -79,15 +76,13 @@ of the installation prefixes. The following example says that module
|
||||
.. code-block:: yaml
|
||||
|
||||
cmake:
|
||||
externals:
|
||||
- spec: cmake@3.7.2
|
||||
modules:
|
||||
- CMake/3.7.2
|
||||
modules:
|
||||
cmake@3.7.2: CMake/3.7.2
|
||||
|
||||
Each ``packages.yaml`` begins with a ``packages:`` attribute, followed
|
||||
by a list of package names. To specify externals, add an ``externals:``
|
||||
attribute under the package name, which lists externals.
|
||||
Each external should specify a ``spec:`` string that should be as
|
||||
Each ``packages.yaml`` begins with a ``packages:`` token, followed
|
||||
by a list of package names. To specify externals, add a ``paths`` or ``modules``
|
||||
token under the package name, which lists externals in a
|
||||
``spec: /path`` or ``spec: module-name`` format. Each spec should be as
|
||||
well-defined as reasonably possible. If a
|
||||
package lacks a spec component, such as missing a compiler or
|
||||
package version, then Spack will guess the missing component based
|
||||
@@ -111,13 +106,10 @@ be:
|
||||
|
||||
packages:
|
||||
openmpi:
|
||||
externals:
|
||||
- spec: "openmpi@1.4.3%gcc@4.4.7 arch=linux-debian7-x86_64"
|
||||
prefix: /opt/openmpi-1.4.3
|
||||
- spec: "openmpi@1.4.3%gcc@4.4.7 arch=linux-debian7-x86_64+debug"
|
||||
prefix: /opt/openmpi-1.4.3-debug
|
||||
- spec: "openmpi@1.6.5%intel@10.1 arch=linux-debian7-x86_64"
|
||||
prefix: /opt/openmpi-1.6.5-intel
|
||||
paths:
|
||||
openmpi@1.4.3%gcc@4.4.7 arch=linux-x86_64-debian7: /opt/openmpi-1.4.3
|
||||
openmpi@1.4.3%gcc@4.4.7 arch=linux-x86_64-debian7+debug: /opt/openmpi-1.4.3-debug
|
||||
openmpi@1.6.5%intel@10.1 arch=linux-x86_64-debian7: /opt/openmpi-1.6.5-intel
|
||||
buildable: False
|
||||
|
||||
The addition of the ``buildable`` flag tells Spack that it should never build
|
||||
@@ -132,158 +124,12 @@ The ``buildable`` does not need to be paired with external packages.
|
||||
It could also be used alone to forbid packages that may be
|
||||
buggy or otherwise undesirable.
|
||||
|
||||
Virtual packages in Spack can also be specified as not buildable, and
|
||||
external implementations can be provided. In the example above,
|
||||
OpenMPI is configured as not buildable, but Spack will often prefer
|
||||
other MPI implementations over the externally available OpenMPI. Spack
|
||||
can be configured with every MPI provider not buildable individually,
|
||||
but more conveniently:
|
||||
|
||||
.. code-block:: yaml
|
||||
.. _concretization-preferences:
|
||||
|
||||
packages:
|
||||
mpi:
|
||||
buildable: False
|
||||
openmpi:
|
||||
externals:
|
||||
- spec: "openmpi@1.4.3%gcc@4.4.7 arch=linux-debian7-x86_64"
|
||||
prefix: /opt/openmpi-1.4.3
|
||||
- spec: "openmpi@1.4.3%gcc@4.4.7 arch=linux-debian7-x86_64+debug"
|
||||
prefix: /opt/openmpi-1.4.3-debug
|
||||
- spec: "openmpi@1.6.5%intel@10.1 arch=linux-debian7-x86_64"
|
||||
prefix: /opt/openmpi-1.6.5-intel
|
||||
|
||||
Implementations can also be listed immediately under the virtual they provide:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
packages:
|
||||
mpi:
|
||||
buildable: False
|
||||
openmpi@1.4.3%gcc@4.4.7 arch=linux-debian7-x86_64: /opt/openmpi-1.4.3
|
||||
openmpi@1.4.3%gcc@4.4.7 arch=linux-debian7-x86_64+debug: /opt/openmpi-1.4.3-debug
|
||||
openmpi@1.6.5%intel@10.1 arch=linux-debian7-x86_64: /opt/openmpi-1.6.5-intel
|
||||
mpich@3.3 %clang@9.0.0 arch=linux-debian7-x86_64: /opt/mpich-3.3-intel
|
||||
|
||||
Spack can then use any of the listed external implementations of MPI
|
||||
to satisfy a dependency, and will choose depending on the compiler and
|
||||
architecture.
|
||||
|
||||
.. _cmd-spack-external-find:
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Automatically Find External Packages
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
You can run the :ref:`spack external find <spack-external-find>` command
|
||||
to search for system-provided packages and add them to ``packages.yaml``.
|
||||
After running this command your ``packages.yaml`` may include new entries:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
packages:
|
||||
cmake:
|
||||
externals:
|
||||
- spec: cmake@3.17.2
|
||||
prefix: /usr
|
||||
|
||||
Generally this is useful for detecting a small set of commonly-used packages;
|
||||
for now this is generally limited to finding build-only dependencies.
|
||||
Specific limitations include:
|
||||
|
||||
* Packages are not discoverable by default: For a package to be
|
||||
discoverable with ``spack external find``, it needs to add special
|
||||
logic. See :ref:`here <make-package-findable>` for more details.
|
||||
* The current implementation only collects and examines executable files,
|
||||
so it is typically only useful for build/run dependencies (in some cases
|
||||
if a library package also provides an executable, it may be possible to
|
||||
extract a meaningful Spec by running the executable - for example the
|
||||
compiler wrappers in MPI implementations).
|
||||
* The logic does not search through module files, it can only detect
|
||||
packages with executables defined in ``PATH``; you can help Spack locate
|
||||
externals which use module files by loading any associated modules for
|
||||
packages that you want Spack to know about before running
|
||||
``spack external find``.
|
||||
* Spack does not overwrite existing entries in the package configuration:
|
||||
If there is an external defined for a spec at any configuration scope,
|
||||
then Spack will not add a new external entry (``spack config blame packages``
|
||||
can help locate all external entries).
|
||||
|
||||
.. _concretizer-options:
|
||||
|
||||
----------------------
|
||||
Concretizer options
|
||||
----------------------
|
||||
|
||||
``packages.yaml`` gives the concretizer preferences for specific packages,
|
||||
but you can also use ``concretizer.yaml`` to customize aspects of the
|
||||
algorithm it uses to select the dependencies you install:
|
||||
|
||||
.. literalinclude:: _spack_root/etc/spack/defaults/concretizer.yaml
|
||||
:language: yaml
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Reuse already installed packages
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The ``reuse`` attribute controls whether Spack will prefer to use installed packages (``true``), or
|
||||
whether it will do a "fresh" installation and prefer the latest settings from
|
||||
``package.py`` files and ``packages.yaml`` (``false``).
|
||||
You can use:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
% spack install --reuse <spec>
|
||||
|
||||
to enable reuse for a single installation, and you can use:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
spack install --fresh <spec>
|
||||
|
||||
to do a fresh install if ``reuse`` is enabled by default.
|
||||
``reuse: true`` is the default.
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Selection of the target microarchitectures
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The options under the ``targets`` attribute control which targets are considered during a solve.
|
||||
Currently the options in this section are only configurable from the ``concretization.yaml`` file
|
||||
and there are no corresponding command line arguments to enable them for a single solve.
|
||||
|
||||
The ``granularity`` option can take two possible values: ``microarchitectures`` and ``generic``.
|
||||
If set to:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
concretizer:
|
||||
targets:
|
||||
granularity: microarchitectures
|
||||
|
||||
Spack will consider all the microarchitectures known to ``archspec`` to label nodes for
|
||||
compatibility. If instead the option is set to:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
concretizer:
|
||||
targets:
|
||||
granularity: generic
|
||||
|
||||
Spack will consider only generic microarchitectures. For instance, when running on an
|
||||
Haswell node, Spack will consider ``haswell`` as the best target in the former case and
|
||||
``x86_64_v3`` as the best target in the latter case.
|
||||
|
||||
The ``host_compatible`` option is a Boolean option that determines whether or not the
|
||||
microarchitectures considered during the solve are constrained to be compatible with the
|
||||
host Spack is currently running on. For instance, if this option is set to ``true``, a
|
||||
user cannot concretize for ``target=icelake`` while running on an Haswell node.
|
||||
|
||||
.. _package-preferences:
|
||||
|
||||
-------------------
|
||||
Package Preferences
|
||||
-------------------
|
||||
--------------------------
|
||||
Concretization Preferences
|
||||
--------------------------
|
||||
|
||||
Spack can be configured to prefer certain compilers, package
|
||||
versions, dependencies, and variants during concretization.
|
||||
@@ -339,7 +185,6 @@ concretization rules. A provider lists a value that packages may
|
||||
``depend_on`` (e.g, MPI) and a list of rules for fulfilling that
|
||||
dependency.
|
||||
|
||||
|
||||
.. _package_permissions:
|
||||
|
||||
-------------------
|
||||
|
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||
.. Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
|
||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
@@ -29,7 +29,6 @@ on these ideas for each distinct build system that Spack supports:
|
||||
:maxdepth: 1
|
||||
:caption: Make-incompatible
|
||||
|
||||
build_systems/mavenpackage
|
||||
build_systems/sconspackage
|
||||
build_systems/wafpackage
|
||||
|
||||
@@ -39,7 +38,6 @@ on these ideas for each distinct build system that Spack supports:
|
||||
|
||||
build_systems/autotoolspackage
|
||||
build_systems/cmakepackage
|
||||
build_systems/cachedcmakepackage
|
||||
build_systems/mesonpackage
|
||||
build_systems/qmakepackage
|
||||
build_systems/sippackage
|
||||
@@ -48,12 +46,10 @@ on these ideas for each distinct build system that Spack supports:
|
||||
:maxdepth: 1
|
||||
:caption: Language-specific
|
||||
|
||||
build_systems/luapackage
|
||||
build_systems/octavepackage
|
||||
build_systems/perlpackage
|
||||
build_systems/pythonpackage
|
||||
build_systems/rpackage
|
||||
build_systems/racketpackage
|
||||
build_systems/rubypackage
|
||||
|
||||
.. toctree::
|
||||
@@ -62,12 +58,8 @@ on these ideas for each distinct build system that Spack supports:
|
||||
|
||||
build_systems/bundlepackage
|
||||
build_systems/cudapackage
|
||||
build_systems/custompackage
|
||||
build_systems/inteloneapipackage
|
||||
build_systems/intelpackage
|
||||
build_systems/multiplepackage
|
||||
build_systems/rocmpackage
|
||||
build_systems/sourceforgepackage
|
||||
build_systems/custompackage
|
||||
|
||||
For reference, the :py:mod:`Build System API docs <spack.build_systems>`
|
||||
provide a list of build systems and methods/attributes that can be
|
||||
|
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||
.. Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
|
||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
@@ -112,44 +112,20 @@ phase runs:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ autoreconf --install --verbose --force -I <aclocal-prefix>/share/aclocal
|
||||
|
||||
In case you need to add more arguments, override ``autoreconf_extra_args``
|
||||
in your ``package.py`` on class scope like this:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
autoreconf_extra_args = ["-Im4"]
|
||||
$ libtoolize
|
||||
$ aclocal
|
||||
$ autoreconf --install --verbose --force
|
||||
|
||||
All you need to do is add a few Autotools dependencies to the package.
|
||||
Most stable releases will come with a ``configure`` script, but if you
|
||||
check out a commit from the ``master`` branch, you would want to add:
|
||||
check out a commit from the ``develop`` branch, you would want to add:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
depends_on('autoconf', type='build', when='@master')
|
||||
depends_on('automake', type='build', when='@master')
|
||||
depends_on('libtool', type='build', when='@master')
|
||||
|
||||
It is typically redundant to list the ``m4`` macro processor package as a
|
||||
dependency, since ``autoconf`` already depends on it.
|
||||
|
||||
"""""""""""""""""""""""""""""""
|
||||
Using a custom autoreconf phase
|
||||
"""""""""""""""""""""""""""""""
|
||||
|
||||
In some cases, it might be needed to replace the default implementation
|
||||
of the autoreconf phase with one running a script interpreter. In this
|
||||
example, the ``bash`` shell is used to run the ``autogen.sh`` script.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
def autoreconf(self, spec, prefix):
|
||||
which('bash')('autogen.sh')
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""
|
||||
patching configure or Makefile.in files
|
||||
"""""""""""""""""""""""""""""""""""""""
|
||||
depends_on('autoconf', type='build', when='@develop')
|
||||
depends_on('automake', type='build', when='@develop')
|
||||
depends_on('libtool', type='build', when='@develop')
|
||||
depends_on('m4', type='build', when='@develop')
|
||||
|
||||
In some cases, developers might need to distribute a patch that modifies
|
||||
one of the files used to generate ``configure`` or ``Makefile.in``.
|
||||
@@ -159,57 +135,6 @@ create a new patch that directly modifies ``configure``. That way,
|
||||
Spack can use the secondary patch and additional build system
|
||||
dependencies aren't necessary.
|
||||
|
||||
""""""""""""""""""""""""""""
|
||||
Old Autotools helper scripts
|
||||
""""""""""""""""""""""""""""
|
||||
|
||||
Autotools based tarballs come with helper scripts such as ``config.sub`` and
|
||||
``config.guess``. It is the responsibility of the developers to keep these files
|
||||
up to date so that they run on every platform, but for very old software
|
||||
releases this is impossible. In these cases Spack can help to replace these
|
||||
files with newer ones, without having to add the heavy dependency on
|
||||
``automake``.
|
||||
|
||||
Automatic helper script replacement is currently enabled by default on
|
||||
``ppc64le`` and ``aarch64``, as these are the known cases where old scripts fail.
|
||||
On these targets, ``AutotoolsPackage`` adds a build dependency on ``gnuconfig``,
|
||||
which is a very light-weight package with newer versions of the helper files.
|
||||
Spack then tries to run all the helper scripts it can find in the release, and
|
||||
replaces them on failure with the helper scripts from ``gnuconfig``.
|
||||
|
||||
To opt out of this feature, use the following setting:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
patch_config_files = False
|
||||
|
||||
To enable it conditionally on different architectures, define a property and
|
||||
make the package depend on ``gnuconfig`` as a build dependency:
|
||||
|
||||
.. code-block
|
||||
|
||||
depends_on('gnuconfig', when='@1.0:')
|
||||
|
||||
@property
|
||||
def patch_config_files(self):
|
||||
return self.spec.satisfies("@1.0:")
|
||||
|
||||
.. note::
|
||||
|
||||
On some exotic architectures it is necessary to use system provided
|
||||
``config.sub`` and ``config.guess`` files. In this case, the most
|
||||
transparent solution is to mark the ``gnuconfig`` package as external and
|
||||
non-buildable, with a prefix set to the directory containing the files:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
gnuconfig:
|
||||
buildable: false
|
||||
externals:
|
||||
- spec: gnuconfig@master
|
||||
prefix: /usr/share/configure_files/
|
||||
|
||||
|
||||
""""""""""""""""
|
||||
force_autoreconf
|
||||
""""""""""""""""
|
||||
@@ -230,7 +155,7 @@ version, this can be done like so:
|
||||
|
||||
@property
|
||||
def force_autoreconf(self):
|
||||
return self.version == Version('1.2.3')
|
||||
return self.version == Version('1.2.3'):
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Finding configure flags
|
||||
@@ -308,163 +233,7 @@ You may have noticed that most of the Autotools flags are of the form
|
||||
``--without-baz``. Since these flags are so common, Spack provides a
|
||||
couple of helper functions to make your life easier.
|
||||
|
||||
"""""""""""""""""
|
||||
enable_or_disable
|
||||
"""""""""""""""""
|
||||
|
||||
Autotools flags for simple boolean variants can be automatically
|
||||
generated by calling the ``enable_or_disable`` method. This is
|
||||
typically used to enable or disable some feature within the package.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
variant(
|
||||
'memchecker',
|
||||
default=False,
|
||||
description='Memchecker support for debugging [degrades performance]'
|
||||
)
|
||||
config_args.extend(self.enable_or_disable('memchecker'))
|
||||
|
||||
In this example, specifying the variant ``+memchecker`` will generate
|
||||
the following configuration options:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
--enable-memchecker
|
||||
|
||||
"""""""""""""""
|
||||
with_or_without
|
||||
"""""""""""""""
|
||||
|
||||
Autotools flags for more complex variants, including boolean variants
|
||||
and multi-valued variants, can be automatically generated by calling
|
||||
the ``with_or_without`` method.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
variant(
|
||||
'schedulers',
|
||||
values=disjoint_sets(
|
||||
('auto',), ('alps', 'lsf', 'tm', 'slurm', 'sge', 'loadleveler')
|
||||
).with_non_feature_values('auto', 'none'),
|
||||
description="List of schedulers for which support is enabled; "
|
||||
"'auto' lets openmpi determine",
|
||||
)
|
||||
if 'schedulers=auto' not in spec:
|
||||
config_args.extend(self.with_or_without('schedulers'))
|
||||
|
||||
In this example, specifying the variant ``schedulers=slurm,sge`` will
|
||||
generate the following configuration options:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
--with-slurm --with-sge
|
||||
|
||||
``enable_or_disable`` is actually functionally equivalent with
|
||||
``with_or_without``, and accepts the same arguments and variant types;
|
||||
but idiomatic autotools packages often follow these naming
|
||||
conventions.
|
||||
|
||||
""""""""""""""""
|
||||
activation_value
|
||||
""""""""""""""""
|
||||
|
||||
Autotools parameters that require an option can still be automatically
|
||||
generated, using the ``activation_value`` argument to
|
||||
``with_or_without`` (or, rarely, ``enable_or_disable``).
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
variant(
|
||||
'fabrics',
|
||||
values=disjoint_sets(
|
||||
('auto',), ('psm', 'psm2', 'verbs', 'mxm', 'ucx', 'libfabric')
|
||||
).with_non_feature_values('auto', 'none'),
|
||||
description="List of fabrics that are enabled; "
|
||||
"'auto' lets openmpi determine",
|
||||
)
|
||||
if 'fabrics=auto' not in spec:
|
||||
config_args.extend(self.with_or_without('fabrics',
|
||||
activation_value='prefix'))
|
||||
|
||||
``activation_value`` accepts a callable that generates the configure
|
||||
parameter value given the variant value; but the special value
|
||||
``prefix`` tells Spack to automatically use the dependenency's
|
||||
installation prefix, which is the most common use for such
|
||||
parameters. In this example, specifying the variant
|
||||
``fabrics=libfabric`` will generate the following configuration
|
||||
options:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
--with-libfabric=</path/to/libfabric>
|
||||
|
||||
"""""""""""""""""""""""
|
||||
The ``variant`` keyword
|
||||
"""""""""""""""""""""""
|
||||
|
||||
When Spack variants and configure flags do not correspond one-to-one, the
|
||||
``variant`` keyword can be passed to ``with_or_without`` and
|
||||
``enable_or_disable``. For example:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
variant('debug_tools', default=False)
|
||||
config_args += self.enable_or_disable('debug-tools', variant='debug_tools')
|
||||
|
||||
Or when one variant controls multiple flags:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
variant('debug_tools', default=False)
|
||||
config_args += self.with_or_without('memchecker', variant='debug_tools')
|
||||
config_args += self.with_or_without('profiler', variant='debug_tools')
|
||||
|
||||
|
||||
""""""""""""""""""""
|
||||
Conditional variants
|
||||
""""""""""""""""""""
|
||||
|
||||
When a variant is conditional and its condition is not met on the concrete spec, the
|
||||
``with_or_without`` and ``enable_or_disable`` methods will simply return an empty list.
|
||||
|
||||
For example:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
variant('profiler', when='@2.0:')
|
||||
config_args += self.with_or_without('profiler')
|
||||
|
||||
will neither add ``--with-profiler`` nor ``--without-profiler`` when the version is
|
||||
below ``2.0``.
|
||||
|
||||
""""""""""""""""""""
|
||||
Activation overrides
|
||||
""""""""""""""""""""
|
||||
|
||||
Finally, the behavior of either ``with_or_without`` or
|
||||
``enable_or_disable`` can be overridden for specific variant
|
||||
values. This is most useful for multi-values variants where some of
|
||||
the variant values require atypical behavior.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
def with_or_without_verbs(self, activated):
|
||||
# Up through version 1.6, this option was named --with-openib.
|
||||
# In version 1.7, it was renamed to be --with-verbs.
|
||||
opt = 'verbs' if self.spec.satisfies('@1.7:') else 'openib'
|
||||
if not activated:
|
||||
return '--without-{0}'.format(opt)
|
||||
return '--with-{0}={1}'.format(opt, self.spec['rdma-core'].prefix)
|
||||
|
||||
Defining ``with_or_without_verbs`` overrides the behavior of a
|
||||
``fabrics=verbs`` variant, changing the configure-time option to
|
||||
``--with-openib`` for older versions of the package and specifying an
|
||||
alternative dependency name:
|
||||
|
||||
.. code-block::
|
||||
|
||||
--with-openib=</path/to/rdma-core>
|
||||
TODO: document ``with_or_without`` and ``enable_or_disable``.
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Configure script in a sub-directory
|
||||
|
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||
.. Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
|
||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
@@ -1,123 +0,0 @@
|
||||
.. Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
|
||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
|
||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
.. _cachedcmakepackage:
|
||||
|
||||
------------------
|
||||
CachedCMakePackage
|
||||
------------------
|
||||
|
||||
The CachedCMakePackage base class is used for CMake-based workflows
|
||||
that create a CMake cache file prior to running ``cmake``. This is
|
||||
useful for packages with arguments longer than the system limit, and
|
||||
for reproducibility.
|
||||
|
||||
The documentation for this class assumes that the user is familiar with
|
||||
the ``CMakePackage`` class from which it inherits. See the documentation
|
||||
for :ref:`CMakePackage <cmakepackage>`.
|
||||
|
||||
^^^^^^
|
||||
Phases
|
||||
^^^^^^
|
||||
|
||||
The ``CachedCMakePackage`` base class comes with the following phases:
|
||||
|
||||
#. ``initconfig`` - generate the CMake cache file
|
||||
#. ``cmake`` - generate the Makefile
|
||||
#. ``build`` - build the package
|
||||
#. ``install`` - install the package
|
||||
|
||||
By default, these phases run:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ mkdir spack-build
|
||||
$ cd spack-build
|
||||
$ cat << EOF > name-arch-compiler@version.cmake
|
||||
# Write information on compilers and dependencies
|
||||
# includes information on mpi and cuda if applicable
|
||||
$ cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/installation/prefix -C name-arch-compiler@version.cmake
|
||||
$ make
|
||||
$ make test # optional
|
||||
$ make install
|
||||
|
||||
The ``CachedCMakePackage`` class inherits from the ``CMakePackage``
|
||||
class, and accepts all of the same options and adds all of the same
|
||||
flags to the ``cmake`` command. Similar to the ``CMakePAckage`` class,
|
||||
you may need to add a few arguments yourself, and the
|
||||
``CachedCMakePackage`` provides the same interface to add those
|
||||
flags.
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Adding entries to the CMake cache
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
In addition to adding flags to the ``cmake`` command, you may need to
|
||||
add entries to the CMake cache in the ``initconfig`` phase. This can
|
||||
be done by overriding one of four methods:
|
||||
|
||||
#. ``CachedCMakePackage.initconfig_compiler_entries``
|
||||
#. ``CachedCMakePackage.initconfig_mpi_entries``
|
||||
#. ``CachedCMakePackage.initconfig_hardware_entries``
|
||||
#. ``CachedCMakePackage.initconfig_package_entries``
|
||||
|
||||
Each of these methods returns a list of CMake cache strings. The
|
||||
distinction between these methods is merely to provide a
|
||||
well-structured and legible cmake cache file -- otherwise, entries
|
||||
from each of these methods are handled identically.
|
||||
|
||||
Spack also provides convenience methods for generating CMake cache
|
||||
entries. These methods are available at module scope in every Spack
|
||||
package. Because CMake parses boolean options, strings, and paths
|
||||
differently, there are three such methods:
|
||||
|
||||
#. ``cmake_cache_option``
|
||||
#. ``cmake_cache_string``
|
||||
#. ``cmake_cache_path``
|
||||
|
||||
These methods each accept three parameters -- the name of the CMake
|
||||
variable associated with the entry, the value of the entry, and an
|
||||
optional comment -- and return strings in the appropriate format to be
|
||||
returned from any of the ``initconfig*`` methods. Additionally, these
|
||||
methods may return comments beginning with the ``#`` character.
|
||||
|
||||
A typical usage of these methods may look something like this:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
def initconfig_mpi_entries(self)
|
||||
# Get existing MPI configurations
|
||||
entries = super(self, Foo).initconfig_mpi_entries()
|
||||
|
||||
# The existing MPI configurations key on whether ``mpi`` is in the spec
|
||||
# This spec has an MPI variant, and we need to enable MPI when it is on.
|
||||
# This hypothetical package controls MPI with the ``FOO_MPI`` option to
|
||||
# cmake.
|
||||
if '+mpi' in self.spec:
|
||||
entries.append(cmake_cache_option('FOO_MPI', True, "enable mpi"))
|
||||
else:
|
||||
entries.append(cmake_cache_option('FOO_MPI', False, "disable mpi"))
|
||||
|
||||
def initconfig_package_entries(self):
|
||||
# Package specific options
|
||||
entries = []
|
||||
|
||||
entries.append('#Entries for build options')
|
||||
|
||||
bar_on = '+bar' in self.spec
|
||||
entries.append(cmake_cache_option('FOO_BAR', bar_on, 'toggle bar'))
|
||||
|
||||
entries.append('#Entries for dependencies')
|
||||
|
||||
if self.spec['blas'].name == 'baz': # baz is our blas provider
|
||||
entries.append(cmake_cache_string('FOO_BLAS', 'baz', 'Use baz'))
|
||||
entries.append(cmake_cache_path('BAZ_PREFIX', self.spec['baz'].prefix))
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
External documentation
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
For more information on CMake cache files, see:
|
||||
https://cmake.org/cmake/help/latest/manual/cmake.1.html
|
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||
.. Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
|
||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
@@ -128,116 +128,20 @@ Adding flags to cmake
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
To add additional flags to the ``cmake`` call, simply override the
|
||||
``cmake_args`` function. The following example defines values for the flags
|
||||
``WHATEVER``, ``ENABLE_BROKEN_FEATURE``, ``DETECT_HDF5``, and ``THREADS`` with
|
||||
and without the :meth:`~spack.build_systems.cmake.CMakePackage.define` and
|
||||
:meth:`~spack.build_systems.cmake.CMakePackage.define_from_variant` helper functions:
|
||||
``cmake_args`` function:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
def cmake_args(self):
|
||||
args = [
|
||||
'-DWHATEVER:STRING=somevalue',
|
||||
self.define('ENABLE_BROKEN_FEATURE', False),
|
||||
self.define_from_variant('DETECT_HDF5', 'hdf5'),
|
||||
self.define_from_variant('THREADS'), # True if +threads
|
||||
]
|
||||
args = []
|
||||
|
||||
if '+hdf5' in self.spec:
|
||||
args.append('-DDETECT_HDF5=ON')
|
||||
else:
|
||||
args.append('-DDETECT_HDF5=OFF')
|
||||
|
||||
return args
|
||||
|
||||
Spack supports CMake defines from conditional variants too. Whenever the condition on
|
||||
the variant is not met, ``define_from_variant()`` will simply return an empty string,
|
||||
and CMake simply ignores the empty command line argument. For example the following
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
variant('example', default=True, when='@2.0:')
|
||||
|
||||
def cmake_args(self):
|
||||
return [self.define_from_variant('EXAMPLE', 'example')]
|
||||
|
||||
will generate ``'cmake' '-DEXAMPLE=ON' ...`` when `@2.0: +example` is met, but will
|
||||
result in ``'cmake' '' ...`` when the spec version is below ``2.0``.
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
CMake arguments provided by Spack
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The following default arguments are controlled by Spack:
|
||||
|
||||
|
||||
``CMAKE_INSTALL_PREFIX``
|
||||
------------------------
|
||||
|
||||
Is set to the the package's install directory.
|
||||
|
||||
|
||||
``CMAKE_PREFIX_PATH``
|
||||
---------------------
|
||||
|
||||
CMake finds dependencies through calls to ``find_package()``, ``find_program()``,
|
||||
``find_library()``, ``find_file()``, and ``find_path()``, which use a list of search
|
||||
paths from ``CMAKE_PREFIX_PATH``. Spack sets this variable to a list of prefixes of the
|
||||
spec's transitive dependencies.
|
||||
|
||||
For troubleshooting cases where CMake fails to find a dependency, add the
|
||||
``--debug-find`` flag to ``cmake_args``.
|
||||
|
||||
``CMAKE_BUILD_TYPE``
|
||||
--------------------
|
||||
|
||||
Every CMake-based package accepts a ``-DCMAKE_BUILD_TYPE`` flag to
|
||||
dictate which level of optimization to use. In order to ensure
|
||||
uniformity across packages, the ``CMakePackage`` base class adds
|
||||
a variant to control this:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
variant('build_type', default='RelWithDebInfo',
|
||||
description='CMake build type',
|
||||
values=('Debug', 'Release', 'RelWithDebInfo', 'MinSizeRel'))
|
||||
|
||||
However, not every CMake package accepts all four of these options.
|
||||
Grep the ``CMakeLists.txt`` file to see if the default values are
|
||||
missing or replaced. For example, the
|
||||
`dealii <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/dealii/package.py>`_
|
||||
package overrides the default variant with:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
variant('build_type', default='DebugRelease',
|
||||
description='The build type to build',
|
||||
values=('Debug', 'Release', 'DebugRelease'))
|
||||
|
||||
For more information on ``CMAKE_BUILD_TYPE``, see:
|
||||
https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html
|
||||
|
||||
|
||||
``CMAKE_INSTALL_RPATH`` and ``CMAKE_INSTALL_RPATH_USE_LINK_PATH=ON``
|
||||
--------------------------------------------------------------------
|
||||
|
||||
CMake uses different RPATHs during the build and after installation, so that executables
|
||||
can locate the libraries they're linked to during the build, and installed executables
|
||||
do not have RPATHs to build directories. In Spack, we have to make sure that RPATHs are
|
||||
set properly after installation.
|
||||
|
||||
Spack sets ``CMAKE_INSTALL_RPATH`` to a list of ``<prefix>/lib`` or ``<prefix>/lib64``
|
||||
directories of the spec's link-type dependencies. Apart from that, it sets
|
||||
``-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON``, which should add RPATHs for directories of
|
||||
linked libraries not in the directories covered by ``CMAKE_INSTALL_RPATH``.
|
||||
|
||||
Usually it's enough to set only ``-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON``, but the
|
||||
reason to provide both options is that packages may dynamically open shared libraries,
|
||||
which CMake cannot detect. In those cases, the RPATHs from ``CMAKE_INSTALL_RPATH`` are
|
||||
used as search paths.
|
||||
|
||||
.. note::
|
||||
|
||||
Some packages provide stub libraries, which contain an interface for linking without
|
||||
an implementation. When using such libraries, it's best to override the option
|
||||
``-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=OFF`` in ``cmake_args``, so that stub libraries
|
||||
are not used at runtime.
|
||||
|
||||
|
||||
^^^^^^^^^^
|
||||
Generators
|
||||
@@ -275,6 +179,36 @@ generators, but it should be simple to add support for alternative
|
||||
generators. For more information on CMake generators, see:
|
||||
https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html
|
||||
|
||||
^^^^^^^^^^^^^^^^
|
||||
CMAKE_BUILD_TYPE
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
Every CMake-based package accepts a ``-DCMAKE_BUILD_TYPE`` flag to
|
||||
dictate which level of optimization to use. In order to ensure
|
||||
uniformity across packages, the ``CMakePackage`` base class adds
|
||||
a variant to control this:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
variant('build_type', default='RelWithDebInfo',
|
||||
description='CMake build type',
|
||||
values=('Debug', 'Release', 'RelWithDebInfo', 'MinSizeRel'))
|
||||
|
||||
However, not every CMake package accepts all four of these options.
|
||||
Grep the ``CMakeLists.txt`` file to see if the default values are
|
||||
missing or replaced. For example, the
|
||||
`dealii <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/dealii/package.py>`_
|
||||
package overrides the default variant with:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
variant('build_type', default='DebugRelease',
|
||||
description='The build type to build',
|
||||
values=('Debug', 'Release', 'DebugRelease'))
|
||||
|
||||
For more information on ``CMAKE_BUILD_TYPE``, see:
|
||||
https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
CMakeLists.txt in a sub-directory
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||
.. Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
|
||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
@@ -9,120 +9,35 @@
|
||||
CudaPackage
|
||||
-----------
|
||||
|
||||
Different from other packages, ``CudaPackage`` does not represent a build system.
|
||||
Instead its goal is to simplify and unify usage of ``CUDA`` in other packages by providing a `mixin-class <https://en.wikipedia.org/wiki/Mixin>`_.
|
||||
Different from other packages, ``CudaPackage`` does not represent a build
|
||||
system. Instead its goal is to simplify and unify usage of ``CUDA`` in other
|
||||
packages.
|
||||
|
||||
You can find source for the package at
|
||||
`<https://github.com/spack/spack/blob/develop/lib/spack/spack/build_systems/cuda.py>`__.
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Provided variants and dependencies
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
^^^^^^^^
|
||||
Variants
|
||||
^^^^^^^^
|
||||
|
||||
This package provides the following variants:
|
||||
|
||||
* **cuda**
|
||||
|
||||
This variant is used to enable/disable building with ``CUDA``. The default
|
||||
is disabled (or ``False``).
|
||||
|
||||
* **cuda_arch**
|
||||
|
||||
This variant supports the optional specification of the architecture.
|
||||
Valid values are maintained in the ``cuda_arch_values`` property and
|
||||
are the numeric character equivalent of the compute capability version
|
||||
(e.g., '10' for version 1.0). Each provided value affects associated
|
||||
``CUDA`` dependencies and compiler conflicts.
|
||||
|
||||
GPUs and their compute capability versions are listed at
|
||||
https://developer.nvidia.com/cuda-gpus .
|
||||
|
||||
^^^^^^^^^
|
||||
Conflicts
|
||||
^^^^^^^^^
|
||||
|
||||
Conflicts are used to prevent builds with known bugs or issues. While
|
||||
base ``CUDA`` conflicts have been included with this package, you may
|
||||
want to add more for your software.
|
||||
|
||||
For example, if your package requires ``cuda_arch`` to be specified when
|
||||
``cuda`` is enabled, you can add the following conflict to your package
|
||||
to terminate such build attempts with a suitable message:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
conflicts('cuda_arch=none', when='+cuda',
|
||||
msg='CUDA architecture is required')
|
||||
|
||||
Similarly, if your software does not support all versions of the property,
|
||||
you could add ``conflicts`` to your package for those versions. For example,
|
||||
suppose your software does not work with CUDA compute capability versions
|
||||
prior to SM 5.0 (``50``). You can add the following code to display a
|
||||
custom message should a user attempt such a build:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
unsupported_cuda_archs = [
|
||||
'10', '11', '12', '13',
|
||||
'20', '21',
|
||||
'30', '32', '35', '37'
|
||||
]
|
||||
for value in unsupported_cuda_archs:
|
||||
conflicts('cuda_arch={0}'.format(value), when='+cuda',
|
||||
msg='CUDA architecture {0} is not supported'.format(value))
|
||||
|
||||
^^^^^^^
|
||||
Methods
|
||||
^^^^^^^
|
||||
|
||||
This package provides one custom helper method, which is used to build
|
||||
standard CUDA compiler flags.
|
||||
|
||||
**cuda_flags**
|
||||
|
||||
This built-in static method returns a list of command line flags
|
||||
for the chosen ``cuda_arch`` value(s). The flags are intended to
|
||||
be passed to the CUDA compiler driver (i.e., ``nvcc``).
|
||||
|
||||
This method must be explicitly called when you are creating the
|
||||
arguments for your build in order to use the values.
|
||||
``CudaPackage`` provides ``cuda`` variant (default to ``off``) to enable/disable
|
||||
``CUDA``, and ``cuda_arch`` variant to optionally specify the architecture.
|
||||
It also declares dependencies on the ``CUDA`` package ``depends_on('cuda@...')``
|
||||
based on the architecture as well as specifies conflicts for certain compiler versions.
|
||||
|
||||
^^^^^
|
||||
Usage
|
||||
^^^^^
|
||||
|
||||
This helper package can be added to your package by adding it as a base
|
||||
class of your package. For example, you can add it to your
|
||||
:ref:`CMakePackage <cmakepackage>`-based package as follows:
|
||||
In order to use it, just add another base class to your package, for example:
|
||||
|
||||
.. code-block:: python
|
||||
:emphasize-lines: 1,7-16
|
||||
|
||||
class MyCudaPackage(CMakePackage, CudaPackage):
|
||||
class MyPackage(CMakePackage, CudaPackage):
|
||||
...
|
||||
def cmake_args(self):
|
||||
spec = self.spec
|
||||
args = []
|
||||
...
|
||||
if '+cuda' in spec:
|
||||
# Set up the cuda macros needed by the build
|
||||
args.append('-DWITH_CUDA=ON')
|
||||
cuda_arch_list = spec.variants['cuda_arch'].value
|
||||
cuda_arch = cuda_arch_list[0]
|
||||
if cuda_arch != 'none':
|
||||
args.append('-DCUDA_FLAGS=-arch=sm_{0}'.format(cuda_arch))
|
||||
options.append('-DWITH_CUDA=ON')
|
||||
cuda_arch = spec.variants['cuda_arch'].value
|
||||
if cuda_arch is not None:
|
||||
options.append('-DCUDA_FLAGS=-arch=sm_{0}'.format(cuda_arch[0]))
|
||||
else:
|
||||
# Ensure build with cuda is disabled
|
||||
args.append('-DWITH_CUDA=OFF')
|
||||
...
|
||||
return args
|
||||
|
||||
assuming only the ``WITH_CUDA`` and ``CUDA_FLAGS`` flags are required.
|
||||
You will need to customize options as needed for your build.
|
||||
|
||||
This example also illustrates how to check for the ``cuda`` variant using
|
||||
``self.spec`` and how to retrieve the ``cuda_arch`` variant's value, which
|
||||
is a list, using ``self.spec.variants['cuda_arch'].value``.
|
||||
|
||||
With over 70 packages using ``CudaPackage`` as of January 2021 there are
|
||||
lots of examples to choose from to get more ideas for using this package.
|
||||
options.append('-DWITH_CUDA=OFF')
|
||||
|
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||
.. Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
|
||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
@@ -9,7 +9,7 @@
|
||||
Custom Build Systems
|
||||
--------------------
|
||||
|
||||
While the built-in build systems should meet your needs for the
|
||||
While the build systems listed above should meet your needs for the
|
||||
vast majority of packages, some packages provide custom build scripts.
|
||||
This guide is intended for the following use cases:
|
||||
|
||||
@@ -31,7 +31,7 @@ installation. Both of these packages require custom build systems.
|
||||
Base class
|
||||
^^^^^^^^^^
|
||||
|
||||
If your package does not belong to any of the built-in build
|
||||
If your package does not belong to any of the aforementioned build
|
||||
systems that Spack already supports, you should inherit from the
|
||||
``Package`` base class. ``Package`` is a simple base class with a
|
||||
single phase: ``install``. If your package is simple, you may be able
|
||||
@@ -168,8 +168,7 @@ if and only if this flag is set, we would use the following line:
|
||||
Testing
|
||||
^^^^^^^
|
||||
|
||||
Let's put everything together and add unit tests to be optionally run
|
||||
during the installation of our package.
|
||||
Let's put everything together and add unit tests to our package.
|
||||
In the ``perl`` package, we can see:
|
||||
|
||||
.. code-block:: python
|
||||
@@ -183,6 +182,12 @@ As you can guess, this runs ``make test`` *after* building the package,
|
||||
if and only if testing is requested. Again, this is not specific to
|
||||
custom build systems, it can be added to existing build systems as well.
|
||||
|
||||
Ideally, every package in Spack will have some sort of test to ensure
|
||||
that it was built correctly. It is up to the package authors to make
|
||||
sure this happens. If you are adding a package for some software and
|
||||
the developers list commands to test the installation, please add these
|
||||
tests to your ``package.py``.
|
||||
|
||||
.. warning::
|
||||
|
||||
The order of decorators matters. The following ordering:
|
||||
@@ -202,12 +207,3 @@ custom build systems, it can be added to existing build systems as well.
|
||||
the tests will always be run regardless of whether or not
|
||||
``--test=root`` is requested. See https://github.com/spack/spack/issues/3833
|
||||
for more information
|
||||
|
||||
Ideally, every package in Spack will have some sort of test to ensure
|
||||
that it was built correctly. It is up to the package authors to make
|
||||
sure this happens. If you are adding a package for some software and
|
||||
the developers list commands to test the installation, please add these
|
||||
tests to your ``package.py``.
|
||||
|
||||
For more information on other forms of package testing, refer to
|
||||
:ref:`Checking an installation <checking_an_installation>`.
|
||||
|
@@ -1,155 +0,0 @@
|
||||
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
|
||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
.. _inteloneapipackage:
|
||||
|
||||
|
||||
====================
|
||||
IntelOneapiPackage
|
||||
====================
|
||||
|
||||
|
||||
.. contents::
|
||||
|
||||
|
||||
oneAPI packages in Spack
|
||||
========================
|
||||
|
||||
Spack can install and use the Intel oneAPI products. You may either
|
||||
use spack to install the oneAPI tools or use the `Intel
|
||||
installers`_. After installation, you may use the tools directly, or
|
||||
use Spack to build packages with the tools.
|
||||
|
||||
The Spack Python class ``IntelOneapiPackage`` is a base class that is
|
||||
used by ``IntelOneapiCompilers``, ``IntelOneapiMkl``,
|
||||
``IntelOneapiTbb`` and other classes to implement the oneAPI
|
||||
packages. See the :ref:`package-list` for the full list of available
|
||||
oneAPI packages or use::
|
||||
|
||||
spack list -d oneAPI
|
||||
|
||||
For more information on a specific package, do::
|
||||
|
||||
spack info <package-name>
|
||||
|
||||
Intel no longer releases new versions of Parallel Studio, which can be
|
||||
used in Spack via the :ref:`intelpackage`. All of its components can
|
||||
now be found in oneAPI.
|
||||
|
||||
Examples
|
||||
========
|
||||
|
||||
Building a Package With icx
|
||||
---------------------------
|
||||
|
||||
In this example, we build patchelf with ``icc`` and ``icx``. The
|
||||
compilers are installed with spack.
|
||||
|
||||
Install the oneAPI compilers::
|
||||
|
||||
spack install intel-oneapi-compilers
|
||||
|
||||
Add the compilers to your ``compilers.yaml`` so spack can use them::
|
||||
|
||||
spack compiler add `spack location -i intel-oneapi-compilers`/compiler/latest/linux/bin/intel64
|
||||
spack compiler add `spack location -i intel-oneapi-compilers`/compiler/latest/linux/bin
|
||||
|
||||
Verify that the compilers are available::
|
||||
|
||||
spack compiler list
|
||||
|
||||
The ``intel-oneapi-compilers`` package includes 2 families of
|
||||
compilers:
|
||||
|
||||
* ``intel``: ``icc``, ``icpc``, ``ifort``. Intel's *classic*
|
||||
compilers.
|
||||
* ``oneapi``: ``icx``, ``icpx``, ``ifx``. Intel's new generation of
|
||||
compilers based on LLVM.
|
||||
|
||||
To build the ``patchelf`` Spack package with ``icc``, do::
|
||||
|
||||
spack install patchelf%intel
|
||||
|
||||
To build with with ``icx``, do ::
|
||||
|
||||
spack install patchelf%oneapi
|
||||
|
||||
Using oneAPI MPI to Satisfy a Virtual Dependence
|
||||
------------------------------------------------------
|
||||
|
||||
The ``hdf5`` package works with any compatible MPI implementation. To
|
||||
build ``hdf5`` with Intel oneAPI MPI do::
|
||||
|
||||
spack install hdf5 +mpi ^intel-oneapi-mpi
|
||||
|
||||
Using Externally Installed oneAPI Tools
|
||||
=======================================
|
||||
|
||||
Spack can also use oneAPI tools that are manually installed with
|
||||
`Intel Installers`_. The procedures for configuring Spack to use
|
||||
external compilers and libraries are different.
|
||||
|
||||
Compilers
|
||||
---------
|
||||
|
||||
To use the compilers, add some information about the installation to
|
||||
``compilers.yaml``. For most users, it is sufficient to do::
|
||||
|
||||
spack compiler add /opt/intel/oneapi/compiler/latest/linux/bin/intel64
|
||||
spack compiler add /opt/intel/oneapi/compiler/latest/linux/bin
|
||||
|
||||
Adapt the paths above if you did not install the tools in the default
|
||||
location. After adding the compilers, using them is the same
|
||||
as if you had installed the ``intel-oneapi-compilers`` package.
|
||||
Another option is to manually add the configuration to
|
||||
``compilers.yaml`` as described in :ref:`Compiler configuration
|
||||
<compiler-config>`.
|
||||
|
||||
Libraries
|
||||
---------
|
||||
|
||||
If you want Spack to use oneMKL that you have installed without Spack in
|
||||
the default location, then add the following to
|
||||
``~/.spack/packages.yaml``, adjusting the version as appropriate::
|
||||
|
||||
intel-oneapi-mkl:
|
||||
externals:
|
||||
- spec: intel-oneapi-mkl@2021.1.1
|
||||
prefix: /opt/intel/oneapi/
|
||||
|
||||
|
||||
Using oneAPI Tools Installed by Spack
|
||||
=====================================
|
||||
|
||||
Spack can be a convenient way to install and configure compilers and
|
||||
libaries, even if you do not intend to build a Spack package. If you
|
||||
want to build a Makefile project using Spack-installed oneAPI compilers,
|
||||
then use spack to configure your environment::
|
||||
|
||||
spack load intel-oneapi-compilers
|
||||
|
||||
And then you can build with::
|
||||
|
||||
CXX=icpx make
|
||||
|
||||
You can also use Spack-installed libraries. For example::
|
||||
|
||||
spack load intel-oneapi-mkl
|
||||
|
||||
Will update your environment CPATH, LIBRARY_PATH, and other
|
||||
environment variables for building an application with oneMKL.
|
||||
|
||||
More information
|
||||
================
|
||||
|
||||
This section describes basic use of oneAPI, especially if it has
|
||||
changed compared to Parallel Studio. See :ref:`intelpackage` for more
|
||||
information on :ref:`intel-virtual-packages`,
|
||||
:ref:`intel-unrelated-packages`,
|
||||
:ref:`intel-integrating-external-libraries`, and
|
||||
:ref:`using-mkl-tips`.
|
||||
|
||||
|
||||
.. _`Intel installers`: https://software.intel.com/content/www/us/en/develop/documentation/installation-guide-for-intel-oneapi-toolkits-linux/top.html
|
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||
.. Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
|
||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
@@ -15,9 +15,6 @@ IntelPackage
|
||||
Intel packages in Spack
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
This is an earlier version of Intel software development tools and has
|
||||
now been replaced by Intel oneAPI Toolkits.
|
||||
|
||||
Spack can install and use several software development products offered by Intel.
|
||||
Some of these are available under no-cost terms, others require a paid license.
|
||||
All share the same basic steps for configuration, installation, and, where
|
||||
@@ -140,7 +137,6 @@ If you need to save disk space or installation time, you could install the
|
||||
``intel`` compilers-only subset (0.6 GB) and just the library packages you
|
||||
need, for example ``intel-mpi`` (0.5 GB) and ``intel-mkl`` (2.5 GB).
|
||||
|
||||
.. _intel-unrelated-packages:
|
||||
|
||||
""""""""""""""""""""
|
||||
Unrelated packages
|
||||
@@ -362,8 +358,6 @@ affected by an advanced third method:
|
||||
Next, visit section `Selecting Intel Compilers`_ to learn how to tell
|
||||
Spack to use the newly configured compilers.
|
||||
|
||||
.. _intel-integrating-external-libraries:
|
||||
|
||||
""""""""""""""""""""""""""""""""""
|
||||
Integrating external libraries
|
||||
""""""""""""""""""""""""""""""""""
|
||||
@@ -424,13 +418,9 @@ Adapt the following example. Be sure to maintain the indentation:
|
||||
# other content ...
|
||||
|
||||
intel-mkl:
|
||||
externals:
|
||||
- spec: "intel-mkl@2018.2.199 arch=linux-centos6-x86_64"
|
||||
modules:
|
||||
- intel-mkl/18/18.0.2
|
||||
- spec: "intel-mkl@2018.3.222 arch=linux-centos6-x86_64"
|
||||
modules:
|
||||
- intel-mkl/18/18.0.3
|
||||
modules:
|
||||
intel-mkl@2018.2.199 arch=linux-centos6-x86_64: intel-mkl/18/18.0.2
|
||||
intel-mkl@2018.3.222 arch=linux-centos6-x86_64: intel-mkl/18/18.0.3
|
||||
|
||||
The version numbers for the ``intel-mkl`` specs defined here correspond to file
|
||||
and directory names that Intel uses for its products because they were adopted
|
||||
@@ -461,16 +451,12 @@ mechanism.
|
||||
|
||||
packages:
|
||||
intel-parallel-studio:
|
||||
externals:
|
||||
- spec: "intel-parallel-studio@cluster.2018.2.199 +mkl+mpi+ipp+tbb+daal arch=linux-centos6-x86_64"
|
||||
modules:
|
||||
- intel/18/18.0.2
|
||||
- spec: "intel-parallel-studio@cluster.2018.3.222 +mkl+mpi+ipp+tbb+daal arch=linux-centos6-x86_64"
|
||||
modules:
|
||||
- intel/18/18.0.3
|
||||
modules:
|
||||
intel-parallel-studio@cluster.2018.2.199 +mkl+mpi+ipp+tbb+daal arch=linux-centos6-x86_64: intel/18/18.0.2
|
||||
intel-parallel-studio@cluster.2018.3.222 +mkl+mpi+ipp+tbb+daal arch=linux-centos6-x86_64: intel/18/18.0.3
|
||||
buildable: False
|
||||
|
||||
One additional example illustrates the use of ``prefix:`` instead of
|
||||
One additional example illustrates the use of ``paths:`` instead of
|
||||
``modules:``, useful when external modulefiles are not available or not
|
||||
suitable:
|
||||
|
||||
@@ -478,15 +464,13 @@ suitable:
|
||||
|
||||
packages:
|
||||
intel-parallel-studio:
|
||||
externals:
|
||||
- spec: "intel-parallel-studio@cluster.2018.2.199 +mkl+mpi+ipp+tbb+daal"
|
||||
prefix: /opt/intel
|
||||
- spec: "intel-parallel-studio@cluster.2018.3.222 +mkl+mpi+ipp+tbb+daal"
|
||||
prefix: /opt/intel
|
||||
paths:
|
||||
intel-parallel-studio@cluster.2018.2.199 +mkl+mpi+ipp+tbb+daal: /opt/intel
|
||||
intel-parallel-studio@cluster.2018.3.222 +mkl+mpi+ipp+tbb+daal: /opt/intel
|
||||
buildable: False
|
||||
|
||||
Note that for the Intel packages discussed here, the directory values in the
|
||||
``prefix:`` entries must be the high-level and typically version-less
|
||||
``paths:`` entries must be the high-level and typically version-less
|
||||
"installation directory" that has been used by Intel's product installer.
|
||||
Such a directory will typically accumulate various product versions. Amongst
|
||||
them, Spack will select the correct version-specific product directory based on
|
||||
@@ -564,29 +548,43 @@ follow `the next section <intel-install-libs_>`_ instead.
|
||||
modules: []
|
||||
spec: intel@18.0.3
|
||||
paths:
|
||||
cc: /usr/bin/true
|
||||
cxx: /usr/bin/true
|
||||
f77: /usr/bin/true
|
||||
fc: /usr/bin/true
|
||||
cc: stub
|
||||
cxx: stub
|
||||
f77: stub
|
||||
fc: stub
|
||||
|
||||
Replace ``18.0.3`` with the version that you determined in the preceding
|
||||
step. The exact contents under ``paths:`` do not matter yet, but the paths must exist.
|
||||
Replace ``18.0.3`` with the version that you determined in the preceeding
|
||||
step. The contents under ``paths:`` do not matter yet.
|
||||
|
||||
This temporary stub is required such that the ``intel-parallel-studio`` package
|
||||
can be installed for the ``intel`` compiler (which the package itself is going
|
||||
to provide after the installation) rather than an arbitrary system compiler.
|
||||
The paths given in ``cc``, ``cxx``, ``f77``, ``fc`` must exist, but will
|
||||
never be used to build anything during the installation of ``intel-parallel-studio``.
|
||||
You are right to ask: "Why on earth is that necessary?" [fn8]_.
|
||||
The answer lies in Spack striving for strict compiler consistency.
|
||||
Consider what happens without such a pre-declared compiler stub:
|
||||
Say, you ask Spack to install a particular version
|
||||
``intel-parallel-studio@edition.V``. Spack will apply an unrelated compiler
|
||||
spec to concretize and install your request, resulting in
|
||||
``intel-parallel-studio@edition.V %X``. That compiler ``%X`` is not going to
|
||||
be the version that this new package itself provides. Rather, it would
|
||||
typically be ``%gcc@...`` in a default Spack installation or possibly indeed
|
||||
``%intel@...``, but at a version that precedes ``V``.
|
||||
|
||||
The reason for this stub is that ``intel-parallel-studio`` also provides the
|
||||
``mpi`` and ``mkl`` packages and when concretizing a spec, Spack ensures
|
||||
strong consistency of the used compiler across all dependencies: [fn8]_.
|
||||
Installing a package ``foo +mkl %intel`` will make Spack look for a package
|
||||
``mkl %intel``, which can be provided by ``intel-parallel-studio+mkl %intel``,
|
||||
but not by ``intel-parallel-studio+mkl %gcc``.
|
||||
The problem comes to the fore as soon as you try to use any virtual ``mkl``
|
||||
or ``mpi`` packages that you would expect to now be provided by
|
||||
``intel-parallel-studio@edition.V``. Spack will indeed see those virtual
|
||||
packages, but only as being tied to the compiler that the package
|
||||
``intel-parallel-studio@edition.V`` was concretized with *at installation*.
|
||||
If you were to install a client package with the new compilers now available
|
||||
to you, you would naturally run ``spack install foo +mkl %intel@V``, yet
|
||||
Spack will either complain about ``mkl%intel@V`` being missing (because it
|
||||
only knows about ``mkl%X``) or it will go and attempt to install *another
|
||||
instance* of ``intel-parallel-studio@edition.V %intel@V`` so as to match the
|
||||
compiler spec ``%intel@V`` that you gave for your client package ``foo``.
|
||||
This will be unexpected and will quickly get annoying because each
|
||||
reinstallation takes up time and extra disk space.
|
||||
|
||||
Failure to do so may result in additional installations of ``mkl``, ``intel-mpi`` or
|
||||
even ``intel-parallel-studio`` as dependencies for other packages.
|
||||
To escape this trap, put the compiler stub declaration shown here in place,
|
||||
then use that pre-declared compiler spec to install the actual package, as
|
||||
shown next. This approach works because during installation only the
|
||||
package's own self-sufficient installer will be used, not any compiler.
|
||||
|
||||
.. _`verify-compiler-anticipated`:
|
||||
|
||||
@@ -637,25 +635,11 @@ follow `the next section <intel-install-libs_>`_ instead.
|
||||
want to use the ``intel64`` variant. The ``icpc`` and ``ifort`` compilers
|
||||
will be located in the same directory as ``icc``.
|
||||
|
||||
* Make sure to specify ``modules: ['intel-parallel-studio-cluster2018.3-intel-18.0.3-HASH']``
|
||||
(with ``HASH`` being the short hash as displayed when running
|
||||
``spack find -l intel-parallel-studio@cluster.2018.3`` and the versions adapted accordingly)
|
||||
to ensure that the correct and complete environment for the Intel compilers gets
|
||||
loaded when running them. With modern versions of the Intel compiler you may otherwise see
|
||||
issues about missing libraries. Please also note that module name must exactly match
|
||||
the name as returned by ``module avail`` (and shown in the example above).
|
||||
|
||||
* Use the ``modules:`` and/or ``cflags:`` tokens to further specify a suitable accompanying
|
||||
* Use the ``modules:`` and/or ``cflags:`` tokens to specify a suitable accompanying
|
||||
``gcc`` version to help pacify picky client packages that ask for C++
|
||||
standards more recent than supported by your system-provided ``gcc`` and its
|
||||
``libstdc++.so``.
|
||||
|
||||
* If you specified a custom variant (for example ``+vtune``) you may want to add this as your
|
||||
preferred variant in the packages configuration for the ``intel-parallel-studio`` package
|
||||
as described in :ref:`package-preferences`. Otherwise you will have to specify
|
||||
the variant everytime ``intel-parallel-studio`` is being used as ``mkl``, ``fftw`` or ``mpi``
|
||||
implementation to avoid pulling in a different variant.
|
||||
|
||||
* To set the Intel compilers for default use in Spack, instead of the usual ``%gcc``,
|
||||
follow section `Selecting Intel compilers`_.
|
||||
|
||||
@@ -712,7 +696,7 @@ follow `the next section <intel-install-libs_>`_ instead.
|
||||
- /home/$user/spack-stage
|
||||
|
||||
Do not duplicate the ``config:`` line if it already is present.
|
||||
Adapt the location, which here is the same as in the preceding example.
|
||||
Adapt the location, which here is the same as in the preceeding example.
|
||||
|
||||
3. Retry installing the large package.
|
||||
|
||||
@@ -814,13 +798,13 @@ by one of the following means:
|
||||
$ spack install libxc@3.0.0%intel
|
||||
|
||||
|
||||
* Alternatively, request Intel compilers implicitly by package preferences.
|
||||
* Alternatively, request Intel compilers implicitly by concretization preferences.
|
||||
Configure the order of compilers in the appropriate ``packages.yaml`` file,
|
||||
under either an ``all:`` or client-package-specific entry, in a
|
||||
``compiler:`` list. Consult the Spack documentation for
|
||||
`Configuring Package Preferences <https://spack-tutorial.readthedocs.io/en/latest/tutorial_configuration.html#configuring-package-preferences>`_
|
||||
and
|
||||
:ref:`Package Preferences <package-preferences>`.
|
||||
:ref:`Concretization Preferences <concretization-preferences>`.
|
||||
|
||||
Example: ``etc/spack/packages.yaml`` might simply contain:
|
||||
|
||||
@@ -840,7 +824,6 @@ for example:
|
||||
compiler: [ intel@18, intel@17, gcc@4.4.7, gcc@4.9.3, gcc@7.3.0, ]
|
||||
|
||||
|
||||
.. _intel-virtual-packages:
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
Selecting libraries to satisfy virtual packages
|
||||
@@ -870,7 +853,7 @@ virtual package, in order of decreasing preference. To learn more about the
|
||||
``providers:`` settings, see the Spack tutorial for
|
||||
`Configuring Package Preferences <https://spack-tutorial.readthedocs.io/en/latest/tutorial_configuration.html#configuring-package-preferences>`_
|
||||
and the section
|
||||
:ref:`Package Preferences <package-preferences>`.
|
||||
:ref:`Concretization Preferences <concretization-preferences>`.
|
||||
|
||||
Example: The following fairly minimal example for ``packages.yaml`` shows how
|
||||
to exclusively use the standalone ``intel-mkl`` package for all the linear
|
||||
@@ -914,7 +897,6 @@ With the proper installation as detailed above, no special steps should be
|
||||
required when a client package specifically (and thus deliberately) requests an
|
||||
Intel package as dependency, this being one of the target use cases for Spack.
|
||||
|
||||
.. _using-mkl-tips:
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""
|
||||
Tips for configuring client packages to use MKL
|
||||
@@ -983,7 +965,7 @@ a *virtual* ``mkl`` package is declared in Spack.
|
||||
|
||||
Likewise, in a
|
||||
:ref:`MakefilePackage <makefilepackage>`
|
||||
or similar package that does not use AutoTools you may need to provide include
|
||||
or similiar package that does not use AutoTools you may need to provide include
|
||||
and link options for use on command lines or in environment variables.
|
||||
For example, to generate an option string of the form ``-I<dir>``, use:
|
||||
|
||||
@@ -1073,6 +1055,6 @@ Footnotes
|
||||
2. Set the hash length in ``install-path-scheme``, also in ``config.yaml``
|
||||
(:ref:`q.v. <config-yaml>`).
|
||||
3. You will want to set the *same* hash length for
|
||||
:ref:`module files <modules-projections>`
|
||||
if you have Spack produce them for you, under ``projections`` in
|
||||
``modules.yaml``.
|
||||
:ref:`tcl module files <modules-naming-scheme>`
|
||||
if you have Spack produce them for you, under ``naming_scheme`` in
|
||||
``modules.yaml``. Other module dialects cannot be altered in this manner.
|
||||
|
@@ -1,105 +0,0 @@
|
||||
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
|
||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
.. _luapackage:
|
||||
|
||||
------------
|
||||
LuaPackage
|
||||
------------
|
||||
|
||||
LuaPackage is a helper for the common case of Lua packages that provide
|
||||
a rockspec file. This is not meant to take a rock archive, but to build
|
||||
a source archive or repository that provides a rockspec, which should cover
|
||||
most lua packages. In the case a Lua package builds by Make rather than
|
||||
luarocks, prefer MakefilePackage.
|
||||
|
||||
^^^^^^
|
||||
Phases
|
||||
^^^^^^
|
||||
|
||||
The ``LuaPackage`` base class comes with the following phases:
|
||||
|
||||
#. ``unpack`` - if using a rock, unpacks the rock and moves into the source directory
|
||||
#. ``preprocess`` - adjust sources or rockspec to fix build
|
||||
#. ``install`` - install the project
|
||||
|
||||
By default, these phases run:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
# If the archive is a source rock
|
||||
$ luarocks unpack <archive>.src.rock
|
||||
$ # preprocess is a noop by default
|
||||
$ luarocks make <name>.rockspec
|
||||
|
||||
|
||||
Any of these phases can be overridden in your package as necessary.
|
||||
|
||||
^^^^^^^^^^^^^^^
|
||||
Important files
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
Packages that use the Lua/LuaRocks build system can be identified by the
|
||||
presence of a ``*.rockspec`` file in their sourcetree, or can be fetched as
|
||||
a source rock archive (``.src.rock``). This file declares things like build
|
||||
instructions and dependencies, the ``.src.rock`` also contains all code.
|
||||
|
||||
It is common for the rockspec file to list the lua version required in
|
||||
a dependency. The LuaPackage class adds appropriate dependencies on a Lua
|
||||
implementation, but it is a good idea to specify the version required with
|
||||
a ``depends_on`` statement. The block normally will be a table definition like
|
||||
this:
|
||||
|
||||
.. code-block:: lua
|
||||
|
||||
dependencies = {
|
||||
"lua >= 5.1",
|
||||
}
|
||||
|
||||
The LuaPackage class supports source repositories and archives containing
|
||||
a rockspec and directly downloading source rock files. It *does not* support
|
||||
downloading dependencies listed inside a rockspec, and thus does not support
|
||||
directly downloading a rockspec as an archive.
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Build system dependencies
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
All base dependencies are added by the build system, but LuaRocks is run to
|
||||
avoid downloading extra Lua dependencies during build. If the package needs
|
||||
Lua libraries outside the standard set, they should be added as dependencies.
|
||||
|
||||
To specify a Lua version constraint but allow all lua implementations, prefer
|
||||
to use ``depends_on("lua-lang@5.1:5.1.99")`` to express any 5.1 compatible
|
||||
version. If the package requires LuaJit rather than Lua,
|
||||
a ``depends_on("luajit")`` should be used to ensure a LuaJit distribution is
|
||||
used instead of the Lua interpreter. Alternately, if only interpreted Lua will
|
||||
work ``depends_on("lua")`` will express that.
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Passing arguments to luarocks make
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
If you need to pass any arguments to the ``luarocks make`` call, you can
|
||||
override the ``luarocks_args`` method like so:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
def luarocks_args(self):
|
||||
return ['flag1', 'flag2']
|
||||
|
||||
One common use of this is to override warnings or flags for newer compilers, as in:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
def luarocks_args(self):
|
||||
return ["CFLAGS='-Wno-error=implicit-function-declaration'"]
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
External documentation
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
For more information on the LuaRocks build system, see:
|
||||
https://luarocks.org/
|
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||
.. Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
|
||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
@@ -147,10 +147,8 @@ and a ``filter_file`` method to help with this. For example:
|
||||
def edit(self, spec, prefix):
|
||||
makefile = FileFilter('Makefile')
|
||||
|
||||
makefile.filter(r'^\s*CC\s*=.*', 'CC = ' + spack_cc)
|
||||
makefile.filter(r'^\s*CXX\s*=.*', 'CXX = ' + spack_cxx)
|
||||
makefile.filter(r'^\s*F77\s*=.*', 'F77 = ' + spack_f77)
|
||||
makefile.filter(r'^\s*FC\s*=.*', 'FC = ' + spack_fc)
|
||||
makefile.filter('CC = gcc', 'CC = cc')
|
||||
makefile.filter('CXX = g++', 'CC = c++')
|
||||
|
||||
|
||||
`stream <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/stream/package.py>`_
|
||||
|
@@ -1,102 +0,0 @@
|
||||
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
|
||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
.. _mavenpackage:
|
||||
|
||||
------------
|
||||
MavenPackage
|
||||
------------
|
||||
|
||||
Apache Maven is a general-purpose build system that does not rely
|
||||
on Makefiles to build software. It is designed for building and
|
||||
managing and Java-based project.
|
||||
|
||||
^^^^^^
|
||||
Phases
|
||||
^^^^^^
|
||||
|
||||
The ``MavenPackage`` base class comes with the following phases:
|
||||
|
||||
#. ``build`` - compile code and package into a JAR file
|
||||
#. ``install`` - copy to installation prefix
|
||||
|
||||
By default, these phases run:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ mvn package
|
||||
$ install . <prefix>
|
||||
|
||||
|
||||
^^^^^^^^^^^^^^^
|
||||
Important files
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
Maven packages can be identified by the presence of a ``pom.xml`` file.
|
||||
This file lists dependencies and other metadata about the project.
|
||||
There may also be configuration files in the ``.mvn`` directory.
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Build system dependencies
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Maven requires the ``mvn`` executable to build the project. It also
|
||||
requires Java at both build- and run-time. Because of this, the base
|
||||
class automatically adds the following dependencies:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
depends_on('java', type=('build', 'run'))
|
||||
depends_on('maven', type='build')
|
||||
|
||||
|
||||
In the ``pom.xml`` file, you may see sections like:
|
||||
|
||||
.. code-block:: xml
|
||||
|
||||
<requireJavaVersion>
|
||||
<version>[1.7,)</version>
|
||||
</requireJavaVersion>
|
||||
<requireMavenVersion>
|
||||
<version>[3.5.4,)</version>
|
||||
</requireMavenVersion>
|
||||
|
||||
|
||||
This specifies the versions of Java and Maven that are required to
|
||||
build the package. See
|
||||
https://docs.oracle.com/middleware/1212/core/MAVEN/maven_version.htm#MAVEN402
|
||||
for a description of this version range syntax. In this case, you
|
||||
should add:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
depends_on('java@7:', type='build')
|
||||
depends_on('maven@3.5.4:', type='build')
|
||||
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Passing arguments to the build phase
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The default build and install phases should be sufficient to install
|
||||
most packages. However, you may want to pass additional flags to
|
||||
the build phase. For example:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
def build_args(self):
|
||||
return [
|
||||
'-Pdist,native',
|
||||
'-Dtar',
|
||||
'-Dmaven.javadoc.skip=true'
|
||||
]
|
||||
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
External documentation
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
For more information on the Maven build system, see:
|
||||
https://maven.apache.org/index.html
|
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||
.. Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
|
||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
@@ -121,15 +121,11 @@ override the ``meson_args`` method like so:
|
||||
.. code-block:: python
|
||||
|
||||
def meson_args(self):
|
||||
return ['--warnlevel=3']
|
||||
return ['--default-library=both']
|
||||
|
||||
|
||||
This method can be used to pass flags as well as variables.
|
||||
|
||||
Note that the ``MesonPackage`` base class already defines variants for
|
||||
``buildtype``, ``default_library`` and ``strip``, which are mapped to default
|
||||
Meson arguments, meaning that you don't have to specify these.
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
External documentation
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
@@ -1,350 +0,0 @@
|
||||
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
|
||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
.. _multiplepackage:
|
||||
|
||||
----------------------
|
||||
Multiple Build Systems
|
||||
----------------------
|
||||
|
||||
Quite frequently, a package will change build systems from one version to the
|
||||
next. For example, a small project that once used a single Makefile to build
|
||||
may now require Autotools to handle the increased number of files that need to
|
||||
be compiled. Or, a package that once used Autotools may switch to CMake for
|
||||
Windows support. In this case, it becomes a bit more challenging to write a
|
||||
single build recipe for this package in Spack.
|
||||
|
||||
There are several ways that this can be handled in Spack:
|
||||
|
||||
#. Subclass the new build system, and override phases as needed (preferred)
|
||||
#. Subclass ``Package`` and implement ``install`` as needed
|
||||
#. Create separate ``*-cmake``, ``*-autotools``, etc. packages for each build system
|
||||
#. Rename the old package to ``*-legacy`` and create a new package
|
||||
#. Move the old package to a ``legacy`` repository and create a new package
|
||||
#. Drop older versions that only support the older build system
|
||||
|
||||
Of these options, 1 is preferred, and will be demonstrated in this
|
||||
documentation. Options 3-5 have issues with concretization, so shouldn't be
|
||||
used. Options 4-5 also don't support more than two build systems. Option 6 only
|
||||
works if the old versions are no longer needed. Option 1 is preferred over 2
|
||||
because it makes it easier to drop the old build system entirely.
|
||||
|
||||
The exact syntax of the package depends on which build systems you need to
|
||||
support. Below are a couple of common examples.
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
Makefile -> Autotools
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Let's say we have the following package:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
class Foo(MakefilePackage):
|
||||
version("1.2.0", sha256="...")
|
||||
|
||||
def edit(self, spec, prefix):
|
||||
filter_file("CC=", "CC=" + spack_cc, "Makefile")
|
||||
|
||||
def install(self, spec, prefix):
|
||||
install_tree(".", prefix)
|
||||
|
||||
|
||||
The package subclasses from :ref:`makefilepackage`, which has three phases:
|
||||
|
||||
#. ``edit`` (does nothing by default)
|
||||
#. ``build`` (runs ``make`` by default)
|
||||
#. ``install`` (runs ``make install`` by default)
|
||||
|
||||
In this case, the ``install`` phase needed to be overridden because the
|
||||
Makefile did not have an install target. We also modify the Makefile to use
|
||||
Spack's compiler wrappers. The default ``build`` phase is not changed.
|
||||
|
||||
Starting with version 1.3.0, we want to use Autotools to build instead.
|
||||
:ref:`autotoolspackage` has four phases:
|
||||
|
||||
#. ``autoreconf`` (does not if a configure script already exists)
|
||||
#. ``configure`` (runs ``./configure --prefix=...`` by default)
|
||||
#. ``build`` (runs ``make`` by default)
|
||||
#. ``install`` (runs ``make install`` by default)
|
||||
|
||||
If the only version we need to support is 1.3.0, the package would look as
|
||||
simple as:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
class Foo(AutotoolsPackage):
|
||||
version("1.3.0", sha256="...")
|
||||
|
||||
def configure_args(self):
|
||||
return ["--enable-shared"]
|
||||
|
||||
|
||||
In this case, we use the default methods for each phase and only override
|
||||
``configure_args`` to specify additional flags to pass to ``./configure``.
|
||||
|
||||
If we wanted to write a single package that supports both versions 1.2.0 and
|
||||
1.3.0, it would look something like:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
class Foo(AutotoolsPackage):
|
||||
version("1.3.0", sha256="...")
|
||||
version("1.2.0", sha256="...", deprecated=True)
|
||||
|
||||
def configure_args(self):
|
||||
return ["--enable-shared"]
|
||||
|
||||
# Remove the following once version 1.2.0 is dropped
|
||||
@when("@:1.2")
|
||||
def patch(self):
|
||||
filter_file("CC=", "CC=" + spack_cc, "Makefile")
|
||||
|
||||
@when("@:1.2")
|
||||
def autoreconf(self, spec, prefix):
|
||||
pass
|
||||
|
||||
@when("@:1.2")
|
||||
def configure(self, spec, prefix):
|
||||
pass
|
||||
|
||||
@when("@:1.2")
|
||||
def install(self, spec, prefix):
|
||||
install_tree(".", prefix)
|
||||
|
||||
|
||||
There are a few interesting things to note here:
|
||||
|
||||
* We added ``deprecated=True`` to version 1.2.0. This signifies that version
|
||||
1.2.0 is deprecated and shouldn't be used. However, if a user still relies
|
||||
on version 1.2.0, it's still there and builds just fine.
|
||||
* We moved the contents of the ``edit`` phase to the ``patch`` function. Since
|
||||
``AutotoolsPackage`` doesn't have an ``edit`` phase, the only way for this
|
||||
step to be executed is to move it to the ``patch`` function, which always
|
||||
gets run.
|
||||
* The ``autoreconf`` and ``configure`` phases become no-ops. Since the old
|
||||
Makefile-based build system doesn't use these, we ignore these phases when
|
||||
building ``foo@1.2.0``.
|
||||
* The ``@when`` decorator is used to override these phases only for older
|
||||
versions. The default methods are used for ``foo@1.3:``.
|
||||
|
||||
Once a new Spack release comes out, version 1.2.0 and everything below the
|
||||
comment can be safely deleted. The result is the same as if we had written a
|
||||
package for version 1.3.0 from scratch.
|
||||
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
Autotools -> CMake
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Let's say we have the following package:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
class Bar(AutotoolsPackage):
|
||||
version("1.2.0", sha256="...")
|
||||
|
||||
def configure_args(self):
|
||||
return ["--enable-shared"]
|
||||
|
||||
|
||||
The package subclasses from :ref:`autotoolspackage`, which has four phases:
|
||||
|
||||
#. ``autoreconf`` (does not if a configure script already exists)
|
||||
#. ``configure`` (runs ``./configure --prefix=...`` by default)
|
||||
#. ``build`` (runs ``make`` by default)
|
||||
#. ``install`` (runs ``make install`` by default)
|
||||
|
||||
In this case, we use the default methods for each phase and only override
|
||||
``configure_args`` to specify additional flags to pass to ``./configure``.
|
||||
|
||||
Starting with version 1.3.0, we want to use CMake to build instead.
|
||||
:ref:`cmakepackage` has three phases:
|
||||
|
||||
#. ``cmake`` (runs ``cmake ...`` by default)
|
||||
#. ``build`` (runs ``make`` by default)
|
||||
#. ``install`` (runs ``make install`` by default)
|
||||
|
||||
If the only version we need to support is 1.3.0, the package would look as
|
||||
simple as:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
class Bar(CMakePackage):
|
||||
version("1.3.0", sha256="...")
|
||||
|
||||
def cmake_args(self):
|
||||
return [self.define("BUILD_SHARED_LIBS", True)]
|
||||
|
||||
|
||||
In this case, we use the default methods for each phase and only override
|
||||
``cmake_args`` to specify additional flags to pass to ``cmake``.
|
||||
|
||||
If we wanted to write a single package that supports both versions 1.2.0 and
|
||||
1.3.0, it would look something like:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
class Bar(CMakePackage):
|
||||
version("1.3.0", sha256="...")
|
||||
version("1.2.0", sha256="...", deprecated=True)
|
||||
|
||||
def cmake_args(self):
|
||||
return [self.define("BUILD_SHARED_LIBS", True)]
|
||||
|
||||
# Remove the following once version 1.2.0 is dropped
|
||||
def configure_args(self):
|
||||
return ["--enable-shared"]
|
||||
|
||||
@when("@:1.2")
|
||||
def cmake(self, spec, prefix):
|
||||
configure("--prefix=" + prefix, *self.configure_args())
|
||||
|
||||
|
||||
There are a few interesting things to note here:
|
||||
|
||||
* We added ``deprecated=True`` to version 1.2.0. This signifies that version
|
||||
1.2.0 is deprecated and shouldn't be used. However, if a user still relies
|
||||
on version 1.2.0, it's still there and builds just fine.
|
||||
* Since CMake and Autotools are so similar, we only need to override the
|
||||
``cmake`` phase, we can use the default ``build`` and ``install`` phases.
|
||||
* We override ``cmake`` to run ``./configure`` for older versions.
|
||||
``configure_args`` remains the same.
|
||||
* The ``@when`` decorator is used to override these phases only for older
|
||||
versions. The default methods are used for ``bar@1.3:``.
|
||||
|
||||
Once a new Spack release comes out, version 1.2.0 and everything below the
|
||||
comment can be safely deleted. The result is the same as if we had written a
|
||||
package for version 1.3.0 from scratch.
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Multiple build systems for the same version
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
During the transition from one build system to another, developers often
|
||||
support multiple build systems at the same time. Spack can only use a single
|
||||
build system for a single version. To decide which build system to use for a
|
||||
particular version, take the following things into account:
|
||||
|
||||
1. If the developers explicitly state that one build system is preferred over
|
||||
another, use that one.
|
||||
2. If one build system is considered "experimental" while another is considered
|
||||
"stable", use the stable build system.
|
||||
3. Otherwise, use the newer build system.
|
||||
|
||||
The developer preference for which build system to use can change over time as
|
||||
a newer build system becomes stable/recommended.
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Dropping support for old build systems
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
When older versions of a package don't support a newer build system, it can be
|
||||
tempting to simply delete them from a package. This significantly reduces
|
||||
package complexity and makes the build recipe much easier to maintain. However,
|
||||
other packages or Spack users may rely on these older versions. The recommended
|
||||
approach is to first support both build systems (as demonstrated above),
|
||||
:ref:`deprecate <deprecate>` versions that rely on the old build system, and
|
||||
remove those versions and any phases that needed to be overridden in the next
|
||||
Spack release.
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Three or more build systems
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
In rare cases, a package may change build systems multiple times. For example,
|
||||
a package may start with Makefiles, then switch to Autotools, then switch to
|
||||
CMake. The same logic used above can be extended to any number of build systems.
|
||||
For example:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
class Baz(CMakePackage):
|
||||
version("1.4.0", sha256="...") # CMake
|
||||
version("1.3.0", sha256="...") # Autotools
|
||||
version("1.2.0", sha256="...") # Makefile
|
||||
|
||||
def cmake_args(self):
|
||||
return [self.define("BUILD_SHARED_LIBS", True)]
|
||||
|
||||
# Remove the following once version 1.3.0 is dropped
|
||||
def configure_args(self):
|
||||
return ["--enable-shared"]
|
||||
|
||||
@when("@1.3")
|
||||
def cmake(self, spec, prefix):
|
||||
configure("--prefix=" + prefix, *self.configure_args())
|
||||
|
||||
# Remove the following once version 1.2.0 is dropped
|
||||
@when("@:1.2")
|
||||
def patch(self):
|
||||
filter_file("CC=", "CC=" + spack_cc, "Makefile")
|
||||
|
||||
@when("@:1.2")
|
||||
def cmake(self, spec, prefix):
|
||||
pass
|
||||
|
||||
@when("@:1.2")
|
||||
def install(self, spec, prefix):
|
||||
install_tree(".", prefix)
|
||||
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
Additional examples
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
When writing new packages, it often helps to see examples of existing packages.
|
||||
Here is an incomplete list of existing Spack packages that have changed build
|
||||
systems before:
|
||||
|
||||
================ ===================== ================
|
||||
Package Previous Build System New Build System
|
||||
================ ===================== ================
|
||||
amber custom CMake
|
||||
arpack-ng Autotools CMake
|
||||
atk Autotools Meson
|
||||
blast None Autotools
|
||||
dyninst Autotools CMake
|
||||
evtgen Autotools CMake
|
||||
fish Autotools CMake
|
||||
gdk-pixbuf Autotools Meson
|
||||
glib Autotools Meson
|
||||
glog Autotools CMake
|
||||
gmt Autotools CMake
|
||||
gtkplus Autotools Meson
|
||||
hpl Makefile Autotools
|
||||
interproscan Perl Maven
|
||||
jasper Autotools CMake
|
||||
kahip SCons CMake
|
||||
kokkos Makefile CMake
|
||||
kokkos-kernels Makefile CMake
|
||||
leveldb Makefile CMake
|
||||
libdrm Autotools Meson
|
||||
libjpeg-turbo Autotools CMake
|
||||
mesa Autotools Meson
|
||||
metis None CMake
|
||||
mpifileutils Autotools CMake
|
||||
muparser Autotools CMake
|
||||
mxnet Makefile CMake
|
||||
nest Autotools CMake
|
||||
neuron Autotools CMake
|
||||
nsimd CMake nsconfig
|
||||
opennurbs Makefile CMake
|
||||
optional-lite None CMake
|
||||
plasma Makefile CMake
|
||||
preseq Makefile Autotools
|
||||
protobuf Autotools CMake
|
||||
py-pygobject Autotools Python
|
||||
singularity Autotools Makefile
|
||||
span-lite None CMake
|
||||
ssht Makefile CMake
|
||||
string-view-lite None CMake
|
||||
superlu Makefile CMake
|
||||
superlu-dist Makefile CMake
|
||||
uncrustify Autotools CMake
|
||||
================ ===================== ================
|
||||
|
||||
Packages that support multiple build systems can be a bit confusing to write.
|
||||
Don't hesitate to open an issue or draft pull request and ask for advice from
|
||||
other Spack developers!
|
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||
.. Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
|
||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||
.. Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
|
||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
@@ -120,6 +120,8 @@ so ``PerlPackage`` contains:
|
||||
|
||||
extends('perl')
|
||||
|
||||
depends_on('perl', type=('build', 'run'))
|
||||
|
||||
|
||||
If your package requires a specific version of Perl, you should
|
||||
specify this.
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||
.. Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
|
||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
@@ -108,19 +108,6 @@ override the ``qmake_args`` method like so:
|
||||
|
||||
This method can be used to pass flags as well as variables.
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
``*.pro`` file in a sub-directory
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
If the ``*.pro`` file used to tell QMake how to build the package is
|
||||
found in a sub-directory, you can tell Spack to run all phases in this
|
||||
sub-directory by adding the following to the package:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
build_directory = 'src'
|
||||
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
External documentation
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
@@ -1,46 +0,0 @@
|
||||
.. Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
|
||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
|
||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
.. _racketpackage:
|
||||
|
||||
-------------
|
||||
RacketPackage
|
||||
-------------
|
||||
|
||||
Much like Python, Racket packages and modules have their own special build system.
|
||||
To learn more about the specifics of Racket package system, please refer to the
|
||||
`Racket Docs <https://docs.racket-lang.org/pkg/cmdline.html>`_.
|
||||
|
||||
^^^^^^
|
||||
Phases
|
||||
^^^^^^
|
||||
|
||||
The ``RacketPackage`` base class provides an ``install`` phase that
|
||||
can be overridden, corresponding to the use of:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ raco pkg install
|
||||
|
||||
^^^^^^^
|
||||
Caveats
|
||||
^^^^^^^
|
||||
|
||||
In principle, ``raco`` supports a second, ``setup`` phase; however, we have not
|
||||
implemented this separately, as in normal circumstances, ``install`` also handles
|
||||
running ``setup`` automatically.
|
||||
|
||||
Unlike Python, Racket currently on supports two installation scopes for packages, user
|
||||
or system, and keeps a registry of installed packages at each scope in its configuration files.
|
||||
This means we can't simply compose a "``RACKET_PATH``" environment variable listing all of the
|
||||
places packages are installed, and update this at will.
|
||||
|
||||
Unfortunately this means that all currently installed packages which extend Racket via ``raco pkg install``
|
||||
are accessible whenever Racket is accessible.
|
||||
|
||||
Additionally, because Spack does not implement uninstall hooks, uninstalling a Spack ``rkt-`` package
|
||||
will have no effect on the ``raco`` installed packages visible to your Racket installation.
|
||||
Instead, you must manually run ``raco pkg remove`` to keep the two package managers in a mutually
|
||||
consistent state.
|
@@ -1,122 +0,0 @@
|
||||
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
|
||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
.. _rocmpackage:
|
||||
|
||||
-----------
|
||||
ROCmPackage
|
||||
-----------
|
||||
|
||||
The ``ROCmPackage`` is not a build system but a helper package. Like ``CudaPackage``,
|
||||
it provides standard variants, dependencies, and conflicts to facilitate building
|
||||
packages using GPUs though for AMD in this case.
|
||||
|
||||
You can find the source for this package (and suggestions for setting up your
|
||||
``compilers.yaml`` and ``packages.yaml`` files) at
|
||||
`<https://github.com/spack/spack/blob/develop/lib/spack/spack/build_systems/rocm.py>`__.
|
||||
|
||||
^^^^^^^^
|
||||
Variants
|
||||
^^^^^^^^
|
||||
|
||||
This package provides the following variants:
|
||||
|
||||
* **rocm**
|
||||
|
||||
This variant is used to enable/disable building with ``rocm``.
|
||||
The default is disabled (or ``False``).
|
||||
|
||||
* **amdgpu_target**
|
||||
|
||||
This variant supports the optional specification of the AMD GPU architecture.
|
||||
Valid values are the names of the GPUs (e.g., ``gfx701``), which are maintained
|
||||
in the ``amdgpu_targets`` property.
|
||||
|
||||
^^^^^^^^^^^^
|
||||
Dependencies
|
||||
^^^^^^^^^^^^
|
||||
|
||||
This package defines basic ``rocm`` dependencies, including ``llvm`` and ``hip``.
|
||||
|
||||
^^^^^^^^^
|
||||
Conflicts
|
||||
^^^^^^^^^
|
||||
|
||||
Conflicts are used to prevent builds with known bugs or issues. This package
|
||||
already requires that the ``amdgpu_target`` always be specified for ``rocm``
|
||||
builds. It also defines a conflict that prevents builds with an ``amdgpu_target``
|
||||
when ``rocm`` is disabled.
|
||||
|
||||
Refer to `Conflicts <https://spack.readthedocs.io/en/latest/packaging_guide.html?highlight=conflicts#conflicts>`__
|
||||
for more information on package conflicts.
|
||||
|
||||
^^^^^^^
|
||||
Methods
|
||||
^^^^^^^
|
||||
|
||||
This package provides one custom helper method, which is used to build
|
||||
standard AMD hip compiler flags.
|
||||
|
||||
**hip_flags**
|
||||
|
||||
This built-in static method returns the appropriately formatted
|
||||
``--amdgpu-target`` build option for ``hipcc``.
|
||||
|
||||
This method must be explicitly called when you are creating the
|
||||
arguments for your build in order to use the values.
|
||||
|
||||
^^^^^
|
||||
Usage
|
||||
^^^^^
|
||||
|
||||
This helper package can be added to your package by adding it as a base
|
||||
class of your package. For example, you can add it to your
|
||||
:ref:`CMakePackage <cmakepackage>`-based package as follows:
|
||||
|
||||
.. code-block:: python
|
||||
:emphasize-lines: 1,3-7,14-25
|
||||
|
||||
class MyRocmPackage(CMakePackage, ROCmPackage):
|
||||
...
|
||||
# Ensure +rocm and amdgpu_targets are passed to dependencies
|
||||
depends_on('mydeppackage', when='+rocm')
|
||||
for val in ROCmPackage.amdgpu_targets:
|
||||
depends_on('mydeppackage amdgpu_target={0}'.format(val),
|
||||
when='amdgpu_target={0}'.format(val))
|
||||
...
|
||||
|
||||
def cmake_args(self):
|
||||
spec = self.spec
|
||||
args = []
|
||||
...
|
||||
if '+rocm' in spec:
|
||||
# Set up the hip macros needed by the build
|
||||
args.extend([
|
||||
'-DENABLE_HIP=ON',
|
||||
'-DHIP_ROOT_DIR={0}'.format(spec['hip'].prefix)])
|
||||
rocm_archs = spec.variants['amdgpu_target'].value
|
||||
if 'none' not in rocm_archs:
|
||||
args.append('-DHIP_HIPCC_FLAGS=--amdgpu-target={0}'
|
||||
.format(",".join(rocm_archs)))
|
||||
else:
|
||||
# Ensure build with hip is disabled
|
||||
args.append('-DENABLE_HIP=OFF')
|
||||
...
|
||||
return args
|
||||
...
|
||||
|
||||
assuming only on the ``ENABLE_HIP``, ``HIP_ROOT_DIR``, and ``HIP_HIPCC_FLAGS``
|
||||
macros are required to be set and the only dependency needing rocm options
|
||||
is ``mydeppackage``. You will need to customize the flags as needed for your
|
||||
build.
|
||||
|
||||
This example also illustrates how to check for the ``rocm`` variant using
|
||||
``self.spec`` and how to retrieve the ``amdgpu_target`` variant's value
|
||||
using ``self.spec.variants['amdgpu_target'].value``.
|
||||
|
||||
All five packages using ``ROCmPackage`` as of January 2021 also use the
|
||||
:ref:`CudaPackage <cudapackage>`. So it is worth looking at those packages
|
||||
to get ideas for creating a package that can support both ``cuda`` and
|
||||
``rocm``.
|
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||
.. Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
|
||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
@@ -79,14 +79,12 @@ Description
|
||||
The first thing you'll need to add to your new package is a description.
|
||||
The top of the homepage for ``caret`` lists the following description:
|
||||
|
||||
Classification and Regression Training
|
||||
caret: Classification and Regression Training
|
||||
|
||||
Misc functions for training and plotting classification and regression models.
|
||||
|
||||
The first line is a short description (title) and the second line is a long
|
||||
description. In this case the description is only one line but often the
|
||||
description is several lines. Spack makes use of both short and long
|
||||
descriptions and convention is to use both when creating an R package.
|
||||
You can either use the short description (first line), long description
|
||||
(second line), or both depending on what you feel is most appropriate.
|
||||
|
||||
^^^^^^^^
|
||||
Homepage
|
||||
@@ -126,67 +124,6 @@ If you only specify the URL for the latest release, your package will
|
||||
no longer be able to fetch that version as soon as a new release comes
|
||||
out. To get around this, add the archive directory as a ``list_url``.
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
Bioconductor packages
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Bioconductor packages are set up in a similar way to CRAN packages, but there
|
||||
are some very important distinctions. Bioconductor packages can be found at:
|
||||
https://bioconductor.org/. Bioconductor packages are R packages and so follow
|
||||
the same packaging scheme as CRAN packages. What is different is that
|
||||
Bioconductor itself is versioned and released. This scheme, using the
|
||||
Bioconductor package installer, allows further specification of the minimum
|
||||
version of R as well as further restrictions on the dependencies between
|
||||
packages than what is possible with the native R packaging system. Spack can
|
||||
not replicate these extra features and thus Bioconductor packages in Spack need
|
||||
to be managed as a group during updates in order to maintain package
|
||||
consistency with Bioconductor itself.
|
||||
|
||||
Another key difference is that, while previous versions of packages are
|
||||
available, they are not available from a site that can be programmatically set,
|
||||
thus a ``list_url`` attribute can not be used. However, each package is also
|
||||
available in a git repository, with branches corresponding to each Bioconductor
|
||||
release. Thus, it is always possible to retrieve the version of any package
|
||||
corresponding to a Bioconductor release simply by fetching the branch that
|
||||
corresponds to the Bioconductor release of the package repository. For this
|
||||
reason, spack Bioconductor R packages use the git repository, with the commit
|
||||
of the respective branch used in the ``version()`` attribute of the package.
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
cran and bioc attributes
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Much like the ``pypi`` attribute for python packages, due to the fact that R
|
||||
packages are obtained from specific repositories, it is possible to set up shortcut
|
||||
attributes that can be used to set ``homepage``, ``url``, ``list_url``, and
|
||||
``git``. For example, the following ``cran`` attribute:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
cran = 'caret'
|
||||
|
||||
is equivalent to:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
homepage = 'https://cloud.r-project.org/package=caret'
|
||||
url = 'https://cloud.r-project.org/src/contrib/caret_6.0-86.tar.gz'
|
||||
list_url = 'https://cloud.r-project.org/src/contrib/Archive/caret'
|
||||
|
||||
Likewise, the following ``bioc`` attribute:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
bioc = 'BiocVersion'
|
||||
|
||||
is equivalent to:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
homepage = 'https://bioconductor.org/packages/BiocVersion/'
|
||||
git = 'https://git.bioconductor.org/packages/BiocVersion'
|
||||
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Build system dependencies
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@@ -201,6 +138,7 @@ every R package needs this, the ``RPackage`` base class contains:
|
||||
.. code-block:: python
|
||||
|
||||
extends('r')
|
||||
depends_on('r', type=('build', 'run'))
|
||||
|
||||
|
||||
Take a close look at the homepage for ``caret``. If you look at the
|
||||
@@ -219,7 +157,7 @@ R dependencies
|
||||
R packages are often small and follow the classic Unix philosophy
|
||||
of doing one thing well. They are modular and usually depend on
|
||||
several other packages. You may find a single package with over a
|
||||
hundred dependencies. Luckily, R packages are well-documented
|
||||
hundred dependencies. Luckily, CRAN packages are well-documented
|
||||
and list all of their dependencies in the following sections:
|
||||
|
||||
* Depends
|
||||
@@ -360,8 +298,8 @@ like so:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
def configure_args(self):
|
||||
mpi_name = self.spec['mpi'].name
|
||||
def configure_args(self, spec, prefix):
|
||||
mpi_name = spec['mpi'].name
|
||||
|
||||
# The type of MPI. Supported values are:
|
||||
# OPENMPI, LAM, MPICH, MPICH2, or CRAY
|
||||
|
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||
.. Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
|
||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
@@ -12,172 +12,5 @@ RubyPackage
|
||||
Like Perl, Python, and R, Ruby has its own build system for
|
||||
installing Ruby gems.
|
||||
|
||||
^^^^^^
|
||||
Phases
|
||||
^^^^^^
|
||||
|
||||
The ``RubyPackage`` base class provides the following phases that
|
||||
can be overridden:
|
||||
|
||||
#. ``build`` - build everything needed to install
|
||||
#. ``install`` - install everything from build directory
|
||||
|
||||
For packages that come with a ``*.gemspec`` file, these phases run:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ gem build *.gemspec
|
||||
$ gem install *.gem
|
||||
|
||||
|
||||
For packages that come with a ``Rakefile`` file, these phases run:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ rake package
|
||||
$ gem install *.gem
|
||||
|
||||
|
||||
For packages that come pre-packaged as a ``*.gem`` file, the build
|
||||
phase is skipped and the install phase runs:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ gem install *.gem
|
||||
|
||||
|
||||
These are all standard ``gem`` commands and can be found by running:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ gem help commands
|
||||
|
||||
|
||||
For packages that only distribute ``*.gem`` files, these files can be
|
||||
downloaded with the ``expand=False`` option in the ``version`` directive.
|
||||
The build phase will be automatically skipped.
|
||||
|
||||
^^^^^^^^^^^^^^^
|
||||
Important files
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
When building from source, Ruby packages can be identified by the
|
||||
presence of any of the following files:
|
||||
|
||||
* ``*.gemspec``
|
||||
* ``Rakefile``
|
||||
* ``setup.rb`` (not yet supported)
|
||||
|
||||
However, not all Ruby packages are released as source code. Some are only
|
||||
released as ``*.gem`` files. These files can be extracted using:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ gem unpack *.gem
|
||||
|
||||
|
||||
^^^^^^^^^^^
|
||||
Description
|
||||
^^^^^^^^^^^
|
||||
|
||||
The ``*.gemspec`` file may contain something like:
|
||||
|
||||
.. code-block:: ruby
|
||||
|
||||
summary = 'An implementation of the AsciiDoc text processor and publishing toolchain'
|
||||
description = 'A fast, open source text processor and publishing toolchain for converting AsciiDoc content to HTML 5, DocBook 5, and other formats.'
|
||||
|
||||
|
||||
Either of these can be used for the description of the Spack package.
|
||||
|
||||
^^^^^^^^
|
||||
Homepage
|
||||
^^^^^^^^
|
||||
|
||||
The ``*.gemspec`` file may contain something like:
|
||||
|
||||
.. code-block:: ruby
|
||||
|
||||
homepage = 'https://asciidoctor.org'
|
||||
|
||||
|
||||
This should be used as the official homepage of the Spack package.
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Build system dependencies
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
All Ruby packages require Ruby at build and run-time. For this reason,
|
||||
the base class contains:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
extends('ruby')
|
||||
|
||||
|
||||
The ``*.gemspec`` file may contain something like:
|
||||
|
||||
.. code-block:: ruby
|
||||
|
||||
required_ruby_version = '>= 2.3.0'
|
||||
|
||||
|
||||
This can be added to the Spack package using:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
depends_on('ruby@2.3.0:', type=('build', 'run'))
|
||||
|
||||
|
||||
^^^^^^^^^^^^^^^^^
|
||||
Ruby dependencies
|
||||
^^^^^^^^^^^^^^^^^
|
||||
|
||||
When you install a package with ``gem``, it reads the ``*.gemspec``
|
||||
file in order to determine the dependencies of the package.
|
||||
If the dependencies are not yet installed, ``gem`` downloads them
|
||||
and installs them for you. This may sound convenient, but Spack
|
||||
cannot rely on this behavior for two reasons:
|
||||
|
||||
#. Spack needs to be able to install packages on air-gapped networks.
|
||||
|
||||
If there is no internet connection, ``gem`` can't download the
|
||||
package dependencies. By explicitly listing every dependency in
|
||||
the ``package.py``, Spack knows what to download ahead of time.
|
||||
|
||||
#. Duplicate installations of the same dependency may occur.
|
||||
|
||||
Spack supports *activation* of Ruby extensions, which involves
|
||||
symlinking the package installation prefix to the Ruby installation
|
||||
prefix. If your package is missing a dependency, that dependency
|
||||
will be installed to the installation directory of the same package.
|
||||
If you try to activate the package + dependency, it may cause a
|
||||
problem if that package has already been activated.
|
||||
|
||||
For these reasons, you must always explicitly list all dependencies.
|
||||
Although the documentation may list the package's dependencies,
|
||||
often the developers assume people will use ``gem`` and won't have to
|
||||
worry about it. Always check the ``*.gemspec`` file to find the true
|
||||
dependencies.
|
||||
|
||||
Check for the following clues in the ``*.gemspec`` file:
|
||||
|
||||
* ``add_runtime_dependency``
|
||||
|
||||
These packages are required for installation.
|
||||
|
||||
* ``add_dependency``
|
||||
|
||||
This is an alias for ``add_runtime_dependency``
|
||||
|
||||
* ``add_development_dependency``
|
||||
|
||||
These packages are optional dependencies used for development.
|
||||
They should not be added as dependencies of the package.
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
External documentation
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
For more information on Ruby packaging, see:
|
||||
https://guides.rubygems.org/
|
||||
This build system is a work-in-progress. See
|
||||
https://github.com/spack/spack/pull/3127 for more information.
|
||||
|
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||
.. Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
|
||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||
.. Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
|
||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
@@ -51,8 +51,10 @@ Build system dependencies
|
||||
``SIPPackage`` requires several dependencies. Python is needed to run
|
||||
the ``configure.py`` build script, and to run the resulting Python
|
||||
libraries. Qt is needed to provide the ``qmake`` command. SIP is also
|
||||
needed to build the package. All of these dependencies are automatically
|
||||
added via the base class
|
||||
needed to build the package. SIP is an unusual dependency in that it
|
||||
must be installed in the same installation directory as the package,
|
||||
so instead of a ``depends_on``, we use a ``resource``. All of these
|
||||
dependencies are automatically added via the base class
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
@@ -60,7 +62,11 @@ added via the base class
|
||||
|
||||
depends_on('qt', type='build')
|
||||
|
||||
depends_on('py-sip', type='build')
|
||||
resource(name='sip',
|
||||
url='https://www.riverbankcomputing.com/static/Downloads/sip/4.19.18/sip-4.19.18.tar.gz',
|
||||
sha256='c0bd863800ed9b15dcad477c4017cdb73fa805c25908b0240564add74d697e1e',
|
||||
destination='.')
|
||||
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Passing arguments to ``configure.py``
|
||||
@@ -93,17 +99,10 @@ in the site-packages directory:
|
||||
$ python
|
||||
>>> import setuptools
|
||||
>>> setuptools.find_packages()
|
||||
[
|
||||
'PyQt5', 'PyQt5.QtCore', 'PyQt5.QtGui', 'PyQt5.QtHelp',
|
||||
'PyQt5.QtMultimedia', 'PyQt5.QtMultimediaWidgets', 'PyQt5.QtNetwork',
|
||||
'PyQt5.QtOpenGL', 'PyQt5.QtPrintSupport', 'PyQt5.QtQml',
|
||||
'PyQt5.QtQuick', 'PyQt5.QtSvg', 'PyQt5.QtTest', 'PyQt5.QtWebChannel',
|
||||
'PyQt5.QtWebSockets', 'PyQt5.QtWidgets', 'PyQt5.QtXml',
|
||||
'PyQt5.QtXmlPatterns'
|
||||
]
|
||||
['QtPy5']
|
||||
|
||||
|
||||
Large, complex packages like ``py-pyqt5`` will return a long list of
|
||||
Large, complex packages like ``QtPy5`` will return a long list of
|
||||
packages, while other packages may return an empty list. These packages
|
||||
only install a single ``foo.py`` file. In Python packaging lingo,
|
||||
a "package" is a directory containing files like:
|
||||
@@ -115,25 +114,21 @@ a "package" is a directory containing files like:
|
||||
foo/baz.py
|
||||
|
||||
|
||||
whereas a "module" is a single Python file.
|
||||
|
||||
The ``SIPPackage`` base class automatically detects these module
|
||||
names for you. If, for whatever reason, the module names detected
|
||||
are wrong, you can provide the names yourself by overriding
|
||||
``import_modules`` like so:
|
||||
whereas a "module" is a single Python file. Since ``find_packages``
|
||||
only returns packages, you'll have to determine the correct module
|
||||
names yourself. You can now add these packages and modules to the
|
||||
package like so:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
import_modules = ['PyQt5']
|
||||
|
||||
|
||||
These tests often catch missing dependencies and non-RPATHed
|
||||
libraries. Make sure not to add modules/packages containing the word
|
||||
"test", as these likely won't end up in the installation directory,
|
||||
or may require test dependencies like pytest to be installed.
|
||||
When you run ``spack install --test=root py-pyqt5``, Spack will attempt
|
||||
to import the ``PyQt5`` module after installation.
|
||||
|
||||
These tests can be triggered by running ``spack install --test=root``
|
||||
or by running ``spack test run`` after the installation has finished.
|
||||
These tests most often catch missing dependencies and non-RPATHed
|
||||
libraries.
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
External documentation
|
||||
|
@@ -1,55 +0,0 @@
|
||||
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
|
||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
.. _sourceforgepackage:
|
||||
|
||||
------------------
|
||||
SourceforgePackage
|
||||
------------------
|
||||
|
||||
``SourceforgePackage`` is a
|
||||
`mixin-class <https://en.wikipedia.org/wiki/Mixin>`_. It automatically
|
||||
sets the URL based on a list of Sourceforge mirrors listed in
|
||||
`sourceforge_mirror_path`, which defaults to a half dozen known mirrors.
|
||||
Refer to the package source
|
||||
(`<https://github.com/spack/spack/blob/develop/lib/spack/spack/build_systems/sourceforge.py>`__) for the current list of mirrors used by Spack.
|
||||
|
||||
|
||||
^^^^^^^
|
||||
Methods
|
||||
^^^^^^^
|
||||
|
||||
This package provides a method for populating mirror URLs.
|
||||
|
||||
**urls**
|
||||
|
||||
This method returns a list of possible URLs for package source.
|
||||
It is decorated with `property` so its results are treated as
|
||||
a package attribute.
|
||||
|
||||
Refer to
|
||||
`<https://spack.readthedocs.io/en/latest/packaging_guide.html#mirrors-of-the-main-url>`__
|
||||
for information on how Spack uses the `urls` attribute during
|
||||
fetching.
|
||||
|
||||
^^^^^
|
||||
Usage
|
||||
^^^^^
|
||||
|
||||
This helper package can be added to your package by adding it as a base
|
||||
class of your package and defining the relative location of an archive
|
||||
file for one version of your software.
|
||||
|
||||
.. code-block:: python
|
||||
:emphasize-lines: 1,3
|
||||
|
||||
class MyPackage(AutotoolsPackage, SourceforgePackage):
|
||||
...
|
||||
sourceforge_mirror_path = "my-package/mypackage.1.0.0.tar.gz"
|
||||
...
|
||||
|
||||
Over 40 packages are using ``SourceforcePackage`` this mix-in as of
|
||||
July 2022 so there are multiple packages to choose from if you want
|
||||
to see a real example.
|
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||
.. Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
|
||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
@@ -47,9 +47,8 @@ Each phase provides a ``<phase>`` function that runs:
|
||||
|
||||
where ``<jobs>`` is the number of parallel jobs to build with. Each phase
|
||||
also has a ``<phase_args>`` function that can pass arguments to this call.
|
||||
All of these functions are empty. The ``configure`` phase
|
||||
automatically adds ``--prefix=/path/to/installation/prefix``, so you
|
||||
don't need to add that in the ``configure_args``.
|
||||
All of these functions are empty except for the ``configure_args``
|
||||
function, which passes ``--prefix=/path/to/installation/prefix``.
|
||||
|
||||
^^^^^^^
|
||||
Testing
|
||||
|
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||
.. Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
|
||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
@@ -1,4 +1,4 @@
|
||||
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
@@ -17,23 +17,19 @@
|
||||
# All configuration values have a default; values that are commented out
|
||||
# serve to show the default.
|
||||
|
||||
import sys
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
from glob import glob
|
||||
|
||||
from docutils.statemachine import StringList
|
||||
from sphinx.domains.python import PythonDomain
|
||||
from sphinx.ext.apidoc import main as sphinx_apidoc
|
||||
from sphinx.parsers import RSTParser
|
||||
|
||||
# -- Spack customizations -----------------------------------------------------
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
sys.path.insert(0, os.path.abspath('_spack_root/lib/spack/external'))
|
||||
sys.path.insert(0, os.path.abspath('_spack_root/lib/spack/external/pytest-fallback'))
|
||||
|
||||
if sys.version_info[0] < 3:
|
||||
sys.path.insert(
|
||||
@@ -85,6 +81,7 @@
|
||||
#
|
||||
# Disable duplicate cross-reference warnings.
|
||||
#
|
||||
from sphinx.domains.python import PythonDomain
|
||||
class PatchedPythonDomain(PythonDomain):
|
||||
def resolve_xref(self, env, fromdocname, builder, typ, target, node, contnode):
|
||||
if 'refspecific' in node:
|
||||
@@ -92,37 +89,21 @@ def resolve_xref(self, env, fromdocname, builder, typ, target, node, contnode):
|
||||
return super(PatchedPythonDomain, self).resolve_xref(
|
||||
env, fromdocname, builder, typ, target, node, contnode)
|
||||
|
||||
#
|
||||
# Disable tabs to space expansion in code blocks
|
||||
# since Makefiles require tabs.
|
||||
#
|
||||
class NoTabExpansionRSTParser(RSTParser):
|
||||
def parse(self, inputstring, document):
|
||||
if isinstance(inputstring, str):
|
||||
lines = inputstring.splitlines()
|
||||
inputstring = StringList(lines, document.current_source)
|
||||
super().parse(inputstring, document)
|
||||
|
||||
def setup(sphinx):
|
||||
sphinx.add_domain(PatchedPythonDomain, override=True)
|
||||
sphinx.add_source_parser(NoTabExpansionRSTParser, override=True)
|
||||
|
||||
# -- General configuration -----------------------------------------------------
|
||||
|
||||
# If your documentation needs a minimal Sphinx version, state it here.
|
||||
needs_sphinx = '3.4'
|
||||
needs_sphinx = '1.8'
|
||||
|
||||
# Add any Sphinx extension module names here, as strings. They can be extensions
|
||||
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
|
||||
extensions = [
|
||||
'sphinx.ext.autodoc',
|
||||
'sphinx.ext.graphviz',
|
||||
'sphinx.ext.intersphinx',
|
||||
'sphinx.ext.napoleon',
|
||||
'sphinx.ext.todo',
|
||||
'sphinx.ext.viewcode',
|
||||
'sphinxcontrib.programoutput',
|
||||
]
|
||||
extensions = ['sphinx.ext.autodoc',
|
||||
'sphinx.ext.graphviz',
|
||||
'sphinx.ext.napoleon',
|
||||
'sphinx.ext.todo',
|
||||
'sphinxcontrib.programoutput']
|
||||
|
||||
# Set default graphviz options
|
||||
graphviz_dot_args = [
|
||||
@@ -147,7 +128,7 @@ def setup(sphinx):
|
||||
|
||||
# General information about the project.
|
||||
project = u'Spack'
|
||||
copyright = u'2013-2021, Lawrence Livermore National Laboratory.'
|
||||
copyright = u'2013-2019, Lawrence Livermore National Laboratory.'
|
||||
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
# |version| and |release|, also used in various other places throughout the
|
||||
@@ -155,7 +136,6 @@ def setup(sphinx):
|
||||
#
|
||||
# The short X.Y version.
|
||||
import spack
|
||||
|
||||
version = '.'.join(str(s) for s in spack.spack_version_info[:2])
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = spack.spack_version
|
||||
@@ -181,20 +161,6 @@ def setup(sphinx):
|
||||
# directories to ignore when looking for source files.
|
||||
exclude_patterns = ['_build', '_spack_root', '.spack-env']
|
||||
|
||||
nitpicky = True
|
||||
nitpick_ignore = [
|
||||
# Python classes that intersphinx is unable to resolve
|
||||
('py:class', 'argparse.HelpFormatter'),
|
||||
('py:class', 'contextlib.contextmanager'),
|
||||
('py:class', 'module'),
|
||||
('py:class', '_io.BufferedReader'),
|
||||
('py:class', 'unittest.case.TestCase'),
|
||||
('py:class', '_frozen_importlib_external.SourceFileLoader'),
|
||||
# Spack classes that are private and we don't want to expose
|
||||
('py:class', 'spack.provider_index._IndexBase'),
|
||||
('py:class', 'spack.repo._PrependFileLoader'),
|
||||
]
|
||||
|
||||
# The reST default role (used for this markup: `text`) to use for all documents.
|
||||
#default_role = None
|
||||
|
||||
@@ -213,8 +179,7 @@ def setup(sphinx):
|
||||
# We use our own extension of the default style with a few modifications
|
||||
from pygments.style import Style
|
||||
from pygments.styles.default import DefaultStyle
|
||||
from pygments.token import Comment, Generic, Text
|
||||
|
||||
from pygments.token import Generic, Comment, Text
|
||||
|
||||
class SpackStyle(DefaultStyle):
|
||||
styles = DefaultStyle.styles.copy()
|
||||
@@ -223,7 +188,6 @@ class SpackStyle(DefaultStyle):
|
||||
styles[Generic.Prompt] = "bold #346ec9"
|
||||
|
||||
import pkg_resources
|
||||
|
||||
dist = pkg_resources.Distribution(__file__)
|
||||
sys.path.append('.') # make 'conf' module findable
|
||||
ep = pkg_resources.EntryPoint.parse('spack = conf:SpackStyle', dist=dist)
|
||||
@@ -389,11 +353,3 @@ class SpackStyle(DefaultStyle):
|
||||
|
||||
# How to display URL addresses: 'footnote', 'no', or 'inline'.
|
||||
#texinfo_show_urls = 'footnote'
|
||||
|
||||
|
||||
# -- Extension configuration -------------------------------------------------
|
||||
|
||||
# sphinx.ext.intersphinx
|
||||
intersphinx_mapping = {
|
||||
"python": ("https://docs.python.org/3", None),
|
||||
}
|
||||
|
@@ -1,13 +1,13 @@
|
||||
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||
.. Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
|
||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
.. _config-yaml:
|
||||
|
||||
============================
|
||||
Spack Settings (config.yaml)
|
||||
============================
|
||||
==============
|
||||
Basic Settings
|
||||
==============
|
||||
|
||||
Spack's basic configuration options are set in ``config.yaml``. You can
|
||||
see the default settings by looking at
|
||||
@@ -72,6 +72,21 @@ used to configure module names.
|
||||
packages have been installed will prevent Spack from being
|
||||
able to find the old installation directories.
|
||||
|
||||
--------------------
|
||||
``module_roots``
|
||||
--------------------
|
||||
|
||||
Controls where Spack installs generated module files. You can customize
|
||||
the location for each type of module. e.g.:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
module_roots:
|
||||
tcl: $spack/share/spack/modules
|
||||
lmod: $spack/share/spack/lmod
|
||||
|
||||
See :ref:`modules` for details.
|
||||
|
||||
--------------------
|
||||
``build_stage``
|
||||
--------------------
|
||||
@@ -84,7 +99,7 @@ username is not already in the path, Spack will append the value of ``$user`` to
|
||||
the selected ``build_stage`` path.
|
||||
|
||||
.. warning:: We highly recommend specifying ``build_stage`` paths that
|
||||
distinguish between staging and other activities to ensure
|
||||
distinguish between staging and other activities to ensure
|
||||
``spack clean`` does not inadvertently remove unrelated files.
|
||||
Spack prepends ``spack-stage-`` to temporary staging directory names to
|
||||
reduce this risk. Using a combination of ``spack`` and or ``stage`` in
|
||||
@@ -187,30 +202,28 @@ of builds.
|
||||
|
||||
Unless overridden in a package or on the command line, Spack builds all
|
||||
packages in parallel. The default parallelism is equal to the number of
|
||||
cores available to the process, up to 16 (the default of ``build_jobs``).
|
||||
For a build system that uses Makefiles, this ``spack install`` runs:
|
||||
cores on your machine, up to 16. Parallelism cannot exceed the number of
|
||||
cores available on the host. For a build system that uses Makefiles, this
|
||||
means running:
|
||||
|
||||
- ``make -j<build_jobs>``, when ``build_jobs`` is less than the number of
|
||||
cores available
|
||||
cores on the machine
|
||||
- ``make -j<ncores>``, when ``build_jobs`` is greater or equal to the
|
||||
number of cores available
|
||||
number of cores on the machine
|
||||
|
||||
If you work on a shared login node or have a strict ulimit, it may be
|
||||
necessary to set the default to a lower value. By setting ``build_jobs``
|
||||
to 4, for example, commands like ``spack install`` will run ``make -j4``
|
||||
instead of hogging every core. To build all software in serial,
|
||||
set ``build_jobs`` to 1.
|
||||
instead of hogging every core.
|
||||
|
||||
Note that specifying the number of jobs on the command line always takes
|
||||
priority, so that ``spack install -j<n>`` always runs `make -j<n>`, even
|
||||
when that exceeds the number of cores available.
|
||||
To build all software in serial, set ``build_jobs`` to 1.
|
||||
|
||||
--------------------
|
||||
``ccache``
|
||||
--------------------
|
||||
|
||||
When set to ``true`` Spack will use ccache to cache compiles. This is
|
||||
useful specifically in two cases: (1) when using ``spack dev-build``, and (2)
|
||||
useful specifically in two cases: (1) when using ``spack setup``, and (2)
|
||||
when building the same package with many different variants. The default is
|
||||
``false``.
|
||||
|
||||
@@ -244,16 +257,3 @@ and ld.so will ONLY search for dependencies in the ``RUNPATH`` of
|
||||
the loading object.
|
||||
|
||||
DO NOT MIX the two options within the same install tree.
|
||||
|
||||
----------------------
|
||||
``terminal_title``
|
||||
----------------------
|
||||
|
||||
By setting this option to ``true``, Spack will update the terminal's title to
|
||||
provide information about its current progress as well as the current and
|
||||
total package numbers.
|
||||
|
||||
To work properly, this requires your terminal to reset its title after
|
||||
Spack has finished its work, otherwise Spack's status information will
|
||||
remain in the terminal's title indefinitely. Most terminals should already
|
||||
be set up this way and clear Spack's status information.
|
||||
|
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||
.. Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
|
||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
@@ -13,16 +13,12 @@ Spack has many configuration files. Here is a quick list of them, in
|
||||
case you want to skip directly to specific docs:
|
||||
|
||||
* :ref:`compilers.yaml <compiler-config>`
|
||||
* :ref:`concretizer.yaml <concretizer-options>`
|
||||
* :ref:`config.yaml <config-yaml>`
|
||||
* :ref:`mirrors.yaml <mirrors>`
|
||||
* :ref:`modules.yaml <modules>`
|
||||
* :ref:`packages.yaml <build-settings>`
|
||||
* :ref:`repos.yaml <repositories>`
|
||||
|
||||
You can also add any of these as inline configuration in ``spack.yaml``
|
||||
in an :ref:`environment <environment-configuration>`.
|
||||
|
||||
-----------
|
||||
YAML Format
|
||||
-----------
|
||||
@@ -37,6 +33,8 @@ Here is an example ``config.yaml`` file:
|
||||
|
||||
config:
|
||||
install_tree: $spack/opt/spack
|
||||
module_roots:
|
||||
lmod: $spack/share/spack/lmod
|
||||
build_stage:
|
||||
- $tempdir/$user/spack-stage
|
||||
- ~/.spack/stage
|
||||
@@ -80,13 +78,6 @@ are six configuration scopes. From lowest to highest:
|
||||
If multiple scopes are listed on the command line, they are ordered
|
||||
from lowest to highest precedence.
|
||||
|
||||
#. **environment**: When using Spack :ref:`environments`, Spack reads
|
||||
additional configuration from the environment file. See
|
||||
:ref:`environment-configuration` for further details on these
|
||||
scopes. Environment scopes can be referenced from the command line
|
||||
as ``env:name`` (to reference environment ``foo``, use
|
||||
``env:foo``).
|
||||
|
||||
#. **command line**: Build settings specified on the command line take
|
||||
precedence over all other scopes.
|
||||
|
||||
@@ -201,11 +192,10 @@ with MPICH. You can create different configuration scopes for use with
|
||||
Platform-specific Scopes
|
||||
------------------------
|
||||
|
||||
For each scope above (excluding environment scopes), there can also be
|
||||
platform-specific settings. For example, on most platforms, GCC is
|
||||
the preferred compiler. However, on macOS (darwin), Clang often works
|
||||
for more packages, and is set as the default compiler. This
|
||||
configuration is set in
|
||||
For each scope above, there can also be platform-specific settings.
|
||||
For example, on most platforms, GCC is the preferred compiler.
|
||||
However, on macOS (darwin), Clang often works for more packages,
|
||||
and is set as the default compiler. This configuration is set in
|
||||
``$(prefix)/etc/spack/defaults/darwin/packages.yaml``. It will take
|
||||
precedence over settings in the ``defaults`` scope, but can still be
|
||||
overridden by settings in ``system``, ``system/darwin``, ``site``,
|
||||
@@ -251,6 +241,8 @@ your configurations look like this:
|
||||
|
||||
config:
|
||||
install_tree: $spack/opt/spack
|
||||
module_roots:
|
||||
lmod: $spack/share/spack/lmod
|
||||
build_stage:
|
||||
- $tempdir/$user/spack-stage
|
||||
- ~/.spack/stage
|
||||
@@ -274,6 +266,8 @@ command:
|
||||
$ spack config get config
|
||||
config:
|
||||
install_tree: /some/other/directory
|
||||
module_roots:
|
||||
lmod: $spack/share/spack/lmod
|
||||
build_stage:
|
||||
- $tempdir/$user/spack-stage
|
||||
- ~/.spack/stage
|
||||
@@ -339,11 +333,13 @@ higher-precedence scope is *prepended* to the defaults. ``spack config
|
||||
get config`` shows the result:
|
||||
|
||||
.. code-block:: console
|
||||
:emphasize-lines: 5-8
|
||||
:emphasize-lines: 7-10
|
||||
|
||||
$ spack config get config
|
||||
config:
|
||||
install_tree: /some/other/directory
|
||||
module_roots:
|
||||
lmod: $spack/share/spack/lmod
|
||||
build_stage:
|
||||
- /lustre-scratch/$user/spack
|
||||
- ~/mystage
|
||||
@@ -367,11 +363,13 @@ user config looked like this:
|
||||
The merged configuration would look like this:
|
||||
|
||||
.. code-block:: console
|
||||
:emphasize-lines: 5-6
|
||||
:emphasize-lines: 7-8
|
||||
|
||||
$ spack config get config
|
||||
config:
|
||||
install_tree: /some/other/directory
|
||||
module_roots:
|
||||
lmod: $spack/share/spack/lmod
|
||||
build_stage:
|
||||
- /lustre-scratch/$user/spack
|
||||
- ~/mystage
|
||||
@@ -396,15 +394,12 @@ Spack-specific variables
|
||||
|
||||
Spack understands several special variables. These are:
|
||||
|
||||
* ``$env``: name of the currently active :ref:`environment <environments>`
|
||||
* ``$spack``: path to the prefix of this Spack installation
|
||||
* ``$tempdir``: default system temporary directory (as specified in
|
||||
Python's `tempfile.tempdir
|
||||
<https://docs.python.org/2/library/tempfile.html#tempfile.tempdir>`_
|
||||
variable.
|
||||
* ``$user``: name of the current user
|
||||
* ``$user_cache_path``: user cache directory (``~/.spack`` unless
|
||||
:ref:`overridden <local-config-overrides>`)
|
||||
|
||||
Note that, as with shell variables, you can write these as ``$varname``
|
||||
or with braces to distinguish the variable from surrounding characters:
|
||||
@@ -492,6 +487,9 @@ account all scopes. For example, to see the fully merged
|
||||
template_dirs:
|
||||
- $spack/templates
|
||||
directory_layout: {architecture}/{compiler.name}-{compiler.version}/{name}-{version}-{hash}
|
||||
module_roots:
|
||||
tcl: $spack/share/spack/modules
|
||||
lmod: $spack/share/spack/lmod
|
||||
build_stage:
|
||||
- $tempdir/$user/spack-stage
|
||||
- ~/.spack/stage
|
||||
@@ -539,6 +537,9 @@ down the problem:
|
||||
/home/myuser/spack/etc/spack/defaults/config.yaml:23 template_dirs:
|
||||
/home/myuser/spack/etc/spack/defaults/config.yaml:24 - $spack/templates
|
||||
/home/myuser/spack/etc/spack/defaults/config.yaml:28 directory_layout: {architecture}/{compiler.name}-{compiler.version}/{name}-{version}-{hash}
|
||||
/home/myuser/spack/etc/spack/defaults/config.yaml:32 module_roots:
|
||||
/home/myuser/spack/etc/spack/defaults/config.yaml:33 tcl: $spack/share/spack/modules
|
||||
/home/myuser/spack/etc/spack/defaults/config.yaml:34 lmod: $spack/share/spack/lmod
|
||||
/home/myuser/spack/etc/spack/defaults/config.yaml:49 build_stage:
|
||||
/home/myuser/spack/etc/spack/defaults/config.yaml:50 - $tempdir/$user/spack-stage
|
||||
/home/myuser/spack/etc/spack/defaults/config.yaml:51 - ~/.spack/stage
|
||||
@@ -553,39 +554,3 @@ built in and are not overridden by a configuration file. The
|
||||
command line. ``dirty`` and ``install_tree`` come from the custom
|
||||
scopes ``./my-scope`` and ``./my-scope-2``, and all other configuration
|
||||
options come from the default configuration files that ship with Spack.
|
||||
|
||||
.. _local-config-overrides:
|
||||
|
||||
------------------------------
|
||||
Overriding Local Configuration
|
||||
------------------------------
|
||||
|
||||
Spack's ``system`` and ``user`` scopes provide ways for administrators and users to set
|
||||
global defaults for all Spack instances, but for use cases where one wants a clean Spack
|
||||
installation, these scopes can be undesirable. For example, users may want to opt out of
|
||||
global system configuration, or they may want to ignore their own home directory
|
||||
settings when running in a continuous integration environment.
|
||||
|
||||
Spack also, by default, keeps various caches and user data in ``~/.spack``, but
|
||||
users may want to override these locations.
|
||||
|
||||
Spack provides three environment variables that allow you to override or opt out of
|
||||
configuration locations:
|
||||
|
||||
* ``SPACK_USER_CONFIG_PATH``: Override the path to use for the
|
||||
``user`` scope (``~/.spack`` by default).
|
||||
* ``SPACK_SYSTEM_CONFIG_PATH``: Override the path to use for the
|
||||
``system`` scope (``/etc/spack`` by default).
|
||||
* ``SPACK_DISABLE_LOCAL_CONFIG``: set this environment variable to completely disable
|
||||
**both** the system and user configuration directories. Spack will only consider its
|
||||
own defaults and ``site`` configuration locations.
|
||||
|
||||
And one that allows you to move the default cache location:
|
||||
|
||||
* ``SPACK_USER_CACHE_PATH``: Override the default path to use for user data
|
||||
(misc_cache, tests, reports, etc.)
|
||||
|
||||
With these settings, if you want to isolate Spack in a CI environment, you can do this::
|
||||
|
||||
export SPACK_DISABLE_LOCAL_CONFIG=true
|
||||
export SPACK_USER_CACHE_PATH=/tmp/spack
|
||||
|
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||
.. Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
|
||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
@@ -9,48 +9,28 @@
|
||||
Container Images
|
||||
================
|
||||
|
||||
Spack :ref:`environments` are a great tool to create container images, but
|
||||
preparing one that is suitable for production requires some more boilerplate
|
||||
than just:
|
||||
Spack can be an ideal tool to setup images for containers since all the
|
||||
features discussed in :ref:`environments` can greatly help to manage
|
||||
the installation of software during the image build process. Nonetheless,
|
||||
building a production image from scratch still requires a lot of
|
||||
boilerplate to:
|
||||
|
||||
.. code-block:: docker
|
||||
- Get Spack working within the image, possibly running as root
|
||||
- Minimize the physical size of the software installed
|
||||
- Properly update the system software in the base image
|
||||
|
||||
COPY spack.yaml /environment
|
||||
RUN spack -e /environment install
|
||||
|
||||
Additional actions may be needed to minimize the size of the
|
||||
container, or to update the system software that is installed in the base
|
||||
image, or to set up a proper entrypoint to run the image. These tasks are
|
||||
usually both necessary and repetitive, so Spack comes with a command
|
||||
to generate recipes for container images starting from a ``spack.yaml``.
|
||||
|
||||
--------------------
|
||||
A Quick Introduction
|
||||
--------------------
|
||||
|
||||
Consider having a Spack environment like the following:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
spack:
|
||||
specs:
|
||||
- gromacs+mpi
|
||||
- mpich
|
||||
|
||||
Producing a ``Dockerfile`` from it is as simple as moving to the directory
|
||||
where the ``spack.yaml`` file is stored and giving the following command:
|
||||
To facilitate users with these tedious tasks, Spack provides a command
|
||||
to automatically generate recipes for container images based on
|
||||
Environments:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack containerize > Dockerfile
|
||||
|
||||
The ``Dockerfile`` that gets created uses multi-stage builds and
|
||||
other techniques to minimize the size of the final image:
|
||||
|
||||
.. code-block:: docker
|
||||
$ ls
|
||||
spack.yaml
|
||||
|
||||
$ spack containerize
|
||||
# Build stage with Spack pre-installed and ready to be used
|
||||
FROM spack/ubuntu-bionic:latest as builder
|
||||
FROM spack/centos7:latest as builder
|
||||
|
||||
# What we want to install and how we want to install it
|
||||
# is specified in a manifest file (spack.yaml)
|
||||
@@ -59,14 +39,13 @@ other techniques to minimize the size of the final image:
|
||||
&& echo " specs:" \
|
||||
&& echo " - gromacs+mpi" \
|
||||
&& echo " - mpich" \
|
||||
&& echo " concretizer: together" \
|
||||
&& echo " unify: true" \
|
||||
&& echo " concretization: together" \
|
||||
&& echo " config:" \
|
||||
&& echo " install_tree: /opt/software" \
|
||||
&& echo " view: /opt/view") > /opt/spack-environment/spack.yaml
|
||||
|
||||
# Install the software, remove unnecessary deps
|
||||
RUN cd /opt/spack-environment && spack env activate . && spack install --fail-fast && spack gc -y
|
||||
# Install the software, remove unecessary deps
|
||||
RUN cd /opt/spack-environment && spack install && spack gc -y
|
||||
|
||||
# Strip all the binaries
|
||||
RUN find -L /opt/view/* -type f -exec readlink -f '{}' \; | \
|
||||
@@ -79,40 +58,43 @@ other techniques to minimize the size of the final image:
|
||||
RUN cd /opt/spack-environment && \
|
||||
spack env activate --sh -d . >> /etc/profile.d/z10_spack_environment.sh
|
||||
|
||||
|
||||
# Bare OS image to run the installed executables
|
||||
FROM ubuntu:18.04
|
||||
FROM centos:7
|
||||
|
||||
COPY --from=builder /opt/spack-environment /opt/spack-environment
|
||||
COPY --from=builder /opt/software /opt/software
|
||||
COPY --from=builder /opt/view /opt/view
|
||||
COPY --from=builder /etc/profile.d/z10_spack_environment.sh /etc/profile.d/z10_spack_environment.sh
|
||||
|
||||
RUN yum update -y && yum install -y epel-release && yum update -y \
|
||||
&& yum install -y libgomp \
|
||||
&& rm -rf /var/cache/yum && yum clean all
|
||||
|
||||
RUN echo 'export PS1="\[$(tput bold)\]\[$(tput setaf 1)\][gromacs]\[$(tput setaf 2)\]\u\[$(tput sgr0)\]:\w $ \[$(tput sgr0)\]"' >> ~/.bashrc
|
||||
|
||||
|
||||
LABEL "app"="gromacs"
|
||||
LABEL "mpi"="mpich"
|
||||
|
||||
ENTRYPOINT ["/bin/bash", "--rcfile", "/etc/profile", "-l"]
|
||||
|
||||
The image itself can then be built and run in the usual way, with any of the
|
||||
tools suitable for the task. For instance, if we decided to use ``docker``:
|
||||
|
||||
.. code-block:: bash
|
||||
The bits that make this automation possible are discussed in details
|
||||
below. All the images generated in this way will be based on
|
||||
multi-stage builds with:
|
||||
|
||||
$ spack containerize > Dockerfile
|
||||
$ docker build -t myimage .
|
||||
[ ... ]
|
||||
$ docker run -it myimage
|
||||
- A fat ``build`` stage containing common build tools and Spack itself
|
||||
- A minimal ``final`` stage containing only the software requested by the user
|
||||
|
||||
The various components involved in the generation of the recipe and their
|
||||
configuration are discussed in details in the sections below.
|
||||
|
||||
.. _container_spack_images:
|
||||
|
||||
--------------------------
|
||||
Spack Images on Docker Hub
|
||||
--------------------------
|
||||
-----------------
|
||||
Spack Base Images
|
||||
-----------------
|
||||
|
||||
Docker images with Spack preinstalled and ready to be used are
|
||||
built when a release is tagged, or nightly on ``develop``. The images
|
||||
are then pushed both to `Docker Hub <https://hub.docker.com/u/spack>`_
|
||||
and to `GitHub Container Registry <https://github.com/orgs/spack/packages?repo_name=spack>`_.
|
||||
The OS that are currently supported are summarized in the table below:
|
||||
built on `Docker Hub <https://hub.docker.com/u/spack>`_
|
||||
at every push to ``develop`` or to a release branch. The OS that
|
||||
are currently supported are summarized in the table below:
|
||||
|
||||
.. _containers-supported-os:
|
||||
|
||||
@@ -122,49 +104,39 @@ The OS that are currently supported are summarized in the table below:
|
||||
* - Operating System
|
||||
- Base Image
|
||||
- Spack Image
|
||||
* - Ubuntu 16.04
|
||||
- ``ubuntu:16.04``
|
||||
- ``spack/ubuntu-xenial``
|
||||
* - Ubuntu 18.04
|
||||
- ``ubuntu:18.04``
|
||||
- ``ubuntu:16.04``
|
||||
- ``spack/ubuntu-bionic``
|
||||
* - Ubuntu 20.04
|
||||
- ``ubuntu:20.04``
|
||||
- ``spack/ubuntu-focal``
|
||||
* - Ubuntu 22.04
|
||||
- ``ubuntu:22.04``
|
||||
- ``spack/ubuntu-jammy``
|
||||
* - CentOS 6
|
||||
- ``centos:6``
|
||||
- ``spack/centos6``
|
||||
* - CentOS 7
|
||||
- ``centos:7``
|
||||
- ``spack/centos7``
|
||||
* - CentOS Stream
|
||||
- ``quay.io/centos/centos:stream``
|
||||
- ``spack/centos-stream``
|
||||
* - openSUSE Leap
|
||||
- ``opensuse/leap``
|
||||
- ``spack/leap15``
|
||||
* - Amazon Linux 2
|
||||
- ``amazonlinux:2``
|
||||
- ``spack/amazon-linux``
|
||||
|
||||
All the images are tagged with the corresponding release of Spack:
|
||||
|
||||
.. image:: images/ghcr_spack.png
|
||||
.. image:: dockerhub_spack.png
|
||||
|
||||
with the exception of the ``latest`` tag that points to the HEAD
|
||||
of the ``develop`` branch. These images are available for anyone
|
||||
to use and take care of all the repetitive tasks that are necessary
|
||||
to setup Spack within a container. The container recipes generated
|
||||
by Spack use them as default base images for their ``build`` stage,
|
||||
even though handles to use custom base images provided by users are
|
||||
available to accommodate complex use cases.
|
||||
to setup Spack within a container. All the container recipes generated
|
||||
automatically by Spack use them as base images for their ``build`` stage.
|
||||
|
||||
---------------------------------
|
||||
Creating Images From Environments
|
||||
---------------------------------
|
||||
|
||||
-------------------------
|
||||
Environment Configuration
|
||||
-------------------------
|
||||
|
||||
Any Spack Environment can be used for the automatic generation of container
|
||||
recipes. Sensible defaults are provided for things like the base image or the
|
||||
version of Spack used in the image.
|
||||
If a finer tuning is needed it can be obtained by adding the relevant metadata
|
||||
under the ``container`` attribute of environments:
|
||||
version of Spack used in the image. If a finer tuning is needed it can be
|
||||
obtained by adding the relevant metadata under the ``container`` attribute
|
||||
of environments:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
@@ -178,10 +150,9 @@ under the ``container`` attribute of environments:
|
||||
# singularity or anything else that is currently supported
|
||||
format: docker
|
||||
|
||||
# Sets the base images for the stages where Spack builds the
|
||||
# software or where the software gets installed after being built..
|
||||
images:
|
||||
os: "centos:7"
|
||||
# Select from a valid list of images
|
||||
base:
|
||||
image: "centos:7"
|
||||
spack: develop
|
||||
|
||||
# Whether or not to strip binaries
|
||||
@@ -189,269 +160,19 @@ under the ``container`` attribute of environments:
|
||||
|
||||
# Additional system packages that are needed at runtime
|
||||
os_packages:
|
||||
final:
|
||||
- libgomp
|
||||
- libgomp
|
||||
|
||||
# Extra instructions
|
||||
extra_instructions:
|
||||
final: |
|
||||
RUN echo 'export PS1="\[$(tput bold)\]\[$(tput setaf 1)\][gromacs]\[$(tput setaf 2)\]\u\[$(tput sgr0)\]:\w $ "' >> ~/.bashrc
|
||||
RUN echo 'export PS1="\[$(tput bold)\]\[$(tput setaf 1)\][gromacs]\[$(tput setaf 2)\]\u\[$(tput sgr0)\]:\w $ \[$(tput sgr0)\]"' >> ~/.bashrc
|
||||
|
||||
# Labels for the image
|
||||
labels:
|
||||
app: "gromacs"
|
||||
mpi: "mpich"
|
||||
|
||||
A detailed description of the options available can be found in the
|
||||
:ref:`container_config_options` section.
|
||||
|
||||
-------------------
|
||||
Setting Base Images
|
||||
-------------------
|
||||
|
||||
The ``images`` subsection is used to select both the image where
|
||||
Spack builds the software and the image where the built software
|
||||
is installed. This attribute can be set in different ways and
|
||||
which one to use depends on the use case at hand.
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Use Official Spack Images From Dockerhub
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
To generate a recipe that uses an official Docker image from the
|
||||
Spack organization to build the software and the corresponding official OS image
|
||||
to install the built software, all the user has to do is specify:
|
||||
|
||||
1. An operating system under ``images:os``
|
||||
2. A Spack version under ``images:spack``
|
||||
|
||||
Any combination of these two values that can be mapped to one of the images
|
||||
discussed in :ref:`container_spack_images` is allowed. For instance, the
|
||||
following ``spack.yaml``:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
spack:
|
||||
specs:
|
||||
- gromacs+mpi
|
||||
- mpich
|
||||
|
||||
container:
|
||||
images:
|
||||
os: centos:7
|
||||
spack: 0.15.4
|
||||
|
||||
uses ``spack/centos7:0.15.4`` and ``centos:7`` for the stages where the
|
||||
software is respectively built and installed:
|
||||
|
||||
.. code-block:: docker
|
||||
|
||||
# Build stage with Spack pre-installed and ready to be used
|
||||
FROM spack/centos7:0.15.4 as builder
|
||||
|
||||
# What we want to install and how we want to install it
|
||||
# is specified in a manifest file (spack.yaml)
|
||||
RUN mkdir /opt/spack-environment \
|
||||
&& (echo "spack:" \
|
||||
&& echo " specs:" \
|
||||
&& echo " - gromacs+mpi" \
|
||||
&& echo " - mpich" \
|
||||
&& echo " concretizer:" \
|
||||
&& echo " unify: true" \
|
||||
&& echo " config:" \
|
||||
&& echo " install_tree: /opt/software" \
|
||||
&& echo " view: /opt/view") > /opt/spack-environment/spack.yaml
|
||||
[ ... ]
|
||||
# Bare OS image to run the installed executables
|
||||
FROM centos:7
|
||||
|
||||
COPY --from=builder /opt/spack-environment /opt/spack-environment
|
||||
COPY --from=builder /opt/software /opt/software
|
||||
COPY --from=builder /opt/view /opt/view
|
||||
COPY --from=builder /etc/profile.d/z10_spack_environment.sh /etc/profile.d/z10_spack_environment.sh
|
||||
|
||||
ENTRYPOINT ["/bin/bash", "--rcfile", "/etc/profile", "-l"]
|
||||
|
||||
This is the simplest available method of selecting base images, and we advise
|
||||
to use it whenever possible. There are cases though where using Spack official
|
||||
images is not enough to fit production needs. In these situations users can
|
||||
extend the recipe to start with the bootstrapping of Spack at a certain pinned
|
||||
version or manually select which base image to start from in the recipe,
|
||||
as we'll see next.
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Use a Bootstrap Stage for Spack
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
In some cases users may want to pin the commit sha that is used for Spack, to ensure later
|
||||
reproducibility, or start from a fork of the official Spack repository to try a bugfix or
|
||||
a feature in the early stage of development. This is possible by being just a little more
|
||||
verbose when specifying information about Spack in the ``spack.yaml`` file:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
images:
|
||||
os: amazonlinux:2
|
||||
spack:
|
||||
# URL of the Spack repository to be used in the container image
|
||||
url: <to-use-a-fork>
|
||||
# Either a commit sha, a branch name or a tag
|
||||
ref: <sha/tag/branch>
|
||||
# If true turn a branch name or a tag into the corresponding commit
|
||||
# sha at the time of recipe generation
|
||||
resolve_sha: <true/false>
|
||||
|
||||
``url`` specifies the URL from which to clone Spack and defaults to https://github.com/spack/spack.
|
||||
The ``ref`` attribute can be either a commit sha, a branch name or a tag. The default value in
|
||||
this case is to use the ``develop`` branch, but it may change in the future to point to the latest stable
|
||||
release. Finally ``resolve_sha`` transform branch names or tags into the corresponding commit
|
||||
shas at the time of recipe generation, to allow for a greater reproducibility of the results
|
||||
at a later time.
|
||||
|
||||
The list of operating systems that can be used to bootstrap Spack can be
|
||||
obtained with:
|
||||
|
||||
.. command-output:: spack containerize --list-os
|
||||
|
||||
.. note::
|
||||
|
||||
The ``resolve_sha`` option uses ``git rev-parse`` under the hood and thus it requires
|
||||
to checkout the corresponding Spack repository in a temporary folder before generating
|
||||
the recipe. Recipe generation may take longer when this option is set to true because
|
||||
of this additional step.
|
||||
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Use Custom Images Provided by Users
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Consider, as an example, building a production grade image for a CUDA
|
||||
application. The best strategy would probably be to build on top of
|
||||
images provided by the vendor and regard CUDA as an external package.
|
||||
|
||||
Spack doesn't currently provide an official image with CUDA configured
|
||||
this way, but users can build it on their own and then configure the
|
||||
environment to explicitly pull it. This requires users to:
|
||||
|
||||
1. Specify the image used to build the software under ``images:build``
|
||||
2. Specify the image used to install the built software under ``images:final``
|
||||
|
||||
A ``spack.yaml`` like the following:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
spack:
|
||||
specs:
|
||||
- gromacs@2019.4+cuda build_type=Release
|
||||
- mpich
|
||||
- fftw precision=float
|
||||
packages:
|
||||
cuda:
|
||||
buildable: False
|
||||
externals:
|
||||
- spec: cuda%gcc
|
||||
prefix: /usr/local/cuda
|
||||
|
||||
container:
|
||||
images:
|
||||
build: custom/cuda-10.1-ubuntu18.04:latest
|
||||
final: nvidia/cuda:10.1-base-ubuntu18.04
|
||||
|
||||
produces, for instance, the following ``Dockerfile``:
|
||||
|
||||
.. code-block:: docker
|
||||
|
||||
# Build stage with Spack pre-installed and ready to be used
|
||||
FROM custom/cuda-10.1-ubuntu18.04:latest as builder
|
||||
|
||||
# What we want to install and how we want to install it
|
||||
# is specified in a manifest file (spack.yaml)
|
||||
RUN mkdir /opt/spack-environment \
|
||||
&& (echo "spack:" \
|
||||
&& echo " specs:" \
|
||||
&& echo " - gromacs@2019.4+cuda build_type=Release" \
|
||||
&& echo " - mpich" \
|
||||
&& echo " - fftw precision=float" \
|
||||
&& echo " packages:" \
|
||||
&& echo " cuda:" \
|
||||
&& echo " buildable: false" \
|
||||
&& echo " externals:" \
|
||||
&& echo " - spec: cuda%gcc" \
|
||||
&& echo " prefix: /usr/local/cuda" \
|
||||
&& echo " concretizer:" \
|
||||
&& echo " unify: true" \
|
||||
&& echo " config:" \
|
||||
&& echo " install_tree: /opt/software" \
|
||||
&& echo " view: /opt/view") > /opt/spack-environment/spack.yaml
|
||||
|
||||
# Install the software, remove unnecessary deps
|
||||
RUN cd /opt/spack-environment && spack env activate . && spack install --fail-fast && spack gc -y
|
||||
|
||||
# Strip all the binaries
|
||||
RUN find -L /opt/view/* -type f -exec readlink -f '{}' \; | \
|
||||
xargs file -i | \
|
||||
grep 'charset=binary' | \
|
||||
grep 'x-executable\|x-archive\|x-sharedlib' | \
|
||||
awk -F: '{print $1}' | xargs strip -s
|
||||
|
||||
# Modifications to the environment that are necessary to run
|
||||
RUN cd /opt/spack-environment && \
|
||||
spack env activate --sh -d . >> /etc/profile.d/z10_spack_environment.sh
|
||||
|
||||
# Bare OS image to run the installed executables
|
||||
FROM nvidia/cuda:10.1-base-ubuntu18.04
|
||||
|
||||
COPY --from=builder /opt/spack-environment /opt/spack-environment
|
||||
COPY --from=builder /opt/software /opt/software
|
||||
COPY --from=builder /opt/view /opt/view
|
||||
COPY --from=builder /etc/profile.d/z10_spack_environment.sh /etc/profile.d/z10_spack_environment.sh
|
||||
|
||||
ENTRYPOINT ["/bin/bash", "--rcfile", "/etc/profile", "-l"]
|
||||
|
||||
where the base images for both stages are completely custom.
|
||||
|
||||
This second mode of selection for base images is more flexible than just
|
||||
choosing an operating system and a Spack version, but is also more demanding.
|
||||
Users may need to generate by themselves their base images and it's also their
|
||||
responsibility to ensure that:
|
||||
|
||||
1. Spack is available in the ``build`` stage and set up correctly to install the required software
|
||||
2. The artifacts produced in the ``build`` stage can be executed in the ``final`` stage
|
||||
|
||||
Therefore we don't recommend its use in cases that can be otherwise
|
||||
covered by the simplified mode shown first.
|
||||
|
||||
----------------------------
|
||||
Singularity Definition Files
|
||||
----------------------------
|
||||
|
||||
In addition to producing recipes in ``Dockerfile`` format Spack can produce
|
||||
Singularity Definition Files by just changing the value of the ``format``
|
||||
attribute:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ cat spack.yaml
|
||||
spack:
|
||||
specs:
|
||||
- hdf5~mpi
|
||||
container:
|
||||
format: singularity
|
||||
|
||||
$ spack containerize > hdf5.def
|
||||
$ sudo singularity build hdf5.sif hdf5.def
|
||||
|
||||
The minimum version of Singularity required to build a SIF (Singularity Image Format)
|
||||
image from the recipes generated by Spack is ``3.5.3``.
|
||||
|
||||
.. _container_config_options:
|
||||
|
||||
-----------------------
|
||||
Configuration Reference
|
||||
-----------------------
|
||||
|
||||
The tables below describe all the configuration options that are currently supported
|
||||
to customize the generation of container recipes:
|
||||
The tables below describe the configuration options that are currently supported:
|
||||
|
||||
.. list-table:: General configuration options for the ``container`` section of ``spack.yaml``
|
||||
:header-rows: 1
|
||||
@@ -464,53 +185,21 @@ to customize the generation of container recipes:
|
||||
- The format of the recipe
|
||||
- ``docker`` or ``singularity``
|
||||
- Yes
|
||||
* - ``images:os``
|
||||
- Operating system used as a base for the image
|
||||
* - ``base:image``
|
||||
- Base image for ``final`` stage
|
||||
- See :ref:`containers-supported-os`
|
||||
- Yes, if using constrained selection of base images
|
||||
* - ``images:spack``
|
||||
- Version of Spack use in the ``build`` stage
|
||||
- Yes
|
||||
* - ``base:spack``
|
||||
- Version of Spack
|
||||
- Valid tags for ``base:image``
|
||||
- Yes, if using constrained selection of base images
|
||||
* - ``images:spack:url``
|
||||
- Repository from which Spack is cloned
|
||||
- Any fork of Spack
|
||||
- No
|
||||
* - ``images:spack:ref``
|
||||
- Reference for the checkout of Spack
|
||||
- Either a commit sha, a branch name or a tag
|
||||
- No
|
||||
* - ``images:spack:resolve_sha``
|
||||
- Resolve branches and tags in ``spack.yaml`` to commits in the generated recipe
|
||||
- True or False (default: False)
|
||||
- No
|
||||
* - ``images:build``
|
||||
- Image to be used in the ``build`` stage
|
||||
- Any valid container image
|
||||
- Yes, if using custom selection of base images
|
||||
* - ``images:final``
|
||||
- Image to be used in the ``build`` stage
|
||||
- Any valid container image
|
||||
- Yes, if using custom selection of base images
|
||||
- Yes
|
||||
* - ``strip``
|
||||
- Whether to strip binaries
|
||||
- ``true`` (default) or ``false``
|
||||
- No
|
||||
* - ``os_packages:command``
|
||||
- Tool used to manage system packages
|
||||
- ``apt``, ``yum``
|
||||
- Only with custom base images
|
||||
* - ``os_packages:update``
|
||||
- Whether or not to update the list of available packages
|
||||
- True or False (default: True)
|
||||
- No
|
||||
* - ``os_packages:build``
|
||||
- System packages needed at build-time
|
||||
- Valid packages for the current OS
|
||||
- No
|
||||
* - ``os_packages:final``
|
||||
- System packages needed at run-time
|
||||
- Valid packages for the current OS
|
||||
* - ``os_packages``
|
||||
- System packages to be installed
|
||||
- Valid packages for the ``final`` OS
|
||||
- No
|
||||
* - ``extra_instructions:build``
|
||||
- Extra instructions (e.g. `RUN`, `COPY`, etc.) at the end of the ``build`` stage
|
||||
@@ -549,56 +238,70 @@ to customize the generation of container recipes:
|
||||
- Description string
|
||||
- No
|
||||
|
||||
--------------
|
||||
Best Practices
|
||||
--------------
|
||||
Once the Environment is properly configured a recipe for a container
|
||||
image can be printed to standard output by issuing the following
|
||||
command from the directory where the ``spack.yaml`` resides:
|
||||
|
||||
^^^
|
||||
MPI
|
||||
^^^
|
||||
Due to the dependency on Fortran for OpenMPI, which is the spack default
|
||||
implementation, consider adding ``gfortran`` to the ``apt-get install`` list.
|
||||
.. code-block:: console
|
||||
|
||||
Recent versions of OpenMPI will require you to pass ``--allow-run-as-root``
|
||||
to your ``mpirun`` calls if started as root user inside Docker.
|
||||
$ spack containerize
|
||||
|
||||
For execution on HPC clusters, it can be helpful to import the docker
|
||||
image into Singularity in order to start a program with an *external*
|
||||
MPI. Otherwise, also add ``openssh-server`` to the ``apt-get install`` list.
|
||||
The example ``spack.yaml`` above would produce for instance the
|
||||
following ``Dockerfile``:
|
||||
|
||||
^^^^
|
||||
CUDA
|
||||
^^^^
|
||||
Starting from CUDA 9.0, Nvidia provides minimal CUDA images based on
|
||||
Ubuntu. Please see `their instructions <https://hub.docker.com/r/nvidia/cuda/>`_.
|
||||
Avoid double-installing CUDA by adding, e.g.
|
||||
.. code-block:: docker
|
||||
|
||||
.. code-block:: yaml
|
||||
# Build stage with Spack pre-installed and ready to be used
|
||||
FROM spack/centos7:latest as builder
|
||||
|
||||
packages:
|
||||
cuda:
|
||||
externals:
|
||||
- spec: "cuda@9.0.176%gcc@5.4.0 arch=linux-ubuntu16-x86_64"
|
||||
prefix: /usr/local/cuda
|
||||
buildable: False
|
||||
# What we want to install and how we want to install it
|
||||
# is specified in a manifest file (spack.yaml)
|
||||
RUN mkdir /opt/spack-environment \
|
||||
&& (echo "spack:" \
|
||||
&& echo " specs:" \
|
||||
&& echo " - gromacs+mpi" \
|
||||
&& echo " - mpich" \
|
||||
&& echo " concretization: together" \
|
||||
&& echo " config:" \
|
||||
&& echo " install_tree: /opt/software" \
|
||||
&& echo " view: /opt/view") > /opt/spack-environment/spack.yaml
|
||||
|
||||
to your ``spack.yaml``.
|
||||
# Install the software, remove unecessary deps
|
||||
RUN cd /opt/spack-environment && spack install && spack gc -y
|
||||
|
||||
Users will either need ``nvidia-docker`` or e.g. Singularity to *execute*
|
||||
device kernels.
|
||||
# Strip all the binaries
|
||||
RUN find -L /opt/view/* -type f -exec readlink -f '{}' \; | \
|
||||
xargs file -i | \
|
||||
grep 'charset=binary' | \
|
||||
grep 'x-executable\|x-archive\|x-sharedlib' | \
|
||||
awk -F: '{print $1}' | xargs strip -s
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Docker on Windows and OSX
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
# Modifications to the environment that are necessary to run
|
||||
RUN cd /opt/spack-environment && \
|
||||
spack env activate --sh -d . >> /etc/profile.d/z10_spack_environment.sh
|
||||
|
||||
On Mac OS and Windows, docker runs on a hypervisor that is not allocated much
|
||||
memory by default, and some spack packages may fail to build due to lack of
|
||||
memory. To work around this issue, consider configuring your docker installation
|
||||
to use more of your host memory. In some cases, you can also ease the memory
|
||||
pressure on parallel builds by limiting the parallelism in your config.yaml.
|
||||
|
||||
.. code-block:: yaml
|
||||
# Bare OS image to run the installed executables
|
||||
FROM centos:7
|
||||
|
||||
config:
|
||||
build_jobs: 2
|
||||
COPY --from=builder /opt/spack-environment /opt/spack-environment
|
||||
COPY --from=builder /opt/software /opt/software
|
||||
COPY --from=builder /opt/view /opt/view
|
||||
COPY --from=builder /etc/profile.d/z10_spack_environment.sh /etc/profile.d/z10_spack_environment.sh
|
||||
|
||||
RUN yum update -y && yum install -y epel-release && yum update -y \
|
||||
&& yum install -y libgomp \
|
||||
&& rm -rf /var/cache/yum && yum clean all
|
||||
|
||||
RUN echo 'export PS1="\[$(tput bold)\]\[$(tput setaf 1)\][gromacs]\[$(tput setaf 2)\]\u\[$(tput sgr0)\]:\w $ \[$(tput sgr0)\]"' >> ~/.bashrc
|
||||
|
||||
|
||||
LABEL "app"="gromacs"
|
||||
LABEL "mpi"="mpich"
|
||||
|
||||
ENTRYPOINT ["/bin/bash", "--rcfile", "/etc/profile", "-l"]
|
||||
|
||||
.. note::
|
||||
Spack can also produce Singularity definition files to build the image. The
|
||||
minimum version of Singularity required to build a SIF (Singularity Image Format)
|
||||
from them is ``3.5.3``.
|
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||
.. Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
|
||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
@@ -27,28 +27,17 @@ correspond to one feature/bugfix/extension/etc. One can create PRs with
|
||||
changes relevant to different ideas, however reviewing such PRs becomes tedious
|
||||
and error prone. If possible, try to follow the **one-PR-one-package/feature** rule.
|
||||
|
||||
--------
|
||||
Branches
|
||||
--------
|
||||
|
||||
Spack's ``develop`` branch has the latest contributions. Nearly all pull
|
||||
requests should start from ``develop`` and target ``develop``.
|
||||
|
||||
There is a branch for each major release series. Release branches
|
||||
originate from ``develop`` and have tags for each point release in the
|
||||
series. For example, ``releases/v0.14`` has tags for ``0.14.0``,
|
||||
``0.14.1``, ``0.14.2``, etc. versions of Spack. We backport important bug
|
||||
fixes to these branches, but we do not advance the package versions or
|
||||
make other changes that would change the way Spack concretizes
|
||||
dependencies. Currently, the maintainers manage these branches by
|
||||
cherry-picking from ``develop``. See :ref:`releases` for more
|
||||
information.
|
||||
Spack uses a rough approximation of the `Git Flow <http://nvie.com/posts/a-successful-git-branching-model/>`_
|
||||
branching model. The develop branch contains the latest contributions, and
|
||||
master is always tagged and points to the latest stable release. Therefore, when
|
||||
you send your request, make ``develop`` the destination branch on the
|
||||
`Spack repository <https://github.com/spack/spack>`_.
|
||||
|
||||
----------------------
|
||||
Continuous Integration
|
||||
----------------------
|
||||
|
||||
Spack uses `Github Actions <https://docs.github.com/en/actions>`_ for Continuous Integration
|
||||
Spack uses `Travis CI <https://travis-ci.org/spack/spack>`_ for Continuous Integration
|
||||
testing. This means that every time you submit a pull request, a series of tests will
|
||||
be run to make sure you didn't accidentally introduce any bugs into Spack. **Your PR
|
||||
will not be accepted until it passes all of these tests.** While you can certainly wait
|
||||
@@ -57,24 +46,25 @@ locally to speed up the review process.
|
||||
|
||||
.. note::
|
||||
|
||||
Oftentimes, CI will fail for reasons other than a problem with your PR.
|
||||
Oftentimes, Travis will fail for reasons other than a problem with your PR.
|
||||
For example, apt-get, pip, or homebrew will fail to download one of the
|
||||
dependencies for the test suite, or a transient bug will cause the unit tests
|
||||
to timeout. If any job fails, click the "Details" link and click on the test(s)
|
||||
to timeout. If Travis fails, click the "Details" link and click on the test(s)
|
||||
that is failing. If it doesn't look like it is failing for reasons related to
|
||||
your PR, you have two options. If you have write permissions for the Spack
|
||||
repository, you should see a "Restart workflow" button on the right-hand side. If
|
||||
repository, you should see a "Restart job" button on the right-hand side. If
|
||||
not, you can close and reopen your PR to rerun all of the tests. If the same
|
||||
test keeps failing, there may be a problem with your PR. If you notice that
|
||||
every recent PR is failing with the same error message, it may be that an issue
|
||||
occurred with the CI infrastructure or one of Spack's dependencies put out a
|
||||
new release that is causing problems. If this is the case, please file an issue.
|
||||
every recent PR is failing with the same error message, it may be that Travis
|
||||
is down or one of Spack's dependencies put out a new release that is causing
|
||||
problems. If this is the case, please file an issue.
|
||||
|
||||
|
||||
We currently test against Python 2.7 and 3.5-3.9 on both macOS and Linux and
|
||||
If you take a look in ``$SPACK_ROOT/.travis.yml``, you'll notice that we test
|
||||
against Python 2.6, 2.7, and 3.4-3.7 on both macOS and Linux. We currently
|
||||
perform 3 types of tests:
|
||||
|
||||
.. _cmd-spack-unit-test:
|
||||
.. _cmd-spack-test:
|
||||
|
||||
^^^^^^^^^^
|
||||
Unit Tests
|
||||
@@ -96,7 +86,7 @@ To run *all* of the unit tests, use:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack unit-test
|
||||
$ spack test
|
||||
|
||||
These tests may take several minutes to complete. If you know you are
|
||||
only modifying a single Spack feature, you can run subsets of tests at a
|
||||
@@ -105,53 +95,51 @@ time. For example, this would run all the tests in
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack unit-test lib/spack/spack/test/architecture.py
|
||||
$ spack test architecture.py
|
||||
|
||||
And this would run the ``test_platform`` test from that file:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack unit-test lib/spack/spack/test/architecture.py::test_platform
|
||||
$ spack test architecture.py::test_platform
|
||||
|
||||
This allows you to develop iteratively: make a change, test that change,
|
||||
make another change, test that change, etc. We use `pytest
|
||||
<http://pytest.org/>`_ as our tests framework, and these types of
|
||||
<http://pytest.org/>`_ as our tests fromework, and these types of
|
||||
arguments are just passed to the ``pytest`` command underneath. See `the
|
||||
pytest docs
|
||||
<http://doc.pytest.org/en/latest/usage.html#specifying-tests-selecting-tests>`_
|
||||
for more details on test selection syntax.
|
||||
|
||||
``spack unit-test`` has a few special options that can help you
|
||||
understand what tests are available. To get a list of all available
|
||||
unit test files, run:
|
||||
``spack test`` has a few special options that can help you understand
|
||||
what tests are available. To get a list of all available unit test
|
||||
files, run:
|
||||
|
||||
.. command-output:: spack unit-test --list
|
||||
.. command-output:: spack test --list
|
||||
:ellipsis: 5
|
||||
|
||||
To see a more detailed list of available unit tests, use ``spack
|
||||
unit-test --list-long``:
|
||||
To see a more detailed list of available unit tests, use ``spack test
|
||||
--list-long``:
|
||||
|
||||
.. command-output:: spack unit-test --list-long
|
||||
.. command-output:: spack test --list-long
|
||||
:ellipsis: 10
|
||||
|
||||
And to see the fully qualified names of all tests, use ``--list-names``:
|
||||
|
||||
.. command-output:: spack unit-test --list-names
|
||||
.. command-output:: spack test --list-names
|
||||
:ellipsis: 5
|
||||
|
||||
You can combine these with ``pytest`` arguments to restrict which tests
|
||||
you want to know about. For example, to see just the tests in
|
||||
``architecture.py``:
|
||||
|
||||
.. command-output:: spack unit-test --list-long lib/spack/spack/test/architecture.py
|
||||
.. command-output:: spack test --list-long architecture.py
|
||||
|
||||
You can also combine any of these options with a ``pytest`` keyword
|
||||
search. See the `pytest usage docs
|
||||
<https://docs.pytest.org/en/stable/usage.html#specifying-tests-selecting-tests>`_:
|
||||
for more details on test selection syntax. For example, to see the names of all tests that have "spec"
|
||||
search. For example, to see the names of all tests that have "spec"
|
||||
or "concretize" somewhere in their names:
|
||||
|
||||
.. command-output:: spack unit-test --list-names -k "spec and concretize"
|
||||
.. command-output:: spack test --list-names -k "spec and concretize"
|
||||
|
||||
By default, ``pytest`` captures the output of all unit tests, and it will
|
||||
print any captured output for failed tests. Sometimes it's helpful to see
|
||||
@@ -161,7 +149,7 @@ argument to ``pytest``:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack unit-test -s --list-long lib/spack/spack/test/architecture.py::test_platform
|
||||
$ spack test -s architecture.py::test_platform
|
||||
|
||||
Unit tests are crucial to making sure bugs aren't introduced into
|
||||
Spack. If you are modifying core Spack libraries or adding new
|
||||
@@ -174,31 +162,29 @@ how to write tests!
|
||||
.. note::
|
||||
|
||||
You may notice the ``share/spack/qa/run-unit-tests`` script in the
|
||||
repository. This script is designed for CI. It runs the unit
|
||||
repository. This script is designed for Travis CI. It runs the unit
|
||||
tests and reports coverage statistics back to Codecov. If you want to
|
||||
run the unit tests yourself, we suggest you use ``spack unit-test``.
|
||||
run the unit tests yourself, we suggest you use ``spack test``.
|
||||
|
||||
^^^^^^^^^^^^
|
||||
Style Tests
|
||||
Flake8 Tests
|
||||
^^^^^^^^^^^^
|
||||
|
||||
Spack uses `Flake8 <http://flake8.pycqa.org/en/latest/>`_ to test for
|
||||
`PEP 8 <https://www.python.org/dev/peps/pep-0008/>`_ conformance and
|
||||
`mypy <https://mypy.readthedocs.io/en/stable/>` for type checking. PEP 8 is
|
||||
`PEP 8 <https://www.python.org/dev/peps/pep-0008/>`_ conformance. PEP 8 is
|
||||
a series of style guides for Python that provide suggestions for everything
|
||||
from variable naming to indentation. In order to limit the number of PRs that
|
||||
were mostly style changes, we decided to enforce PEP 8 conformance. Your PR
|
||||
needs to comply with PEP 8 in order to be accepted, and if it modifies the
|
||||
spack library it needs to successfully type-check with mypy as well.
|
||||
needs to comply with PEP 8 in order to be accepted.
|
||||
|
||||
Testing for compliance with spack's style is easy. Simply run the ``spack style``
|
||||
Testing for PEP 8 compliance is easy. Simply run the ``spack flake8``
|
||||
command:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack style
|
||||
$ spack flake8
|
||||
|
||||
``spack style`` has a couple advantages over running the tools by hand:
|
||||
``spack flake8`` has a couple advantages over running ``flake8`` by hand:
|
||||
|
||||
#. It only tests files that you have modified since branching off of
|
||||
``develop``.
|
||||
@@ -209,9 +195,7 @@ command:
|
||||
checks. For example, URLs are often longer than 80 characters, so we
|
||||
exempt them from line length checks. We also exempt lines that start
|
||||
with "homepage", "url", "version", "variant", "depends_on", and
|
||||
"extends" in ``package.py`` files. This is now also possible when directly
|
||||
running flake8 if you can use the ``spack`` formatter plugin included with
|
||||
spack.
|
||||
"extends" in ``package.py`` files.
|
||||
|
||||
More approved flake8 exemptions can be found
|
||||
`here <https://github.com/spack/spack/blob/develop/.flake8>`_.
|
||||
@@ -244,14 +228,14 @@ However, if you aren't compliant with PEP 8, flake8 will complain:
|
||||
|
||||
Most of the error messages are straightforward, but if you don't understand what
|
||||
they mean, just ask questions about them when you submit your PR. The line numbers
|
||||
will change if you add or delete lines, so simply run ``spack style`` again
|
||||
will change if you add or delete lines, so simply run ``spack flake8`` again
|
||||
to update them.
|
||||
|
||||
.. tip::
|
||||
|
||||
Try fixing flake8 errors in reverse order. This eliminates the need for
|
||||
multiple runs of ``spack style`` just to re-compute line numbers and
|
||||
makes it much easier to fix errors directly off of the CI output.
|
||||
multiple runs of ``spack flake8`` just to re-compute line numbers and
|
||||
makes it much easier to fix errors directly off of the Travis output.
|
||||
|
||||
.. warning::
|
||||
|
||||
@@ -331,13 +315,22 @@ Once all of the dependencies are installed, you can try building the documentati
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ cd path/to/spack/lib/spack/docs/
|
||||
$ cd "$SPACK_ROOT/lib/spack/docs"
|
||||
$ make clean
|
||||
$ make
|
||||
|
||||
If you see any warning or error messages, you will have to correct those before
|
||||
your PR is accepted.
|
||||
|
||||
.. note::
|
||||
|
||||
There is also a ``run-doc-tests`` script in ``share/spack/qa``. The only
|
||||
difference between running this script and running ``make`` by hand is that
|
||||
the script will exit immediately if it encounters an error or warning. This
|
||||
is necessary for Travis CI. If you made a lot of documentation changes, it is
|
||||
much quicker to run ``make`` by hand so that you can see all of the warnings
|
||||
at once.
|
||||
|
||||
If you are editing the documentation, you should obviously be running the
|
||||
documentation tests. But even if you are simply adding a new package, your
|
||||
changes could cause the documentation tests to fail:
|
||||
@@ -392,13 +385,13 @@ coverage. This helps us tell what percentage of lines of code in Spack are
|
||||
covered by unit tests. Although code covered by unit tests can still contain
|
||||
bugs, it is much less error prone than code that is not covered by unit tests.
|
||||
|
||||
Codecov provides `browser extensions <https://github.com/codecov/sourcegraph-codecov>`_
|
||||
for Google Chrome and Firefox. These extensions integrate with GitHub
|
||||
Codecov provides `browser extensions <https://github.com/codecov/browser-extension>`_
|
||||
for Google Chrome, Firefox, and Opera. These extensions integrate with GitHub
|
||||
and allow you to see coverage line-by-line when viewing the Spack repository.
|
||||
If you are new to Spack, a great way to get started is to write unit tests to
|
||||
increase coverage!
|
||||
|
||||
Unlike with CI on Github Actions Codecov tests are not required to pass in order for your
|
||||
Unlike with Travis, Codecov tests are not required to pass in order for your
|
||||
PR to be merged. If you modify core Spack libraries, we would greatly
|
||||
appreciate unit tests that cover these changed lines. Otherwise, we have no
|
||||
way of knowing whether or not your changes introduce a bug. If you make
|
||||
|
@@ -1,4 +1,4 @@
|
||||
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||
.. Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
|
||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
@@ -106,20 +106,11 @@ with a high level view of Spack's directory structure:
|
||||
external/ <- external libs included in Spack distro
|
||||
llnl/ <- some general-use libraries
|
||||
|
||||
spack/ <- spack module; contains Python code
|
||||
build_systems/ <- modules for different build systems
|
||||
cmd/ <- each file in here is a spack subcommand
|
||||
compilers/ <- compiler description files
|
||||
container/ <- module for spack containerize
|
||||
hooks/ <- hook modules to run at different points
|
||||
modules/ <- modules for lmod, tcl, etc.
|
||||
operating_systems/ <- operating system modules
|
||||
platforms/ <- different spack platforms
|
||||
reporters/ <- reporters like cdash, junit
|
||||
schema/ <- schemas to validate data structures
|
||||
solver/ <- the spack solver
|
||||
test/ <- unit test modules
|
||||
util/ <- common code
|
||||
spack/ <- spack module; contains Python code
|
||||
cmd/ <- each file in here is a spack subcommand
|
||||
compilers/ <- compiler description files
|
||||
test/ <- unit test modules
|
||||
util/ <- common code
|
||||
|
||||
Spack is designed so that it could live within a `standard UNIX
|
||||
directory hierarchy <http://linux.die.net/man/7/hier>`_, so ``lib``,
|
||||
@@ -150,22 +141,24 @@ Package-related modules
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
:mod:`spack.package`
|
||||
Contains the :class:`~spack.package_base.Package` class, which
|
||||
Contains the :class:`Package <spack.package.Package>` class, which
|
||||
is the superclass for all packages in Spack. Methods on ``Package``
|
||||
implement all phases of the :ref:`package lifecycle
|
||||
<package-lifecycle>` and manage the build process.
|
||||
|
||||
:mod:`spack.util.naming`
|
||||
Contains functions for mapping between Spack package names,
|
||||
Python module names, and Python class names. Functions like
|
||||
:func:`~spack.util.naming.mod_to_class` handle mapping package
|
||||
module names to class names.
|
||||
:mod:`spack.packages`
|
||||
Contains all of the packages in Spack and methods for managing them.
|
||||
Functions like :func:`packages.get <spack.packages.get>` and
|
||||
:func:`class_name_for_package_name
|
||||
<packages.class_name_for_package_name>` handle mapping package module
|
||||
names to class names and dynamically instantiating packages by name
|
||||
from module files.
|
||||
|
||||
:mod:`spack.directives`
|
||||
*Directives* are functions that can be called inside a package definition
|
||||
to modify the package, like :func:`~spack.directives.depends_on`
|
||||
and :func:`~spack.directives.provides`. See :ref:`dependencies`
|
||||
and :ref:`virtual-dependencies`.
|
||||
:mod:`spack.relations`
|
||||
*Relations* are relationships between packages, like
|
||||
:func:`depends_on <spack.relations.depends_on>` and :func:`provides
|
||||
<spack.relations.provides>`. See :ref:`dependencies` and
|
||||
:ref:`virtual-dependencies`.
|
||||
|
||||
:mod:`spack.multimethod`
|
||||
Implementation of the :func:`@when <spack.multimethod.when>`
|
||||
@@ -177,27 +170,31 @@ Spec-related modules
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
:mod:`spack.spec`
|
||||
Contains :class:`~spack.spec.Spec` and :class:`~spack.spec.SpecParser`.
|
||||
Also implements most of the logic for normalization and concretization
|
||||
of specs.
|
||||
Contains :class:`Spec <spack.spec.Spec>` and :class:`SpecParser
|
||||
<spack.spec.SpecParser>`. Also implements most of the logic for
|
||||
normalization and concretization of specs.
|
||||
|
||||
:mod:`spack.parse`
|
||||
Contains some base classes for implementing simple recursive descent
|
||||
parsers: :class:`~spack.parse.Parser` and :class:`~spack.parse.Lexer`.
|
||||
Used by :class:`~spack.spec.SpecParser`.
|
||||
parsers: :class:`Parser <spack.parse.Parser>` and :class:`Lexer
|
||||
<spack.parse.Lexer>`. Used by :class:`SpecParser
|
||||
<spack.spec.SpecParser>`.
|
||||
|
||||
:mod:`spack.concretize`
|
||||
Contains :class:`~spack.concretize.Concretizer` implementation,
|
||||
which allows site administrators to change Spack's :ref:`concretization-policies`.
|
||||
Contains :class:`DefaultConcretizer
|
||||
<spack.concretize.DefaultConcretizer>` implementation, which allows
|
||||
site administrators to change Spack's :ref:`concretization-policies`.
|
||||
|
||||
:mod:`spack.version`
|
||||
Implements a simple :class:`~spack.version.Version` class with simple
|
||||
comparison semantics. Also implements :class:`~spack.version.VersionRange`
|
||||
and :class:`~spack.version.VersionList`. All three are comparable with each
|
||||
other and offer union and intersection operations. Spack uses these classes
|
||||
to compare versions and to manage version constraints on specs. Comparison
|
||||
semantics are similar to the ``LooseVersion`` class in ``distutils`` and to
|
||||
the way RPM compares version strings.
|
||||
Implements a simple :class:`Version <spack.version.Version>` class
|
||||
with simple comparison semantics. Also implements
|
||||
:class:`VersionRange <spack.version.VersionRange>` and
|
||||
:class:`VersionList <spack.version.VersionList>`. All three are
|
||||
comparable with each other and offer union and intersection
|
||||
operations. Spack uses these classes to compare versions and to
|
||||
manage version constraints on specs. Comparison semantics are
|
||||
similar to the ``LooseVersion`` class in ``distutils`` and to the
|
||||
way RPM compares version strings.
|
||||
|
||||
:mod:`spack.compilers`
|
||||
Submodules contains descriptors for all valid compilers in Spack.
|
||||
@@ -209,6 +206,15 @@ Spec-related modules
|
||||
but compilers aren't fully integrated with the build process
|
||||
yet.
|
||||
|
||||
:mod:`spack.architecture`
|
||||
:func:`architecture.sys_type <spack.architecture.sys_type>` is used
|
||||
to determine the host architecture while building.
|
||||
|
||||
.. warning::
|
||||
|
||||
Not yet implemented. Should eventually have architecture
|
||||
descriptions for cross-compiling.
|
||||
|
||||
^^^^^^^^^^^^^^^^^
|
||||
Build environment
|
||||
^^^^^^^^^^^^^^^^^
|
||||
@@ -216,7 +222,7 @@ Build environment
|
||||
:mod:`spack.stage`
|
||||
Handles creating temporary directories for builds.
|
||||
|
||||
:mod:`spack.build_environment`
|
||||
:mod:`spack.compilation`
|
||||
This contains utility functions used by the compiler wrapper script,
|
||||
``cc``.
|
||||
|
||||
@@ -241,6 +247,9 @@ Unit tests
|
||||
Implements Spack's test suite. Add a module and put its name in
|
||||
the test suite in ``__init__.py`` to add more unit tests.
|
||||
|
||||
:mod:`spack.test.mock_packages`
|
||||
This is a fake package hierarchy used to mock up packages for
|
||||
Spack's test suite.
|
||||
|
||||
^^^^^^^^^^^^^
|
||||
Other Modules
|
||||
@@ -251,7 +260,7 @@ Other Modules
|
||||
tarball URLs.
|
||||
|
||||
:mod:`spack.error`
|
||||
:class:`~spack.error.SpackError`, the base class for
|
||||
:class:`SpackError <spack.error.SpackError>`, the base class for
|
||||
Spack's exception hierarchy.
|
||||
|
||||
:mod:`llnl.util.tty`
|
||||
@@ -284,6 +293,11 @@ Most spack commands look something like this:
|
||||
The information in Package files is used at all stages in this
|
||||
process.
|
||||
|
||||
Conceptually, packages are overloaded. They contain:
|
||||
|
||||
-------------
|
||||
Stage objects
|
||||
-------------
|
||||
|
||||
.. _writing-commands:
|
||||
|
||||
@@ -331,173 +345,6 @@ Whenever you add/remove/rename a command or flags for an existing command,
|
||||
make sure to update Spack's `Bash tab completion script
|
||||
<https://github.com/adamjstewart/spack/blob/develop/share/spack/spack-completion.bash>`_.
|
||||
|
||||
|
||||
-------------
|
||||
Writing Hooks
|
||||
-------------
|
||||
|
||||
A hook is a callback that makes it easy to design functions that run
|
||||
for different events. We do this by way of defining hook types, and then
|
||||
inserting them at different places in the spack code base. Whenever a hook
|
||||
type triggers by way of a function call, we find all the hooks of that type,
|
||||
and run them.
|
||||
|
||||
Spack defines hooks by way of a module at ``lib/spack/spack/hooks`` where we can define
|
||||
types of hooks in the ``__init__.py``, and then python files in that folder
|
||||
can use hook functions. The files are automatically parsed, so if you write
|
||||
a new file for some integration (e.g., ``lib/spack/spack/hooks/myintegration.py``
|
||||
you can then write hook functions in that file that will be automatically detected,
|
||||
and run whenever your hook is called. This section will cover the basic kind
|
||||
of hooks, and how to write them.
|
||||
|
||||
^^^^^^^^^^^^^^
|
||||
Types of Hooks
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
The following hooks are currently implemented to make it easy for you,
|
||||
the developer, to add hooks at different stages of a spack install or similar.
|
||||
If there is a hook that you would like and is missing, you can propose to add a new one.
|
||||
|
||||
"""""""""""""""""""""
|
||||
``pre_install(spec)``
|
||||
"""""""""""""""""""""
|
||||
|
||||
A ``pre_install`` hook is run within an install subprocess, directly before
|
||||
the install starts. It expects a single argument of a spec, and is run in
|
||||
a multiprocessing subprocess. Note that if you see ``pre_install`` functions associated with packages these are not hooks
|
||||
as we have defined them here, but rather callback functions associated with
|
||||
a package install.
|
||||
|
||||
|
||||
""""""""""""""""""""""
|
||||
``post_install(spec)``
|
||||
""""""""""""""""""""""
|
||||
|
||||
A ``post_install`` hook is run within an install subprocess, directly after
|
||||
the install finishes, but before the build stage is removed. If you
|
||||
write one of these hooks, you should expect it to accept a spec as the only
|
||||
argument. This is run in a multiprocessing subprocess. This ``post_install`` is
|
||||
also seen in packages, but in this context not related to the hooks described
|
||||
here.
|
||||
|
||||
|
||||
""""""""""""""""""""""""""
|
||||
``on_install_start(spec)``
|
||||
""""""""""""""""""""""""""
|
||||
|
||||
This hook is run at the beginning of ``lib/spack/spack/installer.py``,
|
||||
in the install function of a ``PackageInstaller``,
|
||||
and importantly is not part of a build process, but before it. This is when
|
||||
we have just newly grabbed the task, and are preparing to install. If you
|
||||
write a hook of this type, you should provide the spec to it.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
def on_install_start(spec):
|
||||
"""On start of an install, we want to...
|
||||
"""
|
||||
print('on_install_start')
|
||||
|
||||
|
||||
""""""""""""""""""""""""""""
|
||||
``on_install_success(spec)``
|
||||
""""""""""""""""""""""""""""
|
||||
|
||||
This hook is run on a successful install, and is also run inside the build
|
||||
process, akin to ``post_install``. The main difference is that this hook
|
||||
is run outside of the context of the stage directory, meaning after the
|
||||
build stage has been removed and the user is alerted that the install was
|
||||
successful. If you need to write a hook that is run on success of a particular
|
||||
phase, you should use ``on_phase_success``.
|
||||
|
||||
""""""""""""""""""""""""""""
|
||||
``on_install_failure(spec)``
|
||||
""""""""""""""""""""""""""""
|
||||
|
||||
This hook is run given an install failure that happens outside of the build
|
||||
subprocess, but somewhere in ``installer.py`` when something else goes wrong.
|
||||
If you need to write a hook that is relevant to a failure within a build
|
||||
process, you would want to instead use ``on_phase_failure``.
|
||||
|
||||
|
||||
"""""""""""""""""""""""""""
|
||||
``on_install_cancel(spec)``
|
||||
"""""""""""""""""""""""""""
|
||||
|
||||
The same, but triggered if a spec install is cancelled for any reason.
|
||||
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""
|
||||
``on_phase_success(pkg, phase_name, log_file)``
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
This hook is run within the install subprocess, and specifically when a phase
|
||||
successfully finishes. Since we are interested in the package, the name of
|
||||
the phase, and any output from it, we require:
|
||||
|
||||
- **pkg**: the package variable, which also has the attached spec at ``pkg.spec``
|
||||
- **phase_name**: the name of the phase that was successful (e.g., configure)
|
||||
- **log_file**: the path to the file with output, in case you need to inspect or otherwise interact with it.
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""
|
||||
``on_phase_error(pkg, phase_name, log_file)``
|
||||
"""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
In the case of an error during a phase, we might want to trigger some event
|
||||
with a hook, and this is the purpose of this particular hook. Akin to
|
||||
``on_phase_success`` we require the same variables - the package that failed,
|
||||
the name of the phase, and the log file where we might find errors.
|
||||
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
Adding a New Hook Type
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Adding a new hook type is very simple! In ``lib/spack/spack/hooks/__init__.py``
|
||||
you can simply create a new ``HookRunner`` that is named to match your new hook.
|
||||
For example, let's say you want to add a new hook called ``post_log_write``
|
||||
to trigger after anything is written to a logger. You would add it as follows:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
# pre/post install and run by the install subprocess
|
||||
pre_install = HookRunner('pre_install')
|
||||
post_install = HookRunner('post_install')
|
||||
|
||||
# hooks related to logging
|
||||
post_log_write = HookRunner('post_log_write') # <- here is my new hook!
|
||||
|
||||
|
||||
You then need to decide what arguments my hook would expect. Since this is
|
||||
related to logging, let's say that you want a message and level. That means
|
||||
that when you add a python file to the ``lib/spack/spack/hooks``
|
||||
folder with one or more callbacks intended to be triggered by this hook. You might
|
||||
use my new hook as follows:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
def post_log_write(message, level):
|
||||
"""Do something custom with the messsage and level every time we write
|
||||
to the log
|
||||
"""
|
||||
print('running post_log_write!')
|
||||
|
||||
|
||||
To use the hook, we would call it as follows somewhere in the logic to do logging.
|
||||
In this example, we use it outside of a logger that is already defined:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
import spack.hooks
|
||||
|
||||
# We do something here to generate a logger and message
|
||||
spack.hooks.post_log_write(message, logger.level)
|
||||
|
||||
|
||||
This is not to say that this would be the best way to implement an integration
|
||||
with the logger (you'd probably want to write a custom logger, or you could
|
||||
have the hook defined within the logger) but serves as an example of writing a hook.
|
||||
|
||||
----------
|
||||
Unit tests
|
||||
----------
|
||||
@@ -506,38 +353,6 @@ Unit tests
|
||||
Unit testing
|
||||
------------
|
||||
|
||||
---------------------
|
||||
Developer environment
|
||||
---------------------
|
||||
|
||||
.. warning::
|
||||
|
||||
This is an experimental feature. It is expected to change and you should
|
||||
not use it in a production environment.
|
||||
|
||||
|
||||
When installing a package, we currently have support to export environment
|
||||
variables to specify adding debug flags to the build. By default, a package
|
||||
install will build without any debug flag. However, if you want to add them,
|
||||
you can export:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
export SPACK_ADD_DEBUG_FLAGS=true
|
||||
spack install zlib
|
||||
|
||||
|
||||
If you want to add custom flags, you should export an additional variable:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
export SPACK_ADD_DEBUG_FLAGS=true
|
||||
export SPACK_DEBUG_FLAGS="-g"
|
||||
spack install zlib
|
||||
|
||||
These environment variables will eventually be integrated into spack so
|
||||
they are set from the command line.
|
||||
|
||||
------------------
|
||||
Developer commands
|
||||
------------------
|
||||
@@ -548,35 +363,11 @@ Developer commands
|
||||
``spack doc``
|
||||
^^^^^^^^^^^^^
|
||||
|
||||
.. _cmd-spack-style:
|
||||
^^^^^^^^^^^^^^
|
||||
``spack test``
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
^^^^^^^^^^^^^^^
|
||||
``spack style``
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
spack style exists to help the developer user to check imports and style with
|
||||
mypy, flake8, isort, and (soon) black. To run all style checks, simply do:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack style
|
||||
|
||||
To run automatic fixes for isort you can do:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack style --fix
|
||||
|
||||
You do not need any of these Python packages installed on your system for
|
||||
the checks to work! Spack will bootstrap install them from packages for
|
||||
your use.
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
``spack unit-test``
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
See the :ref:`contributor guide section <cmd-spack-unit-test>` on
|
||||
``spack unit-test``.
|
||||
See the :ref:`contributor guide section <cmd-spack-test>` on ``spack test``.
|
||||
|
||||
.. _cmd-spack-python:
|
||||
|
||||
@@ -604,89 +395,23 @@ other Spack modules:
|
||||
True
|
||||
>>>
|
||||
|
||||
If you prefer using an IPython interpreter, given that IPython is installed
|
||||
you can specify the interpreter with ``-i``:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack python -i ipython
|
||||
Python 3.8.3 (default, May 19 2020, 18:47:26)
|
||||
Type 'copyright', 'credits' or 'license' for more information
|
||||
IPython 7.17.0 -- An enhanced Interactive Python. Type '?' for help.
|
||||
|
||||
|
||||
Spack version 0.16.0
|
||||
Python 3.8.3, Linux x86_64
|
||||
|
||||
In [1]:
|
||||
|
||||
|
||||
With either interpreter you can run a single command:
|
||||
You can also run a single command:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack python -c 'import distro; distro.linux_distribution()'
|
||||
('Ubuntu', '18.04', 'Bionic Beaver')
|
||||
|
||||
$ spack python -i ipython -c 'import distro; distro.linux_distribution()'
|
||||
Out[1]: ('Ubuntu', '18.04', 'Bionic Beaver')
|
||||
('Fedora', '25', 'Workstation Edition')
|
||||
|
||||
or a file:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack python ~/test_fetching.py
|
||||
$ spack python -i ipython ~/test_fetching.py
|
||||
|
||||
just like you would with the normal ``python`` command.
|
||||
|
||||
|
||||
.. _cmd-spack-url:
|
||||
|
||||
|
||||
^^^^^^^^^^^^^^^
|
||||
``spack blame``
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
Spack blame is a way to quickly see contributors to packages or files
|
||||
in the spack repository. You should provide a target package name or
|
||||
file name to the command. Here is an example asking to see contributions
|
||||
for the package "python":
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack blame python
|
||||
LAST_COMMIT LINES % AUTHOR EMAIL
|
||||
2 weeks ago 3 0.3 Mickey Mouse <cheddar@gmouse.org>
|
||||
a month ago 927 99.7 Minnie Mouse <swiss@mouse.org>
|
||||
|
||||
2 weeks ago 930 100.0
|
||||
|
||||
|
||||
By default, you will get a table view (shown above) sorted by date of contribution,
|
||||
with the most recent contribution at the top. If you want to sort instead
|
||||
by percentage of code contribution, then add ``-p``:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack blame -p python
|
||||
|
||||
|
||||
And to see the git blame view, add ``-g`` instead:
|
||||
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack blame -g python
|
||||
|
||||
|
||||
Finally, to get a json export of the data, add ``--json``:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack blame --json python
|
||||
|
||||
|
||||
^^^^^^^^^^^^^
|
||||
``spack url``
|
||||
^^^^^^^^^^^^^
|
||||
@@ -770,405 +495,3 @@ The bottom of the output shows the top most time consuming functions,
|
||||
slowest on top. The profiling support is from Python's built-in tool,
|
||||
`cProfile
|
||||
<https://docs.python.org/2/library/profile.html#module-cProfile>`_.
|
||||
|
||||
.. _releases:
|
||||
|
||||
--------
|
||||
Releases
|
||||
--------
|
||||
|
||||
This section documents Spack's release process. It is intended for
|
||||
project maintainers, as the tasks described here require maintainer
|
||||
privileges on the Spack repository. For others, we hope this section at
|
||||
least provides some insight into how the Spack project works.
|
||||
|
||||
.. _release-branches:
|
||||
|
||||
^^^^^^^^^^^^^^^^
|
||||
Release branches
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
There are currently two types of Spack releases: :ref:`major releases
|
||||
<major-releases>` (``0.17.0``, ``0.18.0``, etc.) and :ref:`point releases
|
||||
<point-releases>` (``0.17.1``, ``0.17.2``, ``0.17.3``, etc.). Here is a
|
||||
diagram of how Spack release branches work::
|
||||
|
||||
o branch: develop (latest version, v0.19.0.dev0)
|
||||
|
|
||||
o
|
||||
| o branch: releases/v0.18, tag: v0.18.1
|
||||
o |
|
||||
| o tag: v0.18.0
|
||||
o |
|
||||
| o
|
||||
|/
|
||||
o
|
||||
|
|
||||
o
|
||||
| o branch: releases/v0.17, tag: v0.17.2
|
||||
o |
|
||||
| o tag: v0.17.1
|
||||
o |
|
||||
| o tag: v0.17.0
|
||||
o |
|
||||
| o
|
||||
|/
|
||||
o
|
||||
|
||||
The ``develop`` branch has the latest contributions, and nearly all pull
|
||||
requests target ``develop``. The ``develop`` branch will report that its
|
||||
version is that of the next **major** release with a ``.dev0`` suffix.
|
||||
|
||||
Each Spack release series also has a corresponding branch, e.g.
|
||||
``releases/v0.18`` has ``0.18.x`` versions of Spack, and
|
||||
``releases/v0.17`` has ``0.17.x`` versions. A major release is the first
|
||||
tagged version on a release branch. Minor releases are back-ported from
|
||||
develop onto release branches. This is typically done by cherry-picking
|
||||
bugfix commits off of ``develop``.
|
||||
|
||||
To avoid version churn for users of a release series, minor releases
|
||||
**should not** make changes that would change the concretization of
|
||||
packages. They should generally only contain fixes to the Spack core.
|
||||
However, sometimes priorities are such that new functionality needs to
|
||||
be added to a minor release.
|
||||
|
||||
Both major and minor releases are tagged. As a convenience, we also tag
|
||||
the latest release as ``releases/latest``, so that users can easily check
|
||||
it out to get the latest stable version. See :ref:`updating-latest-release`
|
||||
for more details.
|
||||
|
||||
.. note::
|
||||
|
||||
Older spack releases were merged **back** into develop so that we could
|
||||
do fancy things with tags, but since tarballs and many git checkouts do
|
||||
not have tags, this proved overly complex and confusing.
|
||||
|
||||
We have since converted to using `PEP 440 <https://peps.python.org/pep-0440/>`_
|
||||
compliant versions. `See here <https://github.com/spack/spack/pull/25267>`_ for
|
||||
details.
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Scheduling work for releases
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
We schedule work for releases by creating `GitHub projects
|
||||
<https://github.com/spack/spack/projects>`_. At any time, there may be
|
||||
several open release projects. For example, below are two releases (from
|
||||
some past version of the page linked above):
|
||||
|
||||
.. image:: images/projects.png
|
||||
|
||||
This image shows one release in progress for ``0.15.1`` and another for
|
||||
``0.16.0``. Each of these releases has a project board containing issues
|
||||
and pull requests. GitHub shows a status bar with completed work in
|
||||
green, work in progress in purple, and work not started yet in gray, so
|
||||
it's fairly easy to see progress.
|
||||
|
||||
Spack's project boards are not firm commitments so we move work between
|
||||
releases frequently. If we need to make a release and some tasks are not
|
||||
yet done, we will simply move them to the next minor or major release, rather
|
||||
than delaying the release to complete them.
|
||||
|
||||
For more on using GitHub project boards, see `GitHub's documentation
|
||||
<https://docs.github.com/en/github/managing-your-work-on-github/about-project-boards>`_.
|
||||
|
||||
|
||||
.. _major-releases:
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
Making major releases
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Assuming a project board has already been created and all required work
|
||||
completed, the steps to make the major release are:
|
||||
|
||||
#. Create two new project boards:
|
||||
|
||||
* One for the next major release
|
||||
* One for the next point release
|
||||
|
||||
#. Move any optional tasks that are not done to one of the new project boards.
|
||||
|
||||
In general, small bugfixes should go to the next point release. Major
|
||||
features, refactors, and changes that could affect concretization should
|
||||
go in the next major release.
|
||||
|
||||
#. Create a branch for the release, based on ``develop``:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ git checkout -b releases/v0.15 develop
|
||||
|
||||
For a version ``vX.Y.Z``, the branch's name should be
|
||||
``releases/vX.Y``. That is, you should create a ``releases/vX.Y``
|
||||
branch if you are preparing the ``X.Y.0`` release.
|
||||
|
||||
#. Remove the ``dev0`` development release segment from the version tuple in
|
||||
``lib/spack/spack/__init__.py``.
|
||||
|
||||
The version number itself should already be correct and should not be
|
||||
modified.
|
||||
|
||||
#. Update ``CHANGELOG.md`` with major highlights in bullet form.
|
||||
|
||||
Use proper markdown formatting, like `this example from 0.15.0
|
||||
<https://github.com/spack/spack/commit/d4bf70d9882fcfe88507e9cb444331d7dd7ba71c>`_.
|
||||
|
||||
#. Push the release branch to GitHub.
|
||||
|
||||
#. Make sure CI passes on the release branch, including:
|
||||
|
||||
* Regular unit tests
|
||||
* Build tests
|
||||
* The E4S pipeline at `gitlab.spack.io <https://gitlab.spack.io>`_
|
||||
|
||||
If CI is not passing, submit pull requests to ``develop`` as normal
|
||||
and keep rebasing the release branch on ``develop`` until CI passes.
|
||||
|
||||
#. Make sure the entire documentation is up to date. If documentation
|
||||
is outdated submit pull requests to ``develop`` as normal
|
||||
and keep rebasing the release branch on ``develop``.
|
||||
|
||||
#. Bump the major version in the ``develop`` branch.
|
||||
|
||||
Create a pull request targeting the ``develop`` branch, bumping the major
|
||||
version in ``lib/spack/spack/__init__.py`` with a ``dev0`` release segment.
|
||||
For instance when you have just released ``v0.15.0``, set the version
|
||||
to ``(0, 16, 0, 'dev0')`` on ``develop``.
|
||||
|
||||
#. Follow the steps in :ref:`publishing-releases`.
|
||||
|
||||
#. Follow the steps in :ref:`updating-latest-release`.
|
||||
|
||||
#. Follow the steps in :ref:`announcing-releases`.
|
||||
|
||||
|
||||
.. _point-releases:
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
Making point releases
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Assuming a project board has already been created and all required work
|
||||
completed, the steps to make the point release are:
|
||||
|
||||
#. Create a new project board for the next point release.
|
||||
|
||||
#. Move any optional tasks that are not done to the next project board.
|
||||
|
||||
#. Check out the release branch (it should already exist).
|
||||
|
||||
For the ``X.Y.Z`` release, the release branch is called ``releases/vX.Y``.
|
||||
For ``v0.15.1``, you would check out ``releases/v0.15``:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ git checkout releases/v0.15
|
||||
|
||||
#. Cherry-pick each pull request in the ``Done`` column of the release
|
||||
project board onto the release branch.
|
||||
|
||||
This is **usually** fairly simple since we squash the commits from the
|
||||
vast majority of pull requests. That means there is only one commit
|
||||
per pull request to cherry-pick. For example, `this pull request
|
||||
<https://github.com/spack/spack/pull/15777>`_ has three commits, but
|
||||
they were squashed into a single commit on merge. You can see the
|
||||
commit that was created here:
|
||||
|
||||
.. image:: images/pr-commit.png
|
||||
|
||||
You can easily cherry pick it like this (assuming you already have the
|
||||
release branch checked out):
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ git cherry-pick 7e46da7
|
||||
|
||||
For pull requests that were rebased (or not squashed), you'll need to
|
||||
cherry-pick each associated commit individually.
|
||||
|
||||
.. warning::
|
||||
|
||||
It is important to cherry-pick commits in the order they happened,
|
||||
otherwise you can get conflicts while cherry-picking. When
|
||||
cherry-picking onto a point release, look at the merge date,
|
||||
**not** the number of the pull request or the date it was opened.
|
||||
|
||||
Sometimes you may **still** get merge conflicts even if you have
|
||||
cherry-picked all the commits in order. This generally means there
|
||||
is some other intervening pull request that the one you're trying
|
||||
to pick depends on. In these cases, you'll need to make a judgment
|
||||
call regarding those pull requests. Consider the number of affected
|
||||
files and or the resulting differences.
|
||||
|
||||
1. If the dependency changes are small, you might just cherry-pick it,
|
||||
too. If you do this, add the task to the release board.
|
||||
|
||||
2. If the changes are large, then you may decide that this fix is not
|
||||
worth including in a point release, in which case you should remove
|
||||
the task from the release project.
|
||||
|
||||
3. You can always decide to manually back-port the fix to the release
|
||||
branch if neither of the above options makes sense, but this can
|
||||
require a lot of work. It's seldom the right choice.
|
||||
|
||||
#. Bump the version in ``lib/spack/spack/__init__.py``.
|
||||
|
||||
#. Update ``CHANGELOG.md`` with a list of the changes.
|
||||
|
||||
This is typically a summary of the commits you cherry-picked onto the
|
||||
release branch. See `the changelog from 0.14.1
|
||||
<https://github.com/spack/spack/commit/ff0abb9838121522321df2a054d18e54b566b44a>`_.
|
||||
|
||||
#. Push the release branch to GitHub.
|
||||
|
||||
#. Make sure CI passes on the release branch, including:
|
||||
|
||||
* Regular unit tests
|
||||
* Build tests
|
||||
* The E4S pipeline at `gitlab.spack.io <https://gitlab.spack.io>`_
|
||||
|
||||
If CI does not pass, you'll need to figure out why, and make changes
|
||||
to the release branch until it does. You can make more commits, modify
|
||||
or remove cherry-picked commits, or cherry-pick **more** from
|
||||
``develop`` to make this happen.
|
||||
|
||||
#. Follow the steps in :ref:`publishing-releases`.
|
||||
|
||||
#. Follow the steps in :ref:`updating-latest-release`.
|
||||
|
||||
#. Follow the steps in :ref:`announcing-releases`.
|
||||
|
||||
|
||||
.. _publishing-releases:
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Publishing a release on GitHub
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
#. Create the release in GitHub.
|
||||
|
||||
* Go to
|
||||
`github.com/spack/spack/releases <https://github.com/spack/spack/releases>`_
|
||||
and click ``Draft a new release``.
|
||||
|
||||
* Set ``Tag version`` to the name of the tag that will be created.
|
||||
|
||||
The name should start with ``v`` and contain *all three*
|
||||
parts of the version (e.g. ``v0.15.0`` or ``v0.15.1``).
|
||||
|
||||
* Set ``Target`` to the ``releases/vX.Y`` branch (e.g., ``releases/v0.15``).
|
||||
|
||||
* Set ``Release title`` to ``vX.Y.Z`` to match the tag (e.g., ``v0.15.1``).
|
||||
|
||||
* Paste the latest release markdown from your ``CHANGELOG.md`` file as the text.
|
||||
|
||||
* Save the draft so you can keep coming back to it as you prepare the release.
|
||||
|
||||
#. When you are ready to finalize the release, click ``Publish release``.
|
||||
|
||||
#. Immediately after publishing, go back to
|
||||
`github.com/spack/spack/releases
|
||||
<https://github.com/spack/spack/releases>`_ and download the
|
||||
auto-generated ``.tar.gz`` file for the release. It's the ``Source
|
||||
code (tar.gz)`` link.
|
||||
|
||||
#. Click ``Edit`` on the release you just made and attach the downloaded
|
||||
release tarball as a binary. This does two things:
|
||||
|
||||
#. Makes sure that the hash of our releases does not change over time.
|
||||
|
||||
GitHub sometimes annoyingly changes the way they generate tarballs
|
||||
that can result in the hashes changing if you rely on the
|
||||
auto-generated tarball links.
|
||||
|
||||
#. Gets download counts on releases visible through the GitHub API.
|
||||
|
||||
GitHub tracks downloads of artifacts, but *not* the source
|
||||
links. See the `releases
|
||||
page <https://api.github.com/repos/spack/spack/releases>`_ and search
|
||||
for ``download_count`` to see this.
|
||||
|
||||
#. Go to `readthedocs.org <https://readthedocs.org/projects/spack>`_ and
|
||||
activate the release tag.
|
||||
|
||||
This builds the documentation and makes the released version
|
||||
selectable in the versions menu.
|
||||
|
||||
|
||||
.. _updating-latest-release:
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Updating `releases/latest`
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
If the new release is the **highest** Spack release yet, you should
|
||||
also tag it as ``releases/latest``. For example, suppose the highest
|
||||
release is currently ``0.15.3``:
|
||||
|
||||
* If you are releasing ``0.15.4`` or ``0.16.0``, then you should tag
|
||||
it with ``releases/latest``, as these are higher than ``0.15.3``.
|
||||
|
||||
* If you are making a new release of an **older** major version of
|
||||
Spack, e.g. ``0.14.4``, then you should not tag it as
|
||||
``releases/latest`` (as there are newer major versions).
|
||||
|
||||
To tag ``releases/latest``, do this:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ git checkout releases/vX.Y # vX.Y is the new release's branch
|
||||
$ git tag --force releases/latest
|
||||
$ git push --force --tags
|
||||
|
||||
The ``--force`` argument to ``git tag`` makes ``git`` overwrite the existing
|
||||
``releases/latest`` tag with the new one.
|
||||
|
||||
|
||||
.. _announcing-releases:
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
Announcing a release
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
We announce releases in all of the major Spack communication channels.
|
||||
Publishing the release takes care of GitHub. The remaining channels are
|
||||
Twitter, Slack, and the mailing list. Here are the steps:
|
||||
|
||||
#. Announce the release on Twitter.
|
||||
|
||||
* Compose the tweet on the ``@spackpm`` account per the
|
||||
``spack-twitter`` slack channel.
|
||||
|
||||
* Be sure to include a link to the release's page on GitHub.
|
||||
|
||||
You can base the tweet on `this
|
||||
example <https://twitter.com/spackpm/status/1231761858182307840>`_.
|
||||
|
||||
#. Announce the release on Slack.
|
||||
|
||||
* Compose a message in the ``#general`` Slack channel
|
||||
(`spackpm.slack.com <https://spackpm.slack.com>`_).
|
||||
|
||||
* Preface the message with ``@channel`` to notify even those
|
||||
people not currently logged in.
|
||||
|
||||
* Be sure to include a link to the tweet above.
|
||||
|
||||
The tweet will be shown inline so that you do not have to retype
|
||||
your release announcement.
|
||||
|
||||
#. Announce the release on the Spack mailing list.
|
||||
|
||||
* Compose an email to the Spack mailing list.
|
||||
|
||||
* Be sure to include a link to the release's page on GitHub.
|
||||
|
||||
* It is also helpful to include some information directly in the
|
||||
email.
|
||||
|
||||
You can base your announcement on this `example
|
||||
email <https://groups.google.com/forum/#!topic/spack/WT4CT9i_X4s>`_.
|
||||
|
||||
Once you've completed the above steps, congratulations, you're done!
|
||||
You've finished making the release!
|
||||
|
41
lib/spack/docs/docker_for_developers.rst
Normal file
41
lib/spack/docs/docker_for_developers.rst
Normal file
@@ -0,0 +1,41 @@
|
||||
.. Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
|
||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
.. _docker_for_developers:
|
||||
|
||||
=====================
|
||||
Docker for Developers
|
||||
=====================
|
||||
|
||||
This guide is intended for people who want to use our prepared docker
|
||||
environments to work on developing Spack or working on spack packages. It is
|
||||
meant to serve as the companion documentation for the :ref:`packaging-guide`.
|
||||
|
||||
--------
|
||||
Overview
|
||||
--------
|
||||
|
||||
To get started, all you need is the latest version of ``docker``.
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ cd share/spack/docker
|
||||
$ source config/ubuntu.bash
|
||||
$ ./run-image.sh
|
||||
|
||||
This command should drop you into an interactive shell where you can run spack
|
||||
within an isolated docker container running ubuntu. The copy of spack being
|
||||
used should be tied to the working copy of your cloned git repo, so any changes
|
||||
you make should be immediately reflected in the running docker container. Feel
|
||||
free to add or modify any packages or to hack on spack, itself. Your contained
|
||||
copy of spack should immediately reflect all changes.
|
||||
|
||||
To work within a container running a different linux distro, source one of the
|
||||
other environment files under ``config``.
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ source config/fedora.bash
|
||||
$ ./run-image.sh
|
BIN
lib/spack/docs/dockerhub_spack.png
Normal file
BIN
lib/spack/docs/dockerhub_spack.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 88 KiB |
@@ -1,13 +1,13 @@
|
||||
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||
.. Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
|
||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
.. _environments:
|
||||
|
||||
=========================
|
||||
Environments (spack.yaml)
|
||||
=========================
|
||||
============
|
||||
Environments
|
||||
============
|
||||
|
||||
An environment is used to group together a set of specs for the
|
||||
purpose of building, rebuilding and deploying in a coherent fashion.
|
||||
@@ -130,7 +130,7 @@ To activate an environment, use the following command:
|
||||
By default, the ``spack env activate`` will load the view associated
|
||||
with the Environment into the user environment. The ``-v,
|
||||
--with-view`` argument ensures this behavior, and the ``-V,
|
||||
--without-view`` argument activates the environment without changing
|
||||
--without-vew`` argument activates the environment without changing
|
||||
the user environment variables.
|
||||
|
||||
The ``-p`` option to the ``spack env activate`` command modifies the
|
||||
@@ -167,6 +167,15 @@ Any directory can be treated as an environment if it contains a file
|
||||
|
||||
$ spack env activate -d /path/to/directory
|
||||
|
||||
Spack commands that are environment sensitive will also act on the
|
||||
environment any time the current working directory contains a
|
||||
``spack.yaml`` file. Changing working directory to a directory
|
||||
containing a ``spack.yaml`` file is equivalent to the command:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack env activate -d /path/to/dir --without-view
|
||||
|
||||
Anonymous specs can be created in place using the command:
|
||||
|
||||
.. code-block:: console
|
||||
@@ -191,24 +200,44 @@ Environment has been activated. Similarly, the ``install`` and
|
||||
==> 0 installed packages
|
||||
|
||||
$ spack install zlib@1.2.11
|
||||
==> Installing zlib-1.2.11-q6cqrdto4iktfg6qyqcc5u4vmfmwb7iv
|
||||
==> No binary for zlib-1.2.11-q6cqrdto4iktfg6qyqcc5u4vmfmwb7iv found: installing from source
|
||||
==> zlib: Executing phase: 'install'
|
||||
[+] ~/spack/opt/spack/linux-rhel7-broadwell/gcc-8.1.0/zlib-1.2.11-q6cqrdto4iktfg6qyqcc5u4vmfmwb7iv
|
||||
==> Installing zlib
|
||||
==> Searching for binary cache of zlib
|
||||
==> Warning: No Spack mirrors are currently configured
|
||||
==> No binary for zlib found: installing from source
|
||||
==> Fetching http://zlib.net/fossils/zlib-1.2.11.tar.gz
|
||||
######################################################################## 100.0%
|
||||
==> Staging archive: /spack/var/spack/stage/zlib-1.2.11-3r4cfkmx3wwfqeof4bc244yduu2mz4ur/zlib-1.2.11.tar.gz
|
||||
==> Created stage in /spack/var/spack/stage/zlib-1.2.11-3r4cfkmx3wwfqeof4bc244yduu2mz4ur
|
||||
==> No patches needed for zlib
|
||||
==> Building zlib [Package]
|
||||
==> Executing phase: 'install'
|
||||
==> Successfully installed zlib
|
||||
Fetch: 0.36s. Build: 11.58s. Total: 11.93s.
|
||||
[+] /spack/opt/spack/linux-rhel7-x86_64/gcc-4.9.3/zlib-1.2.11-3r4cfkmx3wwfqeof4bc244yduu2mz4ur
|
||||
|
||||
$ spack env activate myenv
|
||||
|
||||
$ spack find
|
||||
==> In environment myenv
|
||||
==> No root specs
|
||||
|
||||
==> 0 installed packages
|
||||
|
||||
$ spack install zlib@1.2.8
|
||||
==> Installing zlib-1.2.8-yfc7epf57nsfn2gn4notccaiyxha6z7x
|
||||
==> No binary for zlib-1.2.8-yfc7epf57nsfn2gn4notccaiyxha6z7x found: installing from source
|
||||
==> zlib: Executing phase: 'install'
|
||||
[+] ~/spack/opt/spack/linux-rhel7-broadwell/gcc-8.1.0/zlib-1.2.8-yfc7epf57nsfn2gn4notccaiyxha6z7x
|
||||
==> Updating view at ~/spack/var/spack/environments/myenv/.spack-env/view
|
||||
==> Installing zlib
|
||||
==> Searching for binary cache of zlib
|
||||
==> Warning: No Spack mirrors are currently configured
|
||||
==> No binary for zlib found: installing from source
|
||||
==> Fetching http://zlib.net/fossils/zlib-1.2.8.tar.gz
|
||||
######################################################################## 100.0%
|
||||
==> Staging archive: /spack/var/spack/stage/zlib-1.2.8-y2t6kq3s23l52yzhcyhbpovswajzi7f7/zlib-1.2.8.tar.gz
|
||||
==> Created stage in /spack/var/spack/stage/zlib-1.2.8-y2t6kq3s23l52yzhcyhbpovswajzi7f7
|
||||
==> No patches needed for zlib
|
||||
==> Building zlib [Package]
|
||||
==> Executing phase: 'install'
|
||||
==> Successfully installed zlib
|
||||
Fetch: 0.26s. Build: 2.08s. Total: 2.35s.
|
||||
[+] /spack/opt/spack/linux-rhel7-x86_64/gcc-4.9.3/zlib-1.2.8-y2t6kq3s23l52yzhcyhbpovswajzi7f7
|
||||
|
||||
$ spack find
|
||||
==> In environment myenv
|
||||
@@ -216,17 +245,15 @@ Environment has been activated. Similarly, the ``install`` and
|
||||
zlib@1.2.8
|
||||
|
||||
==> 1 installed package
|
||||
-- linux-rhel7-broadwell / gcc@8.1.0 ----------------------------
|
||||
-- linux-rhel7-x86_64 / gcc@4.9.3 -------------------------------
|
||||
zlib@1.2.8
|
||||
|
||||
$ despacktivate
|
||||
|
||||
$ spack find
|
||||
==> 2 installed packages
|
||||
-- linux-rhel7-broadwell / gcc@8.1.0 ----------------------------
|
||||
-- linux-rhel7-x86_64 / gcc@4.9.3 -------------------------------
|
||||
zlib@1.2.8 zlib@1.2.11
|
||||
|
||||
|
||||
Note that when we installed the abstract spec ``zlib@1.2.8``, it was
|
||||
presented as a root of the Environment. All explicitly installed
|
||||
packages will be listed as roots of the Environment.
|
||||
@@ -248,24 +275,24 @@ Users can add abstract specs to an Environment using the ``spack add``
|
||||
command. The most important component of an Environment is a list of
|
||||
abstract specs.
|
||||
|
||||
Adding a spec adds to the manifest (the ``spack.yaml`` file), which is
|
||||
used to define the roots of the Environment, but does not affect the
|
||||
concrete specs in the lockfile, nor does it install the spec.
|
||||
Adding a spec adds to the manifest (the ``spack.yaml`` file) and to
|
||||
the roots of the Environment, but does not affect the concrete specs
|
||||
in the lockfile, nor does it install the spec.
|
||||
|
||||
The ``spack add`` command is environment aware. It adds to the
|
||||
currently active environment. All environment aware commands can also
|
||||
be called using the ``spack -e`` flag to specify the environment.
|
||||
be called using the ``spack -E`` flag to specify the environment.
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack env activate myenv
|
||||
$ spack activate myenv
|
||||
$ spack add mpileaks
|
||||
|
||||
or
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ spack -e myenv add python
|
||||
$ spack -E myenv add python
|
||||
|
||||
.. _environments_concretization:
|
||||
|
||||
@@ -273,9 +300,19 @@ or
|
||||
Concretizing
|
||||
^^^^^^^^^^^^
|
||||
|
||||
Once some user specs have been added to an environment, they can be concretized.
|
||||
There are at the moment three different modes of operation to concretize an environment,
|
||||
which are explained in details in :ref:`environments_concretization_config`.
|
||||
Once some user specs have been added to an environment, they can be
|
||||
concretized. *By default specs are concretized separately*, one after
|
||||
the other. This mode of operation permits to deploy a full
|
||||
software stack where multiple configurations of the same package
|
||||
need to be installed alongside each other. Central installations done
|
||||
at HPC centers by system administrators or user support groups
|
||||
are a common case that fits in this behavior.
|
||||
Environments *can also be configured to concretize all
|
||||
the root specs in a self-consistent way* to ensure that
|
||||
each package in the environment comes with a single configuration. This
|
||||
mode of operation is usually what is required by software developers that
|
||||
want to deploy their development environment.
|
||||
|
||||
Regardless of which mode of operation has been chosen, the following
|
||||
command will ensure all the root specs are concretized according to the
|
||||
constraints that are prescribed in the configuration:
|
||||
@@ -321,9 +358,6 @@ installed specs using the ``-c`` (``--concretized``) flag.
|
||||
|
||||
==> 0 installed packages
|
||||
|
||||
|
||||
.. _installing-environment:
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Installing an Environment
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@@ -339,24 +373,6 @@ If the Environment has been concretized, Spack will install the
|
||||
concretized specs. Otherwise, ``spack install`` will first concretize
|
||||
the Environment and then install the concretized specs.
|
||||
|
||||
.. note::
|
||||
|
||||
Every ``spack install`` process builds one package at a time with multiple build
|
||||
jobs, controlled by the ``-j`` flag and the ``config:build_jobs`` option
|
||||
(see :ref:`build-jobs`). To speed up environment builds further, independent
|
||||
packages can be installed in parallel by launching more Spack instances. For
|
||||
example, the following will build at most four packages in parallel using
|
||||
three background jobs:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
[myenv]$ spack install & spack install & spack install & spack install
|
||||
|
||||
Another option is to generate a ``Makefile`` and run ``make -j<N>`` to control
|
||||
the number of parallel install processes. See :ref:`env-generate-depfile`
|
||||
for details.
|
||||
|
||||
|
||||
As it installs, ``spack install`` creates symbolic links in the
|
||||
``logs/`` directory in the Environment, allowing for easy inspection
|
||||
of build logs related to that environment. The ``spack install``
|
||||
@@ -364,18 +380,6 @@ command also stores a Spack repo containing the ``package.py`` file
|
||||
used at install time for each package in the ``repos/`` directory in
|
||||
the Environment.
|
||||
|
||||
The ``--no-add`` option can be used in a concrete environment to tell
|
||||
spack to install specs already present in the environment but not to
|
||||
add any new root specs to the environment. For root specs provided
|
||||
to ``spack install`` on the command line, ``--no-add`` is the default,
|
||||
while for dependency specs on the other hand, it is optional. In other
|
||||
words, if there is an unambiguous match in the active concrete environment
|
||||
for a root spec provided to ``spack install`` on the command line, spack
|
||||
does not require you to specify the ``--no-add`` option to prevent the spec
|
||||
from being added again. At the same time, a spec that already exists in the
|
||||
environment, but only as a dependency, will be added to the environment as a
|
||||
root spec without the ``--no-add`` option.
|
||||
|
||||
^^^^^^^
|
||||
Loading
|
||||
^^^^^^^
|
||||
@@ -392,11 +396,18 @@ Sourcing that file in Bash will make the environment available to the
|
||||
user; and can be included in ``.bashrc`` files, etc. The ``loads``
|
||||
file may also be copied out of the environment, renamed, etc.
|
||||
|
||||
----------
|
||||
spack.yaml
|
||||
----------
|
||||
|
||||
Spack environments can be customized at finer granularity by editing
|
||||
the ``spack.yaml`` manifest file directly.
|
||||
|
||||
.. _environment-configuration:
|
||||
|
||||
------------------------
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Configuring Environments
|
||||
------------------------
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
A variety of Spack behaviors are changed through Spack configuration
|
||||
files, covered in more detail in the :ref:`configuration`
|
||||
@@ -412,15 +423,9 @@ There are two ways to include configuration information in a Spack Environment:
|
||||
|
||||
#. Included in the ``spack.yaml`` file from another file.
|
||||
|
||||
Many Spack commands also affect configuration information in files
|
||||
automatically. Those commands take a ``--scope`` argument, and the
|
||||
environment can be specified by ``env:NAME`` (to affect environment
|
||||
``foo``, set ``--scope env:foo``). These commands will automatically
|
||||
manipulate configuration inline in the ``spack.yaml`` file.
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
"""""""""""""""""""""
|
||||
Inline configurations
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
"""""""""""""""""""""
|
||||
|
||||
Inline Environment-scope configuration is done using the same yaml
|
||||
format as standard Spack configuration scopes, covered in the
|
||||
@@ -441,9 +446,9 @@ a ``packages.yaml`` file) could contain:
|
||||
This configuration sets the default compiler for all packages to
|
||||
``intel``.
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
"""""""""""""""""""""""
|
||||
Included configurations
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
"""""""""""""""""""""""
|
||||
|
||||
Spack environments allow an ``include`` heading in their yaml
|
||||
schema. This heading pulls in external configuration files and applies
|
||||
@@ -460,12 +465,12 @@ Environments can include files with either relative or absolute
|
||||
paths. Inline configurations take precedence over included
|
||||
configurations, so you don't have to change shared configuration files
|
||||
to make small changes to an individual Environment. Included configs
|
||||
listed earlier will have higher precedence, as the included configs are
|
||||
applied in reverse order.
|
||||
listed later will have higher precedence, as the included configs are
|
||||
applied in order.
|
||||
|
||||
-------------------------------
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Manually Editing the Specs List
|
||||
-------------------------------
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The list of abstract/root specs in the Environment is maintained in
|
||||
the ``spack.yaml`` manifest under the heading ``specs``.
|
||||
@@ -483,81 +488,37 @@ Appending to this list in the yaml is identical to using the ``spack
|
||||
add`` command from the command line. However, there is more power
|
||||
available from the yaml file.
|
||||
|
||||
.. _environments_concretization_config:
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
"""""""""""""""""""
|
||||
Spec concretization
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
An environment can be concretized in three different modes and the behavior active under any environment
|
||||
is determined by the ``concretizer:unify`` property. By default specs are concretized *separately*, one after the other:
|
||||
"""""""""""""""""""
|
||||
|
||||
Specs can be concretized separately or together, as already
|
||||
explained in :ref:`environments_concretization`. The behavior active
|
||||
under any environment is determined by the ``concretization`` property:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
spack:
|
||||
specs:
|
||||
- hdf5~mpi
|
||||
- hdf5+mpi
|
||||
- zlib@1.2.8
|
||||
concretizer:
|
||||
unify: false
|
||||
- ncview
|
||||
- netcdf
|
||||
- nco
|
||||
- py-sphinx
|
||||
concretization: together
|
||||
|
||||
This mode of operation permits to deploy a full software stack where multiple configurations of the same package
|
||||
need to be installed alongside each other using the best possible selection of transitive dependencies. The downside
|
||||
is that redundancy of installations is disregarded completely, and thus environments might be more bloated than
|
||||
strictly needed. In the example above, for instance, if a version of ``zlib`` newer than ``1.2.8`` is known to Spack,
|
||||
then it will be used for both ``hdf5`` installations.
|
||||
|
||||
If redundancy of the environment is a concern, Spack provides a way to install it *together where possible*,
|
||||
i.e. trying to maximize reuse of dependencies across different specs:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
spack:
|
||||
specs:
|
||||
- hdf5~mpi
|
||||
- hdf5+mpi
|
||||
- zlib@1.2.8
|
||||
concretizer:
|
||||
unify: when_possible
|
||||
|
||||
Also in this case Spack allows having multiple configurations of the same package, but privileges the reuse of
|
||||
specs over other factors. Going back to our example, this means that both ``hdf5`` installations will use
|
||||
``zlib@1.2.8`` as a dependency even if newer versions of that library are available.
|
||||
Central installations done at HPC centers by system administrators or user support groups are a common case
|
||||
that fits either of these two modes.
|
||||
|
||||
Environments can also be configured to concretize all the root specs *together*, in a self-consistent way, to
|
||||
ensure that each package in the environment comes with a single configuration:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
spack:
|
||||
specs:
|
||||
- hdf5+mpi
|
||||
- zlib@1.2.8
|
||||
concretizer:
|
||||
unify: true
|
||||
|
||||
This mode of operation is usually what is required by software developers that want to deploy their development
|
||||
environment and have a single view of it in the filesystem.
|
||||
|
||||
.. note::
|
||||
|
||||
The ``concretizer:unify`` config option was introduced in Spack 0.18 to
|
||||
replace the ``concretization`` property. For reference,
|
||||
``concretization: together`` is replaced by ``concretizer:unify:true``,
|
||||
and ``concretization: separately`` is replaced by ``concretizer:unify:false``.
|
||||
which can currently take either one of the two allowed values ``together`` or ``separately``
|
||||
(the default).
|
||||
|
||||
.. admonition:: Re-concretization of user specs
|
||||
|
||||
When concretizing specs *together* or *together where possible* the entire set of specs will be
|
||||
When concretizing specs together the entire set of specs will be
|
||||
re-concretized after any addition of new user specs, to ensure that
|
||||
the environment remains consistent / minimal. When instead the specs are concretized
|
||||
the environment remains consistent. When instead the specs are concretized
|
||||
separately only the new specs will be re-concretized after any addition.
|
||||
|
||||
^^^^^^^^^^^^^
|
||||
"""""""""""""
|
||||
Spec Matrices
|
||||
^^^^^^^^^^^^^
|
||||
"""""""""""""
|
||||
|
||||
Entries in the ``specs`` list can be individual abstract specs or a
|
||||
spec matrix.
|
||||
@@ -617,9 +578,9 @@ This allows one to create toolchains out of combinations of
|
||||
constraints and apply them somewhat indiscriminately to packages,
|
||||
without regard for the applicability of the constraint.
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
""""""""""""""""""""
|
||||
Spec List References
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
""""""""""""""""""""
|
||||
|
||||
The last type of possible entry in the specs list is a reference.
|
||||
|
||||
@@ -641,7 +602,7 @@ files are identical.
|
||||
spack:
|
||||
definitions:
|
||||
- first: [libelf, libdwarf]
|
||||
- compilers: ['%gcc', '%intel']
|
||||
- compilers: ['%gcc', '^intel']
|
||||
- second:
|
||||
- $first
|
||||
- matrix:
|
||||
@@ -686,7 +647,7 @@ named list ``compilers`` is ``['%gcc', '%clang', '%intel']`` on
|
||||
spack:
|
||||
definitions:
|
||||
- compilers: ['%gcc', '%clang']
|
||||
- when: arch.satisfies('x86_64:')
|
||||
- when: target == 'x86_64'
|
||||
compilers: ['%intel']
|
||||
|
||||
.. note::
|
||||
@@ -705,12 +666,8 @@ The valid variables for a ``when`` clause are:
|
||||
#. ``target``. The target string of the default Spack
|
||||
architecture on the system.
|
||||
|
||||
#. ``architecture`` or ``arch``. A Spack spec satisfying the default Spack
|
||||
architecture on the system. This supports querying via the ``satisfies``
|
||||
method, as shown above.
|
||||
|
||||
#. ``arch_str``. The architecture string of the default Spack architecture
|
||||
on the system.
|
||||
#. ``architecture`` or ``arch``. The full string of the
|
||||
default Spack architecture on the system.
|
||||
|
||||
#. ``re``. The standard regex module in Python.
|
||||
|
||||
@@ -719,75 +676,35 @@ The valid variables for a ``when`` clause are:
|
||||
#. ``hostname``. The hostname of the system (if ``hostname`` is an
|
||||
executable in the user's PATH).
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
SpecLists as Constraints
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Environment-managed Views
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Dependencies and compilers in Spack can be both packages in an
|
||||
environment and constraints on other packages. References to SpecLists
|
||||
allow a shorthand to treat packages in a list as either a compiler or
|
||||
a dependency using the ``$%`` or ``$^`` syntax respectively.
|
||||
Spack Environments can define filesystem views of their software,
|
||||
which are maintained as packages and can be installed and uninstalled from
|
||||
the Environment. Filesystem views provide an access point for packages
|
||||
from the filesystem for users who want to access those packages
|
||||
directly. For more information on filesystem views, see the section
|
||||
:ref:`filesystem-views`.
|
||||
|
||||
For example, the following environment has three root packages:
|
||||
``gcc@8.1.0``, ``mvapich2@2.3.1 %gcc@8.1.0``, and ``hdf5+mpi
|
||||
%gcc@8.1.0 ^mvapich2@2.3.1``.
|
||||
Spack Environment managed views are updated every time the environment
|
||||
is written out to the lock file ``spack.lock``, so the concrete
|
||||
environment and the view are always compatible.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
spack:
|
||||
definitions:
|
||||
- compilers: [gcc@8.1.0]
|
||||
- mpis: [mvapich2@2.3.1]
|
||||
- packages: [hdf5+mpi]
|
||||
|
||||
specs:
|
||||
- $compilers
|
||||
- matrix:
|
||||
- [$mpis]
|
||||
- [$%compilers]
|
||||
- matrix:
|
||||
- [$packages]
|
||||
- [$^mpis]
|
||||
- [$%compilers]
|
||||
|
||||
This allows for a much-needed reduction in redundancy between packages
|
||||
and constraints.
|
||||
|
||||
----------------
|
||||
Filesystem Views
|
||||
----------------
|
||||
|
||||
Spack Environments can define filesystem views, which provide a direct access point
|
||||
for software similar to the directory hierarchy that might exist under ``/usr/local``.
|
||||
Filesystem views are updated every time the environment is written out to the lock
|
||||
file ``spack.lock``, so the concrete environment and the view are always compatible.
|
||||
The files of the view's installed packages are brought into the view by symbolic or
|
||||
hard links, referencing the original Spack installation, or by copy.
|
||||
|
||||
.. _configuring_environment_views:
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Configuration in ``spack.yaml``
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
"""""""""""""""""""""""""""""
|
||||
Configuring environment views
|
||||
"""""""""""""""""""""""""""""
|
||||
|
||||
The Spack Environment manifest file has a top-level keyword
|
||||
``view``. Each entry under that heading is a **view descriptor**, headed
|
||||
by a name. Any number of views may be defined under the ``view`` heading.
|
||||
The view descriptor contains the root of the view, and
|
||||
optionally the projections for the view, ``select`` and
|
||||
``exclude`` lists for the view and link information via ``link`` and
|
||||
``link_type``.
|
||||
|
||||
For example, in the following manifest
|
||||
``view``. Each entry under that heading is a view descriptor, headed
|
||||
by a name. The view descriptor contains the root of the view, and
|
||||
optionally the projections for the view, and ``select`` and
|
||||
``exclude`` lists for the view. For example, in the following manifest
|
||||
file snippet we define a view named ``mpis``, rooted at
|
||||
``/path/to/view`` in which all projections use the package name,
|
||||
version, and compiler name to determine the path for a given
|
||||
package. This view selects all packages that depend on MPI, and
|
||||
excludes those built with the PGI compiler at version 18.5.
|
||||
The root specs with their (transitive) link and run type dependencies
|
||||
will be put in the view due to the ``link: all`` option,
|
||||
and the files in the view will be symlinks to the spack install
|
||||
directories.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
@@ -799,30 +716,15 @@ directories.
|
||||
select: [^mpi]
|
||||
exclude: ['%pgi@18.5']
|
||||
projections:
|
||||
all: '{name}/{version}-{compiler.name}'
|
||||
link: all
|
||||
link_type: symlink
|
||||
all: {name}/{version}-{compiler.name}
|
||||
|
||||
The default for the ``select`` and
|
||||
For more information on using view projections, see the section on
|
||||
:ref:`adding_projections_to_views`. The default for the ``select`` and
|
||||
``exclude`` values is to select everything and exclude nothing. The
|
||||
default projection is the default view projection (``{}``). The ``link``
|
||||
attribute allows the following values:
|
||||
|
||||
#. ``link: all`` include root specs with their transitive run and link type
|
||||
dependencies (default);
|
||||
#. ``link: run`` include root specs with their transitive run type dependencies;
|
||||
#. ``link: roots`` include root specs without their dependencies.
|
||||
|
||||
The ``link_type`` defaults to ``symlink`` but can also take the value
|
||||
of ``hardlink`` or ``copy``.
|
||||
|
||||
.. tip::
|
||||
|
||||
The option ``link: run`` can be used to create small environment views for
|
||||
Python packages. Python will be able to import packages *inside* of the view even
|
||||
when the environment is not activated, and linked libraries will be located
|
||||
*outside* of the view thanks to rpaths.
|
||||
default projection is the default view projection (``{}``).
|
||||
|
||||
Any number of views may be defined under the ``view`` heading in a
|
||||
Spack Environment.
|
||||
|
||||
There are two shorthands for environments with a single view. If the
|
||||
environment at ``/path/to/env`` has a single view, with a root at
|
||||
@@ -888,47 +790,9 @@ regenerate`` will regenerate the views for the environment. This will
|
||||
apply any updates in the environment configuration that have not yet
|
||||
been applied.
|
||||
|
||||
.. _view_projections:
|
||||
|
||||
""""""""""""""""
|
||||
View Projections
|
||||
""""""""""""""""
|
||||
The default projection into a view is to link every package into the
|
||||
root of the view. The projections attribute is a mapping of partial specs to
|
||||
spec format strings, defined by the :meth:`~spack.spec.Spec.format`
|
||||
function, as shown in the example below:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
projections:
|
||||
zlib: {name}-{version}
|
||||
^mpi: {name}-{version}/{^mpi.name}-{^mpi.version}-{compiler.name}-{compiler.version}
|
||||
all: {name}-{version}/{compiler.name}-{compiler.version}
|
||||
|
||||
The entries in the projections configuration file must all be either
|
||||
specs or the keyword ``all``. For each spec, the projection used will
|
||||
be the first non-``all`` entry that the spec satisfies, or ``all`` if
|
||||
there is an entry for ``all`` and no other entry is satisfied by the
|
||||
spec. Where the keyword ``all`` appears in the file does not
|
||||
matter.
|
||||
|
||||
Given the example above, the spec ``zlib@1.2.8``
|
||||
will be linked into ``/my/view/zlib-1.2.8/``, the spec
|
||||
``hdf5@1.8.10+mpi %gcc@4.9.3 ^mvapich2@2.2`` will be linked into
|
||||
``/my/view/hdf5-1.8.10/mvapich2-2.2-gcc-4.9.3``, and the spec
|
||||
``hdf5@1.8.10~mpi %gcc@4.9.3`` will be linked into
|
||||
``/my/view/hdf5-1.8.10/gcc-4.9.3``.
|
||||
|
||||
If the keyword ``all`` does not appear in the projections
|
||||
configuration file, any spec that does not satisfy any entry in the
|
||||
file will be linked into the root of the view as in a single-prefix
|
||||
view. Any entries that appear below the keyword ``all`` in the
|
||||
projections configuration file will not be used, as all specs will use
|
||||
the projection under ``all`` before reaching those entries.
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
""""""""""""""""""""""""""""
|
||||
Activating environment views
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
""""""""""""""""""""""""""""
|
||||
|
||||
The ``spack env activate`` command will put the default view for the
|
||||
environment into the user's path, in addition to activating the
|
||||
@@ -937,10 +801,8 @@ environment for Spack commands. The arguments ``-v,--with-view`` and
|
||||
behavior is to activate with the environment view if there is one.
|
||||
|
||||
The environment variables affected by the ``spack env activate``
|
||||
command and the paths that are used to update them are determined by
|
||||
the :ref:`prefix inspections <customize-env-modifications>` defined in
|
||||
your modules configuration; the defaults are summarized in the following
|
||||
table.
|
||||
command and the paths that are used to update them are in the
|
||||
following table.
|
||||
|
||||
=================== =========
|
||||
Variable Paths
|
||||
@@ -962,89 +824,3 @@ environment.
|
||||
|
||||
The ``spack env deactivate`` command will remove the default view of
|
||||
the environment from the user's path.
|
||||
|
||||
|
||||
.. _env-generate-depfile:
|
||||
|
||||
|
||||
------------------------------------------
|
||||
Generating Depfiles from Environments
|
||||
------------------------------------------
|
||||
|
||||
Spack can generate ``Makefile``\s to make it easier to build multiple
|
||||
packages in an environment in parallel. Generated ``Makefile``\s expose
|
||||
targets that can be included in existing ``Makefile``\s, to allow
|
||||
other targets to depend on the environment installation.
|
||||
|
||||
A typical workflow is as follows:
|
||||
|
||||
.. code:: console
|
||||
|
||||
spack env create -d .
|
||||
spack -e . add perl
|
||||
spack -e . concretize
|
||||
spack -e . env depfile > Makefile
|
||||
make -j64
|
||||
|
||||
This generates a ``Makefile`` from a concretized environment in the
|
||||
current working directory, and ``make -j64`` installs the environment,
|
||||
exploiting parallelism across packages as much as possible. Spack
|
||||
respects the Make jobserver and forwards it to the build environment
|
||||
of packages, meaning that a single ``-j`` flag is enough to control the
|
||||
load, even when packages are built in parallel.
|
||||
|
||||
By default the following phony convenience targets are available:
|
||||
|
||||
- ``make all``: installs the environment (default target);
|
||||
- ``make fetch-all``: only fetch sources of all packages;
|
||||
- ``make clean``: cleans files used by make, but does not uninstall packages.
|
||||
|
||||
.. tip::
|
||||
|
||||
GNU Make version 4.3 and above have great support for output synchronization
|
||||
through the ``-O`` and ``--output-sync`` flags, which ensure that output is
|
||||
printed orderly per package install. To get synchronized output with colors,
|
||||
use ``make -j<N> SPACK_COLOR=always --output-sync=recurse``.
|
||||
|
||||
The following advanced example shows how generated targets can be used in a
|
||||
``Makefile``:
|
||||
|
||||
.. code:: Makefile
|
||||
|
||||
SPACK ?= spack
|
||||
|
||||
.PHONY: all clean env
|
||||
|
||||
all: env
|
||||
|
||||
spack.lock: spack.yaml
|
||||
$(SPACK) -e . concretize -f
|
||||
|
||||
env.mk: spack.lock
|
||||
$(SPACK) -e . env depfile -o $@ --make-target-prefix spack
|
||||
|
||||
env: spack/env
|
||||
$(info Environment installed!)
|
||||
|
||||
clean:
|
||||
rm -rf spack.lock env.mk spack/
|
||||
|
||||
ifeq (,$(filter clean,$(MAKECMDGOALS)))
|
||||
include env.mk
|
||||
endif
|
||||
|
||||
When ``make`` is invoked, it first "remakes" the missing include ``env.mk``
|
||||
from its rule, which triggers concretization. When done, the generated target
|
||||
``spack/env`` is available. In the above example, the ``env`` target uses this generated
|
||||
target as a prerequisite, meaning that it can make use of the installed packages in
|
||||
its commands.
|
||||
|
||||
As it is typically undesirable to remake ``env.mk`` as part of ``make clean``,
|
||||
the include is conditional.
|
||||
|
||||
.. note::
|
||||
|
||||
When including generated ``Makefile``\s, it is important to use
|
||||
the ``--make-target-prefix`` flag and use the non-phony target
|
||||
``<target-prefix>/env`` as prerequisite, instead of the phony target
|
||||
``<target-prefix>/all``.
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user