Compare commits
3 Commits
update-ver
...
features/o
Author | SHA1 | Date | |
---|---|---|---|
![]() |
a542b0cfc0 | ||
![]() |
0d02262bbc | ||
![]() |
9beac03142 |
@@ -5,7 +5,7 @@ coverage:
|
|||||||
status:
|
status:
|
||||||
project:
|
project:
|
||||||
default:
|
default:
|
||||||
threshold: 2.0%
|
threshold: 0.2%
|
||||||
|
|
||||||
ignore:
|
ignore:
|
||||||
- lib/spack/spack/test/.*
|
- lib/spack/spack/test/.*
|
||||||
|
@@ -1,20 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Load spack environment at terminal startup
|
|
||||||
cat <<EOF >> /root/.bashrc
|
|
||||||
. /workspaces/spack/share/spack/setup-env.sh
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# Load spack environment in this script
|
|
||||||
. /workspaces/spack/share/spack/setup-env.sh
|
|
||||||
|
|
||||||
# Ensure generic targets for maximum matching with buildcaches
|
|
||||||
spack config --scope site add "packages:all:require:[target=x86_64_v3]"
|
|
||||||
spack config --scope site add "concretizer:targets:granularity:generic"
|
|
||||||
|
|
||||||
# Find compiler and install gcc-runtime
|
|
||||||
spack compiler find --scope site
|
|
||||||
|
|
||||||
# Setup buildcaches
|
|
||||||
spack mirror add --scope site develop https://binaries.spack.io/develop
|
|
||||||
spack buildcache keys --install --trust
|
|
@@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "Ubuntu 20.04",
|
|
||||||
"image": "ghcr.io/spack/ubuntu20.04-runner-amd64-gcc-11.4:2023.08.01",
|
|
||||||
"postCreateCommand": "./.devcontainer/postCreateCommand.sh"
|
|
||||||
}
|
|
@@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "Ubuntu 22.04",
|
|
||||||
"image": "ghcr.io/spack/ubuntu-22.04:v2024-05-07",
|
|
||||||
"postCreateCommand": "./.devcontainer/postCreateCommand.sh"
|
|
||||||
}
|
|
@@ -1,5 +1,3 @@
|
|||||||
# .git-blame-ignore-revs
|
# .git-blame-ignore-revs
|
||||||
# Formatted entire codebase with black 23
|
# Formatted entire codebase with black
|
||||||
603569e321013a1a63a637813c94c2834d0a0023
|
|
||||||
# Formatted entire codebase with black 22
|
|
||||||
f52f6e99dbf1131886a80112b8c79dfc414afb7c
|
f52f6e99dbf1131886a80112b8c79dfc414afb7c
|
||||||
|
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -1,4 +1,3 @@
|
|||||||
*.py diff=python
|
*.py diff=python
|
||||||
*.lp linguist-language=Prolog
|
*.lp linguist-language=Prolog
|
||||||
lib/spack/external/* linguist-vendored
|
lib/spack/external/* linguist-vendored
|
||||||
*.bat text eol=crlf
|
|
8
.github/ISSUE_TEMPLATE/build_error.yml
vendored
8
.github/ISSUE_TEMPLATE/build_error.yml
vendored
@@ -9,7 +9,7 @@ body:
|
|||||||
Thanks for taking the time to report this build failure. To proceed with the report please:
|
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>`.
|
1. Title the issue `Installation issue: <name-of-the-package>`.
|
||||||
2. Provide the information required below.
|
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!
|
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
|
- type: textarea
|
||||||
id: reproduce
|
id: reproduce
|
||||||
@@ -29,9 +29,7 @@ body:
|
|||||||
description: |
|
description: |
|
||||||
Please post the error message from spack inside the `<details>` tag below:
|
Please post the error message from spack inside the `<details>` tag below:
|
||||||
value: |
|
value: |
|
||||||
<details><summary>Error message</summary>
|
<details><summary>Error message</summary><pre>
|
||||||
|
|
||||||
<pre>
|
|
||||||
...
|
...
|
||||||
</pre></details>
|
</pre></details>
|
||||||
validations:
|
validations:
|
||||||
@@ -55,7 +53,7 @@ body:
|
|||||||
Please upload the following files:
|
Please upload the following files:
|
||||||
* **`spack-build-out.txt`**
|
* **`spack-build-out.txt`**
|
||||||
* **`spack-build-env.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.
|
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
|
- type: markdown
|
||||||
attributes:
|
attributes:
|
||||||
|
6
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
6
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
@@ -1,4 +1,4 @@
|
|||||||
name: "\U0001F38A Feature request"
|
name: "\U0001F38A Feature request"
|
||||||
description: Suggest adding a feature that is not yet in Spack
|
description: Suggest adding a feature that is not yet in Spack
|
||||||
labels: [feature]
|
labels: [feature]
|
||||||
body:
|
body:
|
||||||
@@ -29,11 +29,13 @@ body:
|
|||||||
attributes:
|
attributes:
|
||||||
label: General information
|
label: General information
|
||||||
options:
|
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
|
- label: I have searched the issues of this repo and believe this is not a duplicate
|
||||||
required: true
|
required: true
|
||||||
- type: markdown
|
- type: markdown
|
||||||
attributes:
|
attributes:
|
||||||
value: |
|
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.
|
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!
|
Other than that, thanks for taking the time to contribute to Spack!
|
||||||
|
4
.github/ISSUE_TEMPLATE/test_error.yml
vendored
4
.github/ISSUE_TEMPLATE/test_error.yml
vendored
@@ -21,9 +21,7 @@ body:
|
|||||||
description: |
|
description: |
|
||||||
Please post the error message from spack inside the `<details>` tag below:
|
Please post the error message from spack inside the `<details>` tag below:
|
||||||
value: |
|
value: |
|
||||||
<details><summary>Error message</summary>
|
<details><summary>Error message</summary><pre>
|
||||||
|
|
||||||
<pre>
|
|
||||||
...
|
...
|
||||||
</pre></details>
|
</pre></details>
|
||||||
validations:
|
validations:
|
||||||
|
7
.github/dependabot.yml
vendored
7
.github/dependabot.yml
vendored
@@ -5,10 +5,3 @@ updates:
|
|||||||
directory: "/"
|
directory: "/"
|
||||||
schedule:
|
schedule:
|
||||||
interval: "daily"
|
interval: "daily"
|
||||||
# Requirements to run style checks and build documentation
|
|
||||||
- package-ecosystem: "pip"
|
|
||||||
directories:
|
|
||||||
- "/.github/workflows/requirements/style/*"
|
|
||||||
- "/lib/spack/docs"
|
|
||||||
schedule:
|
|
||||||
interval: "daily"
|
|
||||||
|
6
.github/pull_request_template.md
vendored
6
.github/pull_request_template.md
vendored
@@ -1,6 +0,0 @@
|
|||||||
<!--
|
|
||||||
Remember that `spackbot` can help with your PR in multiple ways:
|
|
||||||
- `@spackbot help` shows all the commands that are currently available
|
|
||||||
- `@spackbot fix style` tries to push a commit to fix style issues in this PR
|
|
||||||
- `@spackbot re-run pipeline` runs the pipelines again, if you have write access to the repository
|
|
||||||
-->
|
|
52
.github/workflows/audit.yaml
vendored
52
.github/workflows/audit.yaml
vendored
@@ -17,58 +17,28 @@ concurrency:
|
|||||||
jobs:
|
jobs:
|
||||||
# Run audits on all the packages in the built-in repository
|
# Run audits on all the packages in the built-in repository
|
||||||
package-audits:
|
package-audits:
|
||||||
runs-on: ${{ matrix.system.os }}
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
system:
|
|
||||||
- { os: windows-latest, shell: 'powershell Invoke-Expression -Command "./share/spack/qa/windows_test_setup.ps1"; {0}' }
|
|
||||||
- { os: ubuntu-latest, shell: bash }
|
|
||||||
- { os: macos-latest, shell: bash }
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: ${{ matrix.system.shell }}
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # @v2
|
||||||
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b
|
- uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # @v2
|
||||||
with:
|
with:
|
||||||
python-version: ${{inputs.python_version}}
|
python-version: ${{inputs.python_version}}
|
||||||
- name: Install Python packages
|
- name: Install Python packages
|
||||||
run: |
|
run: |
|
||||||
pip install --upgrade pip setuptools pytest coverage[toml]
|
pip install --upgrade pip six setuptools pytest codecov coverage[toml]
|
||||||
- name: Setup for Windows run
|
|
||||||
if: runner.os == 'Windows'
|
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pywin32
|
|
||||||
- name: Package audits (with coverage)
|
- name: Package audits (with coverage)
|
||||||
env:
|
if: ${{ inputs.with_coverage == 'true' }}
|
||||||
COVERAGE_FILE: coverage/.coverage-audits-${{ matrix.system.os }}
|
|
||||||
if: ${{ inputs.with_coverage == 'true' && runner.os != 'Windows' }}
|
|
||||||
run: |
|
run: |
|
||||||
. share/spack/setup-env.sh
|
. share/spack/setup-env.sh
|
||||||
coverage run $(which spack) audit packages
|
coverage run $(which spack) audit packages
|
||||||
coverage run $(which spack) audit configs
|
|
||||||
coverage run $(which spack) -d audit externals
|
|
||||||
coverage combine
|
coverage combine
|
||||||
|
coverage xml
|
||||||
- name: Package audits (without coverage)
|
- name: Package audits (without coverage)
|
||||||
if: ${{ inputs.with_coverage == 'false' && runner.os != 'Windows' }}
|
if: ${{ inputs.with_coverage == 'false' }}
|
||||||
run: |
|
run: |
|
||||||
. share/spack/setup-env.sh
|
. share/spack/setup-env.sh
|
||||||
spack -d audit packages
|
$(which spack) audit packages
|
||||||
spack -d audit configs
|
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # @v2.1.0
|
||||||
spack -d audit externals
|
if: ${{ inputs.with_coverage == 'true' }}
|
||||||
- name: Package audits (without coverage)
|
|
||||||
if: ${{ runner.os == 'Windows' }}
|
|
||||||
run: |
|
|
||||||
. share/spack/setup-env.sh
|
|
||||||
spack -d audit packages
|
|
||||||
./share/spack/qa/validate_last_exit.ps1
|
|
||||||
spack -d audit configs
|
|
||||||
./share/spack/qa/validate_last_exit.ps1
|
|
||||||
spack -d audit externals
|
|
||||||
./share/spack/qa/validate_last_exit.ps1
|
|
||||||
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882
|
|
||||||
if: ${{ inputs.with_coverage == 'true' && runner.os != 'Windows' }}
|
|
||||||
with:
|
with:
|
||||||
name: coverage-audits-${{ matrix.system.os }}
|
flags: unittests,linux,audits
|
||||||
path: coverage
|
|
||||||
include-hidden-files: true
|
|
||||||
|
@@ -1,8 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -ex
|
||||||
source share/spack/setup-env.sh
|
source share/spack/setup-env.sh
|
||||||
$PYTHON bin/spack bootstrap disable github-actions-v0.5
|
|
||||||
$PYTHON bin/spack bootstrap disable spack-install
|
$PYTHON bin/spack bootstrap disable spack-install
|
||||||
$PYTHON bin/spack $SPACK_FLAGS solve zlib
|
$PYTHON bin/spack -d solve zlib
|
||||||
tree $BOOTSTRAP/store
|
tree $BOOTSTRAP/store
|
||||||
exit 0
|
exit 0
|
390
.github/workflows/bootstrap.yml
vendored
390
.github/workflows/bootstrap.yml
vendored
@@ -13,22 +13,118 @@ concurrency:
|
|||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
distros-clingo-sources:
|
fedora-clingo-sources:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: ${{ matrix.image }}
|
container: "fedora:latest"
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
image: ["fedora:latest", "opensuse/leap:latest"]
|
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Fedora
|
- name: Install dependencies
|
||||||
if: ${{ matrix.image == 'fedora:latest' }}
|
|
||||||
run: |
|
run: |
|
||||||
dnf install -y \
|
dnf install -y \
|
||||||
bzip2 curl file gcc-c++ gcc gcc-gfortran git gzip \
|
bzip2 curl file gcc-c++ gcc gcc-gfortran git gnupg2 gzip \
|
||||||
make patch unzip which xz python3 python3-devel tree \
|
make patch unzip which xz python3 python3-devel tree \
|
||||||
cmake bison bison-devel libstdc++-static
|
cmake bison bison-devel libstdc++-static
|
||||||
- name: Setup OpenSUSE
|
- name: Checkout
|
||||||
if: ${{ matrix.image == 'opensuse/leap:latest' }}
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- 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
|
||||||
|
. .github/workflows/setup_git.sh
|
||||||
|
- name: Bootstrap clingo
|
||||||
|
shell: runuser -u spack-test -- bash {0}
|
||||||
|
run: |
|
||||||
|
source share/spack/setup-env.sh
|
||||||
|
spack bootstrap disable github-actions-v0.4
|
||||||
|
spack bootstrap disable github-actions-v0.3
|
||||||
|
spack external find cmake bison
|
||||||
|
spack -d solve zlib
|
||||||
|
tree ~/.spack/bootstrap/store/
|
||||||
|
|
||||||
|
ubuntu-clingo-sources:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container: "ubuntu:latest"
|
||||||
|
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@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- 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
|
||||||
|
. .github/workflows/setup_git.sh
|
||||||
|
- name: Bootstrap clingo
|
||||||
|
shell: runuser -u spack-test -- bash {0}
|
||||||
|
run: |
|
||||||
|
source share/spack/setup-env.sh
|
||||||
|
spack bootstrap disable github-actions-v0.4
|
||||||
|
spack bootstrap disable github-actions-v0.3
|
||||||
|
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"
|
||||||
|
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@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- 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
|
||||||
|
. .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"
|
||||||
|
steps:
|
||||||
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
# Harden CI by applying the workaround described here: https://www.suse.com/support/kb/doc/?id=000019505
|
# Harden CI by applying the workaround described here: https://www.suse.com/support/kb/doc/?id=000019505
|
||||||
zypper update -y || zypper update -y
|
zypper update -y || zypper update -y
|
||||||
@@ -37,117 +133,98 @@ jobs:
|
|||||||
make patch unzip which xz python3 python3-devel tree \
|
make patch unzip which xz python3 python3-devel tree \
|
||||||
cmake bison
|
cmake bison
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
- name: Setup repo
|
||||||
|
run: |
|
||||||
|
# See [1] below
|
||||||
|
git config --global --add safe.directory /__w/spack/spack
|
||||||
|
git --version
|
||||||
|
. .github/workflows/setup_git.sh
|
||||||
- name: Bootstrap clingo
|
- name: Bootstrap clingo
|
||||||
run: |
|
run: |
|
||||||
source share/spack/setup-env.sh
|
source share/spack/setup-env.sh
|
||||||
spack bootstrap disable github-actions-v0.6
|
spack bootstrap disable github-actions-v0.4
|
||||||
spack bootstrap disable github-actions-v0.5
|
spack bootstrap disable github-actions-v0.3
|
||||||
spack external find cmake bison
|
spack external find cmake bison
|
||||||
spack -d solve zlib
|
spack -d solve zlib
|
||||||
tree ~/.spack/bootstrap/store/
|
tree ~/.spack/bootstrap/store/
|
||||||
|
|
||||||
clingo-sources:
|
macos-clingo-sources:
|
||||||
runs-on: ${{ matrix.runner }}
|
runs-on: macos-latest
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
runner: ['macos-13', 'macos-14', "ubuntu-latest"]
|
|
||||||
steps:
|
steps:
|
||||||
- name: Setup macOS
|
- name: Install dependencies
|
||||||
if: ${{ matrix.runner != 'ubuntu-latest' }}
|
|
||||||
run: |
|
run: |
|
||||||
brew install cmake bison tree
|
brew install cmake bison@2.7 tree
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b
|
|
||||||
with:
|
|
||||||
python-version: "3.12"
|
|
||||||
- name: Bootstrap clingo
|
- name: Bootstrap clingo
|
||||||
run: |
|
run: |
|
||||||
source share/spack/setup-env.sh
|
source share/spack/setup-env.sh
|
||||||
spack bootstrap disable github-actions-v0.6
|
export PATH=/usr/local/opt/bison@2.7/bin:$PATH
|
||||||
spack bootstrap disable github-actions-v0.5
|
spack bootstrap disable github-actions-v0.4
|
||||||
|
spack bootstrap disable github-actions-v0.3
|
||||||
spack external find --not-buildable cmake bison
|
spack external find --not-buildable cmake bison
|
||||||
spack -d solve zlib
|
spack -d solve zlib
|
||||||
tree $HOME/.spack/bootstrap/store/
|
|
||||||
|
|
||||||
gnupg-sources:
|
|
||||||
runs-on: ${{ matrix.runner }}
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
runner: [ 'macos-13', 'macos-14', "ubuntu-latest" ]
|
|
||||||
steps:
|
|
||||||
- name: Setup macOS
|
|
||||||
if: ${{ matrix.runner != 'ubuntu-latest' }}
|
|
||||||
run: brew install tree gawk
|
|
||||||
- name: Remove system executables
|
|
||||||
run: |
|
|
||||||
while [ -n "$(command -v gpg gpg2 patchelf)" ]; do
|
|
||||||
sudo rm $(command -v gpg gpg2 patchelf)
|
|
||||||
done
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- name: Bootstrap GnuPG
|
|
||||||
run: |
|
|
||||||
source share/spack/setup-env.sh
|
|
||||||
spack solve zlib
|
|
||||||
spack bootstrap disable github-actions-v0.6
|
|
||||||
spack bootstrap disable github-actions-v0.5
|
|
||||||
spack -d gpg list
|
|
||||||
tree ~/.spack/bootstrap/store/
|
tree ~/.spack/bootstrap/store/
|
||||||
|
|
||||||
from-binaries:
|
macos-clingo-binaries:
|
||||||
runs-on: ${{ matrix.runner }}
|
runs-on: ${{ matrix.macos-version }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
runner: ['macos-13', 'macos-14', "ubuntu-latest"]
|
macos-version: ['macos-11', 'macos-12']
|
||||||
steps:
|
steps:
|
||||||
- name: Setup macOS
|
- name: Install dependencies
|
||||||
if: ${{ matrix.runner != 'ubuntu-latest' }}
|
|
||||||
run: brew install tree
|
|
||||||
- name: Remove system executables
|
|
||||||
run: |
|
run: |
|
||||||
while [ -n "$(command -v gpg gpg2 patchelf)" ]; do
|
brew install tree
|
||||||
sudo rm $(command -v gpg gpg2 patchelf)
|
|
||||||
done
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b
|
|
||||||
with:
|
|
||||||
python-version: |
|
|
||||||
3.8
|
|
||||||
3.9
|
|
||||||
3.10
|
|
||||||
3.11
|
|
||||||
3.12
|
|
||||||
3.13
|
|
||||||
- name: Set bootstrap sources
|
|
||||||
run: |
|
|
||||||
source share/spack/setup-env.sh
|
|
||||||
spack bootstrap disable github-actions-v0.5
|
|
||||||
spack bootstrap disable spack-install
|
|
||||||
- name: Bootstrap clingo
|
- name: Bootstrap clingo
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -ex
|
||||||
for ver in '3.8' '3.9' '3.10' '3.11' '3.12' '3.13'; do
|
for ver in '3.6' '3.7' '3.8' '3.9' '3.10' ; do
|
||||||
not_found=1
|
not_found=1
|
||||||
ver_dir="$(find $RUNNER_TOOL_CACHE/Python -wholename "*/${ver}.*/*/bin" | grep . || true)"
|
ver_dir="$(find $RUNNER_TOOL_CACHE/Python -wholename "*/${ver}.*/*/bin" | grep . || true)"
|
||||||
|
echo "Testing $ver_dir"
|
||||||
if [[ -d "$ver_dir" ]] ; then
|
if [[ -d "$ver_dir" ]] ; then
|
||||||
echo "Testing $ver_dir"
|
|
||||||
if $ver_dir/python --version ; then
|
if $ver_dir/python --version ; then
|
||||||
export PYTHON="$ver_dir/python"
|
export PYTHON="$ver_dir/python"
|
||||||
not_found=0
|
not_found=0
|
||||||
old_path="$PATH"
|
old_path="$PATH"
|
||||||
export PATH="$ver_dir:$PATH"
|
export PATH="$ver_dir:$PATH"
|
||||||
./bin/spack-tmpconfig -b ./.github/workflows/bin/bootstrap-test.sh
|
./bin/spack-tmpconfig -b ./.github/workflows/bootstrap-test.sh
|
||||||
|
export PATH="$old_path"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
# NOTE: test all pythons that exist, not all do on 12
|
||||||
|
done
|
||||||
|
|
||||||
|
ubuntu-clingo-binaries:
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Setup repo
|
||||||
|
run: |
|
||||||
|
git --version
|
||||||
|
. .github/workflows/setup_git.sh
|
||||||
|
- name: Bootstrap clingo
|
||||||
|
run: |
|
||||||
|
set -ex
|
||||||
|
for ver in '3.6' '3.7' '3.8' '3.9' '3.10' ; do
|
||||||
|
not_found=1
|
||||||
|
ver_dir="$(find $RUNNER_TOOL_CACHE/Python -wholename "*/${ver}.*/*/bin" | grep . || true)"
|
||||||
|
echo "Testing $ver_dir"
|
||||||
|
if [[ -d "$ver_dir" ]] ; then
|
||||||
|
if $ver_dir/python --version ; then
|
||||||
|
export PYTHON="$ver_dir/python"
|
||||||
|
not_found=0
|
||||||
|
old_path="$PATH"
|
||||||
|
export PATH="$ver_dir:$PATH"
|
||||||
|
./bin/spack-tmpconfig -b ./.github/workflows/bootstrap-test.sh
|
||||||
export PATH="$old_path"
|
export PATH="$old_path"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@@ -156,49 +233,120 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
- name: Bootstrap GnuPG
|
|
||||||
run: |
|
|
||||||
source share/spack/setup-env.sh
|
|
||||||
spack -d gpg list
|
|
||||||
tree $HOME/.spack/bootstrap/store/
|
|
||||||
- name: Bootstrap File
|
|
||||||
run: |
|
|
||||||
source share/spack/setup-env.sh
|
|
||||||
spack -d python share/spack/qa/bootstrap-file.py
|
|
||||||
tree $HOME/.spack/bootstrap/store/
|
|
||||||
|
|
||||||
windows:
|
ubuntu-gnupg-binaries:
|
||||||
runs-on: "windows-latest"
|
runs-on: ubuntu-latest
|
||||||
|
container: "ubuntu:latest"
|
||||||
steps:
|
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
|
- name: Checkout
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b
|
- 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
|
||||||
|
. .github/workflows/setup_git.sh
|
||||||
|
- name: Bootstrap GnuPG
|
||||||
|
shell: runuser -u spack-test -- bash {0}
|
||||||
|
run: |
|
||||||
|
source share/spack/setup-env.sh
|
||||||
|
spack bootstrap disable spack-install
|
||||||
|
spack -d gpg list
|
||||||
|
tree ~/.spack/bootstrap/store/
|
||||||
|
|
||||||
|
ubuntu-gnupg-sources:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container: "ubuntu:latest"
|
||||||
|
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@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
||||||
with:
|
with:
|
||||||
python-version: "3.12"
|
fetch-depth: 0
|
||||||
- name: Setup Windows
|
- name: Setup non-root user
|
||||||
run: |
|
run: |
|
||||||
Remove-Item -Path (Get-Command gpg).Path
|
# See [1] below
|
||||||
Remove-Item -Path (Get-Command file).Path
|
git config --global --add safe.directory /__w/spack/spack
|
||||||
- name: Bootstrap clingo
|
useradd spack-test && mkdir -p ~spack-test
|
||||||
|
chown -R spack-test . ~spack-test
|
||||||
|
- name: Setup repo
|
||||||
|
shell: runuser -u spack-test -- bash {0}
|
||||||
run: |
|
run: |
|
||||||
./share/spack/setup-env.ps1
|
git --version
|
||||||
spack bootstrap disable github-actions-v0.6
|
. .github/workflows/setup_git.sh
|
||||||
spack bootstrap disable github-actions-v0.5
|
- name: Bootstrap GnuPG
|
||||||
spack external find --not-buildable cmake bison
|
shell: runuser -u spack-test -- bash {0}
|
||||||
spack -d solve zlib
|
run: |
|
||||||
./share/spack/qa/validate_last_exit.ps1
|
source share/spack/setup-env.sh
|
||||||
tree $env:userprofile/.spack/bootstrap/store/
|
spack solve zlib
|
||||||
|
spack bootstrap disable github-actions-v0.4
|
||||||
|
spack bootstrap disable github-actions-v0.3
|
||||||
|
spack -d gpg list
|
||||||
|
tree ~/.spack/bootstrap/store/
|
||||||
|
|
||||||
|
macos-gnupg-binaries:
|
||||||
|
runs-on: macos-latest
|
||||||
|
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@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
||||||
- name: Bootstrap GnuPG
|
- name: Bootstrap GnuPG
|
||||||
run: |
|
run: |
|
||||||
./share/spack/setup-env.ps1
|
source share/spack/setup-env.sh
|
||||||
|
spack bootstrap disable spack-install
|
||||||
spack -d gpg list
|
spack -d gpg list
|
||||||
./share/spack/qa/validate_last_exit.ps1
|
tree ~/.spack/bootstrap/store/
|
||||||
tree $env:userprofile/.spack/bootstrap/store/
|
|
||||||
- name: Bootstrap File
|
macos-gnupg-sources:
|
||||||
|
runs-on: macos-latest
|
||||||
|
steps:
|
||||||
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
./share/spack/setup-env.ps1
|
brew install gawk tree
|
||||||
spack -d python share/spack/qa/bootstrap-file.py
|
# Remove GnuPG since we want to bootstrap it
|
||||||
./share/spack/qa/validate_last_exit.ps1
|
sudo rm -rf /usr/local/bin/gpg
|
||||||
tree $env:userprofile/.spack/bootstrap/store/
|
- name: Checkout
|
||||||
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
||||||
|
- name: Bootstrap GnuPG
|
||||||
|
run: |
|
||||||
|
source share/spack/setup-env.sh
|
||||||
|
spack solve zlib
|
||||||
|
spack bootstrap disable github-actions-v0.4
|
||||||
|
spack bootstrap disable github-actions-v0.3
|
||||||
|
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
|
||||||
|
79
.github/workflows/build-containers.yml
vendored
79
.github/workflows/build-containers.yml
vendored
@@ -38,45 +38,38 @@ jobs:
|
|||||||
# Meaning of the various items in the matrix list
|
# Meaning of the various items in the matrix list
|
||||||
# 0: Container name (e.g. ubuntu-bionic)
|
# 0: Container name (e.g. ubuntu-bionic)
|
||||||
# 1: Platforms to build for
|
# 1: Platforms to build for
|
||||||
# 2: Base image (e.g. ubuntu:22.04)
|
# 2: Base image (e.g. ubuntu:18.04)
|
||||||
dockerfile: [[amazon-linux, 'linux/amd64,linux/arm64', 'amazonlinux:2'],
|
dockerfile: [[amazon-linux, 'linux/amd64,linux/arm64', 'amazonlinux:2'],
|
||||||
[centos-stream9, 'linux/amd64,linux/arm64,linux/ppc64le', 'centos:stream9'],
|
[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'],
|
[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-focal, 'linux/amd64,linux/arm64,linux/ppc64le', 'ubuntu:20.04'],
|
||||||
[ubuntu-jammy, 'linux/amd64,linux/arm64,linux/ppc64le', 'ubuntu:22.04'],
|
[ubuntu-jammy, 'linux/amd64,linux/arm64,linux/ppc64le', 'ubuntu:22.04']]
|
||||||
[ubuntu-noble, 'linux/amd64,linux/arm64,linux/ppc64le', 'ubuntu:24.04'],
|
|
||||||
[almalinux8, 'linux/amd64,linux/arm64,linux/ppc64le', 'almalinux:8'],
|
|
||||||
[almalinux9, 'linux/amd64,linux/arm64,linux/ppc64le', 'almalinux:9'],
|
|
||||||
[rockylinux8, 'linux/amd64,linux/arm64', 'rockylinux:8'],
|
|
||||||
[rockylinux9, 'linux/amd64,linux/arm64', 'rockylinux:9'],
|
|
||||||
[fedora39, 'linux/amd64,linux/arm64,linux/ppc64le', 'fedora:39'],
|
|
||||||
[fedora40, 'linux/amd64,linux/arm64,linux/ppc64le', 'fedora:40']]
|
|
||||||
name: Build ${{ matrix.dockerfile[0] }}
|
name: Build ${{ matrix.dockerfile[0] }}
|
||||||
if: github.repository == 'spack/spack'
|
if: github.repository == 'spack/spack'
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # @v2
|
||||||
|
|
||||||
- uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81
|
- name: Set Container Tag Normal (Nightly)
|
||||||
id: docker_meta
|
run: |
|
||||||
with:
|
container="${{ matrix.dockerfile[0] }}:latest"
|
||||||
images: |
|
echo "container=${container}" >> $GITHUB_ENV
|
||||||
ghcr.io/${{ github.repository_owner }}/${{ matrix.dockerfile[0] }}
|
echo "versioned=${container}" >> $GITHUB_ENV
|
||||||
${{ github.repository_owner }}/${{ matrix.dockerfile[0] }}
|
|
||||||
tags: |
|
# On a new release create a container with the same tag as the release.
|
||||||
type=schedule,pattern=nightly
|
- name: Set Container Tag on Release
|
||||||
type=schedule,pattern=develop
|
if: github.event_name == 'release'
|
||||||
type=semver,pattern={{version}}
|
run: |
|
||||||
type=semver,pattern={{major}}.{{minor}}
|
versioned="${{matrix.dockerfile[0]}}:${GITHUB_REF##*/}"
|
||||||
type=semver,pattern={{major}}
|
echo "versioned=${versioned}" >> $GITHUB_ENV
|
||||||
type=ref,event=branch
|
|
||||||
type=ref,event=pr
|
|
||||||
|
|
||||||
- name: Generate the Dockerfile
|
- name: Generate the Dockerfile
|
||||||
env:
|
env:
|
||||||
SPACK_YAML_OS: "${{ matrix.dockerfile[2] }}"
|
SPACK_YAML_OS: "${{ matrix.dockerfile[2] }}"
|
||||||
run: |
|
run: |
|
||||||
.github/workflows/bin/generate_spack_yaml_containerize.sh
|
.github/workflows/generate_spack_yaml_containerize.sh
|
||||||
. share/spack/setup-env.sh
|
. share/spack/setup-env.sh
|
||||||
mkdir -p dockerfiles/${{ matrix.dockerfile[0] }}
|
mkdir -p dockerfiles/${{ matrix.dockerfile[0] }}
|
||||||
spack containerize --last-stage=bootstrap | tee dockerfiles/${{ matrix.dockerfile[0] }}/Dockerfile
|
spack containerize --last-stage=bootstrap | tee dockerfiles/${{ matrix.dockerfile[0] }}/Dockerfile
|
||||||
@@ -87,19 +80,19 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Upload Dockerfile
|
- name: Upload Dockerfile
|
||||||
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882
|
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
|
||||||
with:
|
with:
|
||||||
name: dockerfiles_${{ matrix.dockerfile[0] }}
|
name: dockerfiles
|
||||||
path: dockerfiles
|
path: dockerfiles
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf
|
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # @v1
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349
|
uses: docker/setup-buildx-action@f03ac48505955848960e80bbb68046aa35c7b9e7 # @v1
|
||||||
|
|
||||||
- name: Log in to GitHub Container Registry
|
- name: Log in to GitHub Container Registry
|
||||||
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
|
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # @v1
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
@@ -107,27 +100,21 @@ jobs:
|
|||||||
|
|
||||||
- name: Log in to DockerHub
|
- name: Log in to DockerHub
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
|
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # @v1
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Build & Deploy ${{ matrix.dockerfile[0] }}
|
- name: Build & Deploy ${{ matrix.dockerfile[0] }}
|
||||||
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75
|
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 # @v2
|
||||||
with:
|
with:
|
||||||
context: dockerfiles/${{ matrix.dockerfile[0] }}
|
context: dockerfiles/${{ matrix.dockerfile[0] }}
|
||||||
platforms: ${{ matrix.dockerfile[1] }}
|
platforms: ${{ matrix.dockerfile[1] }}
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
tags: ${{ steps.docker_meta.outputs.tags }}
|
cache-from: type=gha
|
||||||
labels: ${{ steps.docker_meta.outputs.labels }}
|
cache-to: type=gha,mode=max
|
||||||
|
tags: |
|
||||||
merge-dockerfiles:
|
spack/${{ env.container }}
|
||||||
runs-on: ubuntu-latest
|
spack/${{ env.versioned }}
|
||||||
needs: deploy-images
|
ghcr.io/spack/${{ env.container }}
|
||||||
steps:
|
ghcr.io/spack/${{ env.versioned }}
|
||||||
- name: Merge Artifacts
|
|
||||||
uses: actions/upload-artifact/merge@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882
|
|
||||||
with:
|
|
||||||
name: dockerfiles
|
|
||||||
pattern: dockerfiles_*
|
|
||||||
delete-merged: true
|
|
||||||
|
71
.github/workflows/ci.yaml
vendored
71
.github/workflows/ci.yaml
vendored
@@ -15,6 +15,17 @@ concurrency:
|
|||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
prechecks:
|
||||||
|
needs: [ changes ]
|
||||||
|
uses: ./.github/workflows/valid-style.yml
|
||||||
|
with:
|
||||||
|
with_coverage: ${{ needs.changes.outputs.core }}
|
||||||
|
all-prechecks:
|
||||||
|
needs: [ prechecks ]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Success
|
||||||
|
run: "true"
|
||||||
# Check which files have been updated by the PR
|
# Check which files have been updated by the PR
|
||||||
changes:
|
changes:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -24,12 +35,12 @@ jobs:
|
|||||||
core: ${{ steps.filter.outputs.core }}
|
core: ${{ steps.filter.outputs.core }}
|
||||||
packages: ${{ steps.filter.outputs.packages }}
|
packages: ${{ steps.filter.outputs.packages }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # @v2
|
||||||
if: ${{ github.event_name == 'push' }}
|
if: ${{ github.event_name == 'push' }}
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
# For pull requests it's not necessary to checkout the code
|
# For pull requests it's not necessary to checkout the code
|
||||||
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36
|
- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50
|
||||||
id: filter
|
id: filter
|
||||||
with:
|
with:
|
||||||
# See https://github.com/dorny/paths-filter/issues/56 for the syntax used below
|
# See https://github.com/dorny/paths-filter/issues/56 for the syntax used below
|
||||||
@@ -41,13 +52,6 @@ jobs:
|
|||||||
- 'var/spack/repos/builtin/packages/clingo/**'
|
- 'var/spack/repos/builtin/packages/clingo/**'
|
||||||
- 'var/spack/repos/builtin/packages/python/**'
|
- 'var/spack/repos/builtin/packages/python/**'
|
||||||
- 'var/spack/repos/builtin/packages/re2c/**'
|
- 'var/spack/repos/builtin/packages/re2c/**'
|
||||||
- 'var/spack/repos/builtin/packages/gnupg/**'
|
|
||||||
- 'var/spack/repos/builtin/packages/libassuan/**'
|
|
||||||
- 'var/spack/repos/builtin/packages/libgcrypt/**'
|
|
||||||
- 'var/spack/repos/builtin/packages/libgpg-error/**'
|
|
||||||
- 'var/spack/repos/builtin/packages/libksba/**'
|
|
||||||
- 'var/spack/repos/builtin/packages/npth/**'
|
|
||||||
- 'var/spack/repos/builtin/packages/pinentry/**'
|
|
||||||
- 'lib/spack/**'
|
- 'lib/spack/**'
|
||||||
- 'share/spack/**'
|
- 'share/spack/**'
|
||||||
- '.github/workflows/bootstrap.yml'
|
- '.github/workflows/bootstrap.yml'
|
||||||
@@ -66,54 +70,17 @@ jobs:
|
|||||||
if: ${{ github.repository == 'spack/spack' && needs.changes.outputs.bootstrap == 'true' }}
|
if: ${{ github.repository == 'spack/spack' && needs.changes.outputs.bootstrap == 'true' }}
|
||||||
needs: [ prechecks, changes ]
|
needs: [ prechecks, changes ]
|
||||||
uses: ./.github/workflows/bootstrap.yml
|
uses: ./.github/workflows/bootstrap.yml
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
unit-tests:
|
unit-tests:
|
||||||
if: ${{ github.repository == 'spack/spack' && needs.changes.outputs.core == 'true' }}
|
if: ${{ github.repository == 'spack/spack' && needs.changes.outputs.core == 'true' }}
|
||||||
needs: [ prechecks, changes ]
|
needs: [ prechecks, changes ]
|
||||||
uses: ./.github/workflows/unit_tests.yaml
|
uses: ./.github/workflows/unit_tests.yaml
|
||||||
secrets: inherit
|
windows:
|
||||||
|
if: ${{ github.repository == 'spack/spack' && needs.changes.outputs.core == 'true' }}
|
||||||
prechecks:
|
|
||||||
needs: [ changes ]
|
|
||||||
uses: ./.github/workflows/valid-style.yml
|
|
||||||
secrets: inherit
|
|
||||||
with:
|
|
||||||
with_coverage: ${{ needs.changes.outputs.core }}
|
|
||||||
|
|
||||||
all-prechecks:
|
|
||||||
needs: [ prechecks ]
|
needs: [ prechecks ]
|
||||||
if: ${{ always() }}
|
uses: ./.github/workflows/windows_python.yml
|
||||||
|
all:
|
||||||
|
needs: [ windows, unit-tests, bootstrap ]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Success
|
- name: Success
|
||||||
run: |
|
run: "true"
|
||||||
if [ "${{ needs.prechecks.result }}" == "failure" ] || [ "${{ needs.prechecks.result }}" == "canceled" ]; then
|
|
||||||
echo "Unit tests failed."
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
coverage:
|
|
||||||
needs: [ unit-tests, prechecks ]
|
|
||||||
uses: ./.github/workflows/coverage.yml
|
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
all:
|
|
||||||
needs: [ unit-tests, coverage, bootstrap ]
|
|
||||||
if: ${{ always() }}
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
# See https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#needs-context
|
|
||||||
steps:
|
|
||||||
- name: Status summary
|
|
||||||
run: |
|
|
||||||
if [ "${{ needs.unit-tests.result }}" == "failure" ] || [ "${{ needs.unit-tests.result }}" == "canceled" ]; then
|
|
||||||
echo "Unit tests failed."
|
|
||||||
exit 1
|
|
||||||
elif [ "${{ needs.bootstrap.result }}" == "failure" ] || [ "${{ needs.bootstrap.result }}" == "canceled" ]; then
|
|
||||||
echo "Bootstrap tests failed."
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
34
.github/workflows/coverage.yml
vendored
34
.github/workflows/coverage.yml
vendored
@@ -1,34 +0,0 @@
|
|||||||
name: coverage
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
# Upload coverage reports to codecov once as a single bundle
|
|
||||||
upload:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
|
||||||
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b
|
|
||||||
with:
|
|
||||||
python-version: '3.11'
|
|
||||||
cache: 'pip'
|
|
||||||
|
|
||||||
- name: Install python dependencies
|
|
||||||
run: pip install -r .github/workflows/requirements/coverage/requirements.txt
|
|
||||||
|
|
||||||
- name: Download coverage artifact files
|
|
||||||
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
|
|
||||||
with:
|
|
||||||
pattern: coverage-*
|
|
||||||
path: coverage
|
|
||||||
merge-multiple: true
|
|
||||||
|
|
||||||
- run: ls -la coverage
|
|
||||||
- run: coverage combine -a coverage/.coverage*
|
|
||||||
- run: coverage xml
|
|
||||||
|
|
||||||
- name: "Upload coverage report to CodeCov"
|
|
||||||
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238
|
|
||||||
with:
|
|
||||||
verbose: true
|
|
8
.github/workflows/install_spack.sh
vendored
Executable file
8
.github/workflows/install_spack.sh
vendored
Executable file
@@ -0,0 +1,8 @@
|
|||||||
|
#!/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
|
31
.github/workflows/nightly-win-builds.yml
vendored
31
.github/workflows/nightly-win-builds.yml
vendored
@@ -1,31 +0,0 @@
|
|||||||
name: Windows Paraview Nightly
|
|
||||||
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: '0 2 * * *' # Run at 2 am
|
|
||||||
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell:
|
|
||||||
powershell Invoke-Expression -Command "./share/spack/qa/windows_test_setup.ps1"; {0}
|
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-paraview-deps:
|
|
||||||
runs-on: windows-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b
|
|
||||||
with:
|
|
||||||
python-version: 3.9
|
|
||||||
- name: Install Python packages
|
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip six pywin32 setuptools coverage
|
|
||||||
- name: Build Test
|
|
||||||
run: |
|
|
||||||
spack compiler find
|
|
||||||
spack external find cmake ninja win-sdk win-wdk wgl msmpi
|
|
||||||
spack -d install -y --cdash-upload-url https://cdash.spack.io/submit.php?project=Spack+on+Windows --cdash-track Nightly --only dependencies paraview
|
|
||||||
exit 0
|
|
@@ -1 +0,0 @@
|
|||||||
coverage==7.6.1
|
|
@@ -1,7 +0,0 @@
|
|||||||
black==24.10.0
|
|
||||||
clingo==5.7.1
|
|
||||||
flake8==7.1.1
|
|
||||||
isort==5.13.2
|
|
||||||
mypy==1.8.0
|
|
||||||
types-six==1.16.21.20241105
|
|
||||||
vermin==1.6.0
|
|
140
.github/workflows/unit_tests.yaml
vendored
140
.github/workflows/unit_tests.yaml
vendored
@@ -15,35 +15,42 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest]
|
os: [ubuntu-latest]
|
||||||
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
|
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
|
||||||
|
concretizer: ['clingo']
|
||||||
on_develop:
|
on_develop:
|
||||||
- ${{ github.ref == 'refs/heads/develop' }}
|
- ${{ github.ref == 'refs/heads/develop' }}
|
||||||
include:
|
include:
|
||||||
|
- python-version: '3.11'
|
||||||
|
os: ubuntu-latest
|
||||||
|
concretizer: original
|
||||||
|
on_develop: ${{ github.ref == 'refs/heads/develop' }}
|
||||||
- python-version: '3.6'
|
- python-version: '3.6'
|
||||||
os: ubuntu-20.04
|
os: ubuntu-20.04
|
||||||
|
concretizer: clingo
|
||||||
on_develop: ${{ github.ref == 'refs/heads/develop' }}
|
on_develop: ${{ github.ref == 'refs/heads/develop' }}
|
||||||
exclude:
|
exclude:
|
||||||
- python-version: '3.7'
|
- python-version: '3.7'
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
|
concretizer: 'clingo'
|
||||||
on_develop: false
|
on_develop: false
|
||||||
- python-version: '3.8'
|
- python-version: '3.8'
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
|
concretizer: 'clingo'
|
||||||
on_develop: false
|
on_develop: false
|
||||||
- python-version: '3.9'
|
- python-version: '3.9'
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
|
concretizer: 'clingo'
|
||||||
on_develop: false
|
on_develop: false
|
||||||
- python-version: '3.10'
|
- python-version: '3.10'
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
on_develop: false
|
concretizer: 'clingo'
|
||||||
- python-version: '3.11'
|
|
||||||
os: ubuntu-latest
|
|
||||||
on_develop: false
|
on_develop: false
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # @v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b
|
- uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # @v2
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
- name: Install System packages
|
- name: Install System packages
|
||||||
@@ -55,13 +62,13 @@ jobs:
|
|||||||
cmake bison libbison-dev kcov
|
cmake bison libbison-dev kcov
|
||||||
- name: Install Python packages
|
- name: Install Python packages
|
||||||
run: |
|
run: |
|
||||||
pip install --upgrade pip setuptools pytest pytest-xdist pytest-cov
|
pip install --upgrade pip six setuptools pytest codecov[toml] pytest-xdist pytest-cov
|
||||||
pip install --upgrade flake8 "isort>=4.3.5" "mypy>=0.900" "click" "black"
|
pip install --upgrade flake8 "isort>=4.3.5" "mypy>=0.900" "click" "black"
|
||||||
- name: Setup git configuration
|
- name: Setup git configuration
|
||||||
run: |
|
run: |
|
||||||
# Need this for the git tests to succeed.
|
# Need this for the git tests to succeed.
|
||||||
git --version
|
git --version
|
||||||
. .github/workflows/bin/setup_git.sh
|
. .github/workflows/setup_git.sh
|
||||||
- name: Bootstrap clingo
|
- name: Bootstrap clingo
|
||||||
if: ${{ matrix.concretizer == 'clingo' }}
|
if: ${{ matrix.concretizer == 'clingo' }}
|
||||||
env:
|
env:
|
||||||
@@ -74,25 +81,23 @@ jobs:
|
|||||||
- name: Run unit tests
|
- name: Run unit tests
|
||||||
env:
|
env:
|
||||||
SPACK_PYTHON: python
|
SPACK_PYTHON: python
|
||||||
|
SPACK_TEST_SOLVER: ${{ matrix.concretizer }}
|
||||||
SPACK_TEST_PARALLEL: 2
|
SPACK_TEST_PARALLEL: 2
|
||||||
COVERAGE: true
|
COVERAGE: true
|
||||||
COVERAGE_FILE: coverage/.coverage-${{ matrix.os }}-python${{ matrix.python-version }}
|
|
||||||
UNIT_TEST_COVERAGE: ${{ matrix.python-version == '3.11' }}
|
UNIT_TEST_COVERAGE: ${{ matrix.python-version == '3.11' }}
|
||||||
run: |
|
run: |
|
||||||
share/spack/qa/run-unit-tests
|
share/spack/qa/run-unit-tests
|
||||||
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882
|
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
|
||||||
with:
|
with:
|
||||||
name: coverage-${{ matrix.os }}-python${{ matrix.python-version }}
|
flags: unittests,linux,${{ matrix.concretizer }}
|
||||||
path: coverage
|
|
||||||
include-hidden-files: true
|
|
||||||
# Test shell integration
|
# Test shell integration
|
||||||
shell:
|
shell:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # @v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b
|
- uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # @v2
|
||||||
with:
|
with:
|
||||||
python-version: '3.11'
|
python-version: '3.11'
|
||||||
- name: Install System packages
|
- name: Install System packages
|
||||||
@@ -102,22 +107,20 @@ jobs:
|
|||||||
sudo apt-get install -y coreutils kcov csh zsh tcsh fish dash bash
|
sudo apt-get install -y coreutils kcov csh zsh tcsh fish dash bash
|
||||||
- name: Install Python packages
|
- name: Install Python packages
|
||||||
run: |
|
run: |
|
||||||
pip install --upgrade pip setuptools pytest coverage[toml] pytest-xdist
|
pip install --upgrade pip six setuptools pytest codecov coverage[toml] pytest-xdist
|
||||||
- name: Setup git configuration
|
- name: Setup git configuration
|
||||||
run: |
|
run: |
|
||||||
# Need this for the git tests to succeed.
|
# Need this for the git tests to succeed.
|
||||||
git --version
|
git --version
|
||||||
. .github/workflows/bin/setup_git.sh
|
. .github/workflows/setup_git.sh
|
||||||
- name: Run shell tests
|
- name: Run shell tests
|
||||||
env:
|
env:
|
||||||
COVERAGE: true
|
COVERAGE: true
|
||||||
run: |
|
run: |
|
||||||
share/spack/qa/run-shell-tests
|
share/spack/qa/run-shell-tests
|
||||||
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882
|
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
|
||||||
with:
|
with:
|
||||||
name: coverage-shell
|
flags: shelltests,linux
|
||||||
path: coverage
|
|
||||||
include-hidden-files: true
|
|
||||||
|
|
||||||
# Test RHEL8 UBI with platform Python. This job is run
|
# Test RHEL8 UBI with platform Python. This job is run
|
||||||
# only on PRs modifying core Spack
|
# only on PRs modifying core Spack
|
||||||
@@ -130,13 +133,12 @@ jobs:
|
|||||||
dnf install -y \
|
dnf install -y \
|
||||||
bzip2 curl file gcc-c++ gcc gcc-gfortran git gnupg2 gzip \
|
bzip2 curl file gcc-c++ gcc gcc-gfortran git gnupg2 gzip \
|
||||||
make patch tcl unzip which xz
|
make patch tcl unzip which xz
|
||||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # @v2
|
||||||
- name: Setup repo and non-root user
|
- name: Setup repo and non-root user
|
||||||
run: |
|
run: |
|
||||||
git --version
|
git --version
|
||||||
git config --global --add safe.directory /__w/spack/spack
|
|
||||||
git fetch --unshallow
|
git fetch --unshallow
|
||||||
. .github/workflows/bin/setup_git.sh
|
. .github/workflows/setup_git.sh
|
||||||
useradd spack-test
|
useradd spack-test
|
||||||
chown -R spack-test .
|
chown -R spack-test .
|
||||||
- name: Run unit tests
|
- name: Run unit tests
|
||||||
@@ -149,103 +151,65 @@ jobs:
|
|||||||
clingo-cffi:
|
clingo-cffi:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # @v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b
|
- uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # @v2
|
||||||
with:
|
with:
|
||||||
python-version: '3.13'
|
python-version: '3.11'
|
||||||
- name: Install System packages
|
- name: Install System packages
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get -y update
|
sudo apt-get -y update
|
||||||
sudo apt-get -y install coreutils gfortran graphviz gnupg2
|
sudo apt-get -y install coreutils cvs gfortran graphviz gnupg2 mercurial ninja-build kcov
|
||||||
- name: Install Python packages
|
- name: Install Python packages
|
||||||
run: |
|
run: |
|
||||||
pip install --upgrade pip setuptools pytest coverage[toml] pytest-cov clingo
|
pip install --upgrade pip six setuptools pytest codecov coverage[toml] pytest-cov clingo pytest-xdist
|
||||||
pip install --upgrade flake8 "isort>=4.3.5" "mypy>=0.900" "click" "black"
|
- 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)
|
- name: Run unit tests (full suite with coverage)
|
||||||
env:
|
env:
|
||||||
COVERAGE: true
|
COVERAGE: true
|
||||||
COVERAGE_FILE: coverage/.coverage-clingo-cffi
|
SPACK_TEST_SOLVER: clingo
|
||||||
run: |
|
run: |
|
||||||
. share/spack/setup-env.sh
|
share/spack/qa/run-unit-tests
|
||||||
spack bootstrap disable spack-install
|
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # @v2.1.0
|
||||||
spack bootstrap disable github-actions-v0.5
|
|
||||||
spack bootstrap disable github-actions-v0.6
|
|
||||||
spack bootstrap status
|
|
||||||
spack solve zlib
|
|
||||||
spack unit-test --verbose --cov --cov-config=pyproject.toml --cov-report=xml:coverage.xml lib/spack/spack/test/concretization/core.py
|
|
||||||
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882
|
|
||||||
with:
|
with:
|
||||||
name: coverage-clingo-cffi
|
flags: unittests,linux,clingo
|
||||||
path: coverage
|
|
||||||
include-hidden-files: true
|
|
||||||
# Run unit tests on MacOS
|
# Run unit tests on MacOS
|
||||||
macos:
|
macos:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: macos-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-13, macos-14]
|
python-version: ["3.10"]
|
||||||
python-version: ["3.11"]
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # @v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b
|
- uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # @v2
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
- name: Install Python packages
|
- name: Install Python packages
|
||||||
run: |
|
run: |
|
||||||
pip install --upgrade pip setuptools
|
pip install --upgrade pip six setuptools
|
||||||
pip install --upgrade pytest coverage[toml] pytest-xdist pytest-cov
|
pip install --upgrade pytest codecov coverage[toml] pytest-xdist pytest-cov
|
||||||
- name: Setup Homebrew packages
|
- name: Setup Homebrew packages
|
||||||
run: |
|
run: |
|
||||||
brew install dash fish gcc gnupg kcov
|
brew install dash fish gcc gnupg2 kcov
|
||||||
- name: Run unit tests
|
- name: Run unit tests
|
||||||
env:
|
env:
|
||||||
|
SPACK_TEST_SOLVER: clingo
|
||||||
SPACK_TEST_PARALLEL: 4
|
SPACK_TEST_PARALLEL: 4
|
||||||
COVERAGE_FILE: coverage/.coverage-${{ matrix.os }}-python${{ matrix.python-version }}
|
|
||||||
run: |
|
run: |
|
||||||
git --version
|
git --version
|
||||||
. .github/workflows/bin/setup_git.sh
|
. .github/workflows/setup_git.sh
|
||||||
. share/spack/setup-env.sh
|
. share/spack/setup-env.sh
|
||||||
$(which spack) bootstrap disable spack-install
|
$(which spack) bootstrap disable spack-install
|
||||||
$(which spack) solve zlib
|
$(which spack) solve zlib
|
||||||
common_args=(--dist loadfile --tx '4*popen//python=./bin/spack-tmpconfig python -u ./bin/spack python' -x)
|
common_args=(--dist loadfile --tx '4*popen//python=./bin/spack-tmpconfig python -u ./bin/spack python' -x)
|
||||||
$(which spack) unit-test --verbose --cov --cov-config=pyproject.toml --cov-report=xml:coverage.xml "${common_args[@]}"
|
$(which spack) unit-test --cov --cov-config=pyproject.toml --cov-report=xml:coverage.xml "${common_args[@]}"
|
||||||
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882
|
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
|
||||||
with:
|
with:
|
||||||
name: coverage-${{ matrix.os }}-python${{ matrix.python-version }}
|
flags: unittests,macos
|
||||||
path: coverage
|
|
||||||
include-hidden-files: true
|
|
||||||
# Run unit tests on Windows
|
|
||||||
windows:
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell:
|
|
||||||
powershell Invoke-Expression -Command "./share/spack/qa/windows_test_setup.ps1"; {0}
|
|
||||||
runs-on: windows-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b
|
|
||||||
with:
|
|
||||||
python-version: 3.9
|
|
||||||
- name: Install Python packages
|
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip pywin32 setuptools pytest-cov clingo
|
|
||||||
- name: Create local develop
|
|
||||||
run: |
|
|
||||||
./.github/workflows/bin/setup_git.ps1
|
|
||||||
- name: Unit Test
|
|
||||||
env:
|
|
||||||
COVERAGE_FILE: coverage/.coverage-windows
|
|
||||||
run: |
|
|
||||||
spack unit-test -x --verbose --cov --cov-config=pyproject.toml
|
|
||||||
./share/spack/qa/validate_last_exit.ps1
|
|
||||||
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882
|
|
||||||
with:
|
|
||||||
name: coverage-windows
|
|
||||||
path: coverage
|
|
||||||
include-hidden-files: true
|
|
||||||
|
104
.github/workflows/valid-style.yml
vendored
104
.github/workflows/valid-style.yml
vendored
@@ -18,15 +18,15 @@ jobs:
|
|||||||
validate:
|
validate:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # @v2
|
||||||
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b
|
- uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # @v2
|
||||||
with:
|
with:
|
||||||
python-version: '3.11'
|
python-version: '3.11'
|
||||||
cache: 'pip'
|
cache: 'pip'
|
||||||
- name: Install Python Packages
|
- name: Install Python Packages
|
||||||
run: |
|
run: |
|
||||||
pip install --upgrade pip setuptools
|
pip install --upgrade pip
|
||||||
pip install -r .github/workflows/requirements/style/requirements.txt
|
pip install --upgrade vermin
|
||||||
- name: vermin (Spack's Core)
|
- name: vermin (Spack's Core)
|
||||||
run: vermin --backport importlib --backport argparse --violations --backport typing -t=3.6- -vvv lib/spack/spack/ lib/spack/llnl/ bin/
|
run: vermin --backport importlib --backport argparse --violations --backport typing -t=3.6- -vvv lib/spack/spack/ lib/spack/llnl/ bin/
|
||||||
- name: vermin (Repositories)
|
- name: vermin (Repositories)
|
||||||
@@ -35,114 +35,26 @@ jobs:
|
|||||||
style:
|
style:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # @v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b
|
- uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # @v2
|
||||||
with:
|
with:
|
||||||
python-version: '3.11'
|
python-version: '3.11'
|
||||||
cache: 'pip'
|
cache: 'pip'
|
||||||
- name: Install Python packages
|
- name: Install Python packages
|
||||||
run: |
|
run: |
|
||||||
pip install --upgrade pip setuptools
|
python3 -m pip install --upgrade pip six setuptools types-six black==22.12.0 mypy isort clingo flake8
|
||||||
pip install -r .github/workflows/requirements/style/requirements.txt
|
|
||||||
- name: Setup git configuration
|
- name: Setup git configuration
|
||||||
run: |
|
run: |
|
||||||
# Need this for the git tests to succeed.
|
# Need this for the git tests to succeed.
|
||||||
git --version
|
git --version
|
||||||
. .github/workflows/bin/setup_git.sh
|
. .github/workflows/setup_git.sh
|
||||||
- name: Run style tests
|
- name: Run style tests
|
||||||
run: |
|
run: |
|
||||||
share/spack/qa/run-style-tests
|
share/spack/qa/run-style-tests
|
||||||
audit:
|
audit:
|
||||||
uses: ./.github/workflows/audit.yaml
|
uses: ./.github/workflows/audit.yaml
|
||||||
secrets: inherit
|
|
||||||
with:
|
with:
|
||||||
with_coverage: ${{ inputs.with_coverage }}
|
with_coverage: ${{ inputs.with_coverage }}
|
||||||
python_version: '3.11'
|
python_version: '3.11'
|
||||||
# Check that spack can bootstrap the development environment on Python 3.6 - RHEL8
|
|
||||||
bootstrap-dev-rhel8:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
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@11bd71901bbe5b1630ceea73d27597364c9af683
|
|
||||||
- name: Setup repo and non-root user
|
|
||||||
run: |
|
|
||||||
git --version
|
|
||||||
git config --global --add safe.directory /__w/spack/spack
|
|
||||||
git fetch --unshallow
|
|
||||||
. .github/workflows/bin/setup_git.sh
|
|
||||||
useradd spack-test
|
|
||||||
chown -R spack-test .
|
|
||||||
- name: Bootstrap Spack development environment
|
|
||||||
shell: runuser -u spack-test -- bash {0}
|
|
||||||
run: |
|
|
||||||
source share/spack/setup-env.sh
|
|
||||||
spack debug report
|
|
||||||
spack -d bootstrap now --dev
|
|
||||||
spack -d style -t black
|
|
||||||
spack unit-test -V
|
|
||||||
import-check:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: julia-actions/setup-julia@v2
|
|
||||||
with:
|
|
||||||
version: '1.10'
|
|
||||||
- uses: julia-actions/cache@v2
|
|
||||||
|
|
||||||
# PR: use the base of the PR as the old commit
|
|
||||||
- name: Checkout PR base commit
|
|
||||||
if: github.event_name == 'pull_request'
|
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
|
||||||
with:
|
|
||||||
ref: ${{ github.event.pull_request.base.sha }}
|
|
||||||
path: old
|
|
||||||
# not a PR: use the previous commit as the old commit
|
|
||||||
- name: Checkout previous commit
|
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
|
||||||
with:
|
|
||||||
fetch-depth: 2
|
|
||||||
path: old
|
|
||||||
- name: Checkout previous commit
|
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
run: git -C old reset --hard HEAD^
|
|
||||||
|
|
||||||
- name: Checkout new commit
|
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
|
||||||
with:
|
|
||||||
path: new
|
|
||||||
- name: Install circular import checker
|
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
|
||||||
with:
|
|
||||||
repository: haampie/circular-import-fighter
|
|
||||||
ref: 9f60f51bc7134e0be73f27623f1b0357d1718427
|
|
||||||
path: circular-import-fighter
|
|
||||||
- name: Install dependencies
|
|
||||||
working-directory: circular-import-fighter
|
|
||||||
run: make -j dependencies
|
|
||||||
- name: Import cycles before
|
|
||||||
working-directory: circular-import-fighter
|
|
||||||
run: make SPACK_ROOT=../old && cp solution solution.old
|
|
||||||
- name: Import cycles after
|
|
||||||
working-directory: circular-import-fighter
|
|
||||||
run: make clean-graph && make SPACK_ROOT=../new && cp solution solution.new
|
|
||||||
- name: Compare import cycles
|
|
||||||
working-directory: circular-import-fighter
|
|
||||||
run: |
|
|
||||||
edges_before="$(grep -oP 'edges to delete: \K\d+' solution.old)"
|
|
||||||
edges_after="$(grep -oP 'edges to delete: \K\d+' solution.new)"
|
|
||||||
if [ "$edges_after" -gt "$edges_before" ]; then
|
|
||||||
printf '\033[1;31mImport check failed: %s imports need to be deleted, ' "$edges_after"
|
|
||||||
printf 'previously this was %s\033[0m\n' "$edges_before"
|
|
||||||
printf 'Compare \033[1;97m"Import cycles before"\033[0m and '
|
|
||||||
printf '\033[1;97m"Import cycles after"\033[0m to see problematic imports.\n'
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
printf '\033[1;32mImport check passed: %s <= %s\033[0m\n' "$edges_after" "$edges_before"
|
|
||||||
fi
|
|
||||||
|
155
.github/workflows/windows_python.yml
vendored
Normal file
155
.github/workflows/windows_python.yml
vendored
Normal file
@@ -0,0 +1,155 @@
|
|||||||
|
name: windows
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: windows-${{github.ref}}-${{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:
|
||||||
|
unit-tests:
|
||||||
|
runs-on: windows-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435
|
||||||
|
with:
|
||||||
|
python-version: 3.9
|
||||||
|
- name: Install Python packages
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip six pywin32 setuptools codecov pytest-cov clingo
|
||||||
|
- name: Create local develop
|
||||||
|
run: |
|
||||||
|
./.github/workflows/setup_git.ps1
|
||||||
|
- name: Unit Test
|
||||||
|
run: |
|
||||||
|
spack unit-test -x --verbose --cov --cov-config=pyproject.toml --ignore=lib/spack/spack/test/cmd
|
||||||
|
./share/spack/qa/validate_last_exit.ps1
|
||||||
|
coverage combine -a
|
||||||
|
coverage xml
|
||||||
|
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
|
||||||
|
with:
|
||||||
|
flags: unittests,windows
|
||||||
|
unit-tests-cmd:
|
||||||
|
runs-on: windows-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435
|
||||||
|
with:
|
||||||
|
python-version: 3.9
|
||||||
|
- name: Install Python packages
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip six pywin32 setuptools codecov coverage pytest-cov clingo
|
||||||
|
- name: Create local develop
|
||||||
|
run: |
|
||||||
|
./.github/workflows/setup_git.ps1
|
||||||
|
- name: Command Unit Test
|
||||||
|
run: |
|
||||||
|
spack unit-test -x --verbose --cov --cov-config=pyproject.toml lib/spack/spack/test/cmd
|
||||||
|
./share/spack/qa/validate_last_exit.ps1
|
||||||
|
coverage combine -a
|
||||||
|
coverage xml
|
||||||
|
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
|
||||||
|
with:
|
||||||
|
flags: unittests,windows
|
||||||
|
build-abseil:
|
||||||
|
runs-on: windows-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435
|
||||||
|
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
|
||||||
|
spack external find cmake
|
||||||
|
spack external find ninja
|
||||||
|
spack -d install abseil-cpp
|
||||||
|
# TODO: johnwparent - reduce the size of the installer operations
|
||||||
|
# make-installer:
|
||||||
|
# runs-on: windows-latest
|
||||||
|
# steps:
|
||||||
|
# - name: Disable Windows Symlinks
|
||||||
|
# run: |
|
||||||
|
# git config --global core.symlinks false
|
||||||
|
# shell:
|
||||||
|
# powershell
|
||||||
|
# - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
||||||
|
# with:
|
||||||
|
# fetch-depth: 0
|
||||||
|
# - uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435
|
||||||
|
# with:
|
||||||
|
# python-version: 3.9
|
||||||
|
# - name: Install Python packages
|
||||||
|
# run: |
|
||||||
|
# python -m pip install --upgrade pip six pywin32 setuptools
|
||||||
|
# - name: Add Light and Candle to Path
|
||||||
|
# run: |
|
||||||
|
# $env:WIX >> $GITHUB_PATH
|
||||||
|
# - name: Run Installer
|
||||||
|
# run: |
|
||||||
|
# ./share/spack/qa/setup_spack_installer.ps1
|
||||||
|
# spack make-installer -s . -g SILENT pkg
|
||||||
|
# echo "installer_root=$((pwd).Path)" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
|
# env:
|
||||||
|
# ProgressPreference: SilentlyContinue
|
||||||
|
# - uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb
|
||||||
|
# with:
|
||||||
|
# name: Windows Spack Installer Bundle
|
||||||
|
# path: ${{ env.installer_root }}\pkg\Spack.exe
|
||||||
|
# - uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb
|
||||||
|
# with:
|
||||||
|
# name: Windows Spack Installer
|
||||||
|
# path: ${{ env.installer_root}}\pkg\Spack.msi
|
||||||
|
# execute-installer:
|
||||||
|
# needs: make-installer
|
||||||
|
# runs-on: windows-latest
|
||||||
|
# defaults:
|
||||||
|
# run:
|
||||||
|
# shell: pwsh
|
||||||
|
# steps:
|
||||||
|
# - uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435
|
||||||
|
# with:
|
||||||
|
# python-version: 3.9
|
||||||
|
# - name: Install Python packages
|
||||||
|
# run: |
|
||||||
|
# python -m pip install --upgrade pip six pywin32 setuptools
|
||||||
|
# - 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
|
@@ -1,39 +1,10 @@
|
|||||||
version: 2
|
version: 2
|
||||||
|
|
||||||
build:
|
|
||||||
os: "ubuntu-22.04"
|
|
||||||
apt_packages:
|
|
||||||
- graphviz
|
|
||||||
tools:
|
|
||||||
python: "3.11"
|
|
||||||
|
|
||||||
sphinx:
|
sphinx:
|
||||||
configuration: lib/spack/docs/conf.py
|
configuration: lib/spack/docs/conf.py
|
||||||
fail_on_warning: true
|
fail_on_warning: true
|
||||||
|
|
||||||
python:
|
python:
|
||||||
|
version: 3.7
|
||||||
install:
|
install:
|
||||||
- requirements: lib/spack/docs/requirements.txt
|
- requirements: lib/spack/docs/requirements.txt
|
||||||
|
|
||||||
search:
|
|
||||||
ranking:
|
|
||||||
spack.html: -10
|
|
||||||
spack.*.html: -10
|
|
||||||
llnl.html: -10
|
|
||||||
llnl.*.html: -10
|
|
||||||
_modules/*: -10
|
|
||||||
command_index.html: -9
|
|
||||||
basic_usage.html: 5
|
|
||||||
configuration.html: 5
|
|
||||||
config_yaml.html: 5
|
|
||||||
packages_yaml.html: 5
|
|
||||||
build_settings.html: 5
|
|
||||||
environments.html: 5
|
|
||||||
containers.html: 5
|
|
||||||
mirrors.html: 5
|
|
||||||
module_file_support.html: 5
|
|
||||||
repositories.html: 5
|
|
||||||
binary_caches.html: 5
|
|
||||||
chain.html: 5
|
|
||||||
pipelines.html: 5
|
|
||||||
packaging_guide.html: 5
|
|
||||||
|
1015
CHANGELOG.md
1015
CHANGELOG.md
File diff suppressed because it is too large
Load Diff
58
CITATION.cff
58
CITATION.cff
@@ -27,57 +27,12 @@
|
|||||||
# And here's the CITATION.cff format:
|
# And here's the CITATION.cff format:
|
||||||
#
|
#
|
||||||
cff-version: 1.2.0
|
cff-version: 1.2.0
|
||||||
type: software
|
|
||||||
message: "If you are referencing Spack in a publication, please cite the paper below."
|
message: "If you are referencing Spack in a publication, please cite the paper below."
|
||||||
title: "The Spack Package Manager: Bringing Order to HPC Software Chaos"
|
|
||||||
abstract: >-
|
|
||||||
Large HPC centers spend considerable time supporting software for thousands of users, but the
|
|
||||||
complexity of HPC software is quickly outpacing the capabilities of existing software management
|
|
||||||
tools. Scientific applications require specific versions of compilers, MPI, and other dependency
|
|
||||||
libraries, so using a single, standard software stack is infeasible. However, managing many
|
|
||||||
configurations is difficult because the configuration space is combinatorial in size. We
|
|
||||||
introduce Spack, a tool used at Lawrence Livermore National Laboratory to manage this complexity.
|
|
||||||
Spack provides a novel, re- cursive specification syntax to invoke parametric builds of packages
|
|
||||||
and dependencies. It allows any number of builds to coexist on the same system, and it ensures
|
|
||||||
that installed packages can find their dependencies, regardless of the environment. We show
|
|
||||||
through real-world use cases that Spack supports diverse and demanding applications, bringing
|
|
||||||
order to HPC software chaos.
|
|
||||||
preferred-citation:
|
preferred-citation:
|
||||||
title: "The Spack Package Manager: Bringing Order to HPC Software Chaos"
|
|
||||||
type: conference-paper
|
type: conference-paper
|
||||||
url: "https://tgamblin.github.io/pubs/spack-sc15.pdf"
|
doi: "10.1145/2807591.2807623"
|
||||||
|
url: "https://github.com/spack/spack"
|
||||||
authors:
|
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"
|
|
||||||
conference:
|
|
||||||
name: "Supercomputing 2015 (SC’15)"
|
|
||||||
city: "Austin"
|
|
||||||
region: "Texas"
|
|
||||||
country: "US"
|
|
||||||
date-start: 2015-11-15
|
|
||||||
date-end: 2015-11-20
|
|
||||||
month: 11
|
|
||||||
year: 2015
|
|
||||||
identifiers:
|
|
||||||
- description: "The concept DOI of the work."
|
|
||||||
type: doi
|
|
||||||
value: 10.1145/2807591.2807623
|
|
||||||
- description: "The DOE Document Release Number of the work"
|
|
||||||
type: other
|
|
||||||
value: "LLNL-CONF-669890"
|
|
||||||
authors:
|
|
||||||
- family-names: "Gamblin"
|
- family-names: "Gamblin"
|
||||||
given-names: "Todd"
|
given-names: "Todd"
|
||||||
- family-names: "LeGendre"
|
- family-names: "LeGendre"
|
||||||
@@ -92,3 +47,12 @@ authors:
|
|||||||
given-names: "Bronis R."
|
given-names: "Bronis R."
|
||||||
- family-names: "Futral"
|
- family-names: "Futral"
|
||||||
given-names: "Scott"
|
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
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2013-2024 LLNS, LLC and other Spack Project Developers.
|
Copyright (c) 2013-2023 LLNS, LLC and other Spack Project Developers.
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
59
README.md
59
README.md
@@ -1,38 +1,16 @@
|
|||||||
<div align="left">
|
# <img src="https://cdn.rawgit.com/spack/spack/develop/share/spack/logo/spack-logo.svg" width="64" valign="middle" alt="Spack"/> Spack
|
||||||
|
|
||||||
<h2>
|
[](https://github.com/spack/spack/actions)
|
||||||
<picture>
|
[](https://github.com/spack/spack/actions/workflows/bootstrap.yml)
|
||||||
<source media="(prefers-color-scheme: dark)" srcset="https://cdn.rawgit.com/spack/spack/develop/share/spack/logo/spack-logo-white-text.svg" width="250">
|
[](https://codecov.io/gh/spack/spack)
|
||||||
<source media="(prefers-color-scheme: light)" srcset="https://cdn.rawgit.com/spack/spack/develop/share/spack/logo/spack-logo-text.svg" width="250">
|
[](https://github.com/spack/spack/actions/workflows/build-containers.yml)
|
||||||
<img alt="Spack" src="https://cdn.rawgit.com/spack/spack/develop/share/spack/logo/spack-logo-text.svg" width="250">
|
[](https://spack.readthedocs.io)
|
||||||
</picture>
|
[](https://github.com/psf/black)
|
||||||
|
[](https://slack.spack.io)
|
||||||
<br>
|
|
||||||
<br clear="all">
|
|
||||||
|
|
||||||
<a href="https://github.com/spack/spack/actions/workflows/ci.yml"><img src="https://github.com/spack/spack/workflows/ci/badge.svg" alt="CI Status"></a>
|
|
||||||
<a href="https://github.com/spack/spack/actions/workflows/bootstrapping.yml"><img src="https://github.com/spack/spack/actions/workflows/bootstrap.yml/badge.svg" alt="Bootstrap Status"></a>
|
|
||||||
<a href="https://github.com/spack/spack/actions/workflows/build-containers.yml"><img src="https://github.com/spack/spack/actions/workflows/build-containers.yml/badge.svg" alt="Containers Status"></a>
|
|
||||||
<a href="https://spack.readthedocs.io"><img src="https://readthedocs.org/projects/spack/badge/?version=latest" alt="Documentation Status"></a>
|
|
||||||
<a href="https://codecov.io/gh/spack/spack"><img src="https://codecov.io/gh/spack/spack/branch/develop/graph/badge.svg" alt="Code coverage"/></a>
|
|
||||||
<a href="https://slack.spack.io"><img src="https://slack.spack.io/badge.svg" alt="Slack"/></a>
|
|
||||||
<a href="https://matrix.to/#/#spack-space:matrix.org"><img src="https://img.shields.io/matrix/spack-space%3Amatrix.org?label=matrix" alt="Matrix"/></a>
|
|
||||||
|
|
||||||
</h2>
|
|
||||||
|
|
||||||
**[Getting Started] • [Config] • [Community] • [Contributing] • [Packaging Guide]**
|
|
||||||
|
|
||||||
[Getting Started]: https://spack.readthedocs.io/en/latest/getting_started.html
|
|
||||||
[Config]: https://spack.readthedocs.io/en/latest/configuration.html
|
|
||||||
[Community]: #community
|
|
||||||
[Contributing]: https://spack.readthedocs.io/en/latest/contribution_guide.html
|
|
||||||
[Packaging Guide]: https://spack.readthedocs.io/en/latest/packaging_guide.html
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
Spack is a multi-platform package manager that builds and installs
|
Spack is a multi-platform package manager that builds and installs
|
||||||
multiple versions and configurations of software. It works on Linux,
|
multiple versions and configurations of software. It works on Linux,
|
||||||
macOS, Windows, and many supercomputers. Spack is non-destructive: installing a
|
macOS, and many supercomputers. Spack is non-destructive: installing a
|
||||||
new version of a package does not break existing installations, so many
|
new version of a package does not break existing installations, so many
|
||||||
configurations of the same package can coexist.
|
configurations of the same package can coexist.
|
||||||
|
|
||||||
@@ -46,18 +24,13 @@ See the
|
|||||||
[Feature Overview](https://spack.readthedocs.io/en/latest/features.html)
|
[Feature Overview](https://spack.readthedocs.io/en/latest/features.html)
|
||||||
for examples and highlights.
|
for examples and highlights.
|
||||||
|
|
||||||
To install spack and your first package, make sure you have Python & Git.
|
To install spack and your first package, make sure you have Python.
|
||||||
Then:
|
Then:
|
||||||
|
|
||||||
$ git clone -c feature.manyFiles=true --depth=2 https://github.com/spack/spack.git
|
$ git clone -c feature.manyFiles=true https://github.com/spack/spack.git
|
||||||
$ cd spack/bin
|
$ cd spack/bin
|
||||||
$ ./spack install zlib
|
$ ./spack install zlib
|
||||||
|
|
||||||
> [!TIP]
|
|
||||||
> `-c feature.manyFiles=true` improves git's performance on repositories with 1,000+ files.
|
|
||||||
>
|
|
||||||
> `--depth=2` prunes the git history to reduce the size of the Spack installation.
|
|
||||||
|
|
||||||
Documentation
|
Documentation
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
@@ -89,14 +62,10 @@ Resources:
|
|||||||
|
|
||||||
* **Slack workspace**: [spackpm.slack.com](https://spackpm.slack.com).
|
* **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, visit [slack.spack.io](https://slack.spack.io).
|
||||||
* **Matrix space**: [#spack-space:matrix.org](https://matrix.to/#/#spack-space:matrix.org):
|
* [**Github Discussions**](https://github.com/spack/spack/discussions): not just for discussions, also Q&A.
|
||||||
[bridged](https://github.com/matrix-org/matrix-appservice-slack#matrix-appservice-slack) to Slack.
|
* **Mailing list**: [groups.google.com/d/forum/spack](https://groups.google.com/d/forum/spack)
|
||||||
* [**Github Discussions**](https://github.com/spack/spack/discussions):
|
* **Twitter**: [@spackpm](https://twitter.com/spackpm). Be sure to
|
||||||
for Q&A and discussions. Note the pinned discussions for announcements.
|
|
||||||
* **X**: [@spackpm](https://twitter.com/spackpm). Be sure to
|
|
||||||
`@mention` us!
|
`@mention` us!
|
||||||
* **Mailing list**: [groups.google.com/d/forum/spack](https://groups.google.com/d/forum/spack):
|
|
||||||
only for announcements. Please use other venues for discussions.
|
|
||||||
|
|
||||||
Contributing
|
Contributing
|
||||||
------------------------
|
------------------------
|
||||||
|
32
SECURITY.md
32
SECURITY.md
@@ -2,26 +2,24 @@
|
|||||||
|
|
||||||
## Supported Versions
|
## Supported Versions
|
||||||
|
|
||||||
We provide security updates for `develop` and for the last two
|
We provide security updates for the following releases.
|
||||||
stable (`0.x`) release series of Spack. Security updates will be
|
|
||||||
made available as patch (`0.x.1`, `0.x.2`, etc.) releases.
|
|
||||||
|
|
||||||
For more on Spack's release structure, see
|
For more on Spack's release structure, see
|
||||||
[`README.md`](https://github.com/spack/spack#releases).
|
[`README.md`](https://github.com/spack/spack#releases).
|
||||||
|
|
||||||
|
|
||||||
|
| Version | Supported |
|
||||||
|
| ------- | ------------------ |
|
||||||
|
| develop | :white_check_mark: |
|
||||||
|
| 0.19.x | :white_check_mark: |
|
||||||
|
| 0.18.x | :white_check_mark: |
|
||||||
|
|
||||||
## Reporting a Vulnerability
|
## Reporting a Vulnerability
|
||||||
|
|
||||||
You can report a vulnerability using GitHub's private reporting
|
To report a vulnerability or other security
|
||||||
feature:
|
issue, email maintainers@spack.io.
|
||||||
|
|
||||||
1. Go to [github.com/spack/spack/security](https://github.com/spack/spack/security).
|
You can expect to hear back within two days.
|
||||||
2. Click "Report a vulnerability" in the upper right corner of that page.
|
If your security issue is accepted, we will do
|
||||||
3. Fill out the form and submit your draft security advisory.
|
our best to release a fix within a week. If
|
||||||
|
fixing the issue will take longer than this,
|
||||||
More details are available in
|
we will discuss timeline options with you.
|
||||||
[GitHub's docs](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability).
|
|
||||||
|
|
||||||
You can expect to hear back about security issues 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,4 +1,4 @@
|
|||||||
# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
# sbang project developers. See the top-level COPYRIGHT file for details.
|
# sbang project developers. See the top-level COPYRIGHT file for details.
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# -*- python -*-
|
# -*- python -*-
|
||||||
#
|
#
|
||||||
# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -25,6 +25,8 @@ exit 1
|
|||||||
# Line above is a shell no-op, and ends a python multi-line comment.
|
# Line above is a shell no-op, and ends a python multi-line comment.
|
||||||
# The code above runs this file with our preferred python interpreter.
|
# The code above runs this file with our preferred python interpreter.
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import os.path
|
import os.path
|
||||||
import sys
|
import sys
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -22,4 +22,4 @@
|
|||||||
#
|
#
|
||||||
# This is compatible across platforms.
|
# This is compatible across platforms.
|
||||||
#
|
#
|
||||||
exec spack python "$@"
|
exec /usr/bin/env spack python "$@"
|
||||||
|
@@ -72,7 +72,6 @@ config:
|
|||||||
root: $TMP_DIR/install
|
root: $TMP_DIR/install
|
||||||
misc_cache: $$user_cache_path/cache
|
misc_cache: $$user_cache_path/cache
|
||||||
source_cache: $$user_cache_path/source
|
source_cache: $$user_cache_path/source
|
||||||
environments_root: $TMP_DIR/envs
|
|
||||||
EOF
|
EOF
|
||||||
cat >"$SPACK_USER_CONFIG_PATH/bootstrap.yaml" <<EOF
|
cat >"$SPACK_USER_CONFIG_PATH/bootstrap.yaml" <<EOF
|
||||||
bootstrap:
|
bootstrap:
|
||||||
|
125
bin/spack.bat
125
bin/spack.bat
@@ -1,4 +1,4 @@
|
|||||||
:: Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
:: Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
:: Spack Project Developers. See the top-level COPYRIGHT file for details.
|
:: Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
::
|
::
|
||||||
:: SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
:: SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
::
|
::
|
||||||
@echo off
|
@echo off
|
||||||
|
|
||||||
set spack="%SPACK_ROOT%"\bin\spack
|
set spack=%SPACK_ROOT%\bin\spack
|
||||||
|
|
||||||
::#######################################################################
|
::#######################################################################
|
||||||
:: This is a wrapper around the spack command that forwards calls to
|
:: This is a wrapper around the spack command that forwards calls to
|
||||||
@@ -50,48 +50,25 @@ setlocal enabledelayedexpansion
|
|||||||
:: flags will always start with '-', e.g. --help or -V
|
:: flags will always start with '-', e.g. --help or -V
|
||||||
:: subcommands will never start with '-'
|
:: subcommands will never start with '-'
|
||||||
:: everything after the subcommand is an arg
|
:: everything after the subcommand is an arg
|
||||||
|
for %%x in (%*) do (
|
||||||
|
set t="%%~x"
|
||||||
:process_cl_args
|
if "!t:~0,1!" == "-" (
|
||||||
rem Set first cl argument (denoted by %1) to be processed
|
if defined _sp_subcommand (
|
||||||
set t=%1
|
:: We already have a subcommand, processing args now
|
||||||
rem shift moves all cl positional arguments left by one
|
|
||||||
rem meaning %2 is now %1, this allows us to iterate over each
|
|
||||||
rem argument
|
|
||||||
shift
|
|
||||||
rem assign next "first" cl argument to cl_args, will be null when
|
|
||||||
rem there are now further arguments to process
|
|
||||||
set cl_args=%1
|
|
||||||
if "!t:~0,1!" == "-" (
|
|
||||||
if defined _sp_subcommand (
|
|
||||||
rem We already have a subcommand, processing args now
|
|
||||||
if not defined _sp_args (
|
|
||||||
set "_sp_args=!t!"
|
|
||||||
) else (
|
|
||||||
set "_sp_args=!_sp_args! !t!"
|
set "_sp_args=!_sp_args! !t!"
|
||||||
)
|
|
||||||
) else (
|
|
||||||
if not defined _sp_flags (
|
|
||||||
set "_sp_flags=!t!"
|
|
||||||
) else (
|
) else (
|
||||||
set "_sp_flags=!_sp_flags! !t!"
|
set "_sp_flags=!_sp_flags! !t!"
|
||||||
|
shift
|
||||||
)
|
)
|
||||||
)
|
) else if not defined _sp_subcommand (
|
||||||
) else if not defined _sp_subcommand (
|
set "_sp_subcommand=!t!"
|
||||||
set "_sp_subcommand=!t!"
|
shift
|
||||||
) else (
|
|
||||||
if not defined _sp_args (
|
|
||||||
set "_sp_args=!t!"
|
|
||||||
) else (
|
) else (
|
||||||
set "_sp_args=!_sp_args! !t!"
|
set "_sp_args=!_sp_args! !t!"
|
||||||
|
shift
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
rem if this is not nu;ll, we have more tokens to process
|
|
||||||
rem start above process again with remaining unprocessed cl args
|
|
||||||
if defined cl_args goto :process_cl_args
|
|
||||||
|
|
||||||
|
|
||||||
:: --help, -h and -V flags don't require further output parsing.
|
:: --help, -h and -V flags don't require further output parsing.
|
||||||
:: If we encounter, execute and exit
|
:: If we encounter, execute and exit
|
||||||
if defined _sp_flags (
|
if defined _sp_flags (
|
||||||
@@ -118,21 +95,31 @@ if not defined _sp_subcommand (
|
|||||||
|
|
||||||
:: pass parsed variables outside of local scope. Need to do
|
:: pass parsed variables outside of local scope. Need to do
|
||||||
:: this because delayedexpansion can only be set by setlocal
|
:: this because delayedexpansion can only be set by setlocal
|
||||||
endlocal & (
|
echo %_sp_flags%>flags
|
||||||
set "_sp_flags=%_sp_flags%"
|
echo %_sp_args%>args
|
||||||
set "_sp_args=%_sp_args%"
|
echo %_sp_subcommand%>subcmd
|
||||||
set "_sp_subcommand=%_sp_subcommand%"
|
endlocal
|
||||||
)
|
set /p _sp_subcommand=<subcmd
|
||||||
|
set /p _sp_flags=<flags
|
||||||
|
set /p _sp_args=<args
|
||||||
|
if "%_sp_subcommand%"=="ECHO is off." (set "_sp_subcommand=")
|
||||||
|
if "%_sp_subcommand%"=="ECHO is on." (set "_sp_subcommand=")
|
||||||
|
if "%_sp_flags%"=="ECHO is off." (set "_sp_flags=")
|
||||||
|
if "%_sp_flags%"=="ECHO is on." (set "_sp_flags=")
|
||||||
|
if "%_sp_args%"=="ECHO is off." (set "_sp_args=")
|
||||||
|
if "%_sp_args%"=="ECHO is on." (set "_sp_args=")
|
||||||
|
del subcmd
|
||||||
|
del flags
|
||||||
|
del args
|
||||||
|
|
||||||
:: Filter out some commands. For any others, just run the command.
|
:: Filter out some commands. For any others, just run the command.
|
||||||
if "%_sp_subcommand%" == "cd" (
|
if %_sp_subcommand% == "cd" (
|
||||||
goto :case_cd
|
goto :case_cd
|
||||||
) else if "%_sp_subcommand%" == "env" (
|
) else if %_sp_subcommand% == "env" (
|
||||||
goto :case_env
|
goto :case_env
|
||||||
) else if "%_sp_subcommand%" == "load" (
|
) else if %_sp_subcommand% == "load" (
|
||||||
goto :case_load
|
goto :case_load
|
||||||
) else if "%_sp_subcommand%" == "unload" (
|
) else if %_sp_subcommand% == "unload" (
|
||||||
goto :case_load
|
goto :case_load
|
||||||
) else (
|
) else (
|
||||||
goto :default_case
|
goto :default_case
|
||||||
@@ -167,20 +154,20 @@ goto :end_switch
|
|||||||
if NOT defined _sp_args (
|
if NOT defined _sp_args (
|
||||||
goto :default_case
|
goto :default_case
|
||||||
)
|
)
|
||||||
|
set args_no_quote=%_sp_args:"=%
|
||||||
if NOT "%_sp_args%"=="%_sp_args:--help=%" (
|
if NOT "%args_no_quote%"=="%args_no_quote:--help=%" (
|
||||||
goto :default_case
|
goto :default_case
|
||||||
) else if NOT "%_sp_args%"=="%_sp_args: -h=%" (
|
) else if NOT "%args_no_quote%"=="%args_no_quote: -h=%" (
|
||||||
goto :default_case
|
goto :default_case
|
||||||
) else if NOT "%_sp_args%"=="%_sp_args:--bat=%" (
|
) else if NOT "%args_no_quote%"=="%args_no_quote:--bat=%" (
|
||||||
goto :default_case
|
goto :default_case
|
||||||
) else if NOT "%_sp_args%"=="%_sp_args:deactivate=%" (
|
) else if NOT "%args_no_quote%"=="%args_no_quote:deactivate=%" (
|
||||||
for /f "tokens=* USEBACKQ" %%I in (
|
for /f "tokens=* USEBACKQ" %%I in (
|
||||||
`call python %spack% %_sp_flags% env deactivate --bat %_sp_args:deactivate=%`
|
`call python %spack% %_sp_flags% env deactivate --bat %args_no_quote:deactivate=%`
|
||||||
) do %%I
|
) do %%I
|
||||||
) else if NOT "%_sp_args%"=="%_sp_args:activate=%" (
|
) else if NOT "%args_no_quote%"=="%args_no_quote:activate=%" (
|
||||||
for /f "tokens=* USEBACKQ" %%I in (
|
for /f "tokens=* USEBACKQ" %%I in (
|
||||||
`python %spack% %_sp_flags% env activate --bat %_sp_args:activate=%`
|
`python %spack% %_sp_flags% env activate --bat %args_no_quote:activate=%`
|
||||||
) do %%I
|
) do %%I
|
||||||
) else (
|
) else (
|
||||||
goto :default_case
|
goto :default_case
|
||||||
@@ -188,27 +175,25 @@ if NOT "%_sp_args%"=="%_sp_args:--help=%" (
|
|||||||
goto :end_switch
|
goto :end_switch
|
||||||
|
|
||||||
:case_load
|
:case_load
|
||||||
if NOT defined _sp_args (
|
:: If args contain --sh, --csh, or -h/--help: just execute.
|
||||||
exit /B 0
|
if defined _sp_args (
|
||||||
)
|
if NOT "%_sp_args%"=="%_sp_args:--help=%" (
|
||||||
|
goto :default_case
|
||||||
:: If args contain --bat, or -h/--help: just execute.
|
) else if NOT "%_sp_args%"=="%_sp_args: -h=%" (
|
||||||
if NOT "%_sp_args%"=="%_sp_args:--help=%" (
|
goto :default_case
|
||||||
goto :default_case
|
) else if NOT "%_sp_args%"=="%_sp_args:--bat=%" (
|
||||||
) else if NOT "%_sp_args%"=="%_sp_args:-h=%" (
|
goto :default_case
|
||||||
goto :default_case
|
)
|
||||||
) else if NOT "%_sp_args%"=="%_sp_args:--bat=%" (
|
|
||||||
goto :default_case
|
|
||||||
) else if NOT "%_sp_args%"=="%_sp_args:--list=%" (
|
|
||||||
goto :default_case
|
|
||||||
)
|
)
|
||||||
|
|
||||||
for /f "tokens=* USEBACKQ" %%I in (
|
for /f "tokens=* USEBACKQ" %%I in (
|
||||||
`python "%spack%" %_sp_flags% %_sp_subcommand% --bat %_sp_args%`
|
`python "%spack%" %_sp_flags% %_sp_subcommand% --bat %_sp_args%`) do %%I
|
||||||
) do %%I
|
)
|
||||||
|
|
||||||
goto :end_switch
|
goto :end_switch
|
||||||
|
|
||||||
|
:case_unload
|
||||||
|
goto :case_load
|
||||||
|
|
||||||
:default_case
|
:default_case
|
||||||
python "%spack%" %_sp_flags% %_sp_subcommand% %_sp_args%
|
python "%spack%" %_sp_flags% %_sp_subcommand% %_sp_args%
|
||||||
goto :end_switch
|
goto :end_switch
|
||||||
@@ -241,7 +226,7 @@ for %%Z in ("%_pa_new_path%") do if EXIST %%~sZ\NUL (
|
|||||||
exit /b 0
|
exit /b 0
|
||||||
|
|
||||||
:: set module system roots
|
:: set module system roots
|
||||||
:_sp_multi_pathadd
|
:_sp_multi_pathadd
|
||||||
for %%I in (%~2) do (
|
for %%I in (%~2) do (
|
||||||
for %%Z in (%_sp_compatible_sys_types%) do (
|
for %%Z in (%_sp_compatible_sys_types%) do (
|
||||||
:pathadd "%~1" "%%I\%%Z"
|
:pathadd "%~1" "%%I\%%Z"
|
||||||
|
148
bin/spack.ps1
148
bin/spack.ps1
@@ -1,148 +0,0 @@
|
|||||||
# Copyright 2013-2024 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)
|
|
||||||
# #######################################################################
|
|
||||||
|
|
||||||
function Compare-CommonArgs {
|
|
||||||
$CMDArgs = $args[0]
|
|
||||||
# These aruments take precedence and call for no futher parsing of arguments
|
|
||||||
# invoke actual Spack entrypoint with that context and exit after
|
|
||||||
"--help", "-h", "--version", "-V" | ForEach-Object {
|
|
||||||
$arg_opt = $_
|
|
||||||
if(($CMDArgs) -and ([bool]($CMDArgs.Where({$_ -eq $arg_opt})))) {
|
|
||||||
return $true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $false
|
|
||||||
}
|
|
||||||
|
|
||||||
function Read-SpackArgs {
|
|
||||||
$SpackCMD_params = @()
|
|
||||||
$SpackSubCommand = $NULL
|
|
||||||
$SpackSubCommandArgs = @()
|
|
||||||
$args_ = $args[0]
|
|
||||||
$args_ | ForEach-Object {
|
|
||||||
if (!$SpackSubCommand) {
|
|
||||||
if($_.SubString(0,1) -eq "-")
|
|
||||||
{
|
|
||||||
$SpackCMD_params += $_
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
$SpackSubCommand = $_
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
$SpackSubCommandArgs += $_
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $SpackCMD_params, $SpackSubCommand, $SpackSubCommandArgs
|
|
||||||
}
|
|
||||||
|
|
||||||
function Set-SpackEnv {
|
|
||||||
# This method is responsible
|
|
||||||
# for processing the return from $(spack <command>)
|
|
||||||
# which are returned as System.Object[]'s containing
|
|
||||||
# a list of env commands
|
|
||||||
# Invoke-Expression can only handle one command at a time
|
|
||||||
# so we iterate over the list to invoke the env modification
|
|
||||||
# expressions one at a time
|
|
||||||
foreach($envop in $args[0]){
|
|
||||||
Invoke-Expression $envop
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function Invoke-SpackCD {
|
|
||||||
if (Compare-CommonArgs $SpackSubCommandArgs) {
|
|
||||||
python "$Env:SPACK_ROOT/bin/spack" cd -h
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$LOC = $(python "$Env:SPACK_ROOT/bin/spack" location $SpackSubCommandArgs)
|
|
||||||
if (($NULL -ne $LOC)){
|
|
||||||
if ( Test-Path -Path $LOC){
|
|
||||||
Set-Location $LOC
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function Invoke-SpackEnv {
|
|
||||||
if (Compare-CommonArgs $SpackSubCommandArgs[0]) {
|
|
||||||
python "$Env:SPACK_ROOT/bin/spack" env -h
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$SubCommandSubCommand = $SpackSubCommandArgs[0]
|
|
||||||
$SubCommandSubCommandArgs = $SpackSubCommandArgs[1..$SpackSubCommandArgs.Count]
|
|
||||||
switch ($SubCommandSubCommand) {
|
|
||||||
"activate" {
|
|
||||||
if (Compare-CommonArgs $SubCommandSubCommandArgs) {
|
|
||||||
python "$Env:SPACK_ROOT/bin/spack" env activate $SubCommandSubCommandArgs
|
|
||||||
}
|
|
||||||
elseif ([bool]($SubCommandSubCommandArgs.Where({$_ -eq "--pwsh"}))) {
|
|
||||||
python "$Env:SPACK_ROOT/bin/spack" env activate $SubCommandSubCommandArgs
|
|
||||||
}
|
|
||||||
elseif (!$SubCommandSubCommandArgs) {
|
|
||||||
python "$Env:SPACK_ROOT/bin/spack" env activate $SubCommandSubCommandArgs
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$SpackEnv = $(python "$Env:SPACK_ROOT/bin/spack" $SpackCMD_params env activate "--pwsh" $SubCommandSubCommandArgs)
|
|
||||||
Set-SpackEnv $SpackEnv
|
|
||||||
}
|
|
||||||
}
|
|
||||||
"deactivate" {
|
|
||||||
if ([bool]($SubCommandSubCommandArgs.Where({$_ -eq "--pwsh"}))) {
|
|
||||||
python"$Env:SPACK_ROOT/bin/spack" env deactivate $SubCommandSubCommandArgs
|
|
||||||
}
|
|
||||||
elseif($SubCommandSubCommandArgs) {
|
|
||||||
python "$Env:SPACK_ROOT/bin/spack" env deactivate -h
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$SpackEnv = $(python "$Env:SPACK_ROOT/bin/spack" $SpackCMD_params env deactivate "--pwsh")
|
|
||||||
Set-SpackEnv $SpackEnv
|
|
||||||
}
|
|
||||||
}
|
|
||||||
default {python "$Env:SPACK_ROOT/bin/spack" $SpackCMD_params $SpackSubCommand $SpackSubCommandArgs}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function Invoke-SpackLoad {
|
|
||||||
if (Compare-CommonArgs $SpackSubCommandArgs) {
|
|
||||||
python "$Env:SPACK_ROOT/bin/spack" $SpackCMD_params $SpackSubCommand $SpackSubCommandArgs
|
|
||||||
}
|
|
||||||
elseif ([bool]($SpackSubCommandArgs.Where({($_ -eq "--pwsh") -or ($_ -eq "--list")}))) {
|
|
||||||
python "$Env:SPACK_ROOT/bin/spack" $SpackCMD_params $SpackSubCommand $SpackSubCommandArgs
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$SpackEnv = $(python "$Env:SPACK_ROOT/bin/spack" $SpackCMD_params $SpackSubCommand "--pwsh" $SpackSubCommandArgs)
|
|
||||||
Set-SpackEnv $SpackEnv
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$SpackCMD_params, $SpackSubCommand, $SpackSubCommandArgs = Read-SpackArgs $args
|
|
||||||
|
|
||||||
if (Compare-CommonArgs $SpackCMD_params) {
|
|
||||||
python "$Env:SPACK_ROOT/bin/spack" $SpackCMD_params $SpackSubCommand $SpackSubCommandArgs
|
|
||||||
exit $LASTEXITCODE
|
|
||||||
}
|
|
||||||
|
|
||||||
# Process Spack commands with special conditions
|
|
||||||
# all other commands are piped directly to Spack
|
|
||||||
switch($SpackSubCommand)
|
|
||||||
{
|
|
||||||
"cd" {Invoke-SpackCD}
|
|
||||||
"env" {Invoke-SpackEnv}
|
|
||||||
"load" {Invoke-SpackLoad}
|
|
||||||
"unload" {Invoke-SpackLoad}
|
|
||||||
default {python "$Env:SPACK_ROOT/bin/spack" $SpackCMD_params $SpackSubCommand $SpackSubCommandArgs}
|
|
||||||
}
|
|
||||||
|
|
||||||
exit $LASTEXITCODE
|
|
@@ -1,11 +1,71 @@
|
|||||||
@ECHO OFF
|
@ECHO OFF
|
||||||
|
setlocal EnableDelayedExpansion
|
||||||
:: (c) 2021 Lawrence Livermore National Laboratory
|
:: (c) 2021 Lawrence Livermore National Laboratory
|
||||||
:: To use this file independently of Spack's installer, execute this script in its directory, or add the
|
:: 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.
|
:: associated bin directory to your PATH. Invoke to launch Spack Shell.
|
||||||
::
|
::
|
||||||
:: source_dir/spack/bin/spack_cmd.bat
|
:: source_dir/spack/bin/spack_cmd.bat
|
||||||
::
|
::
|
||||||
|
pushd %~dp0..
|
||||||
|
set SPACK_ROOT=%CD%
|
||||||
|
pushd %CD%\..
|
||||||
|
set spackinstdir=%CD%
|
||||||
|
popd
|
||||||
|
|
||||||
call "%~dp0..\share\spack\setup-env.bat"
|
|
||||||
pushd %SPACK_ROOT%
|
:: Check if Python is on the PATH
|
||||||
%comspec% /K
|
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"
|
||||||
|
)
|
||||||
|
|
||||||
|
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,4 +1,4 @@
|
|||||||
# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
@@ -9,15 +9,15 @@ bootstrap:
|
|||||||
# may not be able to bootstrap all the software that Spack needs,
|
# may not be able to bootstrap all the software that Spack needs,
|
||||||
# depending on its type.
|
# depending on its type.
|
||||||
sources:
|
sources:
|
||||||
- name: github-actions-v0.6
|
- name: 'github-actions-v0.4'
|
||||||
metadata: $spack/share/spack/bootstrap/github-actions-v0.6
|
metadata: $spack/share/spack/bootstrap/github-actions-v0.4
|
||||||
- name: github-actions-v0.5
|
- name: 'github-actions-v0.3'
|
||||||
metadata: $spack/share/spack/bootstrap/github-actions-v0.5
|
metadata: $spack/share/spack/bootstrap/github-actions-v0.3
|
||||||
- name: spack-install
|
- name: 'spack-install'
|
||||||
metadata: $spack/share/spack/bootstrap/spack-install
|
metadata: $spack/share/spack/bootstrap/spack-install
|
||||||
trusted:
|
trusted:
|
||||||
# By default we trust bootstrapping from sources and from binaries
|
# By default we trust bootstrapping from sources and from binaries
|
||||||
# produced on Github via the workflow
|
# produced on Github via the workflow
|
||||||
github-actions-v0.6: true
|
github-actions-v0.4: true
|
||||||
github-actions-v0.5: true
|
github-actions-v0.3: true
|
||||||
spack-install: true
|
spack-install: true
|
||||||
|
@@ -13,18 +13,16 @@ concretizer:
|
|||||||
# Whether to consider installed packages or packages from buildcaches when
|
# Whether to consider installed packages or packages from buildcaches when
|
||||||
# concretizing specs. If `true`, we'll try to use as many installs/binaries
|
# 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
|
# as possible, rather than building. If `false`, we'll always give you a fresh
|
||||||
# concretization. If `dependencies`, we'll only reuse dependencies but
|
# concretization.
|
||||||
# give you a fresh concretization for your root specs.
|
|
||||||
reuse: true
|
reuse: true
|
||||||
# Options that tune which targets are considered for concretization. The
|
# Options that tune which targets are considered for concretization. The
|
||||||
# concretization process is very sensitive to the number targets, and the time
|
# concretization process is very sensitive to the number targets, and the time
|
||||||
# needed to reach a solution increases noticeably with the number of targets
|
# needed to reach a solution increases noticeably with the number of targets
|
||||||
# considered.
|
# considered.
|
||||||
targets:
|
targets:
|
||||||
# Determine whether we want to target specific or generic
|
# Determine whether we want to target specific or generic microarchitectures.
|
||||||
# microarchitectures. Valid values are: "microarchitectures" or "generic".
|
# An example of the first kind might be for instance "skylake" or "bulldozer",
|
||||||
# An example of "microarchitectures" would be "skylake" or "bulldozer",
|
# while generic microarchitectures are for instance "aarch64" or "x86_64_v4".
|
||||||
# while an example of "generic" would be "aarch64" or "x86_64_v4".
|
|
||||||
granularity: microarchitectures
|
granularity: microarchitectures
|
||||||
# If "false" allow targets that are incompatible with the current host (for
|
# If "false" allow targets that are incompatible with the current host (for
|
||||||
# instance concretize with target "icelake" while running on "haswell").
|
# instance concretize with target "icelake" while running on "haswell").
|
||||||
@@ -35,23 +33,4 @@ concretizer:
|
|||||||
# environments can always be activated. When "false" perform concretization separately
|
# environments can always be activated. When "false" perform concretization separately
|
||||||
# on each root spec, allowing different versions and variants of the same package in
|
# on each root spec, allowing different versions and variants of the same package in
|
||||||
# an environment.
|
# an environment.
|
||||||
unify: true
|
unify: true
|
||||||
# Option to deal with possible duplicate nodes (i.e. different nodes from the same package) in the DAG.
|
|
||||||
duplicates:
|
|
||||||
# "none": allows a single node for any package in the DAG.
|
|
||||||
# "minimal": allows the duplication of 'build-tools' nodes only
|
|
||||||
# (e.g. py-setuptools, cmake etc.)
|
|
||||||
# "full" (experimental): allows separation of the entire build-tool stack (e.g. the entire "cmake" subDAG)
|
|
||||||
strategy: minimal
|
|
||||||
# Option to specify compatibility between operating systems for reuse of compilers and packages
|
|
||||||
# Specified as a key: [list] where the key is the os that is being targeted, and the list contains the OS's
|
|
||||||
# it can reuse. Note this is a directional compatibility so mutual compatibility between two OS's
|
|
||||||
# requires two entries i.e. os_compatible: {sonoma: [monterey], monterey: [sonoma]}
|
|
||||||
os_compatible: {}
|
|
||||||
|
|
||||||
# Option to specify whether to support splicing. Splicing allows for
|
|
||||||
# the relinking of concrete package dependencies in order to better
|
|
||||||
# reuse already built packages with ABI compatible dependencies
|
|
||||||
splice:
|
|
||||||
explicit: []
|
|
||||||
automatic: false
|
|
@@ -81,10 +81,6 @@ config:
|
|||||||
source_cache: $spack/var/spack/cache
|
source_cache: $spack/var/spack/cache
|
||||||
|
|
||||||
|
|
||||||
## Directory where spack managed environments are created and stored
|
|
||||||
# environments_root: $spack/var/spack/environments
|
|
||||||
|
|
||||||
|
|
||||||
# Cache directory for miscellaneous files, like the package index.
|
# Cache directory for miscellaneous files, like the package index.
|
||||||
# This can be purged with `spack clean --misc-cache`
|
# This can be purged with `spack clean --misc-cache`
|
||||||
misc_cache: $user_cache_path/cache
|
misc_cache: $user_cache_path/cache
|
||||||
@@ -101,12 +97,6 @@ config:
|
|||||||
verify_ssl: true
|
verify_ssl: true
|
||||||
|
|
||||||
|
|
||||||
# This is where custom certs for proxy/firewall are stored.
|
|
||||||
# It can be a path or environment variable. To match ssl env configuration
|
|
||||||
# the default is the environment variable SSL_CERT_FILE
|
|
||||||
ssl_certs: $SSL_CERT_FILE
|
|
||||||
|
|
||||||
|
|
||||||
# Suppress gpg warnings from binary package verification
|
# Suppress gpg warnings from binary package verification
|
||||||
# Only suppresses warnings, gpg failure will still fail the install
|
# Only suppresses warnings, gpg failure will still fail the install
|
||||||
# Potential rationale to set True: users have already explicitly trusted the
|
# Potential rationale to set True: users have already explicitly trusted the
|
||||||
@@ -115,6 +105,12 @@ config:
|
|||||||
suppress_gpg_warnings: false
|
suppress_gpg_warnings: false
|
||||||
|
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
|
||||||
# If set to true, Spack will always check checksums after downloading
|
# If set to true, Spack will always check checksums after downloading
|
||||||
# archives. If false, Spack skips the checksum step.
|
# archives. If false, Spack skips the checksum step.
|
||||||
checksum: true
|
checksum: true
|
||||||
@@ -164,11 +160,28 @@ config:
|
|||||||
# If set to true, Spack will use ccache to cache C compiles.
|
# If set to true, Spack will use ccache to cache C compiles.
|
||||||
ccache: false
|
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
|
# 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
|
# when Spack needs to manage its own package metadata and all operations are
|
||||||
# expected to complete within the default time limit. The timeout should
|
# expected to complete within the default time limit. The timeout should
|
||||||
# therefore generally be left untouched.
|
# therefore generally be left untouched.
|
||||||
db_lock_timeout: 60
|
db_lock_timeout: 3
|
||||||
|
|
||||||
|
|
||||||
# How long to wait when attempting to modify a package (e.g. to install it).
|
# How long to wait when attempting to modify a package (e.g. to install it).
|
||||||
@@ -199,11 +212,10 @@ config:
|
|||||||
# manipulation by unprivileged user (e.g. AFS)
|
# manipulation by unprivileged user (e.g. AFS)
|
||||||
allow_sgid: true
|
allow_sgid: true
|
||||||
|
|
||||||
# Whether to show status information during building and installing packages.
|
# Whether to set the terminal title to display status information during
|
||||||
# This gives information about Spack's current progress as well as the current
|
# building and installing packages. This gives information about Spack's
|
||||||
# and total number of packages. Information is shown both in the terminal
|
# current progress as well as the current and total number of packages.
|
||||||
# title and inline.
|
terminal_title: false
|
||||||
install_status: true
|
|
||||||
|
|
||||||
# Number of seconds a buildcache's index.json is cached locally before probing
|
# Number of seconds a buildcache's index.json is cached locally before probing
|
||||||
# for updates, within a single Spack invocation. Defaults to 10 minutes.
|
# for updates, within a single Spack invocation. Defaults to 10 minutes.
|
||||||
@@ -212,11 +224,3 @@ config:
|
|||||||
flags:
|
flags:
|
||||||
# Whether to keep -Werror flags active in package builds.
|
# Whether to keep -Werror flags active in package builds.
|
||||||
keep_werror: 'none'
|
keep_werror: 'none'
|
||||||
|
|
||||||
# A mapping of aliases that can be used to define new commands. For instance,
|
|
||||||
# `sp: spec -I` will define a new command `sp` that will execute `spec` with
|
|
||||||
# the `-I` argument. Aliases cannot override existing commands.
|
|
||||||
aliases:
|
|
||||||
concretise: concretize
|
|
||||||
containerise: containerize
|
|
||||||
rm: remove
|
|
||||||
|
16
etc/spack/defaults/cray/modules.yaml
Normal file
16
etc/spack/defaults/cray/modules.yaml
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# -------------------------------------------------------------------------
|
||||||
|
# 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: {}
|
@@ -19,23 +19,12 @@ packages:
|
|||||||
- apple-clang
|
- apple-clang
|
||||||
- clang
|
- clang
|
||||||
- gcc
|
- gcc
|
||||||
|
- intel
|
||||||
providers:
|
providers:
|
||||||
elf: [libelf]
|
elf: [libelf]
|
||||||
fuse: [macfuse]
|
fuse: [macfuse]
|
||||||
gl: [apple-gl]
|
|
||||||
glu: [apple-glu]
|
|
||||||
unwind: [apple-libunwind]
|
unwind: [apple-libunwind]
|
||||||
uuid: [apple-libuuid]
|
uuid: [apple-libuuid]
|
||||||
apple-gl:
|
|
||||||
buildable: false
|
|
||||||
externals:
|
|
||||||
- spec: apple-gl@4.1.0
|
|
||||||
prefix: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
|
|
||||||
apple-glu:
|
|
||||||
buildable: false
|
|
||||||
externals:
|
|
||||||
- spec: apple-glu@1.3.0
|
|
||||||
prefix: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
|
|
||||||
apple-libunwind:
|
apple-libunwind:
|
||||||
buildable: false
|
buildable: false
|
||||||
externals:
|
externals:
|
||||||
@@ -49,4 +38,4 @@ packages:
|
|||||||
# Apple bundles libuuid in libsystem_c version 1353.100.2,
|
# Apple bundles libuuid in libsystem_c version 1353.100.2,
|
||||||
# although the version number used here isn't critical
|
# although the version number used here isn't critical
|
||||||
- spec: apple-libuuid@1353.100.2
|
- spec: apple-libuuid@1353.100.2
|
||||||
prefix: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
|
prefix: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
|
||||||
|
@@ -1,4 +1,2 @@
|
|||||||
mirrors:
|
mirrors:
|
||||||
spack-public:
|
spack-public: https://mirror.spack.io
|
||||||
binary: false
|
|
||||||
url: https://mirror.spack.io
|
|
||||||
|
@@ -40,12 +40,13 @@ modules:
|
|||||||
roots:
|
roots:
|
||||||
tcl: $spack/share/spack/modules
|
tcl: $spack/share/spack/modules
|
||||||
lmod: $spack/share/spack/lmod
|
lmod: $spack/share/spack/lmod
|
||||||
# What type of modules to use ("tcl" and/or "lmod")
|
# What type of modules to use
|
||||||
enable: []
|
enable:
|
||||||
|
- tcl
|
||||||
|
|
||||||
tcl:
|
tcl:
|
||||||
all:
|
all:
|
||||||
autoload: direct
|
autoload: none
|
||||||
|
|
||||||
# Default configurations if lmod is enabled
|
# Default configurations if lmod is enabled
|
||||||
lmod:
|
lmod:
|
||||||
|
@@ -15,39 +15,32 @@
|
|||||||
# -------------------------------------------------------------------------
|
# -------------------------------------------------------------------------
|
||||||
packages:
|
packages:
|
||||||
all:
|
all:
|
||||||
compiler: [gcc, clang, oneapi, xl, nag, fj, aocc]
|
compiler: [gcc, intel, pgi, clang, xl, nag, fj, aocc]
|
||||||
providers:
|
providers:
|
||||||
awk: [gawk]
|
awk: [gawk]
|
||||||
armci: [armcimpi]
|
|
||||||
blas: [openblas, amdblis]
|
blas: [openblas, amdblis]
|
||||||
c: [gcc]
|
|
||||||
cxx: [gcc]
|
|
||||||
D: [ldc]
|
D: [ldc]
|
||||||
daal: [intel-oneapi-daal]
|
daal: [intel-daal]
|
||||||
elf: [elfutils]
|
elf: [elfutils]
|
||||||
fftw-api: [fftw, amdfftw]
|
fftw-api: [fftw, amdfftw]
|
||||||
flame: [libflame, amdlibflame]
|
flame: [libflame, amdlibflame]
|
||||||
fortran: [gcc]
|
|
||||||
fortran-rt: [gcc-runtime, intel-oneapi-runtime]
|
|
||||||
fuse: [libfuse]
|
fuse: [libfuse]
|
||||||
gl: [glx, osmesa]
|
gl: [glx, osmesa]
|
||||||
glu: [mesa-glu, openglu]
|
glu: [mesa-glu, openglu]
|
||||||
golang: [go, gcc]
|
golang: [go, gcc]
|
||||||
go-or-gccgo-bootstrap: [go-bootstrap, gcc]
|
go-external-or-gccgo-bootstrap: [go-bootstrap, gcc]
|
||||||
iconv: [libiconv]
|
iconv: [libiconv]
|
||||||
ipp: [intel-oneapi-ipp]
|
ipp: [intel-ipp]
|
||||||
java: [openjdk, jdk, ibm-java]
|
java: [openjdk, jdk, ibm-java]
|
||||||
jpeg: [libjpeg-turbo, libjpeg]
|
jpeg: [libjpeg-turbo, libjpeg]
|
||||||
lapack: [openblas, amdlibflame]
|
lapack: [openblas, amdlibflame]
|
||||||
libc: [glibc, musl]
|
libglx: [mesa+glx, mesa18+glx]
|
||||||
libgfortran: [gcc-runtime]
|
|
||||||
libglx: [mesa+glx]
|
|
||||||
libifcore: [intel-oneapi-runtime]
|
|
||||||
libllvm: [llvm]
|
libllvm: [llvm]
|
||||||
|
libosmesa: [mesa+osmesa, mesa18+osmesa]
|
||||||
lua-lang: [lua, lua-luajit-openresty, lua-luajit]
|
lua-lang: [lua, lua-luajit-openresty, lua-luajit]
|
||||||
luajit: [lua-luajit-openresty, lua-luajit]
|
luajit: [lua-luajit-openresty, lua-luajit]
|
||||||
mariadb-client: [mariadb-c-client, mariadb]
|
mariadb-client: [mariadb-c-client, mariadb]
|
||||||
mkl: [intel-oneapi-mkl]
|
mkl: [intel-mkl]
|
||||||
mpe: [mpe2]
|
mpe: [mpe2]
|
||||||
mpi: [openmpi, mpich]
|
mpi: [openmpi, mpich]
|
||||||
mysql-client: [mysql, mariadb-c-client]
|
mysql-client: [mysql, mariadb-c-client]
|
||||||
@@ -56,7 +49,6 @@ packages:
|
|||||||
pbs: [openpbs, torque]
|
pbs: [openpbs, torque]
|
||||||
pil: [py-pillow]
|
pil: [py-pillow]
|
||||||
pkgconfig: [pkgconf, pkg-config]
|
pkgconfig: [pkgconf, pkg-config]
|
||||||
qmake: [qt-base, qt]
|
|
||||||
rpc: [libtirpc]
|
rpc: [libtirpc]
|
||||||
scalapack: [netlib-scalapack, amdscalapack]
|
scalapack: [netlib-scalapack, amdscalapack]
|
||||||
sycl: [hipsycl]
|
sycl: [hipsycl]
|
||||||
@@ -64,21 +56,9 @@ packages:
|
|||||||
tbb: [intel-tbb]
|
tbb: [intel-tbb]
|
||||||
unwind: [libunwind]
|
unwind: [libunwind]
|
||||||
uuid: [util-linux-uuid, libuuid]
|
uuid: [util-linux-uuid, libuuid]
|
||||||
wasi-sdk: [wasi-sdk-prebuilt]
|
|
||||||
xxd: [xxd-standalone, vim]
|
xxd: [xxd-standalone, vim]
|
||||||
yacc: [bison, byacc]
|
yacc: [bison, byacc]
|
||||||
ziglang: [zig]
|
ziglang: [zig]
|
||||||
zlib-api: [zlib-ng+compat, zlib]
|
|
||||||
permissions:
|
permissions:
|
||||||
read: world
|
read: world
|
||||||
write: user
|
write: user
|
||||||
cray-mpich:
|
|
||||||
buildable: false
|
|
||||||
cray-mvapich2:
|
|
||||||
buildable: false
|
|
||||||
fujitsu-mpi:
|
|
||||||
buildable: false
|
|
||||||
hpcx-mpi:
|
|
||||||
buildable: false
|
|
||||||
spectrum-mpi:
|
|
||||||
buildable: false
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
config:
|
config:
|
||||||
locks: false
|
locks: false
|
||||||
|
concretizer: clingo
|
||||||
build_stage::
|
build_stage::
|
||||||
- '$spack/.staging'
|
- '$spack/.staging'
|
||||||
stage_name: '{name}-{version}-{hash:7}'
|
|
||||||
|
@@ -19,4 +19,3 @@ packages:
|
|||||||
- msvc
|
- msvc
|
||||||
providers:
|
providers:
|
||||||
mpi: [msmpi]
|
mpi: [msmpi]
|
||||||
gl: [wgl]
|
|
||||||
|
2
lib/spack/docs/.gitignore
vendored
2
lib/spack/docs/.gitignore
vendored
@@ -1,7 +1,7 @@
|
|||||||
|
package_list.html
|
||||||
command_index.rst
|
command_index.rst
|
||||||
spack*.rst
|
spack*.rst
|
||||||
llnl*.rst
|
llnl*.rst
|
||||||
_build
|
_build
|
||||||
.spack-env
|
.spack-env
|
||||||
spack.lock
|
spack.lock
|
||||||
_spack_root
|
|
||||||
|
@@ -1,16 +0,0 @@
|
|||||||
# Copyright 2013-2024 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)
|
|
||||||
|
|
||||||
# The name of the Pygments (syntax highlighting) style to use.
|
|
||||||
# We use our own extension of the default style with a few modifications
|
|
||||||
from pygments.styles.default import DefaultStyle
|
|
||||||
from pygments.token import Generic
|
|
||||||
|
|
||||||
|
|
||||||
class SpackStyle(DefaultStyle):
|
|
||||||
styles = DefaultStyle.styles.copy()
|
|
||||||
background_color = "#f4f4f8"
|
|
||||||
styles[Generic.Output] = "#355"
|
|
||||||
styles[Generic.Prompt] = "bold #346ec9"
|
|
12
lib/spack/docs/_templates/layout.html
vendored
12
lib/spack/docs/_templates/layout.html
vendored
@@ -1,12 +0,0 @@
|
|||||||
{% extends "!layout.html" %}
|
|
||||||
|
|
||||||
{%- block extrahead %}
|
|
||||||
<!-- Google tag (gtag.js) -->
|
|
||||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-S0PQ7WV75K"></script>
|
|
||||||
<script>
|
|
||||||
window.dataLayer = window.dataLayer || [];
|
|
||||||
function gtag(){dataLayer.push(arguments);}
|
|
||||||
gtag('js', new Date());
|
|
||||||
gtag('config', 'G-S0PQ7WV75K');
|
|
||||||
</script>
|
|
||||||
{% endblock %}
|
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -45,8 +45,7 @@ Listing available packages
|
|||||||
|
|
||||||
To install software with Spack, you need to know what software is
|
To install software with Spack, you need to know what software is
|
||||||
available. You can see a list of available package names at the
|
available. You can see a list of available package names at the
|
||||||
`packages.spack.io <https://packages.spack.io>`_ website, or
|
:ref:`package-list` webpage, or using the ``spack list`` command.
|
||||||
using the ``spack list`` command.
|
|
||||||
|
|
||||||
.. _cmd-spack-list:
|
.. _cmd-spack-list:
|
||||||
|
|
||||||
@@ -61,7 +60,7 @@ can install:
|
|||||||
:ellipsis: 10
|
:ellipsis: 10
|
||||||
|
|
||||||
There are thousands of them, so we've truncated the output above, but you
|
There are thousands of them, so we've truncated the output above, but you
|
||||||
can find a `full list here <https://packages.spack.io>`_.
|
can find a :ref:`full list here <package-list>`.
|
||||||
Packages are listed by name in alphabetical order.
|
Packages are listed by name in alphabetical order.
|
||||||
A pattern to match with no wildcards, ``*`` or ``?``,
|
A pattern to match with no wildcards, ``*`` or ``?``,
|
||||||
will be treated as though it started and ended with
|
will be treated as though it started and ended with
|
||||||
@@ -865,7 +864,7 @@ There are several different ways to use Spack packages once you have
|
|||||||
installed them. As you've seen, spack packages are installed into long
|
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
|
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
|
easiest way is to use :ref:`spack load <cmd-spack-load>`, which is
|
||||||
described in this section.
|
described in the next section.
|
||||||
|
|
||||||
Some more advanced ways to use Spack packages include:
|
Some more advanced ways to use Spack packages include:
|
||||||
|
|
||||||
@@ -943,7 +942,7 @@ first ``libelf`` above, you would run:
|
|||||||
|
|
||||||
$ spack load /qmm4kso
|
$ spack load /qmm4kso
|
||||||
|
|
||||||
To see which packages that you have loaded to your environment you would
|
To see which packages that you have loaded to your enviornment you would
|
||||||
use ``spack find --loaded``.
|
use ``spack find --loaded``.
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
@@ -959,86 +958,7 @@ use ``spack find --loaded``.
|
|||||||
You can also use ``spack load --list`` to get the same output, but it
|
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.
|
does not have the full set of query options that ``spack find`` offers.
|
||||||
|
|
||||||
We'll learn more about Spack's spec syntax in :ref:`a later section <sec-specs>`.
|
We'll learn more about Spack's spec syntax in the next section.
|
||||||
|
|
||||||
|
|
||||||
.. _extensions:
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
Python packages and virtual environments
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
Spack can install a large number of Python packages. Their names are
|
|
||||||
typically prefixed with ``py-``. Installing and using them is no
|
|
||||||
different from any other package:
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ spack install py-numpy
|
|
||||||
$ spack load py-numpy
|
|
||||||
$ python3
|
|
||||||
>>> import numpy
|
|
||||||
|
|
||||||
The ``spack load`` command sets the ``PATH`` variable so that the right Python
|
|
||||||
executable is used, and makes sure that ``numpy`` and its dependencies can be
|
|
||||||
located in the ``PYTHONPATH``.
|
|
||||||
|
|
||||||
Spack is different from other Python package managers in that it installs
|
|
||||||
every package into its *own* prefix. This is in contrast to ``pip``, which
|
|
||||||
installs all packages into the same prefix, be it in a virtual environment
|
|
||||||
or not.
|
|
||||||
|
|
||||||
For many users, **virtual environments** are more convenient than repeated
|
|
||||||
``spack load`` commands, particularly when working with multiple Python
|
|
||||||
packages. Fortunately Spack supports environments itself, which together
|
|
||||||
with a view are no different from Python virtual environments.
|
|
||||||
|
|
||||||
The recommended way of working with Python extensions such as ``py-numpy``
|
|
||||||
is through :ref:`Environments <environments>`. The following example creates
|
|
||||||
a Spack environment with ``numpy`` in the current working directory. It also
|
|
||||||
puts a filesystem view in ``./view``, which is a more traditional combined
|
|
||||||
prefix for all packages in the environment.
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ spack env create --with-view view --dir .
|
|
||||||
$ spack -e . add py-numpy
|
|
||||||
$ spack -e . concretize
|
|
||||||
$ spack -e . install
|
|
||||||
|
|
||||||
Now you can activate the environment and start using the packages:
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ spack env activate .
|
|
||||||
$ python3
|
|
||||||
>>> import numpy
|
|
||||||
|
|
||||||
The environment view is also a virtual environment, which is useful if you are
|
|
||||||
sharing the environment with others who are unfamiliar with Spack. They can
|
|
||||||
either use the Python executable directly:
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ ./view/bin/python3
|
|
||||||
>>> import numpy
|
|
||||||
|
|
||||||
or use the activation script:
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ source ./view/bin/activate
|
|
||||||
$ python3
|
|
||||||
>>> import numpy
|
|
||||||
|
|
||||||
In general, there should not be much difference between ``spack env activate``
|
|
||||||
and using the virtual environment. The main advantage of ``spack env activate``
|
|
||||||
is that it knows about more packages than just Python packages, and it may set
|
|
||||||
additional runtime variables that are not covered by the virtual environment
|
|
||||||
activation script.
|
|
||||||
|
|
||||||
See :ref:`environments` for a more in-depth description of Spack
|
|
||||||
environments and customizations to views.
|
|
||||||
|
|
||||||
|
|
||||||
.. _sec-specs:
|
.. _sec-specs:
|
||||||
@@ -1175,17 +1095,6 @@ unspecified version, but packages can depend on other packages with
|
|||||||
could depend on ``mpich@1.2:`` if it can only build with version
|
could depend on ``mpich@1.2:`` if it can only build with version
|
||||||
``1.2`` or higher of ``mpich``.
|
``1.2`` or higher of ``mpich``.
|
||||||
|
|
||||||
.. note:: Windows Spec Syntax Caveats
|
|
||||||
Windows has a few idiosyncrasies when it comes to the Spack spec syntax and the use of certain shells
|
|
||||||
Spack's spec dependency syntax uses the carat (``^``) character, however this is an escape string in CMD
|
|
||||||
so it must be escaped with an additional carat (i.e. ``^^``).
|
|
||||||
CMD also will attempt to interpret strings with ``=`` characters in them. Any spec including this symbol
|
|
||||||
must double quote the string.
|
|
||||||
|
|
||||||
Note: All of these issues are unique to CMD, they can be avoided by using Powershell.
|
|
||||||
|
|
||||||
For more context on these caveats see the related issues: `carat <https://github.com/spack/spack/issues/42833>`_ and `equals <https://github.com/spack/spack/issues/43348>`_
|
|
||||||
|
|
||||||
Below are more details about the specifiers that you can add to specs.
|
Below are more details about the specifiers that you can add to specs.
|
||||||
|
|
||||||
.. _version-specifier:
|
.. _version-specifier:
|
||||||
@@ -1194,38 +1103,16 @@ Below are more details about the specifiers that you can add to specs.
|
|||||||
Version specifier
|
Version specifier
|
||||||
^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
A version specifier ``pkg@<specifier>`` comes after a package name
|
A version specifier comes somewhere after a package name and starts
|
||||||
and starts with ``@``. It can be something abstract that matches
|
with ``@``. It can be a single version, e.g. ``@1.0``, ``@3``, or
|
||||||
multiple known versions, or a specific version. During concretization,
|
``@1.2a7``. Or, it can be a range of versions, such as ``@1.0:1.5``
|
||||||
Spack will pick the optimal version within the spec's constraints
|
(all versions between ``1.0`` and ``1.5``, inclusive). Version ranges
|
||||||
according to policies set for the particular Spack installation.
|
can be open, e.g. ``:3`` means any version up to and including ``3``.
|
||||||
|
This would include ``3.4`` and ``3.4.2``. ``4.2:`` means any version
|
||||||
The version specifier can be *a specific version*, such as ``@=1.0.0`` or
|
above and including ``4.2``. Finally, a version specifier can be a
|
||||||
``@=1.2a7``. Or, it can be *a range of versions*, such as ``@1.0:1.5``.
|
set of arbitrary versions, such as ``@1.0,1.5,1.7`` (``1.0``, ``1.5``,
|
||||||
Version ranges are inclusive, so this example includes both ``1.0``
|
or ``1.7``). When you supply such a specifier to ``spack install``,
|
||||||
and any ``1.5.x`` version. Version ranges can be unbounded, e.g. ``@:3``
|
it constrains the set of versions that Spack will install.
|
||||||
means any version up to and including ``3``. This would include ``3.4``
|
|
||||||
and ``3.4.2``. Similarly, ``@4.2:`` means any version above and including
|
|
||||||
``4.2``. As a short-hand, ``@3`` is equivalent to the range ``@3:3`` and
|
|
||||||
includes any version with major version ``3``.
|
|
||||||
|
|
||||||
Versions are ordered lexicograpically by its components. For more details
|
|
||||||
on the order, see :ref:`the packaging guide <version-comparison>`.
|
|
||||||
|
|
||||||
Notice that you can distinguish between the specific version ``@=3.2`` and
|
|
||||||
the range ``@3.2``. This is useful for packages that follow a versioning
|
|
||||||
scheme that omits the zero patch version number: ``3.2``, ``3.2.1``,
|
|
||||||
``3.2.2``, etc. In general it is preferable to use the range syntax
|
|
||||||
``@3.2``, since ranges also match versions with one-off suffixes, such as
|
|
||||||
``3.2-custom``.
|
|
||||||
|
|
||||||
A version specifier can also be a list of ranges and specific versions,
|
|
||||||
separated by commas. For example, ``@1.0:1.5,=1.7.1`` matches any version
|
|
||||||
in the range ``1.0:1.5`` and the specific version ``1.7.1``.
|
|
||||||
|
|
||||||
^^^^^^^^^^^^
|
|
||||||
Git versions
|
|
||||||
^^^^^^^^^^^^
|
|
||||||
|
|
||||||
For packages with a ``git`` attribute, ``git`` references
|
For packages with a ``git`` attribute, ``git`` references
|
||||||
may be specified instead of a numerical version i.e. branches, tags
|
may be specified instead of a numerical version i.e. branches, tags
|
||||||
@@ -1234,35 +1121,36 @@ reference provided. Acceptable syntaxes for this are:
|
|||||||
|
|
||||||
.. code-block:: sh
|
.. code-block:: sh
|
||||||
|
|
||||||
# commit hashes
|
|
||||||
foo@abcdef1234abcdef1234abcdef1234abcdef1234 # 40 character hashes are automatically treated as git commits
|
|
||||||
foo@git.abcdef1234abcdef1234abcdef1234abcdef1234
|
|
||||||
|
|
||||||
# branches and tags
|
# branches and tags
|
||||||
foo@git.develop # use the develop branch
|
foo@git.develop # use the develop branch
|
||||||
foo@git.0.19 # use the 0.19 tag
|
foo@git.0.19 # use the 0.19 tag
|
||||||
|
|
||||||
Spack always needs to associate a Spack version with the git reference,
|
# commit hashes
|
||||||
which is used for version comparison. This Spack version is heuristically
|
foo@abcdef1234abcdef1234abcdef1234abcdef1234 # 40 character hashes are automatically treated as git commits
|
||||||
taken from the closest valid git tag among ancestors of the git ref.
|
foo@git.abcdef1234abcdef1234abcdef1234abcdef1234
|
||||||
|
|
||||||
Once a Spack version is associated with a git ref, it always printed with
|
Spack versions from git reference either have an associated version supplied by the user,
|
||||||
the git ref. For example, if the commit ``@git.abcdefg`` is tagged
|
or infer a relationship to known versions from the structure of the git repository. If an
|
||||||
``0.19``, then the spec will be shown as ``@git.abcdefg=0.19``.
|
associated version is supplied by the user, Spack treats the git version as equivalent to that
|
||||||
|
version for all version comparisons in the package logic (e.g. ``depends_on('foo', when='@1.5')``).
|
||||||
|
|
||||||
If the git ref is not exactly a tag, then the distance to the nearest tag
|
The associated version can be assigned with ``[git ref]=[version]`` syntax, with the caveat that the specified version is known to Spack from either the package definition, or in the configuration preferences (i.e. ``packages.yaml``).
|
||||||
is also part of the resolved version. ``@git.abcdefg=0.19.git.8`` means
|
|
||||||
that the commit is 8 commits away from the ``0.19`` tag.
|
|
||||||
|
|
||||||
In cases where Spack cannot resolve a sensible version from a git ref,
|
|
||||||
users can specify the Spack version to use for the git ref. This is done
|
|
||||||
by appending ``=`` and the Spack version to the git ref. For example:
|
|
||||||
|
|
||||||
.. code-block:: sh
|
.. code-block:: sh
|
||||||
|
|
||||||
foo@git.my_ref=3.2 # use the my_ref tag or branch, but treat it as version 3.2 for version comparisons
|
foo@git.my_ref=3.2 # use the my_ref tag or branch, but treat it as version 3.2 for version comparisons
|
||||||
foo@git.abcdef1234abcdef1234abcdef1234abcdef1234=develop # use the given commit, but treat it as develop for version comparisons
|
foo@git.abcdef1234abcdef1234abcdef1234abcdef1234=develop # use the given commit, but treat it as develop for version comparisons
|
||||||
|
|
||||||
|
If an associated version is not supplied then the tags in the git repo are used to determine
|
||||||
|
the most recent previous version known to Spack. Details about how versions are compared
|
||||||
|
and how Spack determines if one version is less than another are discussed in the developer guide.
|
||||||
|
|
||||||
|
If the version spec is not provided, then Spack will choose one
|
||||||
|
according to policies set for the particular spack installation. If
|
||||||
|
the spec is ambiguous, i.e. it could match multiple versions, Spack
|
||||||
|
will choose a version within the spec's constraints according to
|
||||||
|
policies set for the particular Spack installation.
|
||||||
|
|
||||||
Details about how versions are compared and how Spack determines if
|
Details about how versions are compared and how Spack determines if
|
||||||
one version is less than another are discussed in the developer guide.
|
one version is less than another are discussed in the developer guide.
|
||||||
|
|
||||||
@@ -1359,10 +1247,6 @@ For example, for the ``stackstart`` variant:
|
|||||||
mpileaks stackstart==4 # variant will be propagated to dependencies
|
mpileaks stackstart==4 # variant will be propagated to dependencies
|
||||||
mpileaks stackstart=4 # only mpileaks will have this variant value
|
mpileaks stackstart=4 # only mpileaks will have this variant value
|
||||||
|
|
||||||
Spack also allows variants to be propagated from a package that does
|
|
||||||
not have that variant.
|
|
||||||
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^
|
||||||
Compiler Flags
|
Compiler Flags
|
||||||
^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^
|
||||||
@@ -1448,12 +1332,22 @@ the reserved keywords ``platform``, ``os`` and ``target``:
|
|||||||
$ spack install libelf os=ubuntu18.04
|
$ spack install libelf os=ubuntu18.04
|
||||||
$ spack install libelf target=broadwell
|
$ spack install libelf target=broadwell
|
||||||
|
|
||||||
|
or together by using the reserved keyword ``arch``:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ spack install libelf arch=cray-CNL10-haswell
|
||||||
|
|
||||||
Normally users don't have to bother specifying the architecture if they
|
Normally users don't have to bother specifying the architecture if they
|
||||||
are installing software for their current host, as in that case the
|
are installing software for their current host, as in that case the
|
||||||
values will be detected automatically. If you need fine-grained control
|
values will be detected automatically. If you need fine-grained control
|
||||||
over which packages use which targets (or over *all* packages' default
|
over which packages use which targets (or over *all* packages' default
|
||||||
target), see :ref:`package-preferences`.
|
target), see :ref:`package-preferences`.
|
||||||
|
|
||||||
|
.. admonition:: Cray machines
|
||||||
|
|
||||||
|
The situation is a little bit different for Cray machines and a detailed
|
||||||
|
explanation on how the architecture can be set on them can be found at :ref:`cray-support`
|
||||||
|
|
||||||
.. _support-for-microarchitectures:
|
.. _support-for-microarchitectures:
|
||||||
|
|
||||||
@@ -1617,30 +1511,6 @@ any MPI implementation will do. If another package depends on
|
|||||||
error. Likewise, if you try to plug in some package that doesn't
|
error. Likewise, if you try to plug in some package that doesn't
|
||||||
provide MPI, Spack will raise an error.
|
provide MPI, Spack will raise an error.
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
Explicit binding of virtual dependencies
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
There are packages that provide more than just one virtual dependency. When interacting with them, users
|
|
||||||
might want to utilize just a subset of what they could provide, and use other providers for virtuals they
|
|
||||||
need.
|
|
||||||
|
|
||||||
It is possible to be more explicit and tell Spack which dependency should provide which virtual, using a
|
|
||||||
special syntax:
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ spack spec strumpack ^[virtuals=mpi] intel-parallel-studio+mkl ^[virtuals=lapack] openblas
|
|
||||||
|
|
||||||
Concretizing the spec above produces the following DAG:
|
|
||||||
|
|
||||||
.. figure:: images/strumpack_virtuals.svg
|
|
||||||
:scale: 60 %
|
|
||||||
:align: center
|
|
||||||
|
|
||||||
where ``intel-parallel-studio`` *could* provide ``mpi``, ``lapack``, and ``blas`` but is used only for the former. The ``lapack``
|
|
||||||
and ``blas`` dependencies are satisfied by ``openblas``.
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
Specifying Specs by Hash
|
Specifying Specs by Hash
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
@@ -1789,6 +1659,165 @@ check only local packages (as opposed to those used transparently from
|
|||||||
``upstream`` spack instances) and the ``-j,--json`` option to output
|
``upstream`` spack instances) and the ``-j,--json`` option to output
|
||||||
machine-readable json data for any errors.
|
machine-readable json data for any errors.
|
||||||
|
|
||||||
|
|
||||||
|
.. _extensions:
|
||||||
|
|
||||||
|
---------------------------
|
||||||
|
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
|
||||||
|
``$prefix/lib/python-2.7/site-packages`` directory.
|
||||||
|
|
||||||
|
In Spack, installation prefixes are immutable, so this type of installation
|
||||||
|
is not directly supported. However, it is possible to create views that
|
||||||
|
allow you to merge install prefixes of multiple packages into a single new prefix.
|
||||||
|
Views are a convenient way to get a more traditional filesystem structure.
|
||||||
|
Using *extensions*, you can ensure that Python packages always share the
|
||||||
|
same prefix in the view as Python itself. Suppose you have
|
||||||
|
Python installed like so:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ spack find python
|
||||||
|
==> 1 installed packages.
|
||||||
|
-- linux-debian7-x86_64 / gcc@4.4.7 --------------------------------
|
||||||
|
python@2.7.8
|
||||||
|
|
||||||
|
.. _cmd-spack-extensions:
|
||||||
|
|
||||||
|
^^^^^^^^^^^^^^^^^^^^
|
||||||
|
``spack extensions``
|
||||||
|
^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
You can find extensions for your Python installation like this:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ spack extensions python
|
||||||
|
==> python@2.7.8%gcc@4.4.7 arch=linux-debian7-x86_64-703c7a96
|
||||||
|
==> 36 extensions:
|
||||||
|
geos py-ipython py-pexpect py-pyside py-sip
|
||||||
|
py-basemap py-libxml2 py-pil py-pytz py-six
|
||||||
|
py-biopython py-mako py-pmw py-rpy2 py-sympy
|
||||||
|
py-cython py-matplotlib py-pychecker py-scientificpython py-virtualenv
|
||||||
|
py-dateutil py-mpi4py py-pygments py-scikit-learn
|
||||||
|
py-epydoc py-mx py-pylint py-scipy
|
||||||
|
py-gnuplot py-nose py-pyparsing py-setuptools
|
||||||
|
py-h5py py-numpy py-pyqt py-shiboken
|
||||||
|
|
||||||
|
==> 12 installed:
|
||||||
|
-- linux-debian7-x86_64 / gcc@4.4.7 --------------------------------
|
||||||
|
py-dateutil@2.4.0 py-nose@1.3.4 py-pyside@1.2.2
|
||||||
|
py-dateutil@2.4.0 py-numpy@1.9.1 py-pytz@2014.10
|
||||||
|
py-ipython@2.3.1 py-pygments@2.0.1 py-setuptools@11.3.1
|
||||||
|
py-matplotlib@1.4.2 py-pyparsing@2.0.3 py-six@1.9.0
|
||||||
|
|
||||||
|
The extensions are a subset of what's returned by ``spack list``, and
|
||||||
|
they are packages like any other. They are installed into their own
|
||||||
|
prefixes, and you can see this with ``spack find --paths``:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ spack find --paths py-numpy
|
||||||
|
==> 1 installed packages.
|
||||||
|
-- linux-debian7-x86_64 / gcc@4.4.7 --------------------------------
|
||||||
|
py-numpy@1.9.1 ~/spack/opt/linux-debian7-x86_64/gcc@4.4.7/py-numpy@1.9.1-66733244
|
||||||
|
|
||||||
|
However, even though this package is installed, you cannot use it
|
||||||
|
directly when you run ``python``:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ spack load python
|
||||||
|
$ python
|
||||||
|
Python 2.7.8 (default, Feb 17 2015, 01:35:25)
|
||||||
|
[GCC 4.4.7 20120313 (Red Hat 4.4.7-11)] on linux2
|
||||||
|
Type "help", "copyright", "credits" or "license" for more information.
|
||||||
|
>>> import numpy
|
||||||
|
Traceback (most recent call last):
|
||||||
|
File "<stdin>", line 1, in <module>
|
||||||
|
ImportError: No module named numpy
|
||||||
|
>>>
|
||||||
|
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
Using Extensions in Environments
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
The recommended way of working with extensions such as ``py-numpy``
|
||||||
|
above is through :ref:`Environments <environments>`. For example,
|
||||||
|
the following creates an environment in the current working directory
|
||||||
|
with a filesystem view in the ``./view`` directory:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ spack env create --with-view view --dir .
|
||||||
|
$ spack -e . add py-numpy
|
||||||
|
$ spack -e . concretize
|
||||||
|
$ spack -e . install
|
||||||
|
|
||||||
|
We recommend environments for two reasons. Firstly, environments
|
||||||
|
can be activated (requires :ref:`shell-support`):
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ spack env activate .
|
||||||
|
|
||||||
|
which sets all the right environment variables such as ``PATH`` and
|
||||||
|
``PYTHONPATH``. This ensures that
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ python
|
||||||
|
>>> import numpy
|
||||||
|
|
||||||
|
works. Secondly, even without shell support, the view ensures
|
||||||
|
that Python can locate its extensions:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ ./view/bin/python
|
||||||
|
>>> import numpy
|
||||||
|
|
||||||
|
See :ref:`environments` for a more in-depth description of Spack
|
||||||
|
environments and customizations to views.
|
||||||
|
|
||||||
|
^^^^^^^^^^^^^^^^^^^^
|
||||||
|
Using ``spack load``
|
||||||
|
^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
A more traditional way of using Spack and extensions is ``spack load``
|
||||||
|
(requires :ref:`shell-support`). This will add the extension to ``PYTHONPATH``
|
||||||
|
in your current shell, and Python itself will be available in the ``PATH``:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ spack load py-numpy
|
||||||
|
$ python
|
||||||
|
>>> import numpy
|
||||||
|
|
||||||
|
The loaded packages can be checked using ``spack find --loaded``
|
||||||
|
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
Loading Extensions via Modules
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
Apart from ``spack env activate`` and ``spack load``, you can load numpy
|
||||||
|
through your environment modules (using ``environment-modules`` or
|
||||||
|
``lmod``). This will also add the extension to the ``PYTHONPATH`` in
|
||||||
|
your current shell.
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ module load <name of numpy module>
|
||||||
|
|
||||||
|
If you do not know the name of the specific numpy module you wish to
|
||||||
|
load, you can use the ``spack module tcl|lmod loads`` command to get
|
||||||
|
the name of the module from the Spack spec.
|
||||||
|
|
||||||
-----------------------
|
-----------------------
|
||||||
Filesystem requirements
|
Filesystem requirements
|
||||||
-----------------------
|
-----------------------
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -18,7 +18,7 @@ your Spack mirror and then downloaded and installed by others.
|
|||||||
|
|
||||||
Whenever a mirror provides prebuilt packages, Spack will take these packages
|
Whenever a mirror provides prebuilt packages, Spack will take these packages
|
||||||
into account during concretization and installation, making ``spack install``
|
into account during concretization and installation, making ``spack install``
|
||||||
significantly faster.
|
signficantly faster.
|
||||||
|
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
@@ -36,7 +36,7 @@ Build caches are created via:
|
|||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
$ spack buildcache push <path/url/mirror name> <spec>
|
$ spack buildcache create <path/url/mirror name> <spec>
|
||||||
|
|
||||||
This command takes the locally installed spec and its dependencies, and
|
This command takes the locally installed spec and its dependencies, and
|
||||||
creates tarballs of their install prefixes. It also generates metadata files,
|
creates tarballs of their install prefixes. It also generates metadata files,
|
||||||
@@ -48,10 +48,14 @@ Here is an example where a build cache is created in a local directory named
|
|||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
$ spack buildcache push ./spack-cache ninja
|
$ spack buildcache create --allow-root ./spack-cache ninja
|
||||||
==> Pushing binary packages to file:///home/spackuser/spack/spack-cache/build_cache
|
==> Pushing binary packages to file:///home/spackuser/spack/spack-cache/build_cache
|
||||||
|
|
||||||
Note that ``ninja`` must be installed locally for this to work.
|
Not that ``ninja`` must be installed locally for this to work.
|
||||||
|
|
||||||
|
We're using the ``--allow-root`` flag to tell Spack that is OK when any of
|
||||||
|
the binaries we're pushing contain references to the local Spack install
|
||||||
|
directory.
|
||||||
|
|
||||||
Once you have a build cache, you can add it as a mirror, discussed next.
|
Once you have a build cache, you can add it as a mirror, discussed next.
|
||||||
|
|
||||||
@@ -143,7 +147,7 @@ and then install from it exclusively, you would do:
|
|||||||
|
|
||||||
$ spack mirror add E4S https://cache.e4s.io
|
$ spack mirror add E4S https://cache.e4s.io
|
||||||
$ spack buildcache keys --install --trust
|
$ spack buildcache keys --install --trust
|
||||||
$ spack install --use-buildcache only <package>
|
$ spack install --use-buildache only <package>
|
||||||
|
|
||||||
We use ``--install`` and ``--trust`` to say that we are installing keys to our
|
We use ``--install`` and ``--trust`` to say that we are installing keys to our
|
||||||
keyring, and trusting all downloaded keys.
|
keyring, and trusting all downloaded keys.
|
||||||
@@ -153,181 +157,18 @@ keyring, and trusting all downloaded keys.
|
|||||||
List of popular build caches
|
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>`_'
|
* `Extreme-scale Scientific Software Stack (E4S) <https://e4s-project.github.io/>`_: `build cache <https://oaciss.uoregon.edu/e4s/inventory.html>`_
|
||||||
|
|
||||||
-------------------
|
|
||||||
Build cache signing
|
|
||||||
-------------------
|
|
||||||
|
|
||||||
By default, Spack will add a cryptographic signature to each package pushed to
|
|
||||||
a build cache, and verifies the signature when installing from a build cache.
|
|
||||||
|
|
||||||
Keys for signing can be managed with the :ref:`spack gpg <cmd-spack-gpg>` command,
|
|
||||||
as well as ``spack buildcache keys`` as mentioned above.
|
|
||||||
|
|
||||||
You can disable signing when pushing with ``spack buildcache push --unsigned``,
|
|
||||||
and disable verification when installing from any build cache with
|
|
||||||
``spack install --no-check-signature``.
|
|
||||||
|
|
||||||
Alternatively, signing and verification can be enabled or disabled on a per build cache
|
|
||||||
basis:
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ spack mirror add --signed <name> <url> # enable signing and verification
|
|
||||||
$ spack mirror add --unsigned <name> <url> # disable signing and verification
|
|
||||||
|
|
||||||
$ spack mirror set --signed <name> # enable signing and verification for an existing mirror
|
|
||||||
$ spack mirror set --unsigned <name> # disable signing and verification for an existing mirror
|
|
||||||
|
|
||||||
Or you can directly edit the ``mirrors.yaml`` configuration file:
|
|
||||||
|
|
||||||
.. code-block:: yaml
|
|
||||||
|
|
||||||
mirrors:
|
|
||||||
<name>:
|
|
||||||
url: <url>
|
|
||||||
signed: false # disable signing and verification
|
|
||||||
|
|
||||||
See also :ref:`mirrors`.
|
|
||||||
|
|
||||||
----------
|
----------
|
||||||
Relocation
|
Relocation
|
||||||
----------
|
----------
|
||||||
|
|
||||||
When using buildcaches across different machines, it is likely that the install
|
Initial build and later installation do not necessarily happen at the same
|
||||||
root will be different from the one used to build the binaries.
|
location. Spack provides a relocation capability and corrects for RPATHs and
|
||||||
|
non-relocatable scripts. However, many packages compile paths into binary
|
||||||
To address this issue, Spack automatically relocates all paths encoded in binaries
|
artifacts directly. In such cases, the build instructions of this package would
|
||||||
and scripts to their new location upon install.
|
need to be adjusted for better re-locatability.
|
||||||
|
|
||||||
Note that there are some cases where this is not possible: if binaries are built in
|
|
||||||
a relatively short path, and then installed to a longer path, there may not be enough
|
|
||||||
space in the binary to encode the new path. In this case, Spack will fail to install
|
|
||||||
the package from the build cache, and a source build is required.
|
|
||||||
|
|
||||||
To reduce the likelihood of this happening, it is highly recommended to add padding to
|
|
||||||
the install root during the build, as specified in the :ref:`config <config-yaml>`
|
|
||||||
section of the configuration:
|
|
||||||
|
|
||||||
.. code-block:: yaml
|
|
||||||
|
|
||||||
config:
|
|
||||||
install_tree:
|
|
||||||
root: /opt/spack
|
|
||||||
padded_length: 128
|
|
||||||
|
|
||||||
|
|
||||||
.. _binary_caches_oci:
|
|
||||||
|
|
||||||
---------------------------------
|
|
||||||
Automatic push to a build cache
|
|
||||||
---------------------------------
|
|
||||||
|
|
||||||
Sometimes it is convenient to push packages to a build cache as soon as they are installed. Spack can do this by setting autopush flag when adding a mirror:
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ spack mirror add --autopush <name> <url or path>
|
|
||||||
|
|
||||||
Or the autopush flag can be set for an existing mirror:
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ spack mirror set --autopush <name> # enable automatic push for an existing mirror
|
|
||||||
$ spack mirror set --no-autopush <name> # disable automatic push for an existing mirror
|
|
||||||
|
|
||||||
Then after installing a package it is automatically pushed to all mirrors with ``autopush: true``. The command
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ spack install <package>
|
|
||||||
|
|
||||||
will have the same effect as
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ spack install <package>
|
|
||||||
$ spack buildcache push <cache> <package> # for all caches with autopush: true
|
|
||||||
|
|
||||||
.. note::
|
|
||||||
|
|
||||||
Packages are automatically pushed to a build cache only if they are built from source.
|
|
||||||
|
|
||||||
-----------------------------------------
|
|
||||||
OCI / Docker V2 registries as build cache
|
|
||||||
-----------------------------------------
|
|
||||||
|
|
||||||
Spack can also use OCI or Docker V2 registries such as Dockerhub, Quay.io,
|
|
||||||
Github Packages, GitLab Container Registry, JFrog Artifactory, and others
|
|
||||||
as build caches. This is a convenient way to share binaries using public
|
|
||||||
infrastructure, or to cache Spack built binaries in Github Actions and
|
|
||||||
GitLab CI.
|
|
||||||
|
|
||||||
To get started, configure an OCI mirror using ``oci://`` as the scheme,
|
|
||||||
and optionally specify a username and password (or personal access token):
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ spack mirror add --oci-username username --oci-password password my_registry oci://example.com/my_image
|
|
||||||
|
|
||||||
Spack follows the naming conventions of Docker, with Dockerhub as the default
|
|
||||||
registry. To use Dockerhub, you can omit the registry domain:
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ spack mirror add --oci-username username --oci-password password my_registry oci://username/my_image
|
|
||||||
|
|
||||||
From here, you can use the mirror as any other build cache:
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ spack buildcache push my_registry <specs...> # push to the registry
|
|
||||||
$ spack install <specs...> # install from the registry
|
|
||||||
|
|
||||||
A unique feature of buildcaches on top of OCI registries is that it's incredibly
|
|
||||||
easy to generate get a runnable container image with the binaries installed. This
|
|
||||||
is a great way to make applications available to users without requiring them to
|
|
||||||
install Spack -- all you need is Docker, Podman or any other OCI-compatible container
|
|
||||||
runtime.
|
|
||||||
|
|
||||||
To produce container images, all you need to do is add the ``--base-image`` flag
|
|
||||||
when pushing to the build cache:
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ spack buildcache push --base-image ubuntu:20.04 my_registry ninja
|
|
||||||
Pushed to example.com/my_image:ninja-1.11.1-yxferyhmrjkosgta5ei6b4lqf6bxbscz.spack
|
|
||||||
|
|
||||||
$ docker run -it example.com/my_image:ninja-1.11.1-yxferyhmrjkosgta5ei6b4lqf6bxbscz.spack
|
|
||||||
root@e4c2b6f6b3f4:/# ninja --version
|
|
||||||
1.11.1
|
|
||||||
|
|
||||||
If ``--base-image`` is not specified, distroless images are produced. In practice,
|
|
||||||
you won't be able to run these as containers, since they don't come with libc and
|
|
||||||
other system dependencies. However, they are still compatible with tools like
|
|
||||||
``skopeo``, ``podman``, and ``docker`` for pulling and pushing.
|
|
||||||
|
|
||||||
.. note::
|
|
||||||
The docker ``overlayfs2`` storage driver is limited to 128 layers, above which a
|
|
||||||
``max depth exceeded`` error may be produced when pulling the image. There
|
|
||||||
are `alternative drivers <https://docs.docker.com/storage/storagedriver/>`_.
|
|
||||||
|
|
||||||
------------------------------------
|
|
||||||
Spack build cache for GitHub Actions
|
|
||||||
------------------------------------
|
|
||||||
|
|
||||||
To significantly speed up Spack in GitHub Actions, binaries can be cached in
|
|
||||||
GitHub Packages. This service is an OCI registry that can be linked to a GitHub
|
|
||||||
repository.
|
|
||||||
|
|
||||||
Spack offers a public build cache for GitHub Actions with a set of common packages,
|
|
||||||
which lets you get started quickly. See the following resources for more information:
|
|
||||||
|
|
||||||
* `spack/setup-spack <https://github.com/spack/setup-spack>`_ for setting up Spack in GitHub
|
|
||||||
Actions
|
|
||||||
* `spack/github-actions-buildcache <https://github.com/spack/github-actions-buildcache>`_ for
|
|
||||||
more details on the public build cache
|
|
||||||
|
|
||||||
.. _cmd-spack-buildcache:
|
.. _cmd-spack-buildcache:
|
||||||
|
|
||||||
@@ -336,7 +177,7 @@ which lets you get started quickly. See the following resources for more informa
|
|||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
``spack buildcache push``
|
``spack buildcache create``
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
Create tarball of installed Spack package and all dependencies.
|
Create tarball of installed Spack package and all dependencies.
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -32,14 +32,9 @@ can't be found. You can readily check if any prerequisite for using Spack is mis
|
|||||||
|
|
||||||
Spack will take care of bootstrapping any missing dependency marked as [B]. Dependencies marked as [-] are instead required to be found on the system.
|
Spack will take care of bootstrapping any missing dependency marked as [B]. Dependencies marked as [-] are instead required to be found on the system.
|
||||||
|
|
||||||
% echo $?
|
|
||||||
1
|
|
||||||
|
|
||||||
In the case of the output shown above Spack detected that both ``clingo`` and ``gnupg``
|
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
|
are missing and it's giving detailed information on why they are needed and whether
|
||||||
they can be bootstrapped. The return code of this command summarizes the results, if any
|
they can be bootstrapped. Running a command that concretize a spec, like:
|
||||||
dependencies are missing the return code is ``1``, otherwise ``0``. Running a command that
|
|
||||||
concretizes a spec, like:
|
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
@@ -49,7 +44,7 @@ concretizes a spec, like:
|
|||||||
==> Installing "clingo-bootstrap@spack%apple-clang@12.0.0~docs~ipo+python build_type=Release arch=darwin-catalina-x86_64" from a buildcache
|
==> Installing "clingo-bootstrap@spack%apple-clang@12.0.0~docs~ipo+python build_type=Release arch=darwin-catalina-x86_64" from a buildcache
|
||||||
[ ... ]
|
[ ... ]
|
||||||
|
|
||||||
automatically triggers the bootstrapping of clingo from pre-built binaries as expected.
|
triggers the bootstrapping of clingo from pre-built binaries as expected.
|
||||||
|
|
||||||
Users can also bootstrap all the dependencies needed by Spack in a single command, which
|
Users can also bootstrap all the dependencies needed by Spack in a single command, which
|
||||||
might be useful to setup containers or other similar environments:
|
might be useful to setup containers or other similar environments:
|
||||||
@@ -87,7 +82,7 @@ You can check what is installed in the bootstrapping store at any time using:
|
|||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
% spack -b find
|
% spack find -b
|
||||||
==> Showing internal bootstrap store at "/Users/spack/.spack/bootstrap/store"
|
==> Showing internal bootstrap store at "/Users/spack/.spack/bootstrap/store"
|
||||||
==> 11 installed packages
|
==> 11 installed packages
|
||||||
-- darwin-catalina-x86_64 / apple-clang@12.0.0 ------------------
|
-- darwin-catalina-x86_64 / apple-clang@12.0.0 ------------------
|
||||||
@@ -101,7 +96,7 @@ In case it is needed you can remove all the software in the current bootstrappin
|
|||||||
% spack clean -b
|
% spack clean -b
|
||||||
==> Removing bootstrapped software and configuration in "/Users/spack/.spack/bootstrap"
|
==> Removing bootstrapped software and configuration in "/Users/spack/.spack/bootstrap"
|
||||||
|
|
||||||
% spack -b find
|
% spack find -b
|
||||||
==> Showing internal bootstrap store at "/Users/spack/.spack/bootstrap/store"
|
==> Showing internal bootstrap store at "/Users/spack/.spack/bootstrap/store"
|
||||||
==> 0 installed packages
|
==> 0 installed packages
|
||||||
|
|
||||||
@@ -175,4 +170,4 @@ bootstrapping.
|
|||||||
|
|
||||||
This command needs to be run on a machine with internet access and the resulting folder
|
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
|
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.
|
commands suggested at the prompt, they can be used to bootstrap Spack.
|
@@ -1,114 +1,275 @@
|
|||||||
.. Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
|
.. _build-settings:
|
||||||
|
|
||||||
|
================================
|
||||||
|
Package Settings (packages.yaml)
|
||||||
|
================================
|
||||||
|
|
||||||
|
Spack allows you to customize how your software is built through the
|
||||||
|
``packages.yaml`` file. Using it, you can make Spack prefer particular
|
||||||
|
implementations of virtual dependencies (e.g., MPI or BLAS/LAPACK),
|
||||||
|
or you can make it prefer to build with particular compilers. You can
|
||||||
|
also tell Spack to use *external* software installations already
|
||||||
|
present on your system.
|
||||||
|
|
||||||
|
At a high level, the ``packages.yaml`` file is structured like this:
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
packages:
|
||||||
|
package1:
|
||||||
|
# settings for package1
|
||||||
|
package2:
|
||||||
|
# settings for package2
|
||||||
|
# ...
|
||||||
|
all:
|
||||||
|
# settings that apply to all packages.
|
||||||
|
|
||||||
|
So you can either set build preferences specifically for *one* package,
|
||||||
|
or you can specify that certain settings should apply to *all* packages.
|
||||||
|
The types of settings you can customize are described in detail below.
|
||||||
|
|
||||||
|
Spack's build defaults are in the default
|
||||||
|
``etc/spack/defaults/packages.yaml`` file. You can override them in
|
||||||
|
``~/.spack/packages.yaml`` or ``etc/spack/packages.yaml``. For more
|
||||||
|
details on how this works, see :ref:`configuration-scopes`.
|
||||||
|
|
||||||
|
.. _sec-external-packages:
|
||||||
|
|
||||||
|
-----------------
|
||||||
|
External Packages
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
Spack can be configured to use externally-installed
|
||||||
|
packages rather than building its own packages. This may be desirable
|
||||||
|
if machines ship with system packages, such as a customized MPI
|
||||||
|
that should be used instead of Spack building its own MPI.
|
||||||
|
|
||||||
|
External packages are configured through the ``packages.yaml`` file.
|
||||||
|
Here's an example of an external configuration:
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
This example lists three installations of OpenMPI, one built with GCC,
|
||||||
|
one built with GCC and debug information, and another built with Intel.
|
||||||
|
If Spack is asked to build a package that uses one of these MPIs as a
|
||||||
|
dependency, it will use the pre-installed OpenMPI in
|
||||||
|
the given directory. Note that the specified path is the top-level
|
||||||
|
install prefix, not the ``bin`` subdirectory.
|
||||||
|
|
||||||
|
``packages.yaml`` can also be used to specify modules to load instead
|
||||||
|
of the installation prefixes. The following example says that module
|
||||||
|
``CMake/3.7.2`` provides cmake version 3.7.2.
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
cmake:
|
||||||
|
externals:
|
||||||
|
- spec: cmake@3.7.2
|
||||||
|
modules:
|
||||||
|
- 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
|
||||||
|
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
|
||||||
|
on its most-favored packages, and it may guess incorrectly.
|
||||||
|
|
||||||
|
Each package version and compiler listed in an external should
|
||||||
|
have entries in Spack's packages and compiler configuration, even
|
||||||
|
though the package and compiler may not ever be built.
|
||||||
|
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
Prevent packages from being built from sources
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
Adding an external spec in ``packages.yaml`` allows Spack to use an external location,
|
||||||
|
but it does not prevent Spack from building packages from sources. In the above example,
|
||||||
|
Spack might choose for many valid reasons to start building and linking with the
|
||||||
|
latest version of OpenMPI rather than continue using the pre-installed OpenMPI versions.
|
||||||
|
|
||||||
|
To prevent this, the ``packages.yaml`` configuration also allows packages
|
||||||
|
to be flagged as non-buildable. The previous example could be modified to
|
||||||
|
be:
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
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
|
||||||
|
buildable: False
|
||||||
|
|
||||||
|
The addition of the ``buildable`` flag tells Spack that it should never build
|
||||||
|
its own version of OpenMPI from sources, and it will instead always rely on a pre-built
|
||||||
|
OpenMPI.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
If ``concretizer:reuse`` is on (see :ref:`concretizer-options` for more information on that flag)
|
||||||
|
pre-built specs include specs already available from a local store, an upstream store, a registered
|
||||||
|
buildcache or specs marked as externals in ``packages.yaml``. If ``concretizer:reuse`` is off, only
|
||||||
|
external specs in ``packages.yaml`` are included in the list of pre-built specs.
|
||||||
|
|
||||||
|
If an external module is specified as not buildable, then Spack will load the
|
||||||
|
external module into the build environment which can be used for linking.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
Non-buildable virtual packages
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
In cases where the concretizer is configured to reuse specs, and other ``mpi`` providers
|
||||||
|
(available via stores or buildcaches) are not wanted, Spack can be configured to require
|
||||||
|
specs matching only the available externals:
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
packages:
|
||||||
|
mpi:
|
||||||
|
buildable: False
|
||||||
|
require:
|
||||||
|
- one_of: [
|
||||||
|
"openmpi@1.4.3%gcc@4.4.7 arch=linux-debian7-x86_64",
|
||||||
|
"openmpi@1.4.3%gcc@4.4.7 arch=linux-debian7-x86_64+debug",
|
||||||
|
"openmpi@1.6.5%intel@10.1 arch=linux-debian7-x86_64"
|
||||||
|
]
|
||||||
|
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
|
||||||
|
|
||||||
|
This configuration prevents any spec using MPI and originating from stores or buildcaches to be reused,
|
||||||
|
unless it matches the requirements under ``packages:mpi:require``. For more information on requirements see
|
||||||
|
:ref:`package-requirements`.
|
||||||
|
|
||||||
|
.. _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 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:
|
||||||
|
|
||||||
==========================================
|
----------------------
|
||||||
Concretization Settings (concretizer.yaml)
|
Concretizer options
|
||||||
==========================================
|
----------------------
|
||||||
|
|
||||||
The ``concretizer.yaml`` configuration file allows to customize aspects of the
|
``packages.yaml`` gives the concretizer preferences for specific packages,
|
||||||
algorithm used to select the dependencies you install. The default configuration
|
but you can also use ``concretizer.yaml`` to customize aspects of the
|
||||||
is the following:
|
algorithm it uses to select the dependencies you install:
|
||||||
|
|
||||||
.. literalinclude:: _spack_root/etc/spack/defaults/concretizer.yaml
|
.. literalinclude:: _spack_root/etc/spack/defaults/concretizer.yaml
|
||||||
:language: yaml
|
:language: yaml
|
||||||
|
|
||||||
--------------------------------
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
Reuse already installed packages
|
Reuse already installed packages
|
||||||
--------------------------------
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
The ``reuse`` attribute controls how aggressively Spack reuses binary packages during concretization. The
|
The ``reuse`` attribute controls whether Spack will prefer to use installed packages (``true``), or
|
||||||
attribute can either be a single value, or an object for more complex configurations.
|
whether it will do a "fresh" installation and prefer the latest settings from
|
||||||
|
``package.py`` files and ``packages.yaml`` (``false``).
|
||||||
In the former case ("single value") it allows Spack to:
|
You can use:
|
||||||
|
|
||||||
1. Reuse installed packages and buildcaches for all the specs to be concretized, when ``true``
|
|
||||||
2. Reuse installed packages and buildcaches only for the dependencies of the root specs, when ``dependencies``
|
|
||||||
3. Disregard reusing installed packages and buildcaches, when ``false``
|
|
||||||
|
|
||||||
In case a finer control over which specs are reused is needed, then the value of this attribute can be
|
|
||||||
an object, with the following keys:
|
|
||||||
|
|
||||||
1. ``roots``: if ``true`` root specs are reused, if ``false`` only dependencies of root specs are reused
|
|
||||||
2. ``from``: list of sources from which reused specs are taken
|
|
||||||
|
|
||||||
Each source in ``from`` is itself an object:
|
|
||||||
|
|
||||||
.. list-table:: Attributes for a source or reusable specs
|
|
||||||
:header-rows: 1
|
|
||||||
|
|
||||||
* - Attribute name
|
|
||||||
- Description
|
|
||||||
* - type (mandatory, string)
|
|
||||||
- Can be ``local``, ``buildcache``, or ``external``
|
|
||||||
* - include (optional, list of specs)
|
|
||||||
- If present, reusable specs must match at least one of the constraint in the list
|
|
||||||
* - exclude (optional, list of specs)
|
|
||||||
- If present, reusable specs must not match any of the constraint in the list.
|
|
||||||
|
|
||||||
For instance, the following configuration:
|
|
||||||
|
|
||||||
.. code-block:: yaml
|
|
||||||
|
|
||||||
concretizer:
|
|
||||||
reuse:
|
|
||||||
roots: true
|
|
||||||
from:
|
|
||||||
- type: local
|
|
||||||
include:
|
|
||||||
- "%gcc"
|
|
||||||
- "%clang"
|
|
||||||
|
|
||||||
tells the concretizer to reuse all specs compiled with either ``gcc`` or ``clang``, that are installed
|
|
||||||
in the local store. Any spec from remote buildcaches is disregarded.
|
|
||||||
|
|
||||||
To reduce the boilerplate in configuration files, default values for the ``include`` and
|
|
||||||
``exclude`` options can be pushed up one level:
|
|
||||||
|
|
||||||
.. code-block:: yaml
|
|
||||||
|
|
||||||
concretizer:
|
|
||||||
reuse:
|
|
||||||
roots: true
|
|
||||||
include:
|
|
||||||
- "%gcc"
|
|
||||||
from:
|
|
||||||
- type: local
|
|
||||||
- type: buildcache
|
|
||||||
- type: local
|
|
||||||
include:
|
|
||||||
- "foo %oneapi"
|
|
||||||
|
|
||||||
In the example above we reuse all specs compiled with ``gcc`` from the local store
|
|
||||||
and remote buildcaches, and we also reuse ``foo %oneapi``. Note that the last source of
|
|
||||||
specs override the default ``include`` attribute.
|
|
||||||
|
|
||||||
For one-off concretizations, the are command line arguments for each of the simple "single value"
|
|
||||||
configurations. This means a user can:
|
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
% spack install --reuse <spec>
|
% spack install --reuse <spec>
|
||||||
|
|
||||||
to enable reuse for a single installation, or:
|
to enable reuse for a single installation, and you can use:
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
spack install --fresh <spec>
|
spack install --fresh <spec>
|
||||||
|
|
||||||
to do a fresh install if ``reuse`` is enabled by default.
|
to do a fresh install if ``reuse`` is enabled by default.
|
||||||
|
``reuse: true`` is the default.
|
||||||
|
|
||||||
.. seealso::
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
FAQ: :ref:`Why does Spack pick particular versions and variants? <faq-concretizer-precedence>`
|
|
||||||
|
|
||||||
------------------------------------------
|
|
||||||
Selection of the target microarchitectures
|
Selection of the target microarchitectures
|
||||||
------------------------------------------
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
The options under the ``targets`` attribute control which targets are considered during a solve.
|
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 ``concretizer.yaml`` file
|
Currently the options in this section are only configurable from the ``concretizer.yaml`` file
|
||||||
@@ -141,131 +302,257 @@ microarchitectures considered during the solve are constrained to be compatible
|
|||||||
host Spack is currently running on. For instance, if this option is set to ``true``, a
|
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.
|
user cannot concretize for ``target=icelake`` while running on an Haswell node.
|
||||||
|
|
||||||
---------------
|
.. _package-requirements:
|
||||||
Duplicate nodes
|
|
||||||
---------------
|
|
||||||
|
|
||||||
The ``duplicates`` attribute controls whether the DAG can contain multiple configurations of
|
--------------------
|
||||||
the same package. This is mainly relevant for build dependencies, which may have their version
|
Package Requirements
|
||||||
pinned by some nodes, and thus be required at different versions by different nodes in the same
|
--------------------
|
||||||
DAG.
|
|
||||||
|
|
||||||
The ``strategy`` option controls how the solver deals with duplicates. If the value is ``none``,
|
Spack can be configured to always use certain compilers, package
|
||||||
then a single configuration per package is allowed in the DAG. This means, for instance, that only
|
versions, and variants during concretization through package
|
||||||
a single ``cmake`` or a single ``py-setuptools`` version is allowed. The result would be a slightly
|
requirements.
|
||||||
faster concretization, at the expense of making a few specs unsolvable.
|
|
||||||
|
|
||||||
If the value is ``minimal`` Spack will allow packages tagged as ``build-tools`` to have duplicates.
|
Package requirements are useful when you find yourself repeatedly
|
||||||
This allows, for instance, to concretize specs whose nodes require different, and incompatible, ranges
|
specifying the same constraints on the command line, and wish that
|
||||||
of some build tool. For instance, in the figure below the latest `py-shapely` requires a newer `py-setuptools`,
|
Spack respects these constraints whether you mention them explicitly
|
||||||
while `py-numpy` still needs an older version:
|
or not. Another use case is specifying constraints that should apply
|
||||||
|
to all root specs in an environment, without having to repeat the
|
||||||
|
constraint everywhere.
|
||||||
|
|
||||||
.. figure:: images/shapely_duplicates.svg
|
Apart from that, requirements config is more flexible than constraints
|
||||||
:scale: 70 %
|
on the command line, because it can specify constraints on packages
|
||||||
:align: center
|
*when they occur* as a dependency. In contrast, on the command line it
|
||||||
|
is not possible to specify constraints on dependencies while also keeping
|
||||||
|
those dependencies optional.
|
||||||
|
|
||||||
Up to Spack v0.20 ``duplicates:strategy:none`` was the default (and only) behavior. From Spack v0.21 the
|
The package requirements configuration is specified in ``packages.yaml``
|
||||||
default behavior is ``duplicates:strategy:minimal``.
|
keyed by package name:
|
||||||
|
|
||||||
--------
|
|
||||||
Splicing
|
|
||||||
--------
|
|
||||||
|
|
||||||
The ``splice`` key covers config attributes for splicing specs in the solver.
|
|
||||||
|
|
||||||
"Splicing" is a method for replacing a dependency with another spec
|
|
||||||
that provides the same package or virtual. There are two types of
|
|
||||||
splices, referring to different behaviors for shared dependencies
|
|
||||||
between the root spec and the new spec replacing a dependency:
|
|
||||||
"transitive" and "intransitive". A "transitive" splice is one that
|
|
||||||
resolves all conflicts by taking the dependency from the new node. An
|
|
||||||
"intransitive" splice is one that resolves all conflicts by taking the
|
|
||||||
dependency from the original root. From a theory perspective, hybrid
|
|
||||||
splices are possible but are not modeled by Spack.
|
|
||||||
|
|
||||||
All spliced specs retain a ``build_spec`` attribute that points to the
|
|
||||||
original Spec before any splice occurred. The ``build_spec`` for a
|
|
||||||
non-spliced spec is itself.
|
|
||||||
|
|
||||||
The figure below shows examples of transitive and intransitive splices:
|
|
||||||
|
|
||||||
.. figure:: images/splices.png
|
|
||||||
:align: center
|
|
||||||
|
|
||||||
The concretizer can be configured to explicitly splice particular
|
|
||||||
replacements for a target spec. Splicing will allow the user to make
|
|
||||||
use of generically built public binary caches, while swapping in
|
|
||||||
highly optimized local builds for performance critical components
|
|
||||||
and/or components that interact closely with the specific hardware
|
|
||||||
details of the system. The most prominent candidate for splicing is
|
|
||||||
MPI providers. MPI packages have relatively well-understood ABI
|
|
||||||
characteristics, and most High Performance Computing facilities deploy
|
|
||||||
highly optimized MPI packages tailored to their particular
|
|
||||||
hardware. The following config block configures Spack to replace
|
|
||||||
whatever MPI provider each spec was concretized to use with the
|
|
||||||
particular package of ``mpich`` with the hash that begins ``abcdef``.
|
|
||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
concretizer:
|
packages:
|
||||||
splice:
|
libfabric:
|
||||||
explicit:
|
require: "@1.13.2"
|
||||||
- target: mpi
|
openmpi:
|
||||||
replacement: mpich/abcdef
|
require:
|
||||||
transitive: false
|
- any_of: ["~cuda", "%gcc"]
|
||||||
|
mpich:
|
||||||
|
require:
|
||||||
|
- one_of: ["+cuda", "+rocm"]
|
||||||
|
|
||||||
.. warning::
|
Requirements are expressed using Spec syntax (the same as what is provided
|
||||||
|
to ``spack install``). In the simplest case, you can specify attributes
|
||||||
|
that you always want the package to have by providing a single spec to
|
||||||
|
``require``; in the above example, ``libfabric`` will always build
|
||||||
|
with version 1.13.2.
|
||||||
|
|
||||||
When configuring an explicit splice, you as the user take on the
|
You can provide a more-relaxed constraint and allow the concretizer to
|
||||||
responsibility for ensuring ABI compatibility between the specs
|
choose between a set of options using ``any_of`` or ``one_of``:
|
||||||
matched by the target and the replacement you provide. If they are
|
|
||||||
not compatible, Spack will not warn you and your application will
|
|
||||||
fail to run.
|
|
||||||
|
|
||||||
The ``target`` field of an explicit splice can be any abstract
|
* ``any_of`` is a list of specs. One of those specs must be satisfied
|
||||||
spec. The ``replacement`` field must be a spec that includes the hash
|
and it is also allowed for the concretized spec to match more than one.
|
||||||
of a concrete spec, and the replacement must either be the same
|
In the above example, that means you could build ``openmpi+cuda%gcc``,
|
||||||
package as the target, provide the virtual that is the target, or
|
``openmpi~cuda%clang`` or ``openmpi~cuda%gcc`` (in the last case,
|
||||||
provide a virtual that the target provides. The ``transitive`` field
|
note that both specs in the ``any_of`` for ``openmpi`` are
|
||||||
is optional -- by default, splices will be transitive.
|
satisfied).
|
||||||
|
* ``one_of`` is also a list of specs, and the final concretized spec
|
||||||
|
must match exactly one of them. In the above example, that means
|
||||||
|
you could build ``mpich+cuda`` or ``mpich+rocm`` but not
|
||||||
|
``mpich+cuda+rocm`` (note the current package definition for
|
||||||
|
``mpich`` already includes a conflict, so this is redundant but
|
||||||
|
still demonstrates the concept).
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
With explicit splices configured, it is possible for Spack to
|
For ``any_of`` and ``one_of``, the order of specs indicates a
|
||||||
concretize to a spec that does not satisfy the input. For example,
|
preference: items that appear earlier in the list are preferred
|
||||||
with the config above ``hdf5 ^mvapich2`` will concretize to user
|
(note that these preferences can be ignored in favor of others).
|
||||||
``mpich/abcdef`` instead of ``mvapich2`` as the MPI provider. Spack
|
|
||||||
will warn the user in this case, but will not fail the
|
|
||||||
concretization.
|
|
||||||
|
|
||||||
.. _automatic_splicing:
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
Setting default requirements
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^
|
You can also set default requirements for all packages under ``all``
|
||||||
Automatic Splicing
|
like this:
|
||||||
^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
The Spack solver can be configured to do automatic splicing for
|
|
||||||
ABI-compatible packages. Automatic splices are enabled in the concretizer
|
|
||||||
config section
|
|
||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
concretizer:
|
packages:
|
||||||
splice:
|
all:
|
||||||
automatic: True
|
require: '%clang'
|
||||||
|
|
||||||
Packages can include ABI-compatibility information using the
|
which means every spec will be required to use ``clang`` as a compiler.
|
||||||
``can_splice`` directive. See :ref:`the packaging
|
|
||||||
guide<abi_compatibility>` for instructions on specifying ABI
|
|
||||||
compatibility using the ``can_splice`` directive.
|
|
||||||
|
|
||||||
.. note::
|
Note that in this case ``all`` represents a *default set of requirements* -
|
||||||
|
if there are specific package requirements, then the default requirements
|
||||||
|
under ``all`` are disregarded. For example, with a configuration like this:
|
||||||
|
|
||||||
The ``can_splice`` directive is experimental and may be changed in
|
.. code-block:: yaml
|
||||||
future versions.
|
|
||||||
|
|
||||||
When automatic splicing is enabled, the concretizer will combine any
|
packages:
|
||||||
number of ABI-compatible specs if possible to reuse installed packages
|
all:
|
||||||
and packages available from binary caches. The end result of these
|
require: '%clang'
|
||||||
specs is equivalent to a series of transitive/intransitive splices,
|
cmake:
|
||||||
but the series may be non-obvious.
|
require: '%gcc'
|
||||||
|
|
||||||
|
Spack requires ``cmake`` to use ``gcc`` and all other nodes (including ``cmake``
|
||||||
|
dependencies) to use ``clang``.
|
||||||
|
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
Setting requirements on virtual specs
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
A requirement on a virtual spec applies whenever that virtual is present in the DAG.
|
||||||
|
This can be useful for fixing which virtual provider you want to use:
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
packages:
|
||||||
|
mpi:
|
||||||
|
require: 'mvapich2 %gcc'
|
||||||
|
|
||||||
|
With the configuration above the only allowed ``mpi`` provider is ``mvapich2 %gcc``.
|
||||||
|
|
||||||
|
Requirements on the virtual spec and on the specific provider are both applied, if
|
||||||
|
present. For instance with a configuration like:
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
packages:
|
||||||
|
mpi:
|
||||||
|
require: 'mvapich2 %gcc'
|
||||||
|
mvapich2:
|
||||||
|
require: '~cuda'
|
||||||
|
|
||||||
|
you will use ``mvapich2~cuda %gcc`` as an ``mpi`` provider.
|
||||||
|
|
||||||
|
.. _package-preferences:
|
||||||
|
|
||||||
|
-------------------
|
||||||
|
Package Preferences
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
In some cases package requirements can be too strong, and package
|
||||||
|
preferences are the better option. Package preferences do not impose
|
||||||
|
constraints on packages for particular versions or variants values,
|
||||||
|
they rather only set defaults -- the concretizer is free to change
|
||||||
|
them if it must due to other constraints. Also note that package
|
||||||
|
preferences are of lower priority than reuse of already installed
|
||||||
|
packages.
|
||||||
|
|
||||||
|
Here's an example ``packages.yaml`` file that sets preferred packages:
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
packages:
|
||||||
|
opencv:
|
||||||
|
compiler: [gcc@4.9]
|
||||||
|
variants: +debug
|
||||||
|
gperftools:
|
||||||
|
version: [2.2, 2.4, 2.3]
|
||||||
|
all:
|
||||||
|
compiler: [gcc@4.4.7, 'gcc@4.6:', intel, clang, pgi]
|
||||||
|
target: [sandybridge]
|
||||||
|
providers:
|
||||||
|
mpi: [mvapich2, mpich, openmpi]
|
||||||
|
|
||||||
|
At a high level, this example is specifying how packages are preferably
|
||||||
|
concretized. The opencv package should prefer using GCC 4.9 and
|
||||||
|
be built with debug options. The gperftools package should prefer version
|
||||||
|
2.2 over 2.4. Every package on the system should prefer mvapich2 for
|
||||||
|
its MPI and GCC 4.4.7 (except for opencv, which overrides this by preferring GCC 4.9).
|
||||||
|
These options are used to fill in implicit defaults. Any of them can be overwritten
|
||||||
|
on the command line if explicitly requested.
|
||||||
|
|
||||||
|
Package preferences accept the follow keys or components under
|
||||||
|
the specific package (or ``all``) section: ``compiler``, ``variants``,
|
||||||
|
``version``, ``providers``, and ``target``. Each component has an
|
||||||
|
ordered list of spec ``constraints``, with earlier entries in the
|
||||||
|
list being preferred over later entries.
|
||||||
|
|
||||||
|
Sometimes a package installation may have constraints that forbid
|
||||||
|
the first concretization rule, in which case Spack will use the first
|
||||||
|
legal concretization rule. Going back to the example, if a user
|
||||||
|
requests gperftools 2.3 or later, then Spack will install version 2.4
|
||||||
|
as the 2.4 version of gperftools is preferred over 2.3.
|
||||||
|
|
||||||
|
An explicit concretization rule in the preferred section will always
|
||||||
|
take preference over unlisted concretizations. In the above example,
|
||||||
|
xlc isn't listed in the compiler list. Every listed compiler from
|
||||||
|
gcc to pgi will thus be preferred over the xlc compiler.
|
||||||
|
|
||||||
|
The syntax for the ``provider`` section differs slightly from other
|
||||||
|
concretization rules. A provider lists a value that packages may
|
||||||
|
``depends_on`` (e.g, MPI) and a list of rules for fulfilling that
|
||||||
|
dependency.
|
||||||
|
|
||||||
|
.. _package_permissions:
|
||||||
|
|
||||||
|
-------------------
|
||||||
|
Package Permissions
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
Spack can be configured to assign permissions to the files installed
|
||||||
|
by a package.
|
||||||
|
|
||||||
|
In the ``packages.yaml`` file under ``permissions``, the attributes
|
||||||
|
``read``, ``write``, and ``group`` control the package
|
||||||
|
permissions. These attributes can be set per-package, or for all
|
||||||
|
packages under ``all``. If permissions are set under ``all`` and for a
|
||||||
|
specific package, the package-specific settings take precedence.
|
||||||
|
|
||||||
|
The ``read`` and ``write`` attributes take one of ``user``, ``group``,
|
||||||
|
and ``world``.
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
packages:
|
||||||
|
all:
|
||||||
|
permissions:
|
||||||
|
write: group
|
||||||
|
group: spack
|
||||||
|
my_app:
|
||||||
|
permissions:
|
||||||
|
read: group
|
||||||
|
group: my_team
|
||||||
|
|
||||||
|
The permissions settings describe the broadest level of access to
|
||||||
|
installations of the specified packages. The execute permissions of
|
||||||
|
the file are set to the same level as read permissions for those files
|
||||||
|
that are executable. The default setting for ``read`` is ``world``,
|
||||||
|
and for ``write`` is ``user``. In the example above, installations of
|
||||||
|
``my_app`` will be installed with user and group permissions but no
|
||||||
|
world permissions, and owned by the group ``my_team``. All other
|
||||||
|
packages will be installed with user and group write privileges, and
|
||||||
|
world read privileges. Those packages will be owned by the group
|
||||||
|
``spack``.
|
||||||
|
|
||||||
|
The ``group`` attribute assigns a Unix-style group to a package. All
|
||||||
|
files installed by the package will be owned by the assigned group,
|
||||||
|
and the sticky group bit will be set on the install prefix and all
|
||||||
|
directories inside the install prefix. This will ensure that even
|
||||||
|
manually placed files within the install prefix are owned by the
|
||||||
|
assigned group. If no group is assigned, Spack will allow the OS
|
||||||
|
default behavior to go as expected.
|
||||||
|
|
||||||
|
----------------------------
|
||||||
|
Assigning Package Attributes
|
||||||
|
----------------------------
|
||||||
|
|
||||||
|
You can assign class-level attributes in the configuration:
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
packages:
|
||||||
|
mpileaks:
|
||||||
|
# Override existing attributes
|
||||||
|
url: http://www.somewhereelse.com/mpileaks-1.0.tar.gz
|
||||||
|
# ... or add new ones
|
||||||
|
x: 1
|
||||||
|
|
||||||
|
Attributes set this way will be accessible to any method executed
|
||||||
|
in the package.py file (e.g. the ``install()`` method). Values for these
|
||||||
|
attributes may be any value parseable by yaml.
|
||||||
|
|
||||||
|
These can only be applied to specific packages, not "all" or
|
||||||
|
virtual packages.
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -127,9 +127,9 @@ check out a commit from the ``master`` branch, you would want to add:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
depends_on("autoconf", type="build", when="@master")
|
depends_on('autoconf', type='build', when='@master')
|
||||||
depends_on("automake", type="build", when="@master")
|
depends_on('automake', type='build', when='@master')
|
||||||
depends_on("libtool", type="build", when="@master")
|
depends_on('libtool', type='build', when='@master')
|
||||||
|
|
||||||
It is typically redundant to list the ``m4`` macro processor package as a
|
It is typically redundant to list the ``m4`` macro processor package as a
|
||||||
dependency, since ``autoconf`` already depends on it.
|
dependency, since ``autoconf`` already depends on it.
|
||||||
@@ -145,16 +145,7 @@ example, the ``bash`` shell is used to run the ``autogen.sh`` script.
|
|||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
def autoreconf(self, spec, prefix):
|
def autoreconf(self, spec, prefix):
|
||||||
which("bash")("autogen.sh")
|
which('bash')('autogen.sh')
|
||||||
|
|
||||||
If the ``package.py`` has build instructions in a separate
|
|
||||||
:ref:`builder class <multiple_build_systems>`, the signature for a phase changes slightly:
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
class AutotoolsBuilder(AutotoolsBuilder):
|
|
||||||
def autoreconf(self, pkg, spec, prefix):
|
|
||||||
which("bash")("autogen.sh")
|
|
||||||
|
|
||||||
"""""""""""""""""""""""""""""""""""""""
|
"""""""""""""""""""""""""""""""""""""""
|
||||||
patching configure or Makefile.in files
|
patching configure or Makefile.in files
|
||||||
@@ -195,9 +186,9 @@ To opt out of this feature, use the following setting:
|
|||||||
To enable it conditionally on different architectures, define a property and
|
To enable it conditionally on different architectures, define a property and
|
||||||
make the package depend on ``gnuconfig`` as a build dependency:
|
make the package depend on ``gnuconfig`` as a build dependency:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block
|
||||||
|
|
||||||
depends_on("gnuconfig", when="@1.0:")
|
depends_on('gnuconfig', when='@1.0:')
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def patch_config_files(self):
|
def patch_config_files(self):
|
||||||
@@ -239,7 +230,7 @@ version, this can be done like so:
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def force_autoreconf(self):
|
def force_autoreconf(self):
|
||||||
return self.version == Version("1.2.3")
|
return self.version == Version('1.2.3')
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
Finding configure flags
|
Finding configure flags
|
||||||
@@ -287,22 +278,13 @@ function like so:
|
|||||||
def configure_args(self):
|
def configure_args(self):
|
||||||
args = []
|
args = []
|
||||||
|
|
||||||
if self.spec.satisfies("+mpi"):
|
if '+mpi' in self.spec:
|
||||||
args.append("--enable-mpi")
|
args.append('--enable-mpi')
|
||||||
else:
|
else:
|
||||||
args.append("--disable-mpi")
|
args.append('--disable-mpi')
|
||||||
|
|
||||||
return args
|
return args
|
||||||
|
|
||||||
|
|
||||||
Alternatively, you can use the :ref:`enable_or_disable <autotools_enable_or_disable>` helper:
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
def configure_args(self):
|
|
||||||
return [self.enable_or_disable("mpi")]
|
|
||||||
|
|
||||||
|
|
||||||
Note that we are explicitly disabling MPI support if it is not
|
Note that we are explicitly disabling MPI support if it is not
|
||||||
requested. This is important, as many Autotools packages will enable
|
requested. This is important, as many Autotools packages will enable
|
||||||
options by default if the dependencies are found, and disable them
|
options by default if the dependencies are found, and disable them
|
||||||
@@ -313,11 +295,9 @@ and `here <https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Automagic_depe
|
|||||||
for a rationale as to why these so-called "automagic" dependencies
|
for a rationale as to why these so-called "automagic" dependencies
|
||||||
are a problem.
|
are a problem.
|
||||||
|
|
||||||
.. note::
|
By default, Autotools installs packages to ``/usr``. We don't want this,
|
||||||
|
so Spack automatically adds ``--prefix=/path/to/installation/prefix``
|
||||||
By default, Autotools installs packages to ``/usr``. We don't want this,
|
to your list of ``configure_args``. You don't need to add this yourself.
|
||||||
so Spack automatically adds ``--prefix=/path/to/installation/prefix``
|
|
||||||
to your list of ``configure_args``. You don't need to add this yourself.
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^
|
||||||
Helper functions
|
Helper functions
|
||||||
@@ -328,8 +308,6 @@ 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
|
``--without-baz``. Since these flags are so common, Spack provides a
|
||||||
couple of helper functions to make your life easier.
|
couple of helper functions to make your life easier.
|
||||||
|
|
||||||
.. _autotools_enable_or_disable:
|
|
||||||
|
|
||||||
"""""""""""""""""
|
"""""""""""""""""
|
||||||
enable_or_disable
|
enable_or_disable
|
||||||
"""""""""""""""""
|
"""""""""""""""""
|
||||||
@@ -341,11 +319,11 @@ typically used to enable or disable some feature within the package.
|
|||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
variant(
|
variant(
|
||||||
"memchecker",
|
'memchecker',
|
||||||
default=False,
|
default=False,
|
||||||
description="Memchecker support for debugging [degrades performance]"
|
description='Memchecker support for debugging [degrades performance]'
|
||||||
)
|
)
|
||||||
config_args.extend(self.enable_or_disable("memchecker"))
|
config_args.extend(self.enable_or_disable('memchecker'))
|
||||||
|
|
||||||
In this example, specifying the variant ``+memchecker`` will generate
|
In this example, specifying the variant ``+memchecker`` will generate
|
||||||
the following configuration options:
|
the following configuration options:
|
||||||
@@ -365,15 +343,15 @@ the ``with_or_without`` method.
|
|||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
variant(
|
variant(
|
||||||
"schedulers",
|
'schedulers',
|
||||||
values=disjoint_sets(
|
values=disjoint_sets(
|
||||||
("auto",), ("alps", "lsf", "tm", "slurm", "sge", "loadleveler")
|
('auto',), ('alps', 'lsf', 'tm', 'slurm', 'sge', 'loadleveler')
|
||||||
).with_non_feature_values("auto", "none"),
|
).with_non_feature_values('auto', 'none'),
|
||||||
description="List of schedulers for which support is enabled; "
|
description="List of schedulers for which support is enabled; "
|
||||||
"'auto' lets openmpi determine",
|
"'auto' lets openmpi determine",
|
||||||
)
|
)
|
||||||
if not spec.satisfies("schedulers=auto"):
|
if 'schedulers=auto' not in spec:
|
||||||
config_args.extend(self.with_or_without("schedulers"))
|
config_args.extend(self.with_or_without('schedulers'))
|
||||||
|
|
||||||
In this example, specifying the variant ``schedulers=slurm,sge`` will
|
In this example, specifying the variant ``schedulers=slurm,sge`` will
|
||||||
generate the following configuration options:
|
generate the following configuration options:
|
||||||
@@ -398,16 +376,16 @@ generated, using the ``activation_value`` argument to
|
|||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
variant(
|
variant(
|
||||||
"fabrics",
|
'fabrics',
|
||||||
values=disjoint_sets(
|
values=disjoint_sets(
|
||||||
("auto",), ("psm", "psm2", "verbs", "mxm", "ucx", "libfabric")
|
('auto',), ('psm', 'psm2', 'verbs', 'mxm', 'ucx', 'libfabric')
|
||||||
).with_non_feature_values("auto", "none"),
|
).with_non_feature_values('auto', 'none'),
|
||||||
description="List of fabrics that are enabled; "
|
description="List of fabrics that are enabled; "
|
||||||
"'auto' lets openmpi determine",
|
"'auto' lets openmpi determine",
|
||||||
)
|
)
|
||||||
if not spec.satisfies("fabrics=auto"):
|
if 'fabrics=auto' not in spec:
|
||||||
config_args.extend(self.with_or_without("fabrics",
|
config_args.extend(self.with_or_without('fabrics',
|
||||||
activation_value="prefix"))
|
activation_value='prefix'))
|
||||||
|
|
||||||
``activation_value`` accepts a callable that generates the configure
|
``activation_value`` accepts a callable that generates the configure
|
||||||
parameter value given the variant value; but the special value
|
parameter value given the variant value; but the special value
|
||||||
@@ -431,16 +409,16 @@ When Spack variants and configure flags do not correspond one-to-one, the
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
variant("debug_tools", default=False)
|
variant('debug_tools', default=False)
|
||||||
config_args += self.enable_or_disable("debug-tools", variant="debug_tools")
|
config_args += self.enable_or_disable('debug-tools', variant='debug_tools')
|
||||||
|
|
||||||
Or when one variant controls multiple flags:
|
Or when one variant controls multiple flags:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
variant("debug_tools", default=False)
|
variant('debug_tools', default=False)
|
||||||
config_args += self.with_or_without("memchecker", variant="debug_tools")
|
config_args += self.with_or_without('memchecker', variant='debug_tools')
|
||||||
config_args += self.with_or_without("profiler", variant="debug_tools")
|
config_args += self.with_or_without('profiler', variant='debug_tools')
|
||||||
|
|
||||||
|
|
||||||
""""""""""""""""""""
|
""""""""""""""""""""
|
||||||
@@ -454,8 +432,8 @@ For example:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
variant("profiler", when="@2.0:")
|
variant('profiler', when='@2.0:')
|
||||||
config_args += self.with_or_without("profiler")
|
config_args += self.with_or_without('profiler')
|
||||||
|
|
||||||
will neither add ``--with-profiler`` nor ``--without-profiler`` when the version is
|
will neither add ``--with-profiler`` nor ``--without-profiler`` when the version is
|
||||||
below ``2.0``.
|
below ``2.0``.
|
||||||
@@ -474,10 +452,10 @@ the variant values require atypical behavior.
|
|||||||
def with_or_without_verbs(self, activated):
|
def with_or_without_verbs(self, activated):
|
||||||
# Up through version 1.6, this option was named --with-openib.
|
# Up through version 1.6, this option was named --with-openib.
|
||||||
# In version 1.7, it was renamed to be --with-verbs.
|
# In version 1.7, it was renamed to be --with-verbs.
|
||||||
opt = "verbs" if self.spec.satisfies("@1.7:") else "openib"
|
opt = 'verbs' if self.spec.satisfies('@1.7:') else 'openib'
|
||||||
if not activated:
|
if not activated:
|
||||||
return f"--without-{opt}"
|
return '--without-{0}'.format(opt)
|
||||||
return f"--with-{opt}={self.spec['rdma-core'].prefix}"
|
return '--with-{0}={1}'.format(opt, self.spec['rdma-core'].prefix)
|
||||||
|
|
||||||
Defining ``with_or_without_verbs`` overrides the behavior of a
|
Defining ``with_or_without_verbs`` overrides the behavior of a
|
||||||
``fabrics=verbs`` variant, changing the configure-time option to
|
``fabrics=verbs`` variant, changing the configure-time option to
|
||||||
@@ -501,7 +479,7 @@ do this like so:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
configure_directory = "src"
|
configure_directory = 'src'
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^
|
||||||
Building out of source
|
Building out of source
|
||||||
@@ -513,7 +491,7 @@ This can be done using the ``build_directory`` variable:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
build_directory = "spack-build"
|
build_directory = 'spack-build'
|
||||||
|
|
||||||
By default, Spack will build the package in the same directory that
|
By default, Spack will build the package in the same directory that
|
||||||
contains the ``configure`` script
|
contains the ``configure`` script
|
||||||
@@ -536,8 +514,8 @@ library or build the documentation, you can add these like so:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
build_targets = ["all", "docs"]
|
build_targets = ['all', 'docs']
|
||||||
install_targets = ["install", "docs"]
|
install_targets = ['install', 'docs']
|
||||||
|
|
||||||
^^^^^^^
|
^^^^^^^
|
||||||
Testing
|
Testing
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -9,32 +9,9 @@
|
|||||||
Bundle
|
Bundle
|
||||||
------
|
------
|
||||||
|
|
||||||
``BundlePackage`` represents a set of packages that are expected to work
|
``BundlePackage`` represents a set of packages that are expected to work well
|
||||||
well together, such as a collection of commonly used software libraries.
|
together, such as a collection of commonly used software libraries. The
|
||||||
The associated software is specified as dependencies.
|
associated software is specified as bundle dependencies.
|
||||||
|
|
||||||
If it makes sense, variants, conflicts, and requirements can be added to
|
|
||||||
the package. :ref:`Variants <variants>` ensure that common build options
|
|
||||||
are consistent across the packages supporting them. :ref:`Conflicts
|
|
||||||
and requirements <packaging_conflicts>` prevent attempts to build with known
|
|
||||||
bugs or limitations.
|
|
||||||
|
|
||||||
For example, if ``MyBundlePackage`` is known to only build on ``linux``,
|
|
||||||
it could use the ``require`` directive as follows:
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
require("platform=linux", msg="MyBundlePackage only builds on linux")
|
|
||||||
|
|
||||||
Spack has a number of built-in bundle packages, such as:
|
|
||||||
|
|
||||||
* `AmdAocl <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/amd-aocl/package.py>`_
|
|
||||||
* `EcpProxyApps <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/ecp-proxy-apps/package.py>`_
|
|
||||||
* `Libc <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/libc/package.py>`_
|
|
||||||
* `Xsdk <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/xsdk/package.py>`_
|
|
||||||
|
|
||||||
where ``Xsdk`` also inherits from ``CudaPackage`` and ``RocmPackage`` and
|
|
||||||
``Libc`` is a virtual bundle package for the C standard library.
|
|
||||||
|
|
||||||
|
|
||||||
^^^^^^^^
|
^^^^^^^^
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -87,7 +87,7 @@ A typical usage of these methods may look something like this:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
def initconfig_mpi_entries(self):
|
def initconfig_mpi_entries(self)
|
||||||
# Get existing MPI configurations
|
# Get existing MPI configurations
|
||||||
entries = super(self, Foo).initconfig_mpi_entries()
|
entries = super(self, Foo).initconfig_mpi_entries()
|
||||||
|
|
||||||
@@ -95,25 +95,25 @@ A typical usage of these methods may look something like this:
|
|||||||
# This spec has an MPI variant, and we need to enable MPI when it is on.
|
# 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
|
# This hypothetical package controls MPI with the ``FOO_MPI`` option to
|
||||||
# cmake.
|
# cmake.
|
||||||
if self.spec.satisfies("+mpi"):
|
if '+mpi' in self.spec:
|
||||||
entries.append(cmake_cache_option("FOO_MPI", True, "enable mpi"))
|
entries.append(cmake_cache_option('FOO_MPI', True, "enable mpi"))
|
||||||
else:
|
else:
|
||||||
entries.append(cmake_cache_option("FOO_MPI", False, "disable mpi"))
|
entries.append(cmake_cache_option('FOO_MPI', False, "disable mpi"))
|
||||||
|
|
||||||
def initconfig_package_entries(self):
|
def initconfig_package_entries(self):
|
||||||
# Package specific options
|
# Package specific options
|
||||||
entries = []
|
entries = []
|
||||||
|
|
||||||
entries.append("#Entries for build options")
|
entries.append('#Entries for build options')
|
||||||
|
|
||||||
bar_on = self.spec.satisfies("+bar")
|
bar_on = '+bar' in self.spec
|
||||||
entries.append(cmake_cache_option("FOO_BAR", bar_on, "toggle bar"))
|
entries.append(cmake_cache_option('FOO_BAR', bar_on, 'toggle bar'))
|
||||||
|
|
||||||
entries.append("#Entries for dependencies")
|
entries.append('#Entries for dependencies')
|
||||||
|
|
||||||
if self.spec["blas"].name == "baz": # baz is our blas provider
|
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_string('FOO_BLAS', 'baz', 'Use baz'))
|
||||||
entries.append(cmake_cache_path("BAZ_PREFIX", self.spec["baz"].prefix))
|
entries.append(cmake_cache_path('BAZ_PREFIX', self.spec['baz'].prefix))
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^
|
||||||
External documentation
|
External documentation
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -82,7 +82,7 @@ class already contains:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
depends_on("cmake", type="build")
|
depends_on('cmake', type='build')
|
||||||
|
|
||||||
|
|
||||||
If you need to specify a particular version requirement, you can
|
If you need to specify a particular version requirement, you can
|
||||||
@@ -90,7 +90,7 @@ override this in your package:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
depends_on("cmake@2.8.12:", type="build")
|
depends_on('cmake@2.8.12:', type='build')
|
||||||
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^
|
||||||
@@ -137,10 +137,10 @@ and without the :meth:`~spack.build_systems.cmake.CMakeBuilder.define` and
|
|||||||
|
|
||||||
def cmake_args(self):
|
def cmake_args(self):
|
||||||
args = [
|
args = [
|
||||||
"-DWHATEVER:STRING=somevalue",
|
'-DWHATEVER:STRING=somevalue',
|
||||||
self.define("ENABLE_BROKEN_FEATURE", False),
|
self.define('ENABLE_BROKEN_FEATURE', False),
|
||||||
self.define_from_variant("DETECT_HDF5", "hdf5"),
|
self.define_from_variant('DETECT_HDF5', 'hdf5'),
|
||||||
self.define_from_variant("THREADS"), # True if +threads
|
self.define_from_variant('THREADS'), # True if +threads
|
||||||
]
|
]
|
||||||
|
|
||||||
return args
|
return args
|
||||||
@@ -151,10 +151,10 @@ and CMake simply ignores the empty command line argument. For example the follow
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
variant("example", default=True, when="@2.0:")
|
variant('example', default=True, when='@2.0:')
|
||||||
|
|
||||||
def cmake_args(self):
|
def cmake_args(self):
|
||||||
return [self.define_from_variant("EXAMPLE", "example")]
|
return [self.define_from_variant('EXAMPLE', 'example')]
|
||||||
|
|
||||||
will generate ``'cmake' '-DEXAMPLE=ON' ...`` when `@2.0: +example` is met, but will
|
will generate ``'cmake' '-DEXAMPLE=ON' ...`` when `@2.0: +example` is met, but will
|
||||||
result in ``'cmake' '' ...`` when the spec version is below ``2.0``.
|
result in ``'cmake' '' ...`` when the spec version is below ``2.0``.
|
||||||
@@ -193,9 +193,9 @@ a variant to control this:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
variant("build_type", default="RelWithDebInfo",
|
variant('build_type', default='RelWithDebInfo',
|
||||||
description="CMake build type",
|
description='CMake build type',
|
||||||
values=("Debug", "Release", "RelWithDebInfo", "MinSizeRel"))
|
values=('Debug', 'Release', 'RelWithDebInfo', 'MinSizeRel'))
|
||||||
|
|
||||||
However, not every CMake package accepts all four of these options.
|
However, not every CMake package accepts all four of these options.
|
||||||
Grep the ``CMakeLists.txt`` file to see if the default values are
|
Grep the ``CMakeLists.txt`` file to see if the default values are
|
||||||
@@ -205,9 +205,9 @@ package overrides the default variant with:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
variant("build_type", default="DebugRelease",
|
variant('build_type', default='DebugRelease',
|
||||||
description="The build type to build",
|
description='The build type to build',
|
||||||
values=("Debug", "Release", "DebugRelease"))
|
values=('Debug', 'Release', 'DebugRelease'))
|
||||||
|
|
||||||
For more information on ``CMAKE_BUILD_TYPE``, see:
|
For more information on ``CMAKE_BUILD_TYPE``, see:
|
||||||
https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html
|
https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html
|
||||||
@@ -250,7 +250,7 @@ generator is Ninja. To switch to the Ninja generator, simply add:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
generator("ninja")
|
generator = 'Ninja'
|
||||||
|
|
||||||
|
|
||||||
``CMakePackage`` defaults to "Unix Makefiles". If you switch to the
|
``CMakePackage`` defaults to "Unix Makefiles". If you switch to the
|
||||||
@@ -258,7 +258,7 @@ Ninja generator, make sure to add:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
depends_on("ninja", type="build")
|
depends_on('ninja', type='build')
|
||||||
|
|
||||||
to the package as well. Aside from that, you shouldn't need to do
|
to the package as well. Aside from that, you shouldn't need to do
|
||||||
anything else. Spack will automatically detect that you are using
|
anything else. Spack will automatically detect that you are using
|
||||||
@@ -288,7 +288,7 @@ like so:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
root_cmakelists_dir = "src"
|
root_cmakelists_dir = 'src'
|
||||||
|
|
||||||
|
|
||||||
Note that this path is relative to the root of the extracted tarball,
|
Note that this path is relative to the root of the extracted tarball,
|
||||||
@@ -304,7 +304,7 @@ different sub-directory, simply override ``build_directory`` like so:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
build_directory = "my-build"
|
build_directory = 'my-build'
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
Build and install targets
|
Build and install targets
|
||||||
@@ -324,8 +324,8 @@ library or build the documentation, you can add these like so:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
build_targets = ["all", "docs"]
|
build_targets = ['all', 'docs']
|
||||||
install_targets = ["install", "docs"]
|
install_targets = ['install', 'docs']
|
||||||
|
|
||||||
^^^^^^^
|
^^^^^^^
|
||||||
Testing
|
Testing
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -28,14 +28,11 @@ This package provides the following variants:
|
|||||||
|
|
||||||
* **cuda_arch**
|
* **cuda_arch**
|
||||||
|
|
||||||
This variant supports the optional specification of one or multiple architectures.
|
This variant supports the optional specification of the architecture.
|
||||||
Valid values are maintained in the ``cuda_arch_values`` property and
|
Valid values are maintained in the ``cuda_arch_values`` property and
|
||||||
are the numeric character equivalent of the compute capability version
|
are the numeric character equivalent of the compute capability version
|
||||||
(e.g., '10' for version 1.0). Each provided value affects associated
|
(e.g., '10' for version 1.0). Each provided value affects associated
|
||||||
``CUDA`` dependencies and compiler conflicts.
|
``CUDA`` dependencies and compiler conflicts.
|
||||||
|
|
||||||
The variant builds both PTX code for the _virtual_ architecture
|
|
||||||
(e.g. ``compute_10``) and binary code for the _real_ architecture (e.g. ``sm_10``).
|
|
||||||
|
|
||||||
GPUs and their compute capability versions are listed at
|
GPUs and their compute capability versions are listed at
|
||||||
https://developer.nvidia.com/cuda-gpus .
|
https://developer.nvidia.com/cuda-gpus .
|
||||||
@@ -54,8 +51,8 @@ to terminate such build attempts with a suitable message:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
conflicts("cuda_arch=none", when="+cuda",
|
conflicts('cuda_arch=none', when='+cuda',
|
||||||
msg="CUDA architecture is required")
|
msg='CUDA architecture is required')
|
||||||
|
|
||||||
Similarly, if your software does not support all versions of the property,
|
Similarly, if your software does not support all versions of the property,
|
||||||
you could add ``conflicts`` to your package for those versions. For example,
|
you could add ``conflicts`` to your package for those versions. For example,
|
||||||
@@ -66,13 +63,13 @@ custom message should a user attempt such a build:
|
|||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
unsupported_cuda_archs = [
|
unsupported_cuda_archs = [
|
||||||
"10", "11", "12", "13",
|
'10', '11', '12', '13',
|
||||||
"20", "21",
|
'20', '21',
|
||||||
"30", "32", "35", "37"
|
'30', '32', '35', '37'
|
||||||
]
|
]
|
||||||
for value in unsupported_cuda_archs:
|
for value in unsupported_cuda_archs:
|
||||||
conflicts(f"cuda_arch={value}", when="+cuda",
|
conflicts('cuda_arch={0}'.format(value), when='+cuda',
|
||||||
msg=f"CUDA architecture {value} is not supported")
|
msg='CUDA architecture {0} is not supported'.format(value))
|
||||||
|
|
||||||
^^^^^^^
|
^^^^^^^
|
||||||
Methods
|
Methods
|
||||||
@@ -107,16 +104,16 @@ class of your package. For example, you can add it to your
|
|||||||
spec = self.spec
|
spec = self.spec
|
||||||
args = []
|
args = []
|
||||||
...
|
...
|
||||||
if spec.satisfies("+cuda"):
|
if '+cuda' in spec:
|
||||||
# Set up the cuda macros needed by the build
|
# Set up the cuda macros needed by the build
|
||||||
args.append("-DWITH_CUDA=ON")
|
args.append('-DWITH_CUDA=ON')
|
||||||
cuda_arch_list = spec.variants["cuda_arch"].value
|
cuda_arch_list = spec.variants['cuda_arch'].value
|
||||||
cuda_arch = cuda_arch_list[0]
|
cuda_arch = cuda_arch_list[0]
|
||||||
if cuda_arch != "none":
|
if cuda_arch != 'none':
|
||||||
args.append(f"-DCUDA_FLAGS=-arch=sm_{cuda_arch}")
|
args.append('-DCUDA_FLAGS=-arch=sm_{0}'.format(cuda_arch))
|
||||||
else:
|
else:
|
||||||
# Ensure build with cuda is disabled
|
# Ensure build with cuda is disabled
|
||||||
args.append("-DWITH_CUDA=OFF")
|
args.append('-DWITH_CUDA=OFF')
|
||||||
...
|
...
|
||||||
return args
|
return args
|
||||||
|
|
||||||
@@ -125,7 +122,7 @@ You will need to customize options as needed for your build.
|
|||||||
|
|
||||||
This example also illustrates how to check for the ``cuda`` variant using
|
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
|
``self.spec`` and how to retrieve the ``cuda_arch`` variant's value, which
|
||||||
is a list, using ``self.spec.variants["cuda_arch"].value``.
|
is a list, using ``self.spec.variants['cuda_arch'].value``.
|
||||||
|
|
||||||
With over 70 packages using ``CudaPackage`` as of January 2021 there are
|
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.
|
lots of examples to choose from to get more ideas for using this package.
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -57,13 +57,13 @@ If you look at the ``perl`` package, you'll see:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
phases = ["configure", "build", "install"]
|
phases = ['configure', 'build', 'install']
|
||||||
|
|
||||||
Similarly, ``cmake`` defines:
|
Similarly, ``cmake`` defines:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
phases = ["bootstrap", "build", "install"]
|
phases = ['bootstrap', 'build', 'install']
|
||||||
|
|
||||||
If we look at the ``cmake`` example, this tells Spack's ``PackageBase``
|
If we look at the ``cmake`` example, this tells Spack's ``PackageBase``
|
||||||
class to run the ``bootstrap``, ``build``, and ``install`` functions
|
class to run the ``bootstrap``, ``build``, and ``install`` functions
|
||||||
@@ -78,7 +78,7 @@ If we look at ``perl``, we see that it defines a ``configure`` method:
|
|||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
def configure(self, spec, prefix):
|
def configure(self, spec, prefix):
|
||||||
configure = Executable("./Configure")
|
configure = Executable('./Configure')
|
||||||
configure(*self.configure_args())
|
configure(*self.configure_args())
|
||||||
|
|
||||||
There is also a corresponding ``configure_args`` function that handles
|
There is also a corresponding ``configure_args`` function that handles
|
||||||
@@ -92,7 +92,7 @@ phases are pretty simple:
|
|||||||
make()
|
make()
|
||||||
|
|
||||||
def install(self, spec, prefix):
|
def install(self, spec, prefix):
|
||||||
make("install")
|
make('install')
|
||||||
|
|
||||||
The ``cmake`` package looks very similar, but with a ``bootstrap``
|
The ``cmake`` package looks very similar, but with a ``bootstrap``
|
||||||
function instead of ``configure``:
|
function instead of ``configure``:
|
||||||
@@ -100,14 +100,14 @@ function instead of ``configure``:
|
|||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
def bootstrap(self, spec, prefix):
|
def bootstrap(self, spec, prefix):
|
||||||
bootstrap = Executable("./bootstrap")
|
bootstrap = Executable('./bootstrap')
|
||||||
bootstrap(*self.bootstrap_args())
|
bootstrap(*self.bootstrap_args())
|
||||||
|
|
||||||
def build(self, spec, prefix):
|
def build(self, spec, prefix):
|
||||||
make()
|
make()
|
||||||
|
|
||||||
def install(self, spec, prefix):
|
def install(self, spec, prefix):
|
||||||
make("install")
|
make('install')
|
||||||
|
|
||||||
Again, there is a ``boostrap_args`` function that determines the
|
Again, there is a ``boostrap_args`` function that determines the
|
||||||
correct bootstrap flags to use.
|
correct bootstrap flags to use.
|
||||||
@@ -128,21 +128,16 @@ before or after a particular phase. For example, in ``perl``, we see:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
@run_after("install")
|
@run_after('install')
|
||||||
def install_cpanm(self):
|
def install_cpanm(self):
|
||||||
spec = self.spec
|
spec = self.spec
|
||||||
maker = make
|
|
||||||
cpan_dir = join_path("cpanm", "cpanm")
|
if '+cpanm' in spec:
|
||||||
if sys.platform == "win32":
|
with working_dir(join_path('cpanm', 'cpanm')):
|
||||||
maker = nmake
|
perl = spec['perl'].command
|
||||||
cpan_dir = join_path(self.stage.source_path, cpan_dir)
|
perl('Makefile.PL')
|
||||||
cpan_dir = windows_sfn(cpan_dir)
|
make()
|
||||||
if "+cpanm" in spec:
|
make('install')
|
||||||
with working_dir(cpan_dir):
|
|
||||||
perl = spec["perl"].command
|
|
||||||
perl("Makefile.PL")
|
|
||||||
maker()
|
|
||||||
maker("install")
|
|
||||||
|
|
||||||
This extra step automatically installs ``cpanm`` in addition to the
|
This extra step automatically installs ``cpanm`` in addition to the
|
||||||
base Perl installation.
|
base Perl installation.
|
||||||
@@ -179,16 +174,10 @@ In the ``perl`` package, we can see:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
@run_after("build")
|
@run_after('build')
|
||||||
@on_package_attributes(run_tests=True)
|
@on_package_attributes(run_tests=True)
|
||||||
def build_test(self):
|
def test(self):
|
||||||
if sys.platform == "win32":
|
make('test')
|
||||||
win32_dir = os.path.join(self.stage.source_path, "win32")
|
|
||||||
win32_dir = windows_sfn(win32_dir)
|
|
||||||
with working_dir(win32_dir):
|
|
||||||
nmake("test", ignore_quotes=True)
|
|
||||||
else:
|
|
||||||
make("test")
|
|
||||||
|
|
||||||
As you can guess, this runs ``make test`` *after* building the package,
|
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
|
if and only if testing is requested. Again, this is not specific to
|
||||||
@@ -200,7 +189,7 @@ custom build systems, it can be added to existing build systems as well.
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
@run_after("install")
|
@run_after('install')
|
||||||
@on_package_attributes(run_tests=True)
|
@on_package_attributes(run_tests=True)
|
||||||
|
|
||||||
works as expected. However, if you reverse the ordering:
|
works as expected. However, if you reverse the ordering:
|
||||||
@@ -208,7 +197,7 @@ custom build systems, it can be added to existing build systems as well.
|
|||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
@on_package_attributes(run_tests=True)
|
@on_package_attributes(run_tests=True)
|
||||||
@run_after("install")
|
@run_after('install')
|
||||||
|
|
||||||
the tests will always be run regardless of whether or not
|
the tests will always be run regardless of whether or not
|
||||||
``--test=root`` is requested. See https://github.com/spack/spack/issues/3833
|
``--test=root`` is requested. See https://github.com/spack/spack/issues/3833
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -25,8 +25,8 @@ use Spack to build packages with the tools.
|
|||||||
The Spack Python class ``IntelOneapiPackage`` is a base class that is
|
The Spack Python class ``IntelOneapiPackage`` is a base class that is
|
||||||
used by ``IntelOneapiCompilers``, ``IntelOneapiMkl``,
|
used by ``IntelOneapiCompilers``, ``IntelOneapiMkl``,
|
||||||
``IntelOneapiTbb`` and other classes to implement the oneAPI
|
``IntelOneapiTbb`` and other classes to implement the oneAPI
|
||||||
packages. Search for ``oneAPI`` at `packages.spack.io <https://packages.spack.io>`_ for the full
|
packages. See the :ref:`package-list` for the full list of available
|
||||||
list of available oneAPI packages, or use::
|
oneAPI packages or use::
|
||||||
|
|
||||||
spack list -d oneAPI
|
spack list -d oneAPI
|
||||||
|
|
||||||
@@ -53,24 +53,18 @@ Install the oneAPI compilers::
|
|||||||
|
|
||||||
Add the compilers to your ``compilers.yaml`` so spack can use them::
|
Add the compilers to your ``compilers.yaml`` so spack can use them::
|
||||||
|
|
||||||
spack compiler add `spack location -i intel-oneapi-compilers`/compiler/latest/bin
|
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::
|
Verify that the compilers are available::
|
||||||
|
|
||||||
spack compiler list
|
spack compiler list
|
||||||
|
|
||||||
Note that 2024 and later releases do not include ``icc``. Before 2024,
|
|
||||||
the package layout was different::
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
The ``intel-oneapi-compilers`` package includes 2 families of
|
The ``intel-oneapi-compilers`` package includes 2 families of
|
||||||
compilers:
|
compilers:
|
||||||
|
|
||||||
* ``intel``: ``icc``, ``icpc``, ``ifort``. Intel's *classic*
|
* ``intel``: ``icc``, ``icpc``, ``ifort``. Intel's *classic*
|
||||||
compilers. 2024 and later releases contain ``ifort``, but not
|
compilers.
|
||||||
``icc`` and ``icpc``.
|
|
||||||
* ``oneapi``: ``icx``, ``icpx``, ``ifx``. Intel's new generation of
|
* ``oneapi``: ``icx``, ``icpx``, ``ifx``. Intel's new generation of
|
||||||
compilers based on LLVM.
|
compilers based on LLVM.
|
||||||
|
|
||||||
@@ -82,55 +76,6 @@ To build with with ``icx``, do ::
|
|||||||
|
|
||||||
spack install patchelf%oneapi
|
spack install patchelf%oneapi
|
||||||
|
|
||||||
|
|
||||||
Using oneAPI Spack environment
|
|
||||||
-------------------------------
|
|
||||||
|
|
||||||
In this example, we build lammps with ``icx`` using Spack environment for oneAPI packages created by Intel. The
|
|
||||||
compilers are installed with Spack like in example above.
|
|
||||||
|
|
||||||
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/bin
|
|
||||||
spack compiler add `spack location -i intel-oneapi-compilers`/compiler/latest/bin
|
|
||||||
|
|
||||||
Verify that the compilers are available::
|
|
||||||
|
|
||||||
spack compiler list
|
|
||||||
|
|
||||||
Clone `spack-configs <https://github.com/spack/spack-configs>`_ repo and activate Intel oneAPI CPU environment::
|
|
||||||
|
|
||||||
git clone https://github.com/spack/spack-configs
|
|
||||||
spack env activate spack-configs/INTEL/CPU
|
|
||||||
spack concretize -f
|
|
||||||
|
|
||||||
`Intel oneAPI CPU environment <https://github.com/spack/spack-configs/blob/main/INTEL/CPU/spack.yaml>`_ contains applications tested and validated by Intel, this list is constantly extended. And currently it supports:
|
|
||||||
|
|
||||||
- `Devito <https://www.devitoproject.org/>`_
|
|
||||||
- `GROMACS <https://www.gromacs.org/>`_
|
|
||||||
- `HPCG <https://www.hpcg-benchmark.org/>`_
|
|
||||||
- `HPL <https://netlib.org/benchmark/hpl/>`_
|
|
||||||
- `LAMMPS <https://www.lammps.org/#gsc.tab=0>`_
|
|
||||||
- `OpenFOAM <https://www.openfoam.com/>`_
|
|
||||||
- `Quantum Espresso <https://www.quantum-espresso.org/>`_
|
|
||||||
- `STREAM <https://www.cs.virginia.edu/stream/>`_
|
|
||||||
- `WRF <https://github.com/wrf-model/WRF>`_
|
|
||||||
|
|
||||||
To build lammps with oneAPI compiler from this environment just run::
|
|
||||||
|
|
||||||
spack install lammps
|
|
||||||
|
|
||||||
Compiled binaries can be find using::
|
|
||||||
|
|
||||||
spack cd -i lammps
|
|
||||||
|
|
||||||
You can do the same for all other applications from this environment.
|
|
||||||
|
|
||||||
|
|
||||||
Using oneAPI MPI to Satisfy a Virtual Dependence
|
Using oneAPI MPI to Satisfy a Virtual Dependence
|
||||||
------------------------------------------------------
|
------------------------------------------------------
|
||||||
|
|
||||||
@@ -152,7 +97,8 @@ Compilers
|
|||||||
To use the compilers, add some information about the installation to
|
To use the compilers, add some information about the installation to
|
||||||
``compilers.yaml``. For most users, it is sufficient to do::
|
``compilers.yaml``. For most users, it is sufficient to do::
|
||||||
|
|
||||||
spack compiler add /opt/intel/oneapi/compiler/latest/bin
|
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
|
Adapt the paths above if you did not install the tools in the default
|
||||||
location. After adding the compilers, using them is the same
|
location. After adding the compilers, using them is the same
|
||||||
@@ -161,12 +107,6 @@ Another option is to manually add the configuration to
|
|||||||
``compilers.yaml`` as described in :ref:`Compiler configuration
|
``compilers.yaml`` as described in :ref:`Compiler configuration
|
||||||
<compiler-config>`.
|
<compiler-config>`.
|
||||||
|
|
||||||
Before 2024, the directory structure was different::
|
|
||||||
|
|
||||||
spack compiler add /opt/intel/oneapi/compiler/latest/linux/bin/intel64
|
|
||||||
spack compiler add /opt/intel/oneapi/compiler/latest/linux/bin
|
|
||||||
|
|
||||||
|
|
||||||
Libraries
|
Libraries
|
||||||
---------
|
---------
|
||||||
|
|
||||||
@@ -184,7 +124,7 @@ Using oneAPI Tools Installed by Spack
|
|||||||
=====================================
|
=====================================
|
||||||
|
|
||||||
Spack can be a convenient way to install and configure compilers and
|
Spack can be a convenient way to install and configure compilers and
|
||||||
libraries, even if you do not intend to build a Spack package. If you
|
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,
|
want to build a Makefile project using Spack-installed oneAPI compilers,
|
||||||
then use spack to configure your environment::
|
then use spack to configure your environment::
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -90,7 +90,7 @@ and optimizers do require a paid license. In Spack, they are packaged as:
|
|||||||
TODO: Confirm and possible change(!) the scope of MPI components (runtime
|
TODO: Confirm and possible change(!) the scope of MPI components (runtime
|
||||||
vs. devel) in current (and previous?) *cluster/professional/composer*
|
vs. devel) in current (and previous?) *cluster/professional/composer*
|
||||||
editions, i.e., presence in downloads, possibly subject to license
|
editions, i.e., presence in downloads, possibly subject to license
|
||||||
coverage(!); see `discussion in PR #4300
|
coverage(!); see `disussion in PR #4300
|
||||||
<https://github.com/spack/spack/pull/4300#issuecomment-305582898>`_. [NB:
|
<https://github.com/spack/spack/pull/4300#issuecomment-305582898>`_. [NB:
|
||||||
An "mpi" subdirectory is not indicative of the full MPI SDK being present
|
An "mpi" subdirectory is not indicative of the full MPI SDK being present
|
||||||
(i.e., ``mpicc``, ..., and header files). The directory may just as well
|
(i.e., ``mpicc``, ..., and header files). The directory may just as well
|
||||||
@@ -392,12 +392,12 @@ See section
|
|||||||
:ref:`Configuration Scopes <configuration-scopes>`
|
:ref:`Configuration Scopes <configuration-scopes>`
|
||||||
for an explanation about the different files
|
for an explanation about the different files
|
||||||
and section
|
and section
|
||||||
:ref:`Build customization <packages-config>`
|
:ref:`Build customization <build-settings>`
|
||||||
for specifics and examples for ``packages.yaml`` files.
|
for specifics and examples for ``packages.yaml`` files.
|
||||||
|
|
||||||
.. If your system administrator did not provide modules for pre-installed Intel
|
.. If your system administrator did not provide modules for pre-installed Intel
|
||||||
tools, you could do well to ask for them, because installing multiple copies
|
tools, you could do well to ask for them, because installing multiple copies
|
||||||
of the Intel tools, as is won't to happen once Spack is in the picture, is
|
of the Intel tools, as is wont to happen once Spack is in the picture, is
|
||||||
bound to stretch disk space and patience thin. If you *are* the system
|
bound to stretch disk space and patience thin. If you *are* the system
|
||||||
administrator and are still new to modules, then perhaps it's best to follow
|
administrator and are still new to modules, then perhaps it's best to follow
|
||||||
the `next section <Installing Intel tools within Spack_>`_ and install the tools
|
the `next section <Installing Intel tools within Spack_>`_ and install the tools
|
||||||
@@ -653,7 +653,7 @@ follow `the next section <intel-install-libs_>`_ instead.
|
|||||||
* If you specified a custom variant (for example ``+vtune``) you may want to add this as your
|
* 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
|
preferred variant in the packages configuration for the ``intel-parallel-studio`` package
|
||||||
as described in :ref:`package-preferences`. Otherwise you will have to specify
|
as described in :ref:`package-preferences`. Otherwise you will have to specify
|
||||||
the variant every time ``intel-parallel-studio`` is being used as ``mkl``, ``fftw`` or ``mpi``
|
the variant everytime ``intel-parallel-studio`` is being used as ``mkl``, ``fftw`` or ``mpi``
|
||||||
implementation to avoid pulling in a different variant.
|
implementation to avoid pulling in a different variant.
|
||||||
|
|
||||||
* To set the Intel compilers for default use in Spack, instead of the usual ``%gcc``,
|
* To set the Intel compilers for default use in Spack, instead of the usual ``%gcc``,
|
||||||
@@ -934,9 +934,9 @@ a *virtual* ``mkl`` package is declared in Spack.
|
|||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
# Examples for absolute and conditional dependencies:
|
# Examples for absolute and conditional dependencies:
|
||||||
depends_on("mkl")
|
depends_on('mkl')
|
||||||
depends_on("mkl", when="+mkl")
|
depends_on('mkl', when='+mkl')
|
||||||
depends_on("mkl", when="fftw=mkl")
|
depends_on('mkl', when='fftw=mkl')
|
||||||
|
|
||||||
The ``MKLROOT`` environment variable (part of the documented API) will be set
|
The ``MKLROOT`` environment variable (part of the documented API) will be set
|
||||||
during all stages of client package installation, and is available to both
|
during all stages of client package installation, and is available to both
|
||||||
@@ -972,8 +972,8 @@ a *virtual* ``mkl`` package is declared in Spack.
|
|||||||
def configure_args(self):
|
def configure_args(self):
|
||||||
args = []
|
args = []
|
||||||
...
|
...
|
||||||
args.append("--with-blas=%s" % self.spec["blas"].libs.ld_flags)
|
args.append('--with-blas=%s' % self.spec['blas'].libs.ld_flags)
|
||||||
args.append("--with-lapack=%s" % self.spec["lapack"].libs.ld_flags)
|
args.append('--with-lapack=%s' % self.spec['lapack'].libs.ld_flags)
|
||||||
...
|
...
|
||||||
|
|
||||||
.. tip::
|
.. tip::
|
||||||
@@ -989,13 +989,13 @@ a *virtual* ``mkl`` package is declared in Spack.
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
self.spec["blas"].headers.include_flags
|
self.spec['blas'].headers.include_flags
|
||||||
|
|
||||||
and to generate linker options (``-L<dir> -llibname ...``), use the same as above,
|
and to generate linker options (``-L<dir> -llibname ...``), use the same as above,
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
self.spec["blas"].libs.ld_flags
|
self.spec['blas'].libs.ld_flags
|
||||||
|
|
||||||
See
|
See
|
||||||
:ref:`MakefilePackage <makefilepackage>`
|
:ref:`MakefilePackage <makefilepackage>`
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -88,7 +88,7 @@ override the ``luarocks_args`` method like so:
|
|||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
def luarocks_args(self):
|
def luarocks_args(self):
|
||||||
return ["flag1", "flag2"]
|
return ['flag1', 'flag2']
|
||||||
|
|
||||||
One common use of this is to override warnings or flags for newer compilers, as in:
|
One common use of this is to override warnings or flags for newer compilers, as in:
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -59,7 +59,7 @@ using GNU Make, you should add a dependency on ``gmake``:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
depends_on("gmake", type="build")
|
depends_on('gmake', type='build')
|
||||||
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
@@ -88,13 +88,13 @@ command-line. However, Makefiles that use ``?=`` for assignment honor
|
|||||||
environment variables. Since Spack already sets ``CC``, ``CXX``, ``F77``,
|
environment variables. Since Spack already sets ``CC``, ``CXX``, ``F77``,
|
||||||
and ``FC``, you won't need to worry about setting these variables. If
|
and ``FC``, you won't need to worry about setting these variables. If
|
||||||
there are any other variables you need to set, you can do this in the
|
there are any other variables you need to set, you can do this in the
|
||||||
``setup_build_environment`` method:
|
``edit`` method:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
def setup_build_environment(self, env):
|
def edit(self, spec, prefix):
|
||||||
env.set("PREFIX", prefix)
|
env['PREFIX'] = prefix
|
||||||
env.set("BLASLIB", spec["blas"].libs.ld_flags)
|
env['BLASLIB'] = spec['blas'].libs.ld_flags
|
||||||
|
|
||||||
|
|
||||||
`cbench <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/cbench/package.py>`_
|
`cbench <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/cbench/package.py>`_
|
||||||
@@ -113,7 +113,7 @@ you can do this like so:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
build_targets = ["CC=cc"]
|
build_targets = ['CC=cc']
|
||||||
|
|
||||||
|
|
||||||
If you do need access to the spec, you can create a property like so:
|
If you do need access to the spec, you can create a property like so:
|
||||||
@@ -125,8 +125,8 @@ If you do need access to the spec, you can create a property like so:
|
|||||||
spec = self.spec
|
spec = self.spec
|
||||||
|
|
||||||
return [
|
return [
|
||||||
"CC=cc",
|
'CC=cc',
|
||||||
f"BLASLIB={spec['blas'].libs.ld_flags}",
|
'BLASLIB={0}'.format(spec['blas'].libs.ld_flags),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
@@ -140,17 +140,17 @@ Edit Makefile
|
|||||||
Some Makefiles are just plain stubborn and will ignore command-line
|
Some Makefiles are just plain stubborn and will ignore command-line
|
||||||
variables. The only way to ensure that these packages build correctly
|
variables. The only way to ensure that these packages build correctly
|
||||||
is to directly edit the Makefile. Spack provides a ``FileFilter`` class
|
is to directly edit the Makefile. Spack provides a ``FileFilter`` class
|
||||||
and a ``filter`` method to help with this. For example:
|
and a ``filter_file`` method to help with this. For example:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
def edit(self, spec, prefix):
|
def edit(self, spec, prefix):
|
||||||
makefile = FileFilter("Makefile")
|
makefile = FileFilter('Makefile')
|
||||||
|
|
||||||
makefile.filter(r"^\s*CC\s*=.*", f"CC = {spack_cc}")
|
makefile.filter(r'^\s*CC\s*=.*', 'CC = ' + spack_cc)
|
||||||
makefile.filter(r"^\s*CXX\s*=.*", f"CXX = {spack_cxx}")
|
makefile.filter(r'^\s*CXX\s*=.*', 'CXX = ' + spack_cxx)
|
||||||
makefile.filter(r"^\s*F77\s*=.*", f"F77 = {spack_f77}")
|
makefile.filter(r'^\s*F77\s*=.*', 'F77 = ' + spack_f77)
|
||||||
makefile.filter(r"^\s*FC\s*=.*", f"FC = {spack_fc}")
|
makefile.filter(r'^\s*FC\s*=.*', 'FC = ' + spack_fc)
|
||||||
|
|
||||||
|
|
||||||
`stream <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/stream/package.py>`_
|
`stream <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/stream/package.py>`_
|
||||||
@@ -181,16 +181,16 @@ well for storing variables:
|
|||||||
|
|
||||||
def edit(self, spec, prefix):
|
def edit(self, spec, prefix):
|
||||||
config = {
|
config = {
|
||||||
"CC": "cc",
|
'CC': 'cc',
|
||||||
"MAKE": "make",
|
'MAKE': 'make',
|
||||||
}
|
}
|
||||||
|
|
||||||
if spec.satisfies("+blas"):
|
if '+blas' in spec:
|
||||||
config["BLAS_LIBS"] = spec["blas"].libs.joined()
|
config['BLAS_LIBS'] = spec['blas'].libs.joined()
|
||||||
|
|
||||||
with open("make.inc", "w") as inc:
|
with open('make.inc', 'w') as inc:
|
||||||
for key in config:
|
for key in config:
|
||||||
inc.write(f"{key} = {config[key]}\n")
|
inc.write('{0} = {1}\n'.format(key, config[key]))
|
||||||
|
|
||||||
|
|
||||||
`elk <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/elk/package.py>`_
|
`elk <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/elk/package.py>`_
|
||||||
@@ -204,14 +204,14 @@ them in a list:
|
|||||||
|
|
||||||
def edit(self, spec, prefix):
|
def edit(self, spec, prefix):
|
||||||
config = [
|
config = [
|
||||||
f"INSTALL_DIR = {prefix}",
|
'INSTALL_DIR = {0}'.format(prefix),
|
||||||
"INCLUDE_DIR = $(INSTALL_DIR)/include",
|
'INCLUDE_DIR = $(INSTALL_DIR)/include',
|
||||||
"LIBRARY_DIR = $(INSTALL_DIR)/lib",
|
'LIBRARY_DIR = $(INSTALL_DIR)/lib',
|
||||||
]
|
]
|
||||||
|
|
||||||
with open("make.inc", "w") as inc:
|
with open('make.inc', 'w') as inc:
|
||||||
for var in config:
|
for var in config:
|
||||||
inc.write(f"{var}\n")
|
inc.write('{0}\n'.format(var))
|
||||||
|
|
||||||
|
|
||||||
`hpl <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/hpl/package.py>`_
|
`hpl <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/hpl/package.py>`_
|
||||||
@@ -284,7 +284,7 @@ can tell Spack where to locate it like so:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
build_directory = "src"
|
build_directory = 'src'
|
||||||
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^
|
||||||
@@ -299,8 +299,8 @@ install the package:
|
|||||||
|
|
||||||
def install(self, spec, prefix):
|
def install(self, spec, prefix):
|
||||||
mkdir(prefix.bin)
|
mkdir(prefix.bin)
|
||||||
install("foo", prefix.bin)
|
install('foo', prefix.bin)
|
||||||
install_tree("lib", prefix.lib)
|
install_tree('lib', prefix.lib)
|
||||||
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -48,8 +48,8 @@ class automatically adds the following dependencies:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
depends_on("java", type=("build", "run"))
|
depends_on('java', type=('build', 'run'))
|
||||||
depends_on("maven", type="build")
|
depends_on('maven', type='build')
|
||||||
|
|
||||||
|
|
||||||
In the ``pom.xml`` file, you may see sections like:
|
In the ``pom.xml`` file, you may see sections like:
|
||||||
@@ -72,8 +72,8 @@ should add:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
depends_on("java@7:", type="build")
|
depends_on('java@7:', type='build')
|
||||||
depends_on("maven@3.5.4:", type="build")
|
depends_on('maven@3.5.4:', type='build')
|
||||||
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
@@ -88,9 +88,9 @@ the build phase. For example:
|
|||||||
|
|
||||||
def build_args(self):
|
def build_args(self):
|
||||||
return [
|
return [
|
||||||
"-Pdist,native",
|
'-Pdist,native',
|
||||||
"-Dtar",
|
'-Dtar',
|
||||||
"-Dmaven.javadoc.skip=true"
|
'-Dmaven.javadoc.skip=true'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -86,8 +86,8 @@ the ``MesonPackage`` base class already contains:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
depends_on("meson", type="build")
|
depends_on('meson', type='build')
|
||||||
depends_on("ninja", type="build")
|
depends_on('ninja', type='build')
|
||||||
|
|
||||||
|
|
||||||
If you need to specify a particular version requirement, you can
|
If you need to specify a particular version requirement, you can
|
||||||
@@ -95,8 +95,8 @@ override this in your package:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
depends_on("meson@0.43.0:", type="build")
|
depends_on('meson@0.43.0:', type='build')
|
||||||
depends_on("ninja", type="build")
|
depends_on('ninja', type='build')
|
||||||
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^
|
||||||
@@ -121,7 +121,7 @@ override the ``meson_args`` method like so:
|
|||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
def meson_args(self):
|
def meson_args(self):
|
||||||
return ["--warnlevel=3"]
|
return ['--warnlevel=3']
|
||||||
|
|
||||||
|
|
||||||
This method can be used to pass flags as well as variables.
|
This method can be used to pass flags as well as variables.
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -118,7 +118,7 @@ so ``PerlPackage`` contains:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
extends("perl")
|
extends('perl')
|
||||||
|
|
||||||
|
|
||||||
If your package requires a specific version of Perl, you should
|
If your package requires a specific version of Perl, you should
|
||||||
@@ -132,14 +132,14 @@ properly. If your package uses ``Makefile.PL`` to build, add:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
depends_on("perl-extutils-makemaker", type="build")
|
depends_on('perl-extutils-makemaker', type='build')
|
||||||
|
|
||||||
|
|
||||||
If your package uses ``Build.PL`` to build, add:
|
If your package uses ``Build.PL`` to build, add:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
depends_on("perl-module-build", type="build")
|
depends_on('perl-module-build', type='build')
|
||||||
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^
|
||||||
@@ -165,80 +165,14 @@ arguments to ``Makefile.PL`` or ``Build.PL`` by overriding
|
|||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
def configure_args(self):
|
def configure_args(self):
|
||||||
expat = self.spec["expat"].prefix
|
expat = self.spec['expat'].prefix
|
||||||
|
|
||||||
return [
|
return [
|
||||||
"EXPATLIBPATH={0}".format(expat.lib),
|
'EXPATLIBPATH={0}'.format(expat.lib),
|
||||||
"EXPATINCPATH={0}".format(expat.include),
|
'EXPATINCPATH={0}'.format(expat.include),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
^^^^^^^
|
|
||||||
Testing
|
|
||||||
^^^^^^^
|
|
||||||
|
|
||||||
``PerlPackage`` provides a simple stand-alone test of the successfully
|
|
||||||
installed package to confirm that installed perl module(s) can be used.
|
|
||||||
These tests can be performed any time after the installation using
|
|
||||||
``spack -v test run``. (For more information on the command, see
|
|
||||||
:ref:`cmd-spack-test-run`.)
|
|
||||||
|
|
||||||
The base class automatically detects perl modules based on the presence
|
|
||||||
of ``*.pm`` files under the package's library directory. For example,
|
|
||||||
the files under ``perl-bignum``'s perl library are:
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ find . -name "*.pm"
|
|
||||||
./bigfloat.pm
|
|
||||||
./bigrat.pm
|
|
||||||
./Math/BigFloat/Trace.pm
|
|
||||||
./Math/BigInt/Trace.pm
|
|
||||||
./Math/BigRat/Trace.pm
|
|
||||||
./bigint.pm
|
|
||||||
./bignum.pm
|
|
||||||
|
|
||||||
|
|
||||||
which results in the package having the ``use_modules`` property containing:
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
use_modules = [
|
|
||||||
"bigfloat",
|
|
||||||
"bigrat",
|
|
||||||
"Math::BigFloat::Trace",
|
|
||||||
"Math::BigInt::Trace",
|
|
||||||
"Math::BigRat::Trace",
|
|
||||||
"bigint",
|
|
||||||
"bignum",
|
|
||||||
]
|
|
||||||
|
|
||||||
.. note::
|
|
||||||
|
|
||||||
This list can often be used to catch missing dependencies.
|
|
||||||
|
|
||||||
If the list is somehow wrong, you can provide the names of the modules
|
|
||||||
yourself by overriding ``use_modules`` like so:
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
use_modules = ["bigfloat", "bigrat", "bigint", "bignum"]
|
|
||||||
|
|
||||||
If you only want a subset of the automatically detected modules to be
|
|
||||||
tested, you could instead define the ``skip_modules`` property on the
|
|
||||||
package. So, instead of overriding ``use_modules`` as shown above, you
|
|
||||||
could define the following:
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
skip_modules = [
|
|
||||||
"Math::BigFloat::Trace",
|
|
||||||
"Math::BigInt::Trace",
|
|
||||||
"Math::BigRat::Trace",
|
|
||||||
]
|
|
||||||
|
|
||||||
for the same use tests.
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^
|
||||||
Alternatives to Spack
|
Alternatives to Spack
|
||||||
^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -152,16 +152,16 @@ set. Once set, ``pypi`` will be used to define the ``homepage``,
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
homepage = "https://pypi.org/project/setuptools/"
|
homepage = 'https://pypi.org/project/setuptools/'
|
||||||
url = "https://pypi.org/packages/source/s/setuptools/setuptools-49.2.0.zip"
|
url = 'https://pypi.org/packages/source/s/setuptools/setuptools-49.2.0.zip'
|
||||||
list_url = "https://pypi.org/simple/setuptools/"
|
list_url = 'https://pypi.org/simple/setuptools/'
|
||||||
|
|
||||||
|
|
||||||
is equivalent to:
|
is equivalent to:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
pypi = "setuptools/setuptools-49.2.0.zip"
|
pypi = 'setuptools/setuptools-49.2.0.zip'
|
||||||
|
|
||||||
|
|
||||||
If a package has a different homepage listed on PyPI, you can
|
If a package has a different homepage listed on PyPI, you can
|
||||||
@@ -208,7 +208,7 @@ dependencies to your package:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
depends_on("py-setuptools@42:", type="build")
|
depends_on('py-setuptools@42:', type='build')
|
||||||
|
|
||||||
|
|
||||||
Note that ``py-wheel`` is already listed as a build dependency in the
|
Note that ``py-wheel`` is already listed as a build dependency in the
|
||||||
@@ -232,7 +232,7 @@ Look for dependencies under the following keys:
|
|||||||
* ``dependencies`` under ``[project]``
|
* ``dependencies`` under ``[project]``
|
||||||
|
|
||||||
These packages are required for building and installation. You can
|
These packages are required for building and installation. You can
|
||||||
add them with ``type=("build", "run")``.
|
add them with ``type=('build', 'run')``.
|
||||||
|
|
||||||
* ``[project.optional-dependencies]``
|
* ``[project.optional-dependencies]``
|
||||||
|
|
||||||
@@ -279,12 +279,12 @@ distutils library, and has almost the exact same API. In addition to
|
|||||||
* ``setup_requires``
|
* ``setup_requires``
|
||||||
|
|
||||||
These packages are usually only needed at build-time, so you can
|
These packages are usually only needed at build-time, so you can
|
||||||
add them with ``type="build"``.
|
add them with ``type='build'``.
|
||||||
|
|
||||||
* ``install_requires``
|
* ``install_requires``
|
||||||
|
|
||||||
These packages are required for building and installation. You can
|
These packages are required for building and installation. You can
|
||||||
add them with ``type=("build", "run")``.
|
add them with ``type=('build', 'run')``.
|
||||||
|
|
||||||
* ``extras_require``
|
* ``extras_require``
|
||||||
|
|
||||||
@@ -296,7 +296,7 @@ distutils library, and has almost the exact same API. In addition to
|
|||||||
|
|
||||||
These are packages that are required to run the unit tests for the
|
These are packages that are required to run the unit tests for the
|
||||||
package. These dependencies can be specified using the
|
package. These dependencies can be specified using the
|
||||||
``type="test"`` dependency type. However, the PyPI tarballs rarely
|
``type='test'`` dependency type. However, the PyPI tarballs rarely
|
||||||
contain unit tests, so there is usually no reason to add these.
|
contain unit tests, so there is usually no reason to add these.
|
||||||
|
|
||||||
See https://setuptools.pypa.io/en/latest/userguide/dependency_management.html
|
See https://setuptools.pypa.io/en/latest/userguide/dependency_management.html
|
||||||
@@ -321,7 +321,7 @@ older versions of flit may use the following keys:
|
|||||||
* ``requires`` under ``[tool.flit.metadata]``
|
* ``requires`` under ``[tool.flit.metadata]``
|
||||||
|
|
||||||
These packages are required for building and installation. You can
|
These packages are required for building and installation. You can
|
||||||
add them with ``type=("build", "run")``.
|
add them with ``type=('build', 'run')``.
|
||||||
|
|
||||||
* ``[tool.flit.metadata.requires-extra]``
|
* ``[tool.flit.metadata.requires-extra]``
|
||||||
|
|
||||||
@@ -366,7 +366,7 @@ If the ``pyproject.toml`` lists ``mesonpy`` as the ``build-backend``,
|
|||||||
it uses the meson build system. Meson uses the default
|
it uses the meson build system. Meson uses the default
|
||||||
``pyproject.toml`` keys to list dependencies.
|
``pyproject.toml`` keys to list dependencies.
|
||||||
|
|
||||||
See https://meson-python.readthedocs.io/en/latest/tutorials/introduction.html
|
See https://meson-python.readthedocs.io/en/latest/usage/start.html
|
||||||
for more information.
|
for more information.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
@@ -434,12 +434,12 @@ the BLAS/LAPACK library you want pkg-config to search for:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
depends_on("py-pip@22.1:", type="build")
|
depends_on('py-pip@22.1:', type='build')
|
||||||
|
|
||||||
def config_settings(self, spec, prefix):
|
def config_settings(self, spec, prefix):
|
||||||
return {
|
return {
|
||||||
"blas": spec["blas"].libs.names[0],
|
'blas': spec['blas'].libs.names[0],
|
||||||
"lapack": spec["lapack"].libs.names[0],
|
'lapack': spec['lapack'].libs.names[0],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -463,10 +463,10 @@ has an optional dependency on ``libyaml`` that can be enabled like so:
|
|||||||
|
|
||||||
def global_options(self, spec, prefix):
|
def global_options(self, spec, prefix):
|
||||||
options = []
|
options = []
|
||||||
if spec.satisfies("+libyaml"):
|
if '+libyaml' in spec:
|
||||||
options.append("--with-libyaml")
|
options.append('--with-libyaml')
|
||||||
else:
|
else:
|
||||||
options.append("--without-libyaml")
|
options.append('--without-libyaml')
|
||||||
return options
|
return options
|
||||||
|
|
||||||
|
|
||||||
@@ -492,10 +492,10 @@ allows you to specify the directories to search for ``libyaml``:
|
|||||||
|
|
||||||
def install_options(self, spec, prefix):
|
def install_options(self, spec, prefix):
|
||||||
options = []
|
options = []
|
||||||
if spec.satisfies("+libyaml"):
|
if '+libyaml' in spec:
|
||||||
options.extend([
|
options.extend([
|
||||||
spec["libyaml"].libs.search_flags,
|
spec['libyaml'].libs.search_flags,
|
||||||
spec["libyaml"].headers.include_flags,
|
spec['libyaml'].headers.include_flags,
|
||||||
])
|
])
|
||||||
return options
|
return options
|
||||||
|
|
||||||
@@ -556,7 +556,7 @@ detected are wrong, you can provide the names yourself by overriding
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
import_modules = ["six"]
|
import_modules = ['six']
|
||||||
|
|
||||||
|
|
||||||
Sometimes the list of module names to import depends on how the
|
Sometimes the list of module names to import depends on how the
|
||||||
@@ -571,9 +571,9 @@ This can be expressed like so:
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def import_modules(self):
|
def import_modules(self):
|
||||||
modules = ["yaml"]
|
modules = ['yaml']
|
||||||
if self.spec.satisfies("+libyaml"):
|
if '+libyaml' in self.spec:
|
||||||
modules.append("yaml.cyaml")
|
modules.append('yaml.cyaml')
|
||||||
return modules
|
return modules
|
||||||
|
|
||||||
|
|
||||||
@@ -582,18 +582,18 @@ libraries. Make sure not to add modules/packages containing the word
|
|||||||
"test", as these likely won't end up in the installation directory,
|
"test", as these likely won't end up in the installation directory,
|
||||||
or may require test dependencies like pytest to be installed.
|
or may require test dependencies like pytest to be installed.
|
||||||
|
|
||||||
Instead of defining the ``import_modules`` explicitly, only the subset
|
Instead of defining the ``import_modules`` explicity, only the subset
|
||||||
of module names to be skipped can be defined by using ``skip_modules``.
|
of module names to be skipped can be defined by using ``skip_modules``.
|
||||||
If a defined module has submodules, they are skipped as well, e.g.,
|
If a defined module has submodules, they are skipped as well, e.g.,
|
||||||
in case the ``plotting`` modules should be excluded from the
|
in case the ``plotting`` modules should be excluded from the
|
||||||
automatically detected ``import_modules`` ``["nilearn", "nilearn.surface",
|
automatically detected ``import_modules`` ``['nilearn', 'nilearn.surface',
|
||||||
"nilearn.plotting", "nilearn.plotting.data"]`` set:
|
'nilearn.plotting', 'nilearn.plotting.data']`` set:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
skip_modules = ["nilearn.plotting"]
|
skip_modules = ['nilearn.plotting']
|
||||||
|
|
||||||
This will set ``import_modules`` to ``["nilearn", "nilearn.surface"]``
|
This will set ``import_modules`` to ``['nilearn', 'nilearn.surface']``
|
||||||
|
|
||||||
Import tests can be run during the installation using ``spack install
|
Import tests can be run during the installation using ``spack install
|
||||||
--test=root`` or at any time after the installation using
|
--test=root`` or at any time after the installation using
|
||||||
@@ -612,11 +612,11 @@ after the ``install`` phase:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
@run_after("install")
|
@run_after('install')
|
||||||
@on_package_attributes(run_tests=True)
|
@on_package_attributes(run_tests=True)
|
||||||
def install_test(self):
|
def install_test(self):
|
||||||
with working_dir("spack-test", create=True):
|
with working_dir('spack-test', create=True):
|
||||||
python("-c", "import numpy; numpy.test('full', verbose=2)")
|
python('-c', 'import numpy; numpy.test("full", verbose=2)')
|
||||||
|
|
||||||
|
|
||||||
when testing is enabled during the installation (i.e., ``spack install
|
when testing is enabled during the installation (i.e., ``spack install
|
||||||
@@ -638,7 +638,7 @@ provides Python bindings in a ``python`` directory, you can use:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
build_directory = "python"
|
build_directory = 'python'
|
||||||
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
@@ -718,45 +718,23 @@ command-line tool, or C/C++/Fortran program with optional Python
|
|||||||
modules? The former should be prepended with ``py-``, while the
|
modules? The former should be prepended with ``py-``, while the
|
||||||
latter should not.
|
latter should not.
|
||||||
|
|
||||||
""""""""""""""""""""""""""""""
|
""""""""""""""""""""""
|
||||||
``extends`` vs. ``depends_on``
|
extends vs. depends_on
|
||||||
""""""""""""""""""""""""""""""
|
""""""""""""""""""""""
|
||||||
|
|
||||||
|
This is very similar to the naming dilemma above, with a slight twist.
|
||||||
As mentioned in the :ref:`Packaging Guide <packaging_extensions>`,
|
As mentioned in the :ref:`Packaging Guide <packaging_extensions>`,
|
||||||
``extends`` and ``depends_on`` are very similar, but ``extends`` ensures
|
``extends`` and ``depends_on`` are very similar, but ``extends`` ensures
|
||||||
that the extension and extendee share the same prefix in views.
|
that the extension and extendee share the same prefix in views.
|
||||||
This allows the user to import a Python module without
|
This allows the user to import a Python module without
|
||||||
having to add that module to ``PYTHONPATH``.
|
having to add that module to ``PYTHONPATH``.
|
||||||
|
|
||||||
Additionally, ``extends("python")`` adds a dependency on the package
|
When deciding between ``extends`` and ``depends_on``, the best rule of
|
||||||
``python-venv``. This improves isolation from the system, whether
|
thumb is to check the installation prefix. If Python libraries are
|
||||||
it's during the build or at runtime: user and system site packages
|
installed to ``<prefix>/lib/pythonX.Y/site-packages``, then you
|
||||||
cannot accidentally be used by any package that ``extends("python")``.
|
should use ``extends``. If Python libraries are installed elsewhere
|
||||||
|
or the only files that get installed reside in ``<prefix>/bin``, then
|
||||||
As a rule of thumb: if a package does not install any Python modules
|
don't use ``extends``.
|
||||||
of its own, and merely puts a Python script in the ``bin`` directory,
|
|
||||||
then there is no need for ``extends``. If the package installs modules
|
|
||||||
in the ``site-packages`` directory, it requires ``extends``.
|
|
||||||
|
|
||||||
"""""""""""""""""""""""""""""""""""""
|
|
||||||
Executing ``python`` during the build
|
|
||||||
"""""""""""""""""""""""""""""""""""""
|
|
||||||
|
|
||||||
Whenever you need to execute a Python command or pass the path of the
|
|
||||||
Python interpreter to the build system, it is best to use the global
|
|
||||||
variable ``python`` directly. For example:
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
@run_before("install")
|
|
||||||
def recythonize(self):
|
|
||||||
python("setup.py", "clean") # use the `python` global
|
|
||||||
|
|
||||||
As mentioned in the previous section, ``extends("python")`` adds an
|
|
||||||
automatic dependency on ``python-venv``, which is a virtual environment
|
|
||||||
that guarantees build isolation. The ``python`` global always refers to
|
|
||||||
the correct Python interpreter, whether the package uses ``extends("python")``
|
|
||||||
or ``depends_on("python")``.
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^
|
||||||
Alternatives to Spack
|
Alternatives to Spack
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -83,7 +83,7 @@ base class already contains:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
depends_on("qt", type="build")
|
depends_on('qt', type='build')
|
||||||
|
|
||||||
|
|
||||||
If you want to specify a particular version requirement, or need to
|
If you want to specify a particular version requirement, or need to
|
||||||
@@ -91,7 +91,7 @@ link to the ``qt`` libraries, you can override this in your package:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
depends_on("qt@5.6.0:")
|
depends_on('qt@5.6.0:')
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
Passing arguments to qmake
|
Passing arguments to qmake
|
||||||
@@ -103,7 +103,7 @@ override the ``qmake_args`` method like so:
|
|||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
def qmake_args(self):
|
def qmake_args(self):
|
||||||
return ["-recursive"]
|
return ['-recursive']
|
||||||
|
|
||||||
|
|
||||||
This method can be used to pass flags as well as variables.
|
This method can be used to pass flags as well as variables.
|
||||||
@@ -118,7 +118,7 @@ sub-directory by adding the following to the package:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
build_directory = "src"
|
build_directory = 'src'
|
||||||
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -81,27 +81,28 @@ class of your package. For example, you can add it to your
|
|||||||
class MyRocmPackage(CMakePackage, ROCmPackage):
|
class MyRocmPackage(CMakePackage, ROCmPackage):
|
||||||
...
|
...
|
||||||
# Ensure +rocm and amdgpu_targets are passed to dependencies
|
# Ensure +rocm and amdgpu_targets are passed to dependencies
|
||||||
depends_on("mydeppackage", when="+rocm")
|
depends_on('mydeppackage', when='+rocm')
|
||||||
for val in ROCmPackage.amdgpu_targets:
|
for val in ROCmPackage.amdgpu_targets:
|
||||||
depends_on(f"mydeppackage amdgpu_target={val}",
|
depends_on('mydeppackage amdgpu_target={0}'.format(val),
|
||||||
when=f"amdgpu_target={val}")
|
when='amdgpu_target={0}'.format(val))
|
||||||
...
|
...
|
||||||
|
|
||||||
def cmake_args(self):
|
def cmake_args(self):
|
||||||
spec = self.spec
|
spec = self.spec
|
||||||
args = []
|
args = []
|
||||||
...
|
...
|
||||||
if spec.satisfies("+rocm"):
|
if '+rocm' in spec:
|
||||||
# Set up the hip macros needed by the build
|
# Set up the hip macros needed by the build
|
||||||
args.extend([
|
args.extend([
|
||||||
"-DENABLE_HIP=ON",
|
'-DENABLE_HIP=ON',
|
||||||
f"-DHIP_ROOT_DIR={spec['hip'].prefix}"])
|
'-DHIP_ROOT_DIR={0}'.format(spec['hip'].prefix)])
|
||||||
rocm_archs = spec.variants["amdgpu_target"].value
|
rocm_archs = spec.variants['amdgpu_target'].value
|
||||||
if "none" not in rocm_archs:
|
if 'none' not in rocm_archs:
|
||||||
args.append(f"-DHIP_HIPCC_FLAGS=--amdgpu-target={','.join(rocm_archs}")
|
args.append('-DHIP_HIPCC_FLAGS=--amdgpu-target={0}'
|
||||||
|
.format(",".join(rocm_archs)))
|
||||||
else:
|
else:
|
||||||
# Ensure build with hip is disabled
|
# Ensure build with hip is disabled
|
||||||
args.append("-DENABLE_HIP=OFF")
|
args.append('-DENABLE_HIP=OFF')
|
||||||
...
|
...
|
||||||
return args
|
return args
|
||||||
...
|
...
|
||||||
@@ -113,7 +114,7 @@ build.
|
|||||||
|
|
||||||
This example also illustrates how to check for the ``rocm`` variant using
|
This example also illustrates how to check for the ``rocm`` variant using
|
||||||
``self.spec`` and how to retrieve the ``amdgpu_target`` variant's value
|
``self.spec`` and how to retrieve the ``amdgpu_target`` variant's value
|
||||||
using ``self.spec.variants["amdgpu_target"].value``.
|
using ``self.spec.variants['amdgpu_target'].value``.
|
||||||
|
|
||||||
All five packages using ``ROCmPackage`` as of January 2021 also use the
|
All five packages using ``ROCmPackage`` as of January 2021 also use the
|
||||||
:ref:`CudaPackage <cudapackage>`. So it is worth looking at those packages
|
:ref:`CudaPackage <cudapackage>`. So it is worth looking at those packages
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -163,28 +163,28 @@ attributes that can be used to set ``homepage``, ``url``, ``list_url``, and
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
cran = "caret"
|
cran = 'caret'
|
||||||
|
|
||||||
is equivalent to:
|
is equivalent to:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
homepage = "https://cloud.r-project.org/package=caret"
|
homepage = 'https://cloud.r-project.org/package=caret'
|
||||||
url = "https://cloud.r-project.org/src/contrib/caret_6.0-86.tar.gz"
|
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"
|
list_url = 'https://cloud.r-project.org/src/contrib/Archive/caret'
|
||||||
|
|
||||||
Likewise, the following ``bioc`` attribute:
|
Likewise, the following ``bioc`` attribute:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
bioc = "BiocVersion"
|
bioc = 'BiocVersion'
|
||||||
|
|
||||||
is equivalent to:
|
is equivalent to:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
homepage = "https://bioconductor.org/packages/BiocVersion/"
|
homepage = 'https://bioconductor.org/packages/BiocVersion/'
|
||||||
git = "https://git.bioconductor.org/packages/BiocVersion"
|
git = 'https://git.bioconductor.org/packages/BiocVersion'
|
||||||
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
@@ -200,7 +200,7 @@ base class contains:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
extends("r")
|
extends('r')
|
||||||
|
|
||||||
|
|
||||||
Take a close look at the homepage for ``caret``. If you look at the
|
Take a close look at the homepage for ``caret``. If you look at the
|
||||||
@@ -209,7 +209,7 @@ You should add this to your package like so:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
depends_on("r@3.2.0:", type=("build", "run"))
|
depends_on('r@3.2.0:', type=('build', 'run'))
|
||||||
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^
|
||||||
@@ -227,7 +227,7 @@ and list all of their dependencies in the following sections:
|
|||||||
* LinkingTo
|
* LinkingTo
|
||||||
|
|
||||||
As far as Spack is concerned, all 3 of these dependency types
|
As far as Spack is concerned, all 3 of these dependency types
|
||||||
correspond to ``type=("build", "run")``, so you don't have to worry
|
correspond to ``type=('build', 'run')``, so you don't have to worry
|
||||||
about the details. If you are curious what they mean,
|
about the details. If you are curious what they mean,
|
||||||
https://github.com/spack/spack/issues/2951 has a pretty good summary:
|
https://github.com/spack/spack/issues/2951 has a pretty good summary:
|
||||||
|
|
||||||
@@ -330,7 +330,7 @@ the dependency:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
depends_on("r-lattice@0.20:", type=("build", "run"))
|
depends_on('r-lattice@0.20:', type=('build', 'run'))
|
||||||
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^
|
||||||
@@ -361,20 +361,20 @@ like so:
|
|||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
def configure_args(self):
|
def configure_args(self):
|
||||||
mpi_name = self.spec["mpi"].name
|
mpi_name = self.spec['mpi'].name
|
||||||
|
|
||||||
# The type of MPI. Supported values are:
|
# The type of MPI. Supported values are:
|
||||||
# OPENMPI, LAM, MPICH, MPICH2, or CRAY
|
# OPENMPI, LAM, MPICH, MPICH2, or CRAY
|
||||||
if mpi_name == "openmpi":
|
if mpi_name == 'openmpi':
|
||||||
Rmpi_type = "OPENMPI"
|
Rmpi_type = 'OPENMPI'
|
||||||
elif mpi_name == "mpich":
|
elif mpi_name == 'mpich':
|
||||||
Rmpi_type = "MPICH2"
|
Rmpi_type = 'MPICH2'
|
||||||
else:
|
else:
|
||||||
raise InstallError("Unsupported MPI type")
|
raise InstallError('Unsupported MPI type')
|
||||||
|
|
||||||
return [
|
return [
|
||||||
"--with-Rmpi-type={0}".format(Rmpi_type),
|
'--with-Rmpi-type={0}'.format(Rmpi_type),
|
||||||
"--with-mpi={0}".format(spec["mpi"].prefix),
|
'--with-mpi={0}'.format(spec['mpi'].prefix),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -84,8 +84,8 @@ The ``*.gemspec`` file may contain something like:
|
|||||||
|
|
||||||
.. code-block:: ruby
|
.. code-block:: ruby
|
||||||
|
|
||||||
summary = "An implementation of the AsciiDoc text processor and publishing toolchain"
|
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."
|
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.
|
Either of these can be used for the description of the Spack package.
|
||||||
@@ -98,7 +98,7 @@ The ``*.gemspec`` file may contain something like:
|
|||||||
|
|
||||||
.. code-block:: ruby
|
.. code-block:: ruby
|
||||||
|
|
||||||
homepage = "https://asciidoctor.org"
|
homepage = 'https://asciidoctor.org'
|
||||||
|
|
||||||
|
|
||||||
This should be used as the official homepage of the Spack package.
|
This should be used as the official homepage of the Spack package.
|
||||||
@@ -112,21 +112,21 @@ the base class contains:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
extends("ruby")
|
extends('ruby')
|
||||||
|
|
||||||
|
|
||||||
The ``*.gemspec`` file may contain something like:
|
The ``*.gemspec`` file may contain something like:
|
||||||
|
|
||||||
.. code-block:: ruby
|
.. code-block:: ruby
|
||||||
|
|
||||||
required_ruby_version = ">= 2.3.0"
|
required_ruby_version = '>= 2.3.0'
|
||||||
|
|
||||||
|
|
||||||
This can be added to the Spack package using:
|
This can be added to the Spack package using:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
depends_on("ruby@2.3.0:", type=("build", "run"))
|
depends_on('ruby@2.3.0:', type=('build', 'run'))
|
||||||
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -49,15 +49,15 @@ following phases:
|
|||||||
#. ``install`` - install the package
|
#. ``install`` - install the package
|
||||||
|
|
||||||
Package developers often add unit tests that can be invoked with
|
Package developers often add unit tests that can be invoked with
|
||||||
``scons test`` or ``scons check``. Spack provides a ``build_test`` method
|
``scons test`` or ``scons check``. Spack provides a ``test`` method
|
||||||
to handle this. Since we don't know which one the package developer
|
to handle this. Since we don't know which one the package developer
|
||||||
chose, the ``build_test`` method does nothing by default, but can be easily
|
chose, the ``test`` method does nothing by default, but can be easily
|
||||||
overridden like so:
|
overridden like so:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
def build_test(self):
|
def test(self):
|
||||||
scons("check")
|
scons('check')
|
||||||
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^
|
||||||
@@ -88,7 +88,7 @@ base class already contains:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
depends_on("scons", type="build")
|
depends_on('scons', type='build')
|
||||||
|
|
||||||
|
|
||||||
If you want to specify a particular version requirement, you can override
|
If you want to specify a particular version requirement, you can override
|
||||||
@@ -96,7 +96,7 @@ this in your package:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
depends_on("scons@2.3.0:", type="build")
|
depends_on('scons@2.3.0:', type='build')
|
||||||
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
@@ -238,14 +238,14 @@ the package build phase. This is done by overriding ``build_args`` like so:
|
|||||||
|
|
||||||
def build_args(self, spec, prefix):
|
def build_args(self, spec, prefix):
|
||||||
args = [
|
args = [
|
||||||
f"PREFIX={prefix}",
|
'PREFIX={0}'.format(prefix),
|
||||||
f"ZLIB={spec['zlib'].prefix}",
|
'ZLIB={0}'.format(spec['zlib'].prefix),
|
||||||
]
|
]
|
||||||
|
|
||||||
if spec.satisfies("+debug"):
|
if '+debug' in spec:
|
||||||
args.append("DEBUG=yes")
|
args.append('DEBUG=yes')
|
||||||
else:
|
else:
|
||||||
args.append("DEBUG=no")
|
args.append('DEBUG=no')
|
||||||
|
|
||||||
return args
|
return args
|
||||||
|
|
||||||
@@ -275,8 +275,8 @@ environment variables. For example, cantera has the following option:
|
|||||||
* env_vars: [ string ]
|
* env_vars: [ string ]
|
||||||
Environment variables to propagate through to SCons. Either the
|
Environment variables to propagate through to SCons. Either the
|
||||||
string "all" or a comma separated list of variable names, e.g.
|
string "all" or a comma separated list of variable names, e.g.
|
||||||
"LD_LIBRARY_PATH,HOME".
|
'LD_LIBRARY_PATH,HOME'.
|
||||||
- default: "LD_LIBRARY_PATH,PYTHONPATH"
|
- default: 'LD_LIBRARY_PATH,PYTHONPATH'
|
||||||
|
|
||||||
|
|
||||||
In the case of cantera, using ``env_vars=all`` allows us to use
|
In the case of cantera, using ``env_vars=all`` allows us to use
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -32,7 +32,7 @@ By default, these phases run:
|
|||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
$ sip-build --verbose --target-dir ...
|
$ python configure.py --bindir ... --destdir ...
|
||||||
$ make
|
$ make
|
||||||
$ make install
|
$ make install
|
||||||
|
|
||||||
@@ -41,30 +41,30 @@ By default, these phases run:
|
|||||||
Important files
|
Important files
|
||||||
^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
Each SIP package comes with a custom configuration file written in Python.
|
Each SIP package comes with a custom ``configure.py`` build script,
|
||||||
For newer packages, this is called ``project.py``, while in older packages,
|
written in Python. This script contains instructions to build the project.
|
||||||
it may be called ``configure.py``. This script contains instructions to build
|
|
||||||
the project.
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
Build system dependencies
|
Build system dependencies
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
``SIPPackage`` requires several dependencies. Python and SIP are needed at build-time
|
``SIPPackage`` requires several dependencies. Python is needed to run
|
||||||
to run the aforementioned configure script. Python is also needed at run-time to
|
the ``configure.py`` build script, and to run the resulting Python
|
||||||
actually use the installed Python library. And as we are building Python bindings
|
libraries. Qt is needed to provide the ``qmake`` command. SIP is also
|
||||||
for C/C++ libraries, Python is also needed as a link dependency. All of these
|
needed to build the package. All of these dependencies are automatically
|
||||||
dependencies are automatically added via the base class.
|
added via the base class
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
extends("python", type=("build", "link", "run"))
|
extends('python')
|
||||||
depends_on("py-sip", type="build")
|
|
||||||
|
|
||||||
|
depends_on('qt', type='build')
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
depends_on('py-sip', type='build')
|
||||||
Passing arguments to ``sip-build``
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
Passing arguments to ``configure.py``
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
Each phase comes with a ``<phase_args>`` function that can be used to pass
|
Each phase comes with a ``<phase_args>`` function that can be used to pass
|
||||||
arguments to that particular phase. For example, if you need to pass
|
arguments to that particular phase. For example, if you need to pass
|
||||||
@@ -72,11 +72,11 @@ arguments to the configure phase, you can use:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
def configure_args(self):
|
def configure_args(self, spec, prefix):
|
||||||
return ["--no-python-dbus"]
|
return ['--no-python-dbus']
|
||||||
|
|
||||||
|
|
||||||
A list of valid options can be found by running ``sip-build --help``.
|
A list of valid options can be found by running ``python configure.py --help``.
|
||||||
|
|
||||||
^^^^^^^
|
^^^^^^^
|
||||||
Testing
|
Testing
|
||||||
@@ -124,7 +124,7 @@ are wrong, you can provide the names yourself by overriding
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
import_modules = ["PyQt5"]
|
import_modules = ['PyQt5']
|
||||||
|
|
||||||
|
|
||||||
These tests often catch missing dependencies and non-RPATHed
|
These tests often catch missing dependencies and non-RPATHed
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -58,13 +58,15 @@ Testing
|
|||||||
``WafPackage`` also provides ``test`` and ``installtest`` methods,
|
``WafPackage`` also provides ``test`` and ``installtest`` methods,
|
||||||
which are run after the ``build`` and ``install`` phases, respectively.
|
which are run after the ``build`` and ``install`` phases, respectively.
|
||||||
By default, these phases do nothing, but you can override them to
|
By default, these phases do nothing, but you can override them to
|
||||||
run package-specific unit tests.
|
run package-specific unit tests. For example, the
|
||||||
|
`py-py2cairo <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/py-py2cairo/package.py>`_
|
||||||
|
package uses:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
def installtest(self):
|
def installtest(self):
|
||||||
with working_dir("test"):
|
with working_dir('test'):
|
||||||
pytest = which("py.test")
|
pytest = which('py.test')
|
||||||
pytest()
|
pytest()
|
||||||
|
|
||||||
|
|
||||||
@@ -93,7 +95,7 @@ the following dependency automatically:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
depends_on("python@2.5:", type="build")
|
depends_on('python@2.5:', type='build')
|
||||||
|
|
||||||
|
|
||||||
Waf only supports Python 2.5 and up.
|
Waf only supports Python 2.5 and up.
|
||||||
@@ -113,7 +115,7 @@ phase, you can use:
|
|||||||
args = []
|
args = []
|
||||||
|
|
||||||
if self.run_tests:
|
if self.run_tests:
|
||||||
args.append("--test")
|
args.append('--test')
|
||||||
|
|
||||||
return args
|
return args
|
||||||
|
|
||||||
|
@@ -1,18 +1,17 @@
|
|||||||
.. Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
.. chain:
|
.. chain:
|
||||||
|
|
||||||
=============================================
|
============================
|
||||||
Chaining Spack Installations (upstreams.yaml)
|
Chaining Spack Installations
|
||||||
=============================================
|
============================
|
||||||
|
|
||||||
You can point your Spack installation to another installation to use any
|
You can point your Spack installation to another installation to use any
|
||||||
packages that are installed there. To register the other Spack instance,
|
packages that are installed there. To register the other Spack instance,
|
||||||
you can add it as an entry to ``upstreams.yaml`` at any of the
|
you can add it as an entry to ``upstreams.yaml``:
|
||||||
:ref:`configuration-scopes`:
|
|
||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
@@ -23,8 +22,7 @@ you can add it as an entry to ``upstreams.yaml`` at any of the
|
|||||||
install_tree: /path/to/another/spack/opt/spack
|
install_tree: /path/to/another/spack/opt/spack
|
||||||
|
|
||||||
``install_tree`` must point to the ``opt/spack`` directory inside of the
|
``install_tree`` must point to the ``opt/spack`` directory inside of the
|
||||||
Spack base directory, or the location of the ``install_tree`` defined
|
Spack base directory.
|
||||||
in :ref:`config.yaml <config-yaml>`.
|
|
||||||
|
|
||||||
Once the upstream Spack instance has been added, ``spack find`` will
|
Once the upstream Spack instance has been added, ``spack find`` will
|
||||||
automatically check the upstream instance when querying installed packages,
|
automatically check the upstream instance when querying installed packages,
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -48,6 +48,9 @@
|
|||||||
os.environ["COLIFY_SIZE"] = "25x120"
|
os.environ["COLIFY_SIZE"] = "25x120"
|
||||||
os.environ["COLUMNS"] = "120"
|
os.environ["COLUMNS"] = "120"
|
||||||
|
|
||||||
|
# Generate full package list if needed
|
||||||
|
subprocess.call(["spack", "list", "--format=html", "--update=package_list.html"])
|
||||||
|
|
||||||
# Generate a command index if an update is needed
|
# Generate a command index if an update is needed
|
||||||
subprocess.call(
|
subprocess.call(
|
||||||
[
|
[
|
||||||
@@ -86,7 +89,6 @@
|
|||||||
# Enable todo items
|
# Enable todo items
|
||||||
todo_include_todos = True
|
todo_include_todos = True
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Disable duplicate cross-reference warnings.
|
# Disable duplicate cross-reference warnings.
|
||||||
#
|
#
|
||||||
@@ -94,7 +96,9 @@ class PatchedPythonDomain(PythonDomain):
|
|||||||
def resolve_xref(self, env, fromdocname, builder, typ, target, node, contnode):
|
def resolve_xref(self, env, fromdocname, builder, typ, target, node, contnode):
|
||||||
if "refspecific" in node:
|
if "refspecific" in node:
|
||||||
del node["refspecific"]
|
del node["refspecific"]
|
||||||
return super().resolve_xref(env, fromdocname, builder, typ, target, node, contnode)
|
return super(PatchedPythonDomain, self).resolve_xref(
|
||||||
|
env, fromdocname, builder, typ, target, node, contnode
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -144,6 +148,7 @@ def setup(sphinx):
|
|||||||
# Get nice vector graphics
|
# Get nice vector graphics
|
||||||
graphviz_output_format = "svg"
|
graphviz_output_format = "svg"
|
||||||
|
|
||||||
|
|
||||||
# Add any paths that contain templates here, relative to this directory.
|
# Add any paths that contain templates here, relative to this directory.
|
||||||
templates_path = ["_templates"]
|
templates_path = ["_templates"]
|
||||||
|
|
||||||
@@ -199,31 +204,18 @@ def setup(sphinx):
|
|||||||
("py:class", "contextlib.contextmanager"),
|
("py:class", "contextlib.contextmanager"),
|
||||||
("py:class", "module"),
|
("py:class", "module"),
|
||||||
("py:class", "_io.BufferedReader"),
|
("py:class", "_io.BufferedReader"),
|
||||||
("py:class", "_io.BytesIO"),
|
|
||||||
("py:class", "unittest.case.TestCase"),
|
("py:class", "unittest.case.TestCase"),
|
||||||
("py:class", "_frozen_importlib_external.SourceFileLoader"),
|
("py:class", "_frozen_importlib_external.SourceFileLoader"),
|
||||||
("py:class", "clingo.Control"),
|
("py:class", "clingo.Control"),
|
||||||
("py:class", "six.moves.urllib.parse.ParseResult"),
|
("py:class", "six.moves.urllib.parse.ParseResult"),
|
||||||
("py:class", "TextIO"),
|
("py:class", "TextIO"),
|
||||||
("py:class", "hashlib._Hash"),
|
|
||||||
("py:class", "concurrent.futures._base.Executor"),
|
|
||||||
# Spack classes that are private and we don't want to expose
|
# Spack classes that are private and we don't want to expose
|
||||||
("py:class", "spack.provider_index._IndexBase"),
|
("py:class", "spack.provider_index._IndexBase"),
|
||||||
("py:class", "spack.repo._PrependFileLoader"),
|
("py:class", "spack.repo._PrependFileLoader"),
|
||||||
("py:class", "spack.build_systems._checks.BaseBuilder"),
|
("py:class", "spack.build_systems._checks.BaseBuilder"),
|
||||||
# Spack classes that intersphinx is unable to resolve
|
# Spack classes that intersphinx is unable to resolve
|
||||||
("py:class", "spack.version.StandardVersion"),
|
("py:class", "spack.version.VersionBase"),
|
||||||
("py:class", "spack.spec.DependencySpec"),
|
("py:class", "spack.spec.DependencySpec"),
|
||||||
("py:class", "spack.spec.ArchSpec"),
|
|
||||||
("py:class", "spack.spec.InstallStatus"),
|
|
||||||
("py:class", "spack.spec.SpecfileReaderBase"),
|
|
||||||
("py:class", "spack.install_test.Pb"),
|
|
||||||
("py:class", "spack.filesystem_view.SimpleFilesystemView"),
|
|
||||||
("py:class", "spack.traverse.EdgeAndDepth"),
|
|
||||||
("py:class", "archspec.cpu.microarchitecture.Microarchitecture"),
|
|
||||||
("py:class", "spack.compiler.CompilerCache"),
|
|
||||||
# TypeVar that is not handled correctly
|
|
||||||
("py:class", "llnl.util.lang.T"),
|
|
||||||
]
|
]
|
||||||
|
|
||||||
# The reST default role (used for this markup: `text`) to use for all documents.
|
# The reST default role (used for this markup: `text`) to use for all documents.
|
||||||
@@ -239,8 +231,30 @@ def setup(sphinx):
|
|||||||
# If true, sectionauthor and moduleauthor directives will be shown in the
|
# If true, sectionauthor and moduleauthor directives will be shown in the
|
||||||
# output. They are ignored by default.
|
# output. They are ignored by default.
|
||||||
# show_authors = False
|
# show_authors = False
|
||||||
sys.path.append("./_pygments")
|
|
||||||
pygments_style = "style.SpackStyle"
|
# The name of the Pygments (syntax highlighting) style to use.
|
||||||
|
# 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
|
||||||
|
|
||||||
|
|
||||||
|
class SpackStyle(DefaultStyle):
|
||||||
|
styles = DefaultStyle.styles.copy()
|
||||||
|
background_color = "#f4f4f8"
|
||||||
|
styles[Generic.Output] = "#355"
|
||||||
|
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)
|
||||||
|
dist._ep_map = {"pygments.styles": {"plugin1": ep}}
|
||||||
|
pkg_resources.working_set.add(dist)
|
||||||
|
|
||||||
|
pygments_style = "spack"
|
||||||
|
|
||||||
# A list of ignored prefixes for module index sorting.
|
# A list of ignored prefixes for module index sorting.
|
||||||
# modindex_common_prefix = []
|
# modindex_common_prefix = []
|
||||||
@@ -325,20 +339,23 @@ def setup(sphinx):
|
|||||||
# Output file base name for HTML help builder.
|
# Output file base name for HTML help builder.
|
||||||
htmlhelp_basename = "Spackdoc"
|
htmlhelp_basename = "Spackdoc"
|
||||||
|
|
||||||
|
|
||||||
# -- Options for LaTeX output --------------------------------------------------
|
# -- Options for LaTeX output --------------------------------------------------
|
||||||
|
|
||||||
latex_elements = {
|
latex_elements = {
|
||||||
# The paper size ('letterpaper' or 'a4paper').
|
# The paper size ('letterpaper' or 'a4paper').
|
||||||
# 'papersize': 'letterpaper',
|
#'papersize': 'letterpaper',
|
||||||
# The font size ('10pt', '11pt' or '12pt').
|
# The font size ('10pt', '11pt' or '12pt').
|
||||||
# 'pointsize': '10pt',
|
#'pointsize': '10pt',
|
||||||
# Additional stuff for the LaTeX preamble.
|
# Additional stuff for the LaTeX preamble.
|
||||||
# 'preamble': '',
|
#'preamble': '',
|
||||||
}
|
}
|
||||||
|
|
||||||
# Grouping the document tree into LaTeX files. List of tuples
|
# Grouping the document tree into LaTeX files. List of tuples
|
||||||
# (source start file, target name, title, author, documentclass [howto/manual]).
|
# (source start file, target name, title, author, documentclass [howto/manual]).
|
||||||
latex_documents = [("index", "Spack.tex", "Spack Documentation", "Todd Gamblin", "manual")]
|
latex_documents = [
|
||||||
|
("index", "Spack.tex", "Spack Documentation", "Todd Gamblin", "manual"),
|
||||||
|
]
|
||||||
|
|
||||||
# The name of an image file (relative to this directory) to place at the top of
|
# The name of an image file (relative to this directory) to place at the top of
|
||||||
# the title page.
|
# the title page.
|
||||||
@@ -385,7 +402,7 @@ def setup(sphinx):
|
|||||||
"Spack",
|
"Spack",
|
||||||
"One line description of project.",
|
"One line description of project.",
|
||||||
"Miscellaneous",
|
"Miscellaneous",
|
||||||
)
|
),
|
||||||
]
|
]
|
||||||
|
|
||||||
# Documents to append as an appendix to all manuals.
|
# Documents to append as an appendix to all manuals.
|
||||||
@@ -401,4 +418,6 @@ def setup(sphinx):
|
|||||||
# -- Extension configuration -------------------------------------------------
|
# -- Extension configuration -------------------------------------------------
|
||||||
|
|
||||||
# sphinx.ext.intersphinx
|
# sphinx.ext.intersphinx
|
||||||
intersphinx_mapping = {"python": ("https://docs.python.org/3", None)}
|
intersphinx_mapping = {
|
||||||
|
"python": ("https://docs.python.org/3", None),
|
||||||
|
}
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -145,25 +145,6 @@ hosts when making ``ssl`` connections. Set to ``false`` to disable, and
|
|||||||
tools like ``curl`` will use their ``--insecure`` options. Disabling
|
tools like ``curl`` will use their ``--insecure`` options. Disabling
|
||||||
this can expose you to attacks. Use at your own risk.
|
this can expose you to attacks. Use at your own risk.
|
||||||
|
|
||||||
--------------------
|
|
||||||
``ssl_certs``
|
|
||||||
--------------------
|
|
||||||
|
|
||||||
Path to custom certificats for SSL verification. The value can be a
|
|
||||||
filesytem path, or an environment variable that expands to an absolute file path.
|
|
||||||
The default value is set to the environment variable ``SSL_CERT_FILE``
|
|
||||||
to use the same syntax used by many other applications that automatically
|
|
||||||
detect custom certificates.
|
|
||||||
When ``url_fetch_method:curl`` the ``config:ssl_certs`` should resolve to
|
|
||||||
a single file. Spack will then set the environment variable ``CURL_CA_BUNDLE``
|
|
||||||
in the subprocess calling ``curl``.
|
|
||||||
If ``url_fetch_method:urllib`` then files and directories are supported i.e.
|
|
||||||
``config:ssl_certs:$SSL_CERT_FILE`` or ``config:ssl_certs:$SSL_CERT_DIR``
|
|
||||||
will work.
|
|
||||||
In all cases the expanded path must be absolute for Spack to use the certificates.
|
|
||||||
Certificates relative to an environment can be created by prepending the path variable
|
|
||||||
with the Spack configuration variable``$env``.
|
|
||||||
|
|
||||||
--------------------
|
--------------------
|
||||||
``checksum``
|
``checksum``
|
||||||
--------------------
|
--------------------
|
||||||
@@ -241,7 +222,7 @@ and location. (See the *Configuration settings* section of ``man
|
|||||||
ccache`` to learn more about the default settings and how to change
|
ccache`` to learn more about the default settings and how to change
|
||||||
them). Please note that we currently disable ccache's ``hash_dir``
|
them). Please note that we currently disable ccache's ``hash_dir``
|
||||||
feature to avoid an issue with the stage directory (see
|
feature to avoid an issue with the stage directory (see
|
||||||
https://github.com/spack/spack/pull/3761#issuecomment-294352232).
|
https://github.com/LLNL/spack/pull/3761#issuecomment-294352232).
|
||||||
|
|
||||||
-----------------------
|
-----------------------
|
||||||
``shared_linking:type``
|
``shared_linking:type``
|
||||||
@@ -311,29 +292,14 @@ It is also worth noting that:
|
|||||||
non_bindable_shared_objects = ["libinterface.so"]
|
non_bindable_shared_objects = ["libinterface.so"]
|
||||||
|
|
||||||
----------------------
|
----------------------
|
||||||
``install_status``
|
``terminal_title``
|
||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
When set to ``true``, Spack will show information about its current progress
|
By setting this option to ``true``, Spack will update the terminal's title to
|
||||||
as well as the current and total package numbers. Progress is shown both
|
provide information about its current progress as well as the current and
|
||||||
in the terminal title and inline. Setting it to ``false`` will not show any
|
total package numbers.
|
||||||
progress information.
|
|
||||||
|
|
||||||
To work properly, this requires your terminal to reset its title after
|
To work properly, this requires your terminal to reset its title after
|
||||||
Spack has finished its work, otherwise Spack's status information will
|
Spack has finished its work, otherwise Spack's status information will
|
||||||
remain in the terminal's title indefinitely. Most terminals should already
|
remain in the terminal's title indefinitely. Most terminals should already
|
||||||
be set up this way and clear Spack's status information.
|
be set up this way and clear Spack's status information.
|
||||||
|
|
||||||
-----------
|
|
||||||
``aliases``
|
|
||||||
-----------
|
|
||||||
|
|
||||||
Aliases can be used to define new Spack commands. They can be either shortcuts
|
|
||||||
for longer commands or include specific arguments for convenience. For instance,
|
|
||||||
if users want to use ``spack install``'s ``-v`` argument all the time, they can
|
|
||||||
create a new alias called ``inst`` that will always call ``install -v``:
|
|
||||||
|
|
||||||
.. code-block:: yaml
|
|
||||||
|
|
||||||
aliases:
|
|
||||||
inst: install -v
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -17,12 +17,11 @@ case you want to skip directly to specific docs:
|
|||||||
* :ref:`config.yaml <config-yaml>`
|
* :ref:`config.yaml <config-yaml>`
|
||||||
* :ref:`mirrors.yaml <mirrors>`
|
* :ref:`mirrors.yaml <mirrors>`
|
||||||
* :ref:`modules.yaml <modules>`
|
* :ref:`modules.yaml <modules>`
|
||||||
* :ref:`packages.yaml <packages-config>`
|
* :ref:`packages.yaml <build-settings>`
|
||||||
* :ref:`repos.yaml <repositories>`
|
* :ref:`repos.yaml <repositories>`
|
||||||
|
|
||||||
You can also add any of these as inline configuration in the YAML
|
You can also add any of these as inline configuration in ``spack.yaml``
|
||||||
manifest file (``spack.yaml``) describing an :ref:`environment
|
in an :ref:`environment <environment-configuration>`.
|
||||||
<environment-configuration>`.
|
|
||||||
|
|
||||||
-----------
|
-----------
|
||||||
YAML Format
|
YAML Format
|
||||||
@@ -73,12 +72,9 @@ are six configuration scopes. From lowest to highest:
|
|||||||
Spack instance per project) or for site-wide settings on a multi-user
|
Spack instance per project) or for site-wide settings on a multi-user
|
||||||
machine (e.g., for a common Spack instance).
|
machine (e.g., for a common Spack instance).
|
||||||
|
|
||||||
#. **plugin**: Read from a Python project's entry points. Settings here affect
|
|
||||||
all instances of Spack running with the same Python installation. This scope takes higher precedence than site, system, and default scopes.
|
|
||||||
|
|
||||||
#. **user**: Stored in the home directory: ``~/.spack/``. These settings
|
#. **user**: Stored in the home directory: ``~/.spack/``. These settings
|
||||||
affect all instances of Spack and take higher precedence than site,
|
affect all instances of Spack and take higher precedence than site,
|
||||||
system, plugin, or defaults scopes.
|
system, or defaults scopes.
|
||||||
|
|
||||||
#. **custom**: Stored in a custom directory specified by ``--config-scope``.
|
#. **custom**: Stored in a custom directory specified by ``--config-scope``.
|
||||||
If multiple scopes are listed on the command line, they are ordered
|
If multiple scopes are listed on the command line, they are ordered
|
||||||
@@ -199,45 +195,6 @@ with MPICH. You can create different configuration scopes for use with
|
|||||||
mpi: [mpich]
|
mpi: [mpich]
|
||||||
|
|
||||||
|
|
||||||
.. _plugin-scopes:
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^
|
|
||||||
Plugin scopes
|
|
||||||
^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
.. note::
|
|
||||||
Python version >= 3.8 is required to enable plugin configuration.
|
|
||||||
|
|
||||||
Spack can be made aware of configuration scopes that are installed as part of a python package. To do so, register a function that returns the scope's path to the ``"spack.config"`` entry point. Consider the Python package ``my_package`` that includes Spack configurations:
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
my-package/
|
|
||||||
├── src
|
|
||||||
│ ├── my_package
|
|
||||||
│ │ ├── __init__.py
|
|
||||||
│ │ └── spack/
|
|
||||||
│ │ │ └── config.yaml
|
|
||||||
└── pyproject.toml
|
|
||||||
|
|
||||||
adding the following to ``my_package``'s ``pyproject.toml`` will make ``my_package``'s ``spack/`` configurations visible to Spack when ``my_package`` is installed:
|
|
||||||
|
|
||||||
.. code-block:: toml
|
|
||||||
|
|
||||||
[project.entry_points."spack.config"]
|
|
||||||
my_package = "my_package:get_config_path"
|
|
||||||
|
|
||||||
The function ``my_package.get_extension_path`` in ``my_package/__init__.py`` might look like
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
import importlib.resources
|
|
||||||
|
|
||||||
def get_config_path():
|
|
||||||
dirname = importlib.resources.files("my_package").joinpath("spack")
|
|
||||||
if dirname.exists():
|
|
||||||
return str(dirname)
|
|
||||||
|
|
||||||
.. _platform-scopes:
|
.. _platform-scopes:
|
||||||
|
|
||||||
------------------------
|
------------------------
|
||||||
@@ -270,9 +227,6 @@ You can get the name to use for ``<platform>`` by running ``spack arch
|
|||||||
--platform``. The system config scope has a ``<platform>`` section for
|
--platform``. The system config scope has a ``<platform>`` section for
|
||||||
sites at which ``/etc`` is mounted on multiple heterogeneous machines.
|
sites at which ``/etc`` is mounted on multiple heterogeneous machines.
|
||||||
|
|
||||||
|
|
||||||
.. _config-scope-precedence:
|
|
||||||
|
|
||||||
----------------
|
----------------
|
||||||
Scope Precedence
|
Scope Precedence
|
||||||
----------------
|
----------------
|
||||||
@@ -281,17 +235,10 @@ When spack queries for configuration parameters, it searches in
|
|||||||
higher-precedence scopes first. So, settings in a higher-precedence file
|
higher-precedence scopes first. So, settings in a higher-precedence file
|
||||||
can override those with the same key in a lower-precedence one. For
|
can override those with the same key in a lower-precedence one. For
|
||||||
list-valued settings, Spack *prepends* higher-precedence settings to
|
list-valued settings, Spack *prepends* higher-precedence settings to
|
||||||
lower-precedence settings. Completely ignoring lower-precedence configuration
|
lower-precedence settings. Completely ignoring higher-level configuration
|
||||||
options is supported with the ``::`` notation for keys (see
|
options is supported with the ``::`` notation for keys (see
|
||||||
:ref:`config-overrides` below).
|
:ref:`config-overrides` below).
|
||||||
|
|
||||||
There are also special notations for string concatenation and precendense override:
|
|
||||||
|
|
||||||
* ``+:`` will force *prepending* strings or lists. For lists, this is the default behavior.
|
|
||||||
* ``-:`` works similarly, but for *appending* values.
|
|
||||||
|
|
||||||
:ref:`config-prepend-append`
|
|
||||||
|
|
||||||
^^^^^^^^^^^
|
^^^^^^^^^^^
|
||||||
Simple keys
|
Simple keys
|
||||||
^^^^^^^^^^^
|
^^^^^^^^^^^
|
||||||
@@ -332,47 +279,6 @@ command:
|
|||||||
- ~/.spack/stage
|
- ~/.spack/stage
|
||||||
|
|
||||||
|
|
||||||
.. _config-prepend-append:
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^
|
|
||||||
String Concatenation
|
|
||||||
^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
Above, the user ``config.yaml`` *completely* overrides specific settings in the
|
|
||||||
default ``config.yaml``. Sometimes, it is useful to add a suffix/prefix
|
|
||||||
to a path or name. To do this, you can use the ``-:`` notation for *append*
|
|
||||||
string concatenation at the end of a key in a configuration file. For example:
|
|
||||||
|
|
||||||
.. code-block:: yaml
|
|
||||||
:emphasize-lines: 1
|
|
||||||
:caption: ~/.spack/config.yaml
|
|
||||||
|
|
||||||
config:
|
|
||||||
install_tree-: /my/custom/suffix/
|
|
||||||
|
|
||||||
Spack will then append to the lower-precedence configuration under the
|
|
||||||
``install_tree-:`` section:
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ spack config get config
|
|
||||||
config:
|
|
||||||
install_tree: /some/other/directory/my/custom/suffix
|
|
||||||
build_stage:
|
|
||||||
- $tempdir/$user/spack-stage
|
|
||||||
- ~/.spack/stage
|
|
||||||
|
|
||||||
|
|
||||||
Similarly, ``+:`` can be used to *prepend* to a path or name:
|
|
||||||
|
|
||||||
.. code-block:: yaml
|
|
||||||
:emphasize-lines: 1
|
|
||||||
:caption: ~/.spack/config.yaml
|
|
||||||
|
|
||||||
config:
|
|
||||||
install_tree+: /my/custom/suffix/
|
|
||||||
|
|
||||||
|
|
||||||
.. _config-overrides:
|
.. _config-overrides:
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
@@ -511,7 +417,6 @@ Spack understands over a dozen special variables. These are:
|
|||||||
* ``$target_family``. The target family for the current host, as
|
* ``$target_family``. The target family for the current host, as
|
||||||
detected by ArchSpec. E.g. ``x86_64`` or ``aarch64``.
|
detected by ArchSpec. E.g. ``x86_64`` or ``aarch64``.
|
||||||
* ``$date``: the current date in the format YYYY-MM-DD
|
* ``$date``: the current date in the format YYYY-MM-DD
|
||||||
* ``$spack_short_version``: the Spack version truncated to the first components.
|
|
||||||
|
|
||||||
|
|
||||||
Note that, as with shell variables, you can write these as ``$varname``
|
Note that, as with shell variables, you can write these as ``$varname``
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -9,96 +9,24 @@
|
|||||||
Container Images
|
Container Images
|
||||||
================
|
================
|
||||||
|
|
||||||
Spack :ref:`environments` can easily be turned into container images. This page
|
Spack :ref:`environments` are a great tool to create container images, but
|
||||||
outlines two ways in which this can be done:
|
preparing one that is suitable for production requires some more boilerplate
|
||||||
|
than just:
|
||||||
1. By installing the environment on the host system, and copying the installations
|
|
||||||
into the container image. This approach does not require any tools like Docker
|
|
||||||
or Singularity to be installed.
|
|
||||||
2. By generating a Docker or Singularity recipe that can be used to build the
|
|
||||||
container image. In this approach, Spack builds the software inside the
|
|
||||||
container runtime, not on the host system.
|
|
||||||
|
|
||||||
The first approach is easiest if you already have an installed environment,
|
|
||||||
the second approach gives more control over the container image.
|
|
||||||
|
|
||||||
---------------------------
|
|
||||||
From existing installations
|
|
||||||
---------------------------
|
|
||||||
|
|
||||||
If you already have a Spack environment installed on your system, you can
|
|
||||||
share the binaries as an OCI compatible container image. To get started you
|
|
||||||
just have to configure and OCI registry and run ``spack buildcache push``.
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
# Create and install an environment in the current directory
|
|
||||||
spack env create -d .
|
|
||||||
spack -e . add pkg-a pkg-b
|
|
||||||
spack -e . install
|
|
||||||
|
|
||||||
# Configure the registry
|
|
||||||
spack -e . mirror add --oci-username ... --oci-password ... container-registry oci://example.com/name/image
|
|
||||||
|
|
||||||
# Push the image
|
|
||||||
spack -e . buildcache push --update-index --base-image ubuntu:22.04 --tag my_env container-registry
|
|
||||||
|
|
||||||
The resulting container image can then be run as follows:
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ docker run -it example.com/name/image:my_env
|
|
||||||
|
|
||||||
The image generated by Spack consists of the specified base image with each package from the
|
|
||||||
environment as a separate layer on top. The image is minimal by construction, it only contains the
|
|
||||||
environment roots and its runtime dependencies.
|
|
||||||
|
|
||||||
.. note::
|
|
||||||
|
|
||||||
When using registries like GHCR and Docker Hub, the ``--oci-password`` flag is not
|
|
||||||
the password for your account, but a personal access token you need to generate separately.
|
|
||||||
|
|
||||||
The specified ``--base-image`` should have a libc that is compatible with the host system.
|
|
||||||
For example if your host system is Ubuntu 20.04, you can use ``ubuntu:20.04``, ``ubuntu:22.04``
|
|
||||||
or newer: the libc in the container image must be at least the version of the host system,
|
|
||||||
assuming ABI compatibility. It is also perfectly fine to use a completely different
|
|
||||||
Linux distribution as long as the libc is compatible.
|
|
||||||
|
|
||||||
For convenience, Spack also turns the OCI registry into a :ref:`build cache <binary_caches_oci>`,
|
|
||||||
so that future ``spack install`` of the environment will simply pull the binaries from the
|
|
||||||
registry instead of doing source builds. The flag ``--update-index`` is needed to make Spack
|
|
||||||
take the build cache into account when concretizing.
|
|
||||||
|
|
||||||
.. note::
|
|
||||||
|
|
||||||
When generating container images in CI, the approach above is recommended when CI jobs
|
|
||||||
already run in a sandboxed environment. You can simply use ``spack`` directly
|
|
||||||
in the CI job and push the resulting image to a registry. Subsequent CI jobs should
|
|
||||||
run faster because Spack can install from the same registry instead of rebuilding from
|
|
||||||
sources.
|
|
||||||
|
|
||||||
---------------------------------------------
|
|
||||||
Generating recipes for Docker and Singularity
|
|
||||||
---------------------------------------------
|
|
||||||
|
|
||||||
Apart from copying existing installations into container images, Spack can also
|
|
||||||
generate recipes for container images. This is useful if you want to run Spack
|
|
||||||
itself in a sandboxed environment instead of on the host system.
|
|
||||||
|
|
||||||
Since recipes need a little bit more boilerplate than
|
|
||||||
|
|
||||||
.. code-block:: docker
|
.. code-block:: docker
|
||||||
|
|
||||||
COPY spack.yaml /environment
|
COPY spack.yaml /environment
|
||||||
RUN spack -e /environment install
|
RUN spack -e /environment install
|
||||||
|
|
||||||
Spack provides a command to generate customizable recipes for container images. Customizations
|
Additional actions may be needed to minimize the size of the
|
||||||
include minimizing the size of the image, installing packages in the base image using the system
|
container, or to update the system software that is installed in the base
|
||||||
package manager, and setting up a proper entrypoint to run the image.
|
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
|
A Quick Introduction
|
||||||
~~~~~~~~~~~~~~~~~~~~
|
--------------------
|
||||||
|
|
||||||
Consider having a Spack environment like the following:
|
Consider having a Spack environment like the following:
|
||||||
|
|
||||||
@@ -109,8 +37,8 @@ Consider having a Spack environment like the following:
|
|||||||
- gromacs+mpi
|
- gromacs+mpi
|
||||||
- mpich
|
- mpich
|
||||||
|
|
||||||
Producing a ``Dockerfile`` from it is as simple as changing directories to
|
Producing a ``Dockerfile`` from it is as simple as moving to the directory
|
||||||
where the ``spack.yaml`` file is stored and running the following command:
|
where the ``spack.yaml`` file is stored and giving the following command:
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
@@ -176,9 +104,9 @@ configuration are discussed in details in the sections below.
|
|||||||
|
|
||||||
.. _container_spack_images:
|
.. _container_spack_images:
|
||||||
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
--------------------------
|
||||||
Spack Images on Docker Hub
|
Spack Images on Docker Hub
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
--------------------------
|
||||||
|
|
||||||
Docker images with Spack preinstalled and ready to be used are
|
Docker images with Spack preinstalled and ready to be used are
|
||||||
built when a release is tagged, or nightly on ``develop``. The images
|
built when a release is tagged, or nightly on ``develop``. The images
|
||||||
@@ -194,44 +122,27 @@ The OS that are currently supported are summarized in the table below:
|
|||||||
* - Operating System
|
* - Operating System
|
||||||
- Base Image
|
- Base Image
|
||||||
- Spack Image
|
- Spack Image
|
||||||
|
* - Ubuntu 18.04
|
||||||
|
- ``ubuntu:18.04``
|
||||||
|
- ``spack/ubuntu-bionic``
|
||||||
* - Ubuntu 20.04
|
* - Ubuntu 20.04
|
||||||
- ``ubuntu:20.04``
|
- ``ubuntu:20.04``
|
||||||
- ``spack/ubuntu-focal``
|
- ``spack/ubuntu-focal``
|
||||||
* - Ubuntu 22.04
|
* - Ubuntu 22.04
|
||||||
- ``ubuntu:22.04``
|
- ``ubuntu:22.04``
|
||||||
- ``spack/ubuntu-jammy``
|
- ``spack/ubuntu-jammy``
|
||||||
* - Ubuntu 24.04
|
* - CentOS 7
|
||||||
- ``ubuntu:24.04``
|
- ``centos:7``
|
||||||
- ``spack/ubuntu-noble``
|
- ``spack/centos7``
|
||||||
* - CentOS Stream9
|
* - CentOS Stream
|
||||||
- ``quay.io/centos/centos:stream9``
|
- ``quay.io/centos/centos:stream``
|
||||||
- ``spack/centos-stream9``
|
- ``spack/centos-stream``
|
||||||
* - openSUSE Leap
|
* - openSUSE Leap
|
||||||
- ``opensuse/leap``
|
- ``opensuse/leap``
|
||||||
- ``spack/leap15``
|
- ``spack/leap15``
|
||||||
* - Amazon Linux 2
|
* - Amazon Linux 2
|
||||||
- ``amazonlinux:2``
|
- ``amazonlinux:2``
|
||||||
- ``spack/amazon-linux``
|
- ``spack/amazon-linux``
|
||||||
* - AlmaLinux 8
|
|
||||||
- ``almalinux:8``
|
|
||||||
- ``spack/almalinux8``
|
|
||||||
* - AlmaLinux 9
|
|
||||||
- ``almalinux:9``
|
|
||||||
- ``spack/almalinux9``
|
|
||||||
* - Rocky Linux 8
|
|
||||||
- ``rockylinux:8``
|
|
||||||
- ``spack/rockylinux8``
|
|
||||||
* - Rocky Linux 9
|
|
||||||
- ``rockylinux:9``
|
|
||||||
- ``spack/rockylinux9``
|
|
||||||
* - Fedora Linux 39
|
|
||||||
- ``fedora:39``
|
|
||||||
- ``spack/fedora39``
|
|
||||||
* - Fedora Linux 40
|
|
||||||
- ``fedora:40``
|
|
||||||
- ``spack/fedora40``
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
All the images are tagged with the corresponding release of Spack:
|
All the images are tagged with the corresponding release of Spack:
|
||||||
|
|
||||||
@@ -245,9 +156,9 @@ by Spack use them as default base images for their ``build`` stage,
|
|||||||
even though handles to use custom base images provided by users are
|
even though handles to use custom base images provided by users are
|
||||||
available to accommodate complex use cases.
|
available to accommodate complex use cases.
|
||||||
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
---------------------------------
|
||||||
Configuring the Container Recipe
|
Creating Images From Environments
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
---------------------------------
|
||||||
|
|
||||||
Any Spack Environment can be used for the automatic generation of container
|
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
|
recipes. Sensible defaults are provided for things like the base image or the
|
||||||
@@ -281,25 +192,31 @@ under the ``container`` attribute of environments:
|
|||||||
final:
|
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
|
||||||
|
|
||||||
# Labels for the image
|
# Labels for the image
|
||||||
labels:
|
labels:
|
||||||
app: "gromacs"
|
app: "gromacs"
|
||||||
mpi: "mpich"
|
mpi: "mpich"
|
||||||
|
|
||||||
A detailed description of the options available can be found in the :ref:`container_config_options` section.
|
A detailed description of the options available can be found in the
|
||||||
|
:ref:`container_config_options` section.
|
||||||
|
|
||||||
~~~~~~~~~~~~~~~~~~~
|
-------------------
|
||||||
Setting Base Images
|
Setting Base Images
|
||||||
~~~~~~~~~~~~~~~~~~~
|
-------------------
|
||||||
|
|
||||||
The ``images`` subsection is used to select both the image where
|
The ``images`` subsection is used to select both the image where
|
||||||
Spack builds the software and the image where the built software
|
Spack builds the software and the image where the built software
|
||||||
is installed. This attribute can be set in different ways and
|
is installed. This attribute can be set in different ways and
|
||||||
which one to use depends on the use case at hand.
|
which one to use depends on the use case at hand.
|
||||||
|
|
||||||
""""""""""""""""""""""""""""""""""""""""
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
Use Official Spack Images From Dockerhub
|
Use Official Spack Images From Dockerhub
|
||||||
""""""""""""""""""""""""""""""""""""""""
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
To generate a recipe that uses an official Docker image from the
|
To generate a recipe that uses an official Docker image from the
|
||||||
Spack organization to build the software and the corresponding official OS image
|
Spack organization to build the software and the corresponding official OS image
|
||||||
@@ -504,9 +421,9 @@ responsibility to ensure that:
|
|||||||
Therefore we don't recommend its use in cases that can be otherwise
|
Therefore we don't recommend its use in cases that can be otherwise
|
||||||
covered by the simplified mode shown first.
|
covered by the simplified mode shown first.
|
||||||
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
----------------------------
|
||||||
Singularity Definition Files
|
Singularity Definition Files
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
----------------------------
|
||||||
|
|
||||||
In addition to producing recipes in ``Dockerfile`` format Spack can produce
|
In addition to producing recipes in ``Dockerfile`` format Spack can produce
|
||||||
Singularity Definition Files by just changing the value of the ``format``
|
Singularity Definition Files by just changing the value of the ``format``
|
||||||
@@ -527,132 +444,11 @@ attribute:
|
|||||||
The minimum version of Singularity required to build a SIF (Singularity Image Format)
|
The minimum version of Singularity required to build a SIF (Singularity Image Format)
|
||||||
image from the recipes generated by Spack is ``3.5.3``.
|
image from the recipes generated by Spack is ``3.5.3``.
|
||||||
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
Extending the Jinja2 Templates
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
The Dockerfile and the Singularity definition file that Spack can generate are based on
|
|
||||||
a few Jinja2 templates that are rendered according to the environment being containerized.
|
|
||||||
Even though Spack allows a great deal of customization by just setting appropriate values for
|
|
||||||
the configuration options, sometimes that is not enough.
|
|
||||||
|
|
||||||
In those cases, a user can directly extend the template that Spack uses to render the image
|
|
||||||
to e.g. set additional environment variables or perform specific operations either before or
|
|
||||||
after a given stage of the build. Let's consider as an example the following structure:
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ tree /opt/environment
|
|
||||||
/opt/environment
|
|
||||||
├── data
|
|
||||||
│ └── data.csv
|
|
||||||
├── spack.yaml
|
|
||||||
├── data
|
|
||||||
└── templates
|
|
||||||
└── container
|
|
||||||
└── CustomDockerfile
|
|
||||||
|
|
||||||
containing both the custom template extension and the environment manifest file. To use a custom
|
|
||||||
template, the environment must register the directory containing it, and declare its use under the
|
|
||||||
``container`` configuration:
|
|
||||||
|
|
||||||
.. code-block:: yaml
|
|
||||||
:emphasize-lines: 7-8,12
|
|
||||||
|
|
||||||
spack:
|
|
||||||
specs:
|
|
||||||
- hdf5~mpi
|
|
||||||
concretizer:
|
|
||||||
unify: true
|
|
||||||
config:
|
|
||||||
template_dirs:
|
|
||||||
- /opt/environment/templates
|
|
||||||
container:
|
|
||||||
format: docker
|
|
||||||
depfile: true
|
|
||||||
template: container/CustomDockerfile
|
|
||||||
|
|
||||||
The template extension can override two blocks, named ``build_stage`` and ``final_stage``, similarly to
|
|
||||||
the example below:
|
|
||||||
|
|
||||||
.. code-block::
|
|
||||||
:emphasize-lines: 3,8
|
|
||||||
|
|
||||||
{% extends "container/Dockerfile" %}
|
|
||||||
{% block build_stage %}
|
|
||||||
RUN echo "Start building"
|
|
||||||
{{ super() }}
|
|
||||||
{% endblock %}
|
|
||||||
{% block final_stage %}
|
|
||||||
{{ super() }}
|
|
||||||
COPY data /share/myapp/data
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
The Dockerfile is generated by running:
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ spack -e /opt/environment containerize
|
|
||||||
|
|
||||||
Note that the environment must be active for spack to read the template.
|
|
||||||
The recipe that gets generated contains the two extra instruction that we added in our template extension:
|
|
||||||
|
|
||||||
.. code-block:: Dockerfile
|
|
||||||
:emphasize-lines: 4,43
|
|
||||||
|
|
||||||
# Build stage with Spack pre-installed and ready to be used
|
|
||||||
FROM spack/ubuntu-jammy:latest as builder
|
|
||||||
|
|
||||||
RUN echo "Start building"
|
|
||||||
|
|
||||||
# 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 " - hdf5~mpi" \
|
|
||||||
&& echo " concretizer:" \
|
|
||||||
&& echo " unify: true" \
|
|
||||||
&& echo " config:" \
|
|
||||||
&& echo " template_dirs:" \
|
|
||||||
&& echo " - /tmp/environment/templates" \
|
|
||||||
&& 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 concretize && spack env depfile -o Makefile && make -j $(nproc) && 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 ubuntu:22.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 /opt/view /opt/view
|
|
||||||
COPY --from=builder /etc/profile.d/z10_spack_environment.sh /etc/profile.d/z10_spack_environment.sh
|
|
||||||
|
|
||||||
COPY data /share/myapp/data
|
|
||||||
|
|
||||||
ENTRYPOINT ["/bin/bash", "--rcfile", "/etc/profile", "-l", "-c", "$*", "--" ]
|
|
||||||
CMD [ "/bin/bash" ]
|
|
||||||
|
|
||||||
|
|
||||||
.. _container_config_options:
|
.. _container_config_options:
|
||||||
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~
|
-----------------------
|
||||||
Configuration Reference
|
Configuration Reference
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~
|
-----------------------
|
||||||
|
|
||||||
The tables below describe all the configuration options that are currently supported
|
The tables below describe all the configuration options that are currently supported
|
||||||
to customize the generation of container recipes:
|
to customize the generation of container recipes:
|
||||||
@@ -668,10 +464,6 @@ to customize the generation of container recipes:
|
|||||||
- The format of the recipe
|
- The format of the recipe
|
||||||
- ``docker`` or ``singularity``
|
- ``docker`` or ``singularity``
|
||||||
- Yes
|
- Yes
|
||||||
* - ``depfile``
|
|
||||||
- Whether to use a depfile for installation, or not
|
|
||||||
- True or False (default)
|
|
||||||
- No
|
|
||||||
* - ``images:os``
|
* - ``images:os``
|
||||||
- Operating system used as a base for the image
|
- Operating system used as a base for the image
|
||||||
- See :ref:`containers-supported-os`
|
- See :ref:`containers-supported-os`
|
||||||
@@ -706,7 +498,7 @@ to customize the generation of container recipes:
|
|||||||
- No
|
- No
|
||||||
* - ``os_packages:command``
|
* - ``os_packages:command``
|
||||||
- Tool used to manage system packages
|
- Tool used to manage system packages
|
||||||
- ``apt``, ``yum``, ``dnf``, ``dnf_epel``, ``zypper``, ``apk``, ``yum_amazon``
|
- ``apt``, ``yum``
|
||||||
- Only with custom base images
|
- Only with custom base images
|
||||||
* - ``os_packages:update``
|
* - ``os_packages:update``
|
||||||
- Whether or not to update the list of available packages
|
- Whether or not to update the list of available packages
|
||||||
@@ -720,6 +512,14 @@ to customize the generation of container recipes:
|
|||||||
- System packages needed at run-time
|
- System packages needed at run-time
|
||||||
- Valid packages for the current OS
|
- Valid packages for the current OS
|
||||||
- No
|
- No
|
||||||
|
* - ``extra_instructions:build``
|
||||||
|
- Extra instructions (e.g. `RUN`, `COPY`, etc.) at the end of the ``build`` stage
|
||||||
|
- Anything understood by the current ``format``
|
||||||
|
- No
|
||||||
|
* - ``extra_instructions:final``
|
||||||
|
- Extra instructions (e.g. `RUN`, `COPY`, etc.) at the end of the ``final`` stage
|
||||||
|
- Anything understood by the current ``format``
|
||||||
|
- No
|
||||||
* - ``labels``
|
* - ``labels``
|
||||||
- Labels to tag the image
|
- Labels to tag the image
|
||||||
- Pairs of key-value strings
|
- Pairs of key-value strings
|
||||||
@@ -749,13 +549,13 @@ to customize the generation of container recipes:
|
|||||||
- Description string
|
- Description string
|
||||||
- No
|
- No
|
||||||
|
|
||||||
~~~~~~~~~~~~~~
|
--------------
|
||||||
Best Practices
|
Best Practices
|
||||||
~~~~~~~~~~~~~~
|
--------------
|
||||||
|
|
||||||
"""
|
^^^
|
||||||
MPI
|
MPI
|
||||||
"""
|
^^^
|
||||||
Due to the dependency on Fortran for OpenMPI, which is the spack default
|
Due to the dependency on Fortran for OpenMPI, which is the spack default
|
||||||
implementation, consider adding ``gfortran`` to the ``apt-get install`` list.
|
implementation, consider adding ``gfortran`` to the ``apt-get install`` list.
|
||||||
|
|
||||||
@@ -766,9 +566,9 @@ 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*
|
image into Singularity in order to start a program with an *external*
|
||||||
MPI. Otherwise, also add ``openssh-server`` to the ``apt-get install`` list.
|
MPI. Otherwise, also add ``openssh-server`` to the ``apt-get install`` list.
|
||||||
|
|
||||||
""""
|
^^^^
|
||||||
CUDA
|
CUDA
|
||||||
""""
|
^^^^
|
||||||
Starting from CUDA 9.0, Nvidia provides minimal CUDA images based on
|
Starting from CUDA 9.0, Nvidia provides minimal CUDA images based on
|
||||||
Ubuntu. Please see `their instructions <https://hub.docker.com/r/nvidia/cuda/>`_.
|
Ubuntu. Please see `their instructions <https://hub.docker.com/r/nvidia/cuda/>`_.
|
||||||
Avoid double-installing CUDA by adding, e.g.
|
Avoid double-installing CUDA by adding, e.g.
|
||||||
@@ -787,9 +587,9 @@ to your ``spack.yaml``.
|
|||||||
Users will either need ``nvidia-docker`` or e.g. Singularity to *execute*
|
Users will either need ``nvidia-docker`` or e.g. Singularity to *execute*
|
||||||
device kernels.
|
device kernels.
|
||||||
|
|
||||||
"""""""""""""""""""""""""
|
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
Docker on Windows and OSX
|
Docker on Windows and OSX
|
||||||
"""""""""""""""""""""""""
|
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
On Mac OS and Windows, docker runs on a hypervisor that is not allocated much
|
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 by default, and some spack packages may fail to build due to lack of
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -118,7 +118,7 @@ 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 framework, and these types of
|
||||||
arguments are just passed to the ``pytest`` command underneath. See `the
|
arguments are just passed to the ``pytest`` command underneath. See `the
|
||||||
pytest docs
|
pytest docs
|
||||||
<https://doc.pytest.org/en/latest/how-to/usage.html#specifying-which-tests-to-run>`_
|
<http://doc.pytest.org/en/latest/usage.html#specifying-tests-selecting-tests>`_
|
||||||
for more details on test selection syntax.
|
for more details on test selection syntax.
|
||||||
|
|
||||||
``spack unit-test`` has a few special options that can help you
|
``spack unit-test`` has a few special options that can help you
|
||||||
@@ -147,7 +147,7 @@ you want to know about. For example, to see just the tests in
|
|||||||
|
|
||||||
You can also combine any of these options with a ``pytest`` keyword
|
You can also combine any of these options with a ``pytest`` keyword
|
||||||
search. See the `pytest usage docs
|
search. See the `pytest usage docs
|
||||||
<https://doc.pytest.org/en/latest/how-to/usage.html#specifying-which-tests-to-run>`_
|
<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"
|
for more details on test selection syntax. For example, to see the names of all tests that have "spec"
|
||||||
or "concretize" somewhere in their names:
|
or "concretize" somewhere in their names:
|
||||||
|
|
||||||
@@ -184,7 +184,7 @@ Style Tests
|
|||||||
|
|
||||||
Spack uses `Flake8 <http://flake8.pycqa.org/en/latest/>`_ to test for
|
Spack uses `Flake8 <http://flake8.pycqa.org/en/latest/>`_ to test for
|
||||||
`PEP 8 <https://www.python.org/dev/peps/pep-0008/>`_ conformance and
|
`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
|
`mypy <https://mypy.readthedocs.io/en/stable/>` for type checking. PEP 8 is
|
||||||
a series of style guides for Python that provide suggestions for everything
|
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
|
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
|
were mostly style changes, we decided to enforce PEP 8 conformance. Your PR
|
||||||
@@ -310,220 +310,53 @@ Once all of the dependencies are installed, you can try building the documentati
|
|||||||
$ make clean
|
$ make clean
|
||||||
$ make
|
$ make
|
||||||
|
|
||||||
If you see any warning or error messages, you will have to correct those before your PR
|
If you see any warning or error messages, you will have to correct those before
|
||||||
is accepted. If you are editing the documentation, you should be running the
|
your PR is accepted.
|
||||||
documentation tests to make sure there are no errors. Documentation changes can result
|
|
||||||
in some obfuscated warning messages. If you don't understand what they mean, feel free
|
|
||||||
to ask when you submit your PR.
|
|
||||||
|
|
||||||
.. _spack-builders-and-pipelines:
|
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:
|
||||||
|
|
||||||
^^^^^^^^^
|
.. code-block:: console
|
||||||
GitLab CI
|
|
||||||
^^^^^^^^^
|
|
||||||
|
|
||||||
""""""""""""""""""
|
package_list.rst:8745: WARNING: Block quote ends without a blank line; unexpected unindent.
|
||||||
Build Cache Stacks
|
|
||||||
""""""""""""""""""
|
|
||||||
|
|
||||||
Spack welcomes the contribution of software stacks of interest to the community. These
|
At first, this error message will mean nothing to you, since you didn't edit
|
||||||
stacks are used to test package recipes and generate publicly available build caches.
|
that file. Until you look at line 8745 of the file in question:
|
||||||
Spack uses GitLab CI for managing the orchestration of build jobs.
|
|
||||||
|
|
||||||
GitLab Entry Point
|
.. code-block:: rst
|
||||||
~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
Add stack entrypoint to the ``share/spack/gitlab/cloud_pipelines/.gitlab-ci.yml``. There
|
Description:
|
||||||
are two stages required for each new stack, the generation stage and the build stage.
|
NetCDF is a set of software libraries and self-describing, machine-
|
||||||
|
independent data formats that support the creation, access, and sharing
|
||||||
|
of array-oriented scientific data.
|
||||||
|
|
||||||
The generate stage is defined using the job template ``.generate`` configured with
|
Our documentation includes :ref:`a list of all Spack packages <package-list>`.
|
||||||
environment variables defining the name of the stack in ``SPACK_CI_STACK_NAME`` and the
|
If you add a new package, its docstring is added to this page. The problem in
|
||||||
platform (``SPACK_TARGET_PLATFORM``) and architecture (``SPACK_TARGET_ARCH``) configuration,
|
this case was that the docstring looked like:
|
||||||
and the tags associated with the class of runners to build on.
|
|
||||||
|
|
||||||
.. note::
|
.. code-block:: python
|
||||||
|
|
||||||
The ``SPACK_CI_STACK_NAME`` must match the name of the directory containing the
|
class Netcdf(Package):
|
||||||
stacks ``spack.yaml``.
|
"""
|
||||||
|
NetCDF is a set of software libraries and self-describing,
|
||||||
|
machine-independent data formats that support the creation,
|
||||||
|
access, and sharing of array-oriented scientific data.
|
||||||
|
"""
|
||||||
|
|
||||||
|
Docstrings cannot start with a newline character, or else Sphinx will complain.
|
||||||
|
Instead, they should look like:
|
||||||
|
|
||||||
.. note::
|
.. code-block:: python
|
||||||
|
|
||||||
The platform and architecture variables are specified in order to select the
|
class Netcdf(Package):
|
||||||
correct configurations from the generic configurations used in Spack CI. The
|
"""NetCDF is a set of software libraries and self-describing,
|
||||||
configurations currently available are:
|
machine-independent data formats that support the creation,
|
||||||
|
access, and sharing of array-oriented scientific data."""
|
||||||
|
|
||||||
* ``.cray_rhel_zen4``
|
Documentation changes can result in much more obfuscated warning messages.
|
||||||
* ``.cray_sles_zen4``
|
If you don't understand what they mean, feel free to ask when you submit
|
||||||
* ``.darwin_aarch64``
|
your PR.
|
||||||
* ``.darwin_x86_64``
|
|
||||||
* ``.linux_aarch64``
|
|
||||||
* ``.linux_icelake``
|
|
||||||
* ``.linux_neoverse_n1``
|
|
||||||
* ``.linux_neoverse_v1``
|
|
||||||
* ``.linux_neoverse_v2``
|
|
||||||
* ``.linux_power``
|
|
||||||
* ``.linux_skylake``
|
|
||||||
* ``.linux_x86_64``
|
|
||||||
* ``.linux_x86_64_v4``
|
|
||||||
|
|
||||||
New configurations can be added to accommodate new platforms and architectures.
|
|
||||||
|
|
||||||
|
|
||||||
The build stage is defined as a trigger job that consumes the GitLab CI pipeline generated in
|
|
||||||
the generate stage for this stack. Build stage jobs use the ``.build`` job template which
|
|
||||||
handles the basic configuration.
|
|
||||||
|
|
||||||
An example entry point for a new stack called ``my-super-cool-stack``
|
|
||||||
|
|
||||||
.. code-block:: yaml
|
|
||||||
|
|
||||||
.my-super-cool-stack:
|
|
||||||
extends: [ ".linux_x86_64_v3" ]
|
|
||||||
variables:
|
|
||||||
SPACK_CI_STACK_NAME: my-super-cool-stack
|
|
||||||
tags: [ "all", "tags", "your", "job", "needs"]
|
|
||||||
|
|
||||||
my-super-cool-stack-generate:
|
|
||||||
extends: [ ".generate", ".my-super-cool-stack" ]
|
|
||||||
image: my-super-cool-stack-image:0.0.1
|
|
||||||
|
|
||||||
my-super-cool-stack-build:
|
|
||||||
extends: [ ".build", ".my-super-cool-stack" ]
|
|
||||||
trigger:
|
|
||||||
include:
|
|
||||||
- artifact: jobs_scratch_dir/cloud-ci-pipeline.yml
|
|
||||||
job: my-super-cool-stack-generate
|
|
||||||
strategy: depend
|
|
||||||
needs:
|
|
||||||
- artifacts: True
|
|
||||||
job: my-super-cool-stack-generate
|
|
||||||
|
|
||||||
|
|
||||||
Stack Configuration
|
|
||||||
~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
The stack configuration is a spack environment file with two additional sections added.
|
|
||||||
Stack configurations should be located in ``share/spack/gitlab/cloud_pipelines/stacks/<stack_name>/spack.yaml``.
|
|
||||||
|
|
||||||
The ``ci`` section is generally used to define stack specific mappings such as image or tags.
|
|
||||||
For more information on what can go into the ``ci`` section refer to the docs on pipelines.
|
|
||||||
|
|
||||||
The ``cdash`` section is used for defining where to upload the results of builds. Spack configures
|
|
||||||
most of the details for posting pipeline results to
|
|
||||||
`cdash.spack.io <https://cdash.spack.io/index.php?project=Spack+Testing>`_. The only
|
|
||||||
requirement in the stack configuration is to define a ``build-group`` that is unique,
|
|
||||||
this is usually the long name of the stack.
|
|
||||||
|
|
||||||
An example stack that builds ``zlib``.
|
|
||||||
|
|
||||||
.. code-block:: yaml
|
|
||||||
|
|
||||||
spack:
|
|
||||||
view: false
|
|
||||||
packages:
|
|
||||||
all:
|
|
||||||
require: ["%gcc", "target=x86_64_v3"]
|
|
||||||
specs:
|
|
||||||
- zlib
|
|
||||||
|
|
||||||
ci:
|
|
||||||
pipeline-gen
|
|
||||||
- build-job:
|
|
||||||
image: my-super-cool-stack-image:0.0.1
|
|
||||||
|
|
||||||
cdash:
|
|
||||||
build-group: My Super Cool Stack
|
|
||||||
|
|
||||||
.. note::
|
|
||||||
|
|
||||||
The ``image`` used in the ``*-generate`` job must match exactly the ``image`` used in the ``build-job``.
|
|
||||||
When the images do not match the build job may fail.
|
|
||||||
|
|
||||||
|
|
||||||
"""""""""""""""""""
|
|
||||||
Registering Runners
|
|
||||||
"""""""""""""""""""
|
|
||||||
|
|
||||||
Contributing computational resources to Spack's CI build farm is one way to help expand the
|
|
||||||
capabilities and offerings of the public Spack build caches. Currently, Spack utilizes linux runners
|
|
||||||
from AWS, Google, and the University of Oregon (UO).
|
|
||||||
|
|
||||||
Runners require three key peices:
|
|
||||||
* Runner Registration Token
|
|
||||||
* Accurate tags
|
|
||||||
* OIDC Authentication script
|
|
||||||
* GPG keys
|
|
||||||
|
|
||||||
|
|
||||||
Minimum GitLab Runner Version: ``16.1.0``
|
|
||||||
`Intallation instructions <https://docs.gitlab.com/runner/install/>`_
|
|
||||||
|
|
||||||
Registration Token
|
|
||||||
~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
The first step to contribute new runners is to open an issue in the `spack infrastructure <https://github.com/spack/spack-infrastructure/issues/new?assignees=&labels=runner-registration&projects=&template=runner_registration.yml>`_
|
|
||||||
project. This will be reported to the spack infrastructure team who will guide users through the process
|
|
||||||
of registering new runners for Spack CI.
|
|
||||||
|
|
||||||
The information needed to register a runner is the motivation for the new resources, a semi-detailed description of
|
|
||||||
the runner, and finallly the point of contact for maintaining the software on the runner.
|
|
||||||
|
|
||||||
The point of contact will then work with the infrastruture team to obtain runner registration token(s) for interacting with
|
|
||||||
with Spack's GitLab instance. Once the runner is active, this point of contact will also be responsible for updating the
|
|
||||||
GitLab runner software to keep pace with Spack's Gitlab.
|
|
||||||
|
|
||||||
Tagging
|
|
||||||
~~~~~~~
|
|
||||||
|
|
||||||
In the initial stages of runner registration it is important to **exclude** the special tag ``spack``. This will prevent
|
|
||||||
the new runner(s) from being picked up for production CI jobs while it is configured and evaluated. Once it is determined
|
|
||||||
that the runner is ready for production use the ``spack`` tag will be added.
|
|
||||||
|
|
||||||
Because gitlab has no concept of tag exclustion, runners that provide specialized resource also require specialized tags.
|
|
||||||
For example, a basic CPU only x86_64 runner may have a tag ``x86_64`` associated with it. However, a runner containing an
|
|
||||||
CUDA capable GPU may have the tag ``x86_64-cuda`` to denote that it should only be used for packages that will benefit from
|
|
||||||
a CUDA capable resource.
|
|
||||||
|
|
||||||
OIDC
|
|
||||||
~~~~
|
|
||||||
|
|
||||||
Spack runners use OIDC authentication for connecting to the appropriate AWS bucket
|
|
||||||
which is used for coordinating the communication of binaries between build jobs. In
|
|
||||||
order to configure OIDC authentication, Spack CI runners use a python script with minimal
|
|
||||||
dependencies. This script can be configured for runners as seen here using the ``pre_build_script``.
|
|
||||||
|
|
||||||
.. code-block:: toml
|
|
||||||
|
|
||||||
[[runners]]
|
|
||||||
pre_build_script = """
|
|
||||||
echo 'Executing Spack pre-build setup script'
|
|
||||||
|
|
||||||
for cmd in "${PY3:-}" python3 python; do
|
|
||||||
if command -v > /dev/null "$cmd"; then
|
|
||||||
export PY3="$(command -v "$cmd")"
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ -z "${PY3:-}" ]; then
|
|
||||||
echo "Unable to find python3 executable"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
$PY3 -c "import urllib.request;urllib.request.urlretrieve('https://raw.githubusercontent.com/spack/spack-infrastructure/main/scripts/gitlab_runner_pre_build/pre_build.py', 'pre_build.py')"
|
|
||||||
$PY3 pre_build.py > envvars
|
|
||||||
|
|
||||||
. ./envvars
|
|
||||||
rm -f envvars
|
|
||||||
unset GITLAB_OIDC_TOKEN
|
|
||||||
"""
|
|
||||||
|
|
||||||
GPG Keys
|
|
||||||
~~~~~~~~
|
|
||||||
|
|
||||||
Runners that may be utilized for ``protected`` CI require the registration of an intermediate signing key that
|
|
||||||
can be used to sign packages. For more information on package signing read :ref:`key_architecture`.
|
|
||||||
|
|
||||||
--------
|
--------
|
||||||
Coverage
|
Coverage
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -181,6 +181,10 @@ Spec-related modules
|
|||||||
:mod:`spack.parser`
|
:mod:`spack.parser`
|
||||||
Contains :class:`~spack.parser.SpecParser` and functions related to parsing specs.
|
Contains :class:`~spack.parser.SpecParser` and functions related to parsing specs.
|
||||||
|
|
||||||
|
:mod:`spack.concretize`
|
||||||
|
Contains :class:`~spack.concretize.Concretizer` implementation,
|
||||||
|
which allows site administrators to change Spack's :ref:`concretization-policies`.
|
||||||
|
|
||||||
:mod:`spack.version`
|
:mod:`spack.version`
|
||||||
Implements a simple :class:`~spack.version.Version` class with simple
|
Implements a simple :class:`~spack.version.Version` class with simple
|
||||||
comparison semantics. Also implements :class:`~spack.version.VersionRange`
|
comparison semantics. Also implements :class:`~spack.version.VersionRange`
|
||||||
@@ -333,9 +337,13 @@ 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,
|
type triggers by way of a function call, we find all the hooks of that type,
|
||||||
and run them.
|
and run them.
|
||||||
|
|
||||||
Spack defines hooks by way of a module in the ``lib/spack/spack/hooks`` directory.
|
Spack defines hooks by way of a module at ``lib/spack/spack/hooks`` where we can define
|
||||||
This module has to be registered in ``__init__.py`` so that Spack is aware of it.
|
types of hooks in the ``__init__.py``, and then python files in that folder
|
||||||
This section will cover the basic kind of hooks, and how to write them.
|
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
|
Types of Hooks
|
||||||
@@ -349,23 +357,91 @@ If there is a hook that you would like and is missing, you can propose to add a
|
|||||||
``pre_install(spec)``
|
``pre_install(spec)``
|
||||||
"""""""""""""""""""""
|
"""""""""""""""""""""
|
||||||
|
|
||||||
A ``pre_install`` hook is run within the install subprocess, directly before the install starts.
|
A ``pre_install`` hook is run within an install subprocess, directly before
|
||||||
It expects a single argument of a spec.
|
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, explicit=None)``
|
``post_install(spec)``
|
||||||
"""""""""""""""""""""""""""""""""""""
|
""""""""""""""""""""""
|
||||||
|
|
||||||
A ``post_install`` hook is run within the install subprocess, directly after the install finishes,
|
A ``post_install`` hook is run within an install subprocess, directly after
|
||||||
but before the build stage is removed and the spec is registered in the database. It expects two
|
the install finishes, but before the build stage is removed. If you
|
||||||
arguments: spec and an optional boolean indicating whether this spec is being installed explicitly.
|
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.
|
||||||
|
|
||||||
""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
||||||
``pre_uninstall(spec)`` and ``post_uninstall(spec)``
|
|
||||||
""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
||||||
|
|
||||||
These hooks are currently used for cleaning up module files after uninstall.
|
""""""""""""""""""""""""""
|
||||||
|
``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.
|
||||||
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^
|
||||||
@@ -396,7 +472,7 @@ use my new hook as follows:
|
|||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
def post_log_write(message, level):
|
def post_log_write(message, level):
|
||||||
"""Do something custom with the message and level every time we write
|
"""Do something custom with the messsage and level every time we write
|
||||||
to the log
|
to the log
|
||||||
"""
|
"""
|
||||||
print('running post_log_write!')
|
print('running post_log_write!')
|
||||||
@@ -544,11 +620,11 @@ With either interpreter you can run a single command:
|
|||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
$ spack python -c 'from spack.spec import Spec; Spec("python").concretized()'
|
$ spack python -c 'import distro; distro.linux_distribution()'
|
||||||
...
|
('Ubuntu', '18.04', 'Bionic Beaver')
|
||||||
|
|
||||||
$ spack python -i ipython -c 'from spack.spec import Spec; Spec("python").concretized()'
|
$ spack python -i ipython -c 'import distro; distro.linux_distribution()'
|
||||||
Out[1]: ...
|
Out[1]: ('Ubuntu', '18.04', 'Bionic Beaver')
|
||||||
|
|
||||||
or a file:
|
or a file:
|
||||||
|
|
||||||
@@ -708,27 +784,27 @@ Release branches
|
|||||||
^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
There are currently two types of Spack releases: :ref:`major releases
|
There are currently two types of Spack releases: :ref:`major releases
|
||||||
<major-releases>` (``0.21.0``, ``0.22.0``, etc.) and :ref:`patch releases
|
<major-releases>` (``0.17.0``, ``0.18.0``, etc.) and :ref:`point releases
|
||||||
<patch-releases>` (``0.22.1``, ``0.22.2``, ``0.22.3``, etc.). Here is a
|
<point-releases>` (``0.17.1``, ``0.17.2``, ``0.17.3``, etc.). Here is a
|
||||||
diagram of how Spack release branches work::
|
diagram of how Spack release branches work::
|
||||||
|
|
||||||
o branch: develop (latest version, v0.23.0.dev0)
|
o branch: develop (latest version, v0.19.0.dev0)
|
||||||
|
|
|
|
||||||
o
|
o
|
||||||
| o branch: releases/v0.22, tag: v0.22.1
|
| o branch: releases/v0.18, tag: v0.18.1
|
||||||
o |
|
o |
|
||||||
| o tag: v0.22.0
|
| o tag: v0.18.0
|
||||||
o |
|
o |
|
||||||
| o
|
| o
|
||||||
|/
|
|/
|
||||||
o
|
o
|
||||||
|
|
|
|
||||||
o
|
o
|
||||||
| o branch: releases/v0.21, tag: v0.21.2
|
| o branch: releases/v0.17, tag: v0.17.2
|
||||||
o |
|
o |
|
||||||
| o tag: v0.21.1
|
| o tag: v0.17.1
|
||||||
o |
|
o |
|
||||||
| o tag: v0.21.0
|
| o tag: v0.17.0
|
||||||
o |
|
o |
|
||||||
| o
|
| o
|
||||||
|/
|
|/
|
||||||
@@ -739,8 +815,8 @@ requests target ``develop``. The ``develop`` branch will report that its
|
|||||||
version is that of the next **major** release with a ``.dev0`` suffix.
|
version is that of the next **major** release with a ``.dev0`` suffix.
|
||||||
|
|
||||||
Each Spack release series also has a corresponding branch, e.g.
|
Each Spack release series also has a corresponding branch, e.g.
|
||||||
``releases/v0.22`` has ``v0.22.x`` versions of Spack, and
|
``releases/v0.18`` has ``0.18.x`` versions of Spack, and
|
||||||
``releases/v0.21`` has ``v0.21.x`` versions. A major release is the first
|
``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
|
tagged version on a release branch. Minor releases are back-ported from
|
||||||
develop onto release branches. This is typically done by cherry-picking
|
develop onto release branches. This is typically done by cherry-picking
|
||||||
bugfix commits off of ``develop``.
|
bugfix commits off of ``develop``.
|
||||||
@@ -770,40 +846,27 @@ for more details.
|
|||||||
Scheduling work for releases
|
Scheduling work for releases
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
We schedule work for **major releases** through `milestones
|
We schedule work for releases by creating `GitHub projects
|
||||||
<https://github.com/spack/spack/milestones>`_ and `GitHub Projects
|
<https://github.com/spack/spack/projects>`_. At any time, there may be
|
||||||
<https://github.com/spack/spack/projects>`_, while **patch releases** use `labels
|
several open release projects. For example, below are two releases (from
|
||||||
<https://github.com/spack/spack/labels>`_.
|
some past version of the page linked above):
|
||||||
|
|
||||||
There is only one milestone open at a time. Its name corresponds to the next major version, for
|
.. image:: images/projects.png
|
||||||
example ``v0.23``. Important issues and pull requests should be assigned to this milestone by
|
|
||||||
core developers, so that they are not forgotten at the time of release. The milestone is closed
|
|
||||||
when the release is made, and a new milestone is created for the next major release.
|
|
||||||
|
|
||||||
Bug reports in GitHub issues are automatically labelled ``bug`` and ``triage``. Spack developers
|
This image shows one release in progress for ``0.15.1`` and another for
|
||||||
assign one of the labels ``impact-low``, ``impact-medium`` or ``impact-high``. This will make the
|
``0.16.0``. Each of these releases has a project board containing issues
|
||||||
issue appear in the `Triaged bugs <https://github.com/orgs/spack/projects/6>`_ project board.
|
and pull requests. GitHub shows a status bar with completed work in
|
||||||
Important issues should be assigned to the next milestone as well, so they appear at the top of
|
green, work in progress in purple, and work not started yet in gray, so
|
||||||
the project board.
|
it's fairly easy to see progress.
|
||||||
|
|
||||||
Spack's milestones are not firm commitments so we move work between releases frequently. If we
|
Spack's project boards are not firm commitments so we move work between
|
||||||
need to make a release and some tasks are not yet done, we will simply move them to the next major
|
releases frequently. If we need to make a release and some tasks are not
|
||||||
release milestone, rather than delaying the release to complete them.
|
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
|
||||||
Backporting bug fixes
|
<https://docs.github.com/en/github/managing-your-work-on-github/about-project-boards>`_.
|
||||||
^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
When a bug is fixed in the ``develop`` branch, it is often necessary to backport the fix to one
|
|
||||||
(or more) of the ``release/vX.Y`` branches. Only the release manager is responsible for doing
|
|
||||||
backports, but Spack maintainers are responsible for labelling pull requests (and issues if no bug
|
|
||||||
fix is available yet) with ``vX.Y.Z`` labels. The label should correspond to the next patch version
|
|
||||||
that the bug fix should be backported to.
|
|
||||||
|
|
||||||
Backports are done publicly by the release manager using a pull request named ``Backports vX.Y.Z``.
|
|
||||||
This pull request is opened from the ``backports/vX.Y.Z`` branch, targets the ``releases/vX.Y``
|
|
||||||
branch and contains a (growing) list of cherry-picked commits from the ``develop`` branch.
|
|
||||||
Typically there are one or two backport pull requests open at any given time.
|
|
||||||
|
|
||||||
.. _major-releases:
|
.. _major-releases:
|
||||||
|
|
||||||
@@ -811,21 +874,25 @@ Typically there are one or two backport pull requests open at any given time.
|
|||||||
Making major releases
|
Making major releases
|
||||||
^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
Assuming all required work from the milestone is completed, the steps to make the major release
|
Assuming a project board has already been created and all required work
|
||||||
are:
|
completed, the steps to make the major release are:
|
||||||
|
|
||||||
#. `Create a new milestone <https://github.com/spack/spack/milestones>`_ for the next major
|
#. Create two new project boards:
|
||||||
release.
|
|
||||||
|
|
||||||
#. `Create a new label <https://github.com/spack/spack/labels>`_ for the next patch release.
|
* One for the next major release
|
||||||
|
* One for the next point release
|
||||||
|
|
||||||
#. Move any optional tasks that are not done to the next milestone.
|
#. 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``:
|
#. Create a branch for the release, based on ``develop``:
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
$ git checkout -b releases/v0.23 develop
|
$ git checkout -b releases/v0.15 develop
|
||||||
|
|
||||||
For a version ``vX.Y.Z``, the branch's name should be
|
For a version ``vX.Y.Z``, the branch's name should be
|
||||||
``releases/vX.Y``. That is, you should create a ``releases/vX.Y``
|
``releases/vX.Y``. That is, you should create a ``releases/vX.Y``
|
||||||
@@ -861,8 +928,8 @@ are:
|
|||||||
|
|
||||||
Create a pull request targeting the ``develop`` branch, bumping the major
|
Create a pull request targeting the ``develop`` branch, bumping the major
|
||||||
version in ``lib/spack/spack/__init__.py`` with a ``dev0`` release segment.
|
version in ``lib/spack/spack/__init__.py`` with a ``dev0`` release segment.
|
||||||
For instance when you have just released ``v0.23.0``, set the version
|
For instance when you have just released ``v0.15.0``, set the version
|
||||||
to ``(0, 24, 0, 'dev0')`` on ``develop``.
|
to ``(0, 16, 0, 'dev0')`` on ``develop``.
|
||||||
|
|
||||||
#. Follow the steps in :ref:`publishing-releases`.
|
#. Follow the steps in :ref:`publishing-releases`.
|
||||||
|
|
||||||
@@ -871,52 +938,82 @@ are:
|
|||||||
#. Follow the steps in :ref:`announcing-releases`.
|
#. Follow the steps in :ref:`announcing-releases`.
|
||||||
|
|
||||||
|
|
||||||
.. _patch-releases:
|
.. _point-releases:
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^
|
||||||
Making patch releases
|
Making point releases
|
||||||
^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
To make the patch release process both efficient and transparent, we use a *backports pull request*
|
Assuming a project board has already been created and all required work
|
||||||
which contains cherry-picked commits from the ``develop`` branch. The majority of the work is to
|
completed, the steps to make the point release are:
|
||||||
cherry-pick the bug fixes, which ideally should be done as soon as they land on ``develop``:
|
|
||||||
this ensures cherry-picking happens in order, and makes conflicts easier to resolve since the
|
|
||||||
changes are fresh in the mind of the developer.
|
|
||||||
|
|
||||||
The backports pull request is always titled ``Backports vX.Y.Z`` and is labelled ``backports``. It
|
#. Create a new project board for the next point release.
|
||||||
is opened from a branch named ``backports/vX.Y.Z`` and targets the ``releases/vX.Y`` branch.
|
|
||||||
|
|
||||||
Whenever a pull request labelled ``vX.Y.Z`` is merged, cherry-pick the associated squashed commit
|
#. Move any optional tasks that are not done to the next project board.
|
||||||
on ``develop`` to the ``backports/vX.Y.Z`` branch. For pull requests that were rebased (or not
|
|
||||||
squashed), cherry-pick each associated commit individually. Never force push to the
|
|
||||||
``backports/vX.Y.Z`` branch.
|
|
||||||
|
|
||||||
.. warning::
|
#. Check out the release branch (it should already exist).
|
||||||
|
|
||||||
Sometimes you may **still** get merge conflicts even if you have
|
For the ``X.Y.Z`` release, the release branch is called ``releases/vX.Y``.
|
||||||
cherry-picked all the commits in order. This generally means there
|
For ``v0.15.1``, you would check out ``releases/v0.15``:
|
||||||
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 changes are small, you might just cherry-pick it.
|
.. code-block:: console
|
||||||
|
|
||||||
2. If the changes are large, then you may decide that this fix is not
|
$ git checkout releases/v0.15
|
||||||
worth including in a patch release, in which case you should remove
|
|
||||||
the label from the pull request. Remember that large, manual backports
|
|
||||||
are seldom the right choice for a patch release.
|
|
||||||
|
|
||||||
When all commits are cherry-picked in the ``backports/vX.Y.Z`` branch, make the patch
|
#. If a pull request to the release branch named ``Backports vX.Y.Z`` is not already
|
||||||
release as follows:
|
in the project, create it. This pull request ought to be created as early as
|
||||||
|
possible when working on a release project, so that we can build the release
|
||||||
|
commits incrementally, and identify potential conflicts at an early stage.
|
||||||
|
|
||||||
#. `Create a new label <https://github.com/spack/spack/labels>`_ ``vX.Y.{Z+1}`` for the next patch
|
#. Cherry-pick each pull request in the ``Done`` column of the release
|
||||||
release.
|
project board onto the ``Backports vX.Y.Z`` pull request.
|
||||||
|
|
||||||
#. Replace the label ``vX.Y.Z`` with ``vX.Y.{Z+1}`` for all PRs and issues that are not done.
|
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:
|
||||||
|
|
||||||
#. Manually push a single commit with commit message ``Set version to vX.Y.Z`` to the
|
.. image:: images/pr-commit.png
|
||||||
``backports/vX.Y.Z`` branch, that both bumps the Spack version number and updates the changelog:
|
|
||||||
|
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 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.
|
||||||
|
|
||||||
|
#. When all the commits from the project board are cherry-picked into
|
||||||
|
the ``Backports vX.Y.Z`` pull request, you can push a commit to:
|
||||||
|
|
||||||
1. Bump the version in ``lib/spack/spack/__init__.py``.
|
1. Bump the version in ``lib/spack/spack/__init__.py``.
|
||||||
2. Update ``CHANGELOG.md`` with a list of the changes.
|
2. Update ``CHANGELOG.md`` with a list of the changes.
|
||||||
@@ -925,22 +1022,20 @@ release as follows:
|
|||||||
release branch. See `the changelog from 0.14.1
|
release branch. See `the changelog from 0.14.1
|
||||||
<https://github.com/spack/spack/commit/ff0abb9838121522321df2a054d18e54b566b44a>`_.
|
<https://github.com/spack/spack/commit/ff0abb9838121522321df2a054d18e54b566b44a>`_.
|
||||||
|
|
||||||
#. Make sure CI passes on the **backports pull request**, including:
|
#. Merge the ``Backports vX.Y.Z`` PR with the **Rebase and merge** strategy. This
|
||||||
|
is needed to keep track in the release branch of all the commits that were
|
||||||
|
cherry-picked.
|
||||||
|
|
||||||
|
#. Make sure CI passes on the release branch, including:
|
||||||
|
|
||||||
* Regular unit tests
|
* Regular unit tests
|
||||||
* Build tests
|
* Build tests
|
||||||
* The E4S pipeline at `gitlab.spack.io <https://gitlab.spack.io>`_
|
* The E4S pipeline at `gitlab.spack.io <https://gitlab.spack.io>`_
|
||||||
|
|
||||||
#. Merge the ``Backports vX.Y.Z`` PR with the **Rebase and merge** strategy. This
|
If CI does not pass, you'll need to figure out why, and make changes
|
||||||
is needed to keep track in the release branch of all the commits that were
|
to the release branch until it does. You can make more commits, modify
|
||||||
cherry-picked.
|
or remove cherry-picked commits, or cherry-pick **more** from
|
||||||
|
``develop`` to make this happen.
|
||||||
#. Make sure CI passes on the last commit of the **release branch**.
|
|
||||||
|
|
||||||
#. In the rare case you need to include additional commits in the patch release after the backports
|
|
||||||
PR is merged, it is best to delete the last commit ``Set version to vX.Y.Z`` from the release
|
|
||||||
branch with a single force push, open a new backports PR named ``Backports vX.Y.Z (2)``, and
|
|
||||||
repeat the process. Avoid repeated force pushes to the release branch.
|
|
||||||
|
|
||||||
#. Follow the steps in :ref:`publishing-releases`.
|
#. Follow the steps in :ref:`publishing-releases`.
|
||||||
|
|
||||||
@@ -1015,31 +1110,25 @@ Updating `releases/latest`
|
|||||||
|
|
||||||
If the new release is the **highest** Spack release yet, you should
|
If the new release is the **highest** Spack release yet, you should
|
||||||
also tag it as ``releases/latest``. For example, suppose the highest
|
also tag it as ``releases/latest``. For example, suppose the highest
|
||||||
release is currently ``0.22.3``:
|
release is currently ``0.15.3``:
|
||||||
|
|
||||||
* If you are releasing ``0.22.4`` or ``0.23.0``, then you should tag
|
* 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.22.3``.
|
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
|
* If you are making a new release of an **older** major version of
|
||||||
Spack, e.g. ``0.21.4``, then you should not tag it as
|
Spack, e.g. ``0.14.4``, then you should not tag it as
|
||||||
``releases/latest`` (as there are newer major versions).
|
``releases/latest`` (as there are newer major versions).
|
||||||
|
|
||||||
To do so, first fetch the latest tag created on GitHub, since you may not have it locally:
|
To tag ``releases/latest``, do this:
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
$ git fetch --force git@github.com:spack/spack vX.Y.Z
|
$ git checkout releases/vX.Y # vX.Y is the new release's branch
|
||||||
|
$ git tag --force releases/latest
|
||||||
|
$ git push --force --tags
|
||||||
|
|
||||||
Then tag ``vX.Y.Z`` as ``releases/latest`` and push the individual tag to GitHub.
|
The ``--force`` argument to ``git tag`` makes ``git`` overwrite the existing
|
||||||
|
``releases/latest`` tag with the new one.
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ git tag --force releases/latest vX.Y.Z
|
|
||||||
$ git push --force git@github.com:spack/spack releases/latest
|
|
||||||
|
|
||||||
The ``--force`` argument to ``git tag`` makes ``git`` overwrite the existing ``releases/latest``
|
|
||||||
tag with the new one. Do **not** use the ``--tags`` flag when pushing, since this will push *all*
|
|
||||||
local tags.
|
|
||||||
|
|
||||||
|
|
||||||
.. _announcing-releases:
|
.. _announcing-releases:
|
||||||
@@ -1050,9 +1139,9 @@ Announcing a release
|
|||||||
|
|
||||||
We announce releases in all of the major Spack communication channels.
|
We announce releases in all of the major Spack communication channels.
|
||||||
Publishing the release takes care of GitHub. The remaining channels are
|
Publishing the release takes care of GitHub. The remaining channels are
|
||||||
X, Slack, and the mailing list. Here are the steps:
|
Twitter, Slack, and the mailing list. Here are the steps:
|
||||||
|
|
||||||
#. Announce the release on X.
|
#. Announce the release on Twitter.
|
||||||
|
|
||||||
* Compose the tweet on the ``@spackpm`` account per the
|
* Compose the tweet on the ``@spackpm`` account per the
|
||||||
``spack-twitter`` slack channel.
|
``spack-twitter`` slack channel.
|
||||||
|
@@ -1,60 +1,53 @@
|
|||||||
.. Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
.. _environments:
|
.. _environments:
|
||||||
|
|
||||||
=====================================
|
=========================
|
||||||
Environments (spack.yaml, spack.lock)
|
Environments (spack.yaml)
|
||||||
=====================================
|
=========================
|
||||||
|
|
||||||
An environment is used to group a set of specs intended for some purpose
|
An environment is used to group together a set of specs for the
|
||||||
to be built, rebuilt, and deployed in a coherent fashion. Environments
|
purpose of building, rebuilding and deploying in a coherent fashion.
|
||||||
define aspects of the installation of the software, such as:
|
Environments provide a number of advantages over the *à la carte*
|
||||||
|
approach of building and loading individual Spack modules:
|
||||||
|
|
||||||
#. *which* specs to install;
|
#. Environments separate the steps of (a) choosing what to
|
||||||
#. *how* those specs are configured; and
|
install, (b) concretizing, and (c) installing. This allows
|
||||||
#. *where* the concretized software will be installed.
|
Environments to remain stable and repeatable, even if Spack packages
|
||||||
|
are upgraded: specs are only re-concretized when the user
|
||||||
Aggregating this information into an environment for processing has advantages
|
explicitly asks for it. It is even possible to reliably
|
||||||
over the *à la carte* approach of building and loading individual Spack modules.
|
transport environments between different computers running
|
||||||
|
different versions of Spack!
|
||||||
With environments, you concretize, install, or load (activate) all of the
|
#. Environments allow several specs to be built at once; a more robust
|
||||||
specs with a single command. Concretization fully configures the specs
|
solution than ad-hoc scripts making multiple calls to ``spack
|
||||||
and dependencies of the environment in preparation for installing the
|
install``.
|
||||||
software. This is a more robust solution than ad-hoc installation scripts.
|
#. An Environment that is built as a whole can be loaded as a whole
|
||||||
And you can share an environment or even re-use it on a different computer.
|
into the user environment. An Environment can be built to maintain
|
||||||
|
a filesystem view of its packages, and the environment can load
|
||||||
Environment definitions, especially *how* specs are configured, allow the
|
that view into the user environment at activation time. Spack can
|
||||||
software to remain stable and repeatable even when Spack packages are upgraded. Changes are only picked up when the environment is explicitly re-concretized.
|
also generate a script to load all modules related to an
|
||||||
|
environment.
|
||||||
Defining *where* specs are installed supports a filesystem view of the
|
|
||||||
environment. Yet Spack maintains a single installation of the software that
|
|
||||||
can be re-used across multiple environments.
|
|
||||||
|
|
||||||
Activating an environment determines *when* all of the associated (and
|
|
||||||
installed) specs are loaded so limits the software loaded to those specs
|
|
||||||
actually needed by the environment. Spack can even generate a script to
|
|
||||||
load all modules related to an environment.
|
|
||||||
|
|
||||||
Other packaging systems also provide environments that are similar in
|
Other packaging systems also provide environments that are similar in
|
||||||
some ways to Spack environments; for example, `Conda environments
|
some ways to Spack environments; for example, `Conda environments
|
||||||
<https://conda.io/docs/user-guide/tasks/manage-environments.html>`_ or
|
<https://conda.io/docs/user-guide/tasks/manage-environments.html>`_ or
|
||||||
`Python Virtual Environments
|
`Python Virtual Environments
|
||||||
<https://docs.python.org/3/tutorial/venv.html>`_. Spack environments
|
<https://docs.python.org/3/tutorial/venv.html>`_. Spack environments
|
||||||
provide some distinctive features though:
|
provide some distinctive features:
|
||||||
|
|
||||||
#. A spec installed "in" an environment is no different from the same
|
#. A spec installed "in" an environment is no different from the same
|
||||||
spec installed anywhere else in Spack.
|
spec installed anywhere else in Spack. Environments are assembled
|
||||||
#. Spack environments may contain more than one spec of the same
|
simply by collecting together a set of specs.
|
||||||
|
#. Spack Environments may contain more than one spec of the same
|
||||||
package.
|
package.
|
||||||
|
|
||||||
Spack uses a "manifest and lock" model similar to `Bundler gemfiles
|
Spack uses a "manifest and lock" model similar to `Bundler gemfiles
|
||||||
<https://bundler.io/man/gemfile.5.html>`_ and other package managers.
|
<https://bundler.io/man/gemfile.5.html>`_ and other package
|
||||||
The environment's user input file (or manifest), is named ``spack.yaml``.
|
managers. The user input file is named ``spack.yaml`` and the lock
|
||||||
The lock file, which contains the fully configured and concretized specs,
|
file is named ``spack.lock``
|
||||||
is named ``spack.lock``.
|
|
||||||
|
|
||||||
.. _environments-using:
|
.. _environments-using:
|
||||||
|
|
||||||
@@ -65,9 +58,9 @@ Using Environments
|
|||||||
Here we follow a typical use case of creating, concretizing,
|
Here we follow a typical use case of creating, concretizing,
|
||||||
installing and loading an environment.
|
installing and loading an environment.
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
Creating a managed Environment
|
Creating a named Environment
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
An environment is created by:
|
An environment is created by:
|
||||||
|
|
||||||
@@ -75,60 +68,54 @@ An environment is created by:
|
|||||||
|
|
||||||
$ spack env create myenv
|
$ spack env create myenv
|
||||||
|
|
||||||
The directory ``$SPACK_ROOT/var/spack/environments/myenv`` is created
|
Spack then creates the directory ``var/spack/environments/myenv``.
|
||||||
to manage the environment.
|
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
All managed environments by default are stored in the
|
All named environments are stored in the ``var/spack/environments`` folder.
|
||||||
``$SPACK_ROOT/var/spack/environments`` folder. This location can be changed
|
|
||||||
by setting the ``environments_root`` variable in ``config.yaml``.
|
|
||||||
|
|
||||||
Spack creates the file ``spack.yaml``, hidden directory ``.spack-env``, and
|
In the ``var/spack/environments/myenv`` directory, Spack creates the
|
||||||
``spack.lock`` file under ``$SPACK_ROOT/var/spack/environments/myenv``. User
|
file ``spack.yaml`` and the hidden directory ``.spack-env``.
|
||||||
interaction occurs through the ``spack.yaml`` file and the Spack commands
|
|
||||||
that affect it. Metadata and, by default, the view are stored in the
|
Spack stores metadata in the ``.spack-env`` directory. User
|
||||||
``.spack-env`` directory. When the environment is concretized, Spack creates
|
interaction will occur through the ``spack.yaml`` file and the Spack
|
||||||
the ``spack.lock`` file with the fully configured specs and dependencies for
|
commands that affect it. When the environment is concretized, Spack
|
||||||
|
will create a file ``spack.lock`` with the concrete information for
|
||||||
the environment.
|
the environment.
|
||||||
|
|
||||||
The ``.spack-env`` subdirectory also contains:
|
In addition to being the default location for the view associated with
|
||||||
|
an Environment, the ``.spack-env`` directory also contains:
|
||||||
|
|
||||||
* ``repo/``: A subdirectory acting as the repo consisting of the Spack
|
* ``repo/``: A repo consisting of the Spack packages used in this
|
||||||
packages used in the environment. It allows the environment to build
|
environment. This allows the environment to build the same, in
|
||||||
the same, in theory, even on different versions of Spack with different
|
theory, even on different versions of Spack with different
|
||||||
packages!
|
packages!
|
||||||
* ``logs/``: A subdirectory containing the build logs for the packages
|
* ``logs/``: A directory containing the build logs for the packages
|
||||||
in this environment.
|
in this Environment.
|
||||||
|
|
||||||
Spack Environments can also be created from either the user input, or
|
Spack Environments can also be created from either a ``spack.yaml``
|
||||||
manifest, file or the lockfile. Create an environment from a manifest using:
|
manifest or a ``spack.lock`` lockfile. To create an Environment from a
|
||||||
|
``spack.yaml`` manifest:
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
$ spack env create myenv spack.yaml
|
$ spack env create myenv spack.yaml
|
||||||
|
|
||||||
The resulting environment is guaranteed to have the same root specs as
|
To create an Environment from a ``spack.lock`` lockfile:
|
||||||
the original but may concretize differently in the presence of different
|
|
||||||
explicit or default configuration settings (e.g., a different version of
|
|
||||||
Spack or for a different user account).
|
|
||||||
|
|
||||||
Create an environment from a ``spack.lock`` file using:
|
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
$ spack env create myenv spack.lock
|
$ spack env create myenv spack.lock
|
||||||
|
|
||||||
The resulting environment, when on the same or a compatible machine, is
|
Either of these commands can also take a full path to the
|
||||||
guaranteed to initially have the same concrete specs as the original.
|
initialization file.
|
||||||
|
|
||||||
.. note::
|
A Spack Environment created from a ``spack.yaml`` manifest is
|
||||||
|
guaranteed to have the same root specs as the original Environment,
|
||||||
Environment creation also accepts a full path to the file.
|
but may concretize differently. A Spack Environment created from a
|
||||||
|
``spack.lock`` lockfile is guaranteed to have the same concrete specs
|
||||||
If the path is not under the ``$SPACK_ROOT/var/spack/environments``
|
as the original Environment. Either may obviously then differ as the
|
||||||
directory then the source is referred to as an
|
user modifies it.
|
||||||
:ref:`independent environment <independent_environments>`.
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
Activating an Environment
|
Activating an Environment
|
||||||
@@ -141,7 +128,7 @@ To activate an environment, use the following command:
|
|||||||
$ spack env activate myenv
|
$ spack env activate myenv
|
||||||
|
|
||||||
By default, the ``spack env activate`` will load the view associated
|
By default, the ``spack env activate`` will load the view associated
|
||||||
with the environment into the user environment. The ``-v,
|
with the Environment into the user environment. The ``-v,
|
||||||
--with-view`` argument ensures this behavior, and the ``-V,
|
--with-view`` argument ensures this behavior, and the ``-V,
|
||||||
--without-view`` argument activates the environment without changing
|
--without-view`` argument activates the environment without changing
|
||||||
the user environment variables.
|
the user environment variables.
|
||||||
@@ -154,20 +141,6 @@ user's prompt to begin with the environment name in brackets.
|
|||||||
$ spack env activate -p myenv
|
$ spack env activate -p myenv
|
||||||
[myenv] $ ...
|
[myenv] $ ...
|
||||||
|
|
||||||
The ``activate`` command can also be used to create a new environment, if it is
|
|
||||||
not already defined, by adding the ``--create`` flag. Managed and independent
|
|
||||||
environments can both be created using the same flags that `spack env create`
|
|
||||||
accepts. If an environment already exists then spack will simply activate it
|
|
||||||
and ignore the create-specific flags.
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ spack env activate --create -p myenv
|
|
||||||
# ...
|
|
||||||
# [creates if myenv does not exist yet]
|
|
||||||
# ...
|
|
||||||
[myenv] $ ...
|
|
||||||
|
|
||||||
To deactivate an environment, use the command:
|
To deactivate an environment, use the command:
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
@@ -183,50 +156,34 @@ or the shortcut alias
|
|||||||
If the environment was activated with its view, deactivating the
|
If the environment was activated with its view, deactivating the
|
||||||
environment will remove the view from the user environment.
|
environment will remove the view from the user environment.
|
||||||
|
|
||||||
.. _independent_environments:
|
^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
Anonymous Environments
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
Any directory can be treated as an environment if it contains a file
|
||||||
Independent Environments
|
``spack.yaml``. To load an anonymous environment, use:
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
Independent environments can be located in any directory outside of Spack.
|
|
||||||
|
|
||||||
.. note::
|
|
||||||
|
|
||||||
When uninstalling packages, Spack asks the user to confirm the removal of packages
|
|
||||||
that are still used in a managed environment. This is not the case for independent
|
|
||||||
environments.
|
|
||||||
|
|
||||||
To create an independent environment, use one of the following commands:
|
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
$ spack env create --dir my_env
|
$ spack env activate -d /path/to/directory
|
||||||
$ spack env create ./my_env
|
|
||||||
|
|
||||||
As a shorthand, you can also create an independent environment upon activation if it does not
|
Anonymous specs can be created in place using the command:
|
||||||
already exist:
|
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
$ spack env activate --create ./my_env
|
$ spack env create -d .
|
||||||
|
|
||||||
For convenience, Spack can also place an independent environment in a temporary directory for you:
|
In this case Spack simply creates a spack.yaml file in the requested
|
||||||
|
directory.
|
||||||
|
|
||||||
.. code-block:: console
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
Environment Sensitive Commands
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
$ spack env activate --temp
|
Spack commands are environment sensitive. For example, the ``find``
|
||||||
|
command shows only the specs in the active Environment if an
|
||||||
|
Environment has been activated. Similarly, the ``install`` and
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
``uninstall`` commands act on the active environment.
|
||||||
Environment-Aware Commands
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
Spack commands are environment-aware. For example, the ``find``
|
|
||||||
command shows only the specs in the active environment if an
|
|
||||||
environment has been activated. Otherwise it shows all specs in
|
|
||||||
the Spack instance. The same rule applies to the ``install`` and
|
|
||||||
``uninstall`` commands.
|
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
@@ -271,33 +228,32 @@ the Spack instance. The same rule applies to the ``install`` and
|
|||||||
|
|
||||||
|
|
||||||
Note that when we installed the abstract spec ``zlib@1.2.8``, it was
|
Note that when we installed the abstract spec ``zlib@1.2.8``, it was
|
||||||
presented as a root of the environment. All explicitly installed
|
presented as a root of the Environment. All explicitly installed
|
||||||
packages will be listed as roots of the environment.
|
packages will be listed as roots of the Environment.
|
||||||
|
|
||||||
All of the Spack commands that act on the list of installed specs are
|
All of the Spack commands that act on the list of installed specs are
|
||||||
environment-aware in this way, including ``install``,
|
Environment-sensitive in this way, including ``install``,
|
||||||
``uninstall``, ``find``, ``extensions``, etcetera. In the
|
``uninstall``, ``find``, ``extensions``, and more. In the
|
||||||
:ref:`environment-configuration` section we will discuss
|
:ref:`environment-configuration` section we will discuss
|
||||||
environment-aware commands further.
|
Environment-sensitive commands further.
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^
|
||||||
Adding Abstract Specs
|
Adding Abstract Specs
|
||||||
^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
An abstract spec is the user-specified spec before Spack applies
|
An abstract spec is the user-specified spec before Spack has applied
|
||||||
defaults or dependency information.
|
any defaults or dependency information.
|
||||||
|
|
||||||
Users can add abstract specs to an environment using the ``spack add``
|
Users can add abstract specs to an Environment using the ``spack add``
|
||||||
command. The most important component of an environment is a list of
|
command. The most important component of an Environment is a list of
|
||||||
abstract specs.
|
abstract specs.
|
||||||
|
|
||||||
Adding a spec adds it as a root spec of the environment in the user
|
Adding a spec adds to the manifest (the ``spack.yaml`` file), which is
|
||||||
input file (``spack.yaml``). It does not affect the concrete specs
|
used to define the roots of the Environment, but does not affect the
|
||||||
in the lock file (``spack.lock``) and it does not install the spec.
|
concrete specs in the lockfile, nor does it install the spec.
|
||||||
|
|
||||||
The ``spack add`` command is environment-aware. It adds the spec to the
|
The ``spack add`` command is environment aware. It adds to the
|
||||||
currently active environment. An error is generated if there isn't an
|
currently active environment. All environment aware commands can also
|
||||||
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
|
.. code-block:: console
|
||||||
@@ -317,11 +273,11 @@ or
|
|||||||
Concretizing
|
Concretizing
|
||||||
^^^^^^^^^^^^
|
^^^^^^^^^^^^
|
||||||
|
|
||||||
Once user specs have been added to an environment, they can be concretized.
|
Once some user specs have been added to an environment, they can be concretized.
|
||||||
There are three different modes of operation to concretize an environment,
|
There are at the moment three different modes of operation to concretize an environment,
|
||||||
explained in detail in :ref:`environments_concretization_config`.
|
which are explained in details in :ref:`environments_concretization_config`.
|
||||||
Regardless of which mode of operation is chosen, the following
|
Regardless of which mode of operation has been chosen, the following
|
||||||
command will ensure all of the root specs are concretized according to the
|
command will ensure all the root specs are concretized according to the
|
||||||
constraints that are prescribed in the configuration:
|
constraints that are prescribed in the configuration:
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
@@ -330,15 +286,16 @@ constraints that are prescribed in the configuration:
|
|||||||
|
|
||||||
In the case of specs that are not concretized together, the command
|
In the case of specs that are not concretized together, the command
|
||||||
above will concretize only the specs that were added and not yet
|
above will concretize only the specs that were added and not yet
|
||||||
concretized. Forcing a re-concretization of all of the specs can be done
|
concretized. Forcing a re-concretization of all the specs can be done
|
||||||
by adding the ``-f`` option:
|
instead with this command:
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
[myenv]$ spack concretize -f
|
[myenv]$ spack concretize -f
|
||||||
|
|
||||||
Without the option, Spack guarantees that already concretized specs are
|
When the ``-f`` flag is not used to reconcretize all specs, Spack
|
||||||
unchanged in the environment.
|
guarantees that already concretized specs are unchanged in the
|
||||||
|
environment.
|
||||||
|
|
||||||
The ``concretize`` command does not install any packages. For packages
|
The ``concretize`` command does not install any packages. For packages
|
||||||
that have already been installed outside of the environment, the
|
that have already been installed outside of the environment, the
|
||||||
@@ -371,16 +328,16 @@ installed specs using the ``-c`` (``--concretized``) flag.
|
|||||||
Installing an Environment
|
Installing an Environment
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
In addition to adding individual specs to an environment, one
|
In addition to installing individual specs into an Environment, one
|
||||||
can install the entire environment at once using the command
|
can install the entire Environment at once using the command
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
[myenv]$ spack install
|
[myenv]$ spack install
|
||||||
|
|
||||||
If the environment has been concretized, Spack will install the
|
If the Environment has been concretized, Spack will install the
|
||||||
concretized specs. Otherwise, ``spack install`` will concretize
|
concretized specs. Otherwise, ``spack install`` will first concretize
|
||||||
the environment before installing the concretized specs.
|
the Environment and then install the concretized specs.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
@@ -401,17 +358,17 @@ the environment before installing the concretized specs.
|
|||||||
|
|
||||||
|
|
||||||
As it installs, ``spack install`` creates symbolic links in the
|
As it installs, ``spack install`` creates symbolic links in the
|
||||||
``logs/`` directory in the environment, allowing for easy inspection
|
``logs/`` directory in the Environment, allowing for easy inspection
|
||||||
of build logs related to that environment. The ``spack install``
|
of build logs related to that environment. The ``spack install``
|
||||||
command also stores a Spack repo containing the ``package.py`` file
|
command also stores a Spack repo containing the ``package.py`` file
|
||||||
used at install time for each package in the ``repos/`` directory in
|
used at install time for each package in the ``repos/`` directory in
|
||||||
the environment.
|
the Environment.
|
||||||
|
|
||||||
The ``--no-add`` option can be used in a concrete environment to tell
|
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
|
spack to install specs already present in the environment but not to
|
||||||
add any new root specs to the environment. For root specs provided
|
add any new root specs to the environment. For root specs provided
|
||||||
to ``spack install`` on the command line, ``--no-add`` is the default,
|
to ``spack install`` on the command line, ``--no-add`` is the default,
|
||||||
while for dependency specs, it is optional. In other
|
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
|
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
|
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
|
does not require you to specify the ``--no-add`` option to prevent the spec
|
||||||
@@ -425,22 +382,12 @@ Developing Packages in a Spack Environment
|
|||||||
|
|
||||||
The ``spack develop`` command allows one to develop Spack packages in
|
The ``spack develop`` command allows one to develop Spack packages in
|
||||||
an environment. It requires a spec containing a concrete version, and
|
an environment. It requires a spec containing a concrete version, and
|
||||||
will configure Spack to install the package from local source.
|
will configure Spack to install the package from local source. By
|
||||||
If a version is not provided from the command line interface then spack
|
default, it will also clone the package to a subdirectory in the
|
||||||
will automatically pick the highest version the package has defined.
|
environment. This package will have a special variant ``dev_path``
|
||||||
This means any infinity versions (``develop``, ``main``, ``stable``) will be
|
|
||||||
preferred in this selection process.
|
|
||||||
By default, ``spack develop`` will also clone the package to a subdirectory in the
|
|
||||||
environment for the local source. This package will have a special variant ``dev_path``
|
|
||||||
set, and Spack will ensure the package and its dependents are rebuilt
|
set, and Spack will ensure the package and its dependents are rebuilt
|
||||||
any time the environment is installed if the package's local source
|
any time the environment is installed if the package's local source
|
||||||
code has been modified. Spack's native implementation to check for modifications
|
code has been modified. Spack ensures that all instances of a
|
||||||
is to check if ``mtime`` is newer than the installation.
|
|
||||||
A custom check can be created by overriding the ``detect_dev_src_change`` method
|
|
||||||
in your package class. This is particularly useful for projects using custom spack repo's
|
|
||||||
to drive development and want to optimize performance.
|
|
||||||
|
|
||||||
Spack ensures that all instances of a
|
|
||||||
developed package in the environment are concretized to match the
|
developed package in the environment are concretized to match the
|
||||||
version (and other constraints) passed as the spec argument to the
|
version (and other constraints) passed as the spec argument to the
|
||||||
``spack develop`` command.
|
``spack develop`` command.
|
||||||
@@ -450,26 +397,9 @@ also be used as valid concrete versions (see :ref:`version-specifier`).
|
|||||||
This means that for a package ``foo``, ``spack develop foo@git.main`` will clone
|
This means that for a package ``foo``, ``spack develop foo@git.main`` will clone
|
||||||
the ``main`` branch of the package, and ``spack install`` will install from
|
the ``main`` branch of the package, and ``spack install`` will install from
|
||||||
that git clone if ``foo`` is in the environment.
|
that git clone if ``foo`` is in the environment.
|
||||||
Further development on ``foo`` can be tested by re-installing the environment,
|
Further development on ``foo`` can be tested by reinstalling the environment,
|
||||||
and eventually committed and pushed to the upstream git repo.
|
and eventually committed and pushed to the upstream git repo.
|
||||||
|
|
||||||
If the package being developed supports out-of-source builds then users can use the
|
|
||||||
``--build_directory`` flag to control the location and name of the build directory.
|
|
||||||
This is a shortcut to set the ``package_attributes:build_directory`` in the
|
|
||||||
``packages`` configuration (see :ref:`assigning-package-attributes`).
|
|
||||||
The supplied location will become the build-directory for that package in all future builds.
|
|
||||||
|
|
||||||
.. warning::
|
|
||||||
Potential pitfalls of setting the build directory
|
|
||||||
Spack does not check for out-of-source build compatibility with the packages and
|
|
||||||
so the onerous of making sure the package supports out-of-source builds is on
|
|
||||||
the user.
|
|
||||||
For example, most ``autotool`` and ``makefile`` packages do not support out-of-source builds
|
|
||||||
while all ``CMake`` packages do.
|
|
||||||
Understanding these nuances are on the software developers and we strongly encourage
|
|
||||||
developers to only redirect the build directory if they understand their package's
|
|
||||||
build-system.
|
|
||||||
|
|
||||||
^^^^^^^
|
^^^^^^^
|
||||||
Loading
|
Loading
|
||||||
^^^^^^^
|
^^^^^^^
|
||||||
@@ -486,125 +416,6 @@ Sourcing that file in Bash will make the environment available to the
|
|||||||
user; and can be included in ``.bashrc`` files, etc. The ``loads``
|
user; and can be included in ``.bashrc`` files, etc. The ``loads``
|
||||||
file may also be copied out of the environment, renamed, etc.
|
file may also be copied out of the environment, renamed, etc.
|
||||||
|
|
||||||
|
|
||||||
.. _environment_include_concrete:
|
|
||||||
|
|
||||||
------------------------------
|
|
||||||
Included Concrete Environments
|
|
||||||
------------------------------
|
|
||||||
|
|
||||||
Spack environments can create an environment based off of information in already
|
|
||||||
established environments. You can think of it as a combination of existing
|
|
||||||
environments. It will gather information from the existing environment's
|
|
||||||
``spack.lock`` and use that during the creation of this included concrete
|
|
||||||
environment. When an included concrete environment is created it will generate
|
|
||||||
a ``spack.lock`` file for the newly created environment.
|
|
||||||
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
Creating included environments
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
To create a combined concrete environment, you must have at least one existing
|
|
||||||
concrete environment. You will use the command ``spack env create`` with the
|
|
||||||
argument ``--include-concrete`` followed by the name or path of the environment
|
|
||||||
you'd like to include. Here is an example of how to create a combined environment
|
|
||||||
from the command line.
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ spack env create myenv
|
|
||||||
$ spack -e myenv add python
|
|
||||||
$ spack -e myenv concretize
|
|
||||||
$ spack env create --include-concrete myenv included_env
|
|
||||||
|
|
||||||
|
|
||||||
You can also include an environment directly in the ``spack.yaml`` file. It
|
|
||||||
involves adding the ``include_concrete`` heading in the yaml followed by the
|
|
||||||
absolute path to the independent environments.
|
|
||||||
|
|
||||||
.. code-block:: yaml
|
|
||||||
|
|
||||||
spack:
|
|
||||||
specs: []
|
|
||||||
concretizer:
|
|
||||||
unify: true
|
|
||||||
include_concrete:
|
|
||||||
- /absolute/path/to/environment1
|
|
||||||
- /absolute/path/to/environment2
|
|
||||||
|
|
||||||
|
|
||||||
Once the ``spack.yaml`` has been updated you must concretize the environment to
|
|
||||||
get the concrete specs from the included environments.
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
Updating an included environment
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
If changes were made to the base environment and you want that reflected in the
|
|
||||||
included environment you will need to reconcretize both the base environment and the
|
|
||||||
included environment for the change to be implemented. For example:
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ spack env create myenv
|
|
||||||
$ spack -e myenv add python
|
|
||||||
$ spack -e myenv concretize
|
|
||||||
$ spack env create --include-concrete myenv included_env
|
|
||||||
|
|
||||||
|
|
||||||
$ spack -e myenv find
|
|
||||||
==> In environment myenv
|
|
||||||
==> Root specs
|
|
||||||
python
|
|
||||||
|
|
||||||
==> 0 installed packages
|
|
||||||
|
|
||||||
|
|
||||||
$ spack -e included_env find
|
|
||||||
==> In environment included_env
|
|
||||||
==> No root specs
|
|
||||||
==> Included specs
|
|
||||||
python
|
|
||||||
|
|
||||||
==> 0 installed packages
|
|
||||||
|
|
||||||
Here we see that ``included_env`` has access to the python package through
|
|
||||||
the ``myenv`` environment. But if we were to add another spec to ``myenv``,
|
|
||||||
``included_env`` will not be able to access the new information.
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ spack -e myenv add perl
|
|
||||||
$ spack -e myenv concretize
|
|
||||||
$ spack -e myenv find
|
|
||||||
==> In environment myenv
|
|
||||||
==> Root specs
|
|
||||||
perl python
|
|
||||||
|
|
||||||
==> 0 installed packages
|
|
||||||
|
|
||||||
|
|
||||||
$ spack -e included_env find
|
|
||||||
==> In environment included_env
|
|
||||||
==> No root specs
|
|
||||||
==> Included specs
|
|
||||||
python
|
|
||||||
|
|
||||||
==> 0 installed packages
|
|
||||||
|
|
||||||
It isn't until you run the ``spack concretize`` command that the combined
|
|
||||||
environment will get the updated information from the reconcretized base environmennt.
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ spack -e included_env concretize
|
|
||||||
$ spack -e included_env find
|
|
||||||
==> In environment included_env
|
|
||||||
==> No root specs
|
|
||||||
==> Included specs
|
|
||||||
perl python
|
|
||||||
|
|
||||||
==> 0 installed packages
|
|
||||||
|
|
||||||
.. _environment-configuration:
|
.. _environment-configuration:
|
||||||
|
|
||||||
------------------------
|
------------------------
|
||||||
@@ -635,7 +446,7 @@ manipulate configuration inline in the ``spack.yaml`` file.
|
|||||||
Inline configurations
|
Inline configurations
|
||||||
^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
Inline environment-scope configuration is done using the same yaml
|
Inline Environment-scope configuration is done using the same yaml
|
||||||
format as standard Spack configuration scopes, covered in the
|
format as standard Spack configuration scopes, covered in the
|
||||||
:ref:`configuration` section. Each section is contained under a
|
:ref:`configuration` section. Each section is contained under a
|
||||||
top-level yaml object with it's name. For example, a ``spack.yaml``
|
top-level yaml object with it's name. For example, a ``spack.yaml``
|
||||||
@@ -645,11 +456,11 @@ a ``packages.yaml`` file) could contain:
|
|||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
spack:
|
spack:
|
||||||
# ...
|
...
|
||||||
packages:
|
packages:
|
||||||
all:
|
all:
|
||||||
compiler: [intel]
|
compiler: [intel]
|
||||||
# ...
|
...
|
||||||
|
|
||||||
This configuration sets the default compiler for all packages to
|
This configuration sets the default compiler for all packages to
|
||||||
``intel``.
|
``intel``.
|
||||||
@@ -660,7 +471,7 @@ Included configurations
|
|||||||
|
|
||||||
Spack environments allow an ``include`` heading in their yaml
|
Spack environments allow an ``include`` heading in their yaml
|
||||||
schema. This heading pulls in external configuration files and applies
|
schema. This heading pulls in external configuration files and applies
|
||||||
them to the environment.
|
them to the Environment.
|
||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
@@ -673,9 +484,6 @@ them to the environment.
|
|||||||
Environments can include files or URLs. File paths can be relative or
|
Environments can include files or URLs. File paths can be relative or
|
||||||
absolute. URLs include the path to the text for individual files or
|
absolute. URLs include the path to the text for individual files or
|
||||||
can be the path to a directory containing configuration files.
|
can be the path to a directory containing configuration files.
|
||||||
Spack supports ``file``, ``http``, ``https`` and ``ftp`` protocols (or
|
|
||||||
schemes). Spack-specific, environment and user path variables may be
|
|
||||||
used in these paths. See :ref:`config-file-variables` for more information.
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
Configuration precedence
|
Configuration precedence
|
||||||
@@ -690,7 +498,7 @@ have higher precedence, as the included configs are applied in reverse order.
|
|||||||
Manually Editing the Specs List
|
Manually Editing the Specs List
|
||||||
-------------------------------
|
-------------------------------
|
||||||
|
|
||||||
The list of abstract/root specs in the environment is maintained in
|
The list of abstract/root specs in the Environment is maintained in
|
||||||
the ``spack.yaml`` manifest under the heading ``specs``.
|
the ``spack.yaml`` manifest under the heading ``specs``.
|
||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
@@ -780,11 +588,10 @@ user support groups providing a large software stack for their HPC center.
|
|||||||
|
|
||||||
.. admonition:: Re-concretization of user specs
|
.. admonition:: Re-concretization of user specs
|
||||||
|
|
||||||
The ``spack concretize`` command without additional arguments will *not* change any
|
When using *unified* concretization (when possible), the entire set of specs will be
|
||||||
previously concretized specs. This may prevent it from finding a solution when using
|
re-concretized after any addition of new user specs, to ensure that
|
||||||
``unify: true``, and it may prevent it from finding a minimal solution when using
|
the environment remains consistent / minimal. When instead unified concretization is
|
||||||
``unify: when_possible``. You can force Spack to ignore the existing concrete environment
|
disabled, only the new specs will be concretized after any addition.
|
||||||
with ``spack concretize -f``.
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^
|
^^^^^^^^^^^^^
|
||||||
Spec Matrices
|
Spec Matrices
|
||||||
@@ -798,7 +605,7 @@ evaluates to the cross-product of those specs. Spec matrices also
|
|||||||
contain an ``excludes`` directive, which eliminates certain
|
contain an ``excludes`` directive, which eliminates certain
|
||||||
combinations from the evaluated result.
|
combinations from the evaluated result.
|
||||||
|
|
||||||
The following two environment manifests are identical:
|
The following two Environment manifests are identical:
|
||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
@@ -823,6 +630,35 @@ The following two environment manifests are identical:
|
|||||||
Spec matrices can be used to install swaths of software across various
|
Spec matrices can be used to install swaths of software across various
|
||||||
toolchains.
|
toolchains.
|
||||||
|
|
||||||
|
Note that ordering of matrices is important. For example, the
|
||||||
|
following environments are identical:
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
spack:
|
||||||
|
specs:
|
||||||
|
- matrix:
|
||||||
|
- [hdf5@1.10.2+mpi]
|
||||||
|
- [^mpich, ^openmpi]
|
||||||
|
- ['%gcc']
|
||||||
|
- matrix:
|
||||||
|
- [hdf5@1.12.1+mpi]
|
||||||
|
- ['%gcc']
|
||||||
|
- [^mpich, ^openmpi]
|
||||||
|
|
||||||
|
spack:
|
||||||
|
specs:
|
||||||
|
- hdf5@1.10.2+mpi ^mpich%gcc
|
||||||
|
- hdf5@1.10.2+mpi ^openmpi%gcc
|
||||||
|
- hdf5@1.12.1+mpi %gcc ^mpich
|
||||||
|
- hdf5@1.12.1+mpi %gcc ^openmpi
|
||||||
|
|
||||||
|
Notice how the first matrix applies the compiler constraints to the
|
||||||
|
mpi dependencies, whereas the second matrix applies the compiler
|
||||||
|
constraints directly to the root hdf5 node. This gives users the full
|
||||||
|
breadth of expressiveness of the spec syntax through the matrix
|
||||||
|
interface.
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^
|
||||||
Spec List References
|
Spec List References
|
||||||
^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^
|
||||||
@@ -873,7 +709,7 @@ files are identical.
|
|||||||
In short files like the example, it may be easier to simply list the
|
In short files like the example, it may be easier to simply list the
|
||||||
included specs. However for more complicated examples involving many
|
included specs. However for more complicated examples involving many
|
||||||
packages across many toolchains, separately factored lists make
|
packages across many toolchains, separately factored lists make
|
||||||
environments substantially more manageable.
|
Environments substantially more manageable.
|
||||||
|
|
||||||
Additionally, the ``-l`` option to the ``spack add`` command allows
|
Additionally, the ``-l`` option to the ``spack add`` command allows
|
||||||
one to add to named lists in the definitions section of the manifest
|
one to add to named lists in the definitions section of the manifest
|
||||||
@@ -892,7 +728,7 @@ named list ``compilers`` is ``['%gcc', '%clang', '%intel']`` on
|
|||||||
spack:
|
spack:
|
||||||
definitions:
|
definitions:
|
||||||
- compilers: ['%gcc', '%clang']
|
- compilers: ['%gcc', '%clang']
|
||||||
- when: arch.satisfies('target=x86_64:')
|
- when: arch.satisfies('x86_64:')
|
||||||
compilers: ['%intel']
|
compilers: ['%intel']
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
@@ -959,85 +795,32 @@ For example, the following environment has three root packages:
|
|||||||
This allows for a much-needed reduction in redundancy between packages
|
This allows for a much-needed reduction in redundancy between packages
|
||||||
and constraints.
|
and constraints.
|
||||||
|
|
||||||
|
----------------
|
||||||
|
Filesystem Views
|
||||||
|
----------------
|
||||||
|
|
||||||
-----------------
|
Spack Environments can define filesystem views, which provide a direct access point
|
||||||
Environment Views
|
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.
|
||||||
Spack Environments can have an associated filesystem view, which is a directory
|
The files of the view's installed packages are brought into the view by symbolic or
|
||||||
with a more traditional structure ``<view>/bin``, ``<view>/lib``, ``<view>/include``
|
hard links, referencing the original Spack installation, or by copy.
|
||||||
in which all files of the installed packages are linked.
|
|
||||||
|
|
||||||
By default a view is created for each environment, thanks to the ``view: true``
|
|
||||||
option in the ``spack.yaml`` manifest file:
|
|
||||||
|
|
||||||
.. code-block:: yaml
|
|
||||||
|
|
||||||
spack:
|
|
||||||
specs: [perl, python]
|
|
||||||
view: true
|
|
||||||
|
|
||||||
The view is created in a hidden directory ``.spack-env/view`` relative to the environment.
|
|
||||||
If you've used ``spack env activate``, you may have already interacted with this view. Spack
|
|
||||||
prepends its ``<view>/bin`` dir to ``PATH`` when the environment is activated, so that
|
|
||||||
you can directly run executables from all installed packages in the environment.
|
|
||||||
|
|
||||||
Views are highly customizable: you can control where they are put, modify their structure,
|
|
||||||
include and exclude specs, change how files are linked, and you can even generate multiple
|
|
||||||
views for a single environment.
|
|
||||||
|
|
||||||
.. _configuring_environment_views:
|
.. _configuring_environment_views:
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
Minimal view configuration
|
Configuration in ``spack.yaml``
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
The minimal configuration
|
The Spack Environment manifest file has a top-level keyword
|
||||||
|
``view``. Each entry under that heading is a **view descriptor**, headed
|
||||||
.. code-block:: yaml
|
by a name. Any number of views may be defined under the ``view`` heading.
|
||||||
|
The view descriptor contains the root of the view, and
|
||||||
spack:
|
optionally the projections for the view, ``select`` and
|
||||||
# ...
|
``exclude`` lists for the view and link information via ``link`` and
|
||||||
view: true
|
|
||||||
|
|
||||||
lets Spack generate a single view with default settings under the
|
|
||||||
``.spack-env/view`` directory of the environment.
|
|
||||||
|
|
||||||
Another short way to configure a view is to specify just where to put it:
|
|
||||||
|
|
||||||
.. code-block:: yaml
|
|
||||||
|
|
||||||
spack:
|
|
||||||
# ...
|
|
||||||
view: /path/to/view
|
|
||||||
|
|
||||||
Views can also be disabled by setting ``view: false``.
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
Advanced view configuration
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
One or more **view descriptors** can be defined under ``view``, keyed by a name.
|
|
||||||
The example from the previous section with ``view: /path/to/view`` is equivalent
|
|
||||||
to defining a view descriptor named ``default`` with a ``root`` attribute:
|
|
||||||
|
|
||||||
.. code-block:: yaml
|
|
||||||
|
|
||||||
spack:
|
|
||||||
# ...
|
|
||||||
view:
|
|
||||||
default: # name of the view
|
|
||||||
root: /path/to/view # view descriptor attribute
|
|
||||||
|
|
||||||
The ``default`` view descriptor name is special: when you ``spack env activate`` your
|
|
||||||
environment, this view will be used to update (among other things) your ``PATH``
|
|
||||||
variable.
|
|
||||||
|
|
||||||
View descriptors must contain the root of the view, and optionally projections,
|
|
||||||
``select`` and ``exclude`` lists and link information via ``link`` and
|
|
||||||
``link_type``.
|
``link_type``.
|
||||||
|
|
||||||
As a more advanced example, in the following manifest
|
For example, in the following manifest
|
||||||
file snippet we define a view named ``mpis``, rooted at
|
file snippet we define a view named ``mpis``, rooted at
|
||||||
``/path/to/view`` in which all projections use the package name,
|
``/path/to/view`` in which all projections use the package name,
|
||||||
version, and compiler name to determine the path for a given
|
version, and compiler name to determine the path for a given
|
||||||
@@ -1051,7 +834,7 @@ directories.
|
|||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
spack:
|
spack:
|
||||||
# ...
|
...
|
||||||
view:
|
view:
|
||||||
mpis:
|
mpis:
|
||||||
root: /path/to/view
|
root: /path/to/view
|
||||||
@@ -1082,14 +865,63 @@ of ``hardlink`` or ``copy``.
|
|||||||
when the environment is not activated, and linked libraries will be located
|
when the environment is not activated, and linked libraries will be located
|
||||||
*outside* of the view thanks to rpaths.
|
*outside* of the view thanks to rpaths.
|
||||||
|
|
||||||
|
|
||||||
|
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
|
||||||
|
``/path/to/env/.spack-env/view``, with default selection and exclusion
|
||||||
|
and the default projection, we can put ``view: True`` in the
|
||||||
|
environment manifest. Similarly, if the environment has a view with a
|
||||||
|
different root, but default selection, exclusion, and projections, the
|
||||||
|
manifest can say ``view: /path/to/view``. These views are
|
||||||
|
automatically named ``default``, so that
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
spack:
|
||||||
|
...
|
||||||
|
view: True
|
||||||
|
|
||||||
|
is equivalent to
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
spack:
|
||||||
|
...
|
||||||
|
view:
|
||||||
|
default:
|
||||||
|
root: .spack-env/view
|
||||||
|
|
||||||
|
and
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
spack:
|
||||||
|
...
|
||||||
|
view: /path/to/view
|
||||||
|
|
||||||
|
is equivalent to
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
spack:
|
||||||
|
...
|
||||||
|
view:
|
||||||
|
default:
|
||||||
|
root: /path/to/view
|
||||||
|
|
||||||
|
By default, Spack environments are configured with ``view: True`` in
|
||||||
|
the manifest. Environments can be configured without views using
|
||||||
|
``view: False``. For backwards compatibility reasons, environments
|
||||||
|
with no ``view`` key are treated the same as ``view: True``.
|
||||||
|
|
||||||
From the command line, the ``spack env create`` command takes an
|
From the command line, the ``spack env create`` command takes an
|
||||||
argument ``--with-view [PATH]`` that sets the path for a single, default
|
argument ``--with-view [PATH]`` that sets the path for a single, default
|
||||||
view. If no path is specified, the default path is used (``view:
|
view. If no path is specified, the default path is used (``view:
|
||||||
true``). The argument ``--without-view`` can be used to create an
|
True``). The argument ``--without-view`` can be used to create an
|
||||||
environment without any view configured.
|
environment without any view configured.
|
||||||
|
|
||||||
The ``spack env view`` command can be used to change the manage views
|
The ``spack env view`` command can be used to change the manage views
|
||||||
of an environment. The subcommand ``spack env view enable`` will add a
|
of an Environment. The subcommand ``spack env view enable`` will add a
|
||||||
view named ``default`` to an environment. It takes an optional
|
view named ``default`` to an environment. It takes an optional
|
||||||
argument to specify the path for the new default view. The subcommand
|
argument to specify the path for the new default view. The subcommand
|
||||||
``spack env view disable`` will remove the view named ``default`` from
|
``spack env view disable`` will remove the view named ``default`` from
|
||||||
@@ -1111,20 +943,9 @@ function, as shown in the example below:
|
|||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
projections:
|
projections:
|
||||||
zlib: "{name}-{version}"
|
zlib: {name}-{version}
|
||||||
^mpi: "{name}-{version}/{^mpi.name}-{^mpi.version}-{compiler.name}-{compiler.version}"
|
^mpi: {name}-{version}/{^mpi.name}-{^mpi.version}-{compiler.name}-{compiler.version}
|
||||||
all: "{name}-{version}/{compiler.name}-{compiler.version}"
|
all: {name}-{version}/{compiler.name}-{compiler.version}
|
||||||
|
|
||||||
Projections also permit environment and spack configuration variable
|
|
||||||
expansions as shown below:
|
|
||||||
|
|
||||||
.. code-block:: yaml
|
|
||||||
|
|
||||||
projections:
|
|
||||||
all: "{name}-{version}/{compiler.name}-{compiler.version}/$date/$SYSTEM_ENV_VARIBLE"
|
|
||||||
|
|
||||||
where ``$date`` is the spack configuration variable that will expand with the ``YYYY-MM-DD``
|
|
||||||
format and ``$SYSTEM_ENV_VARIABLE`` is an environment variable defined in the shell.
|
|
||||||
|
|
||||||
The entries in the projections configuration file must all be either
|
The entries in the projections configuration file must all be either
|
||||||
specs or the keyword ``all``. For each spec, the projection used will
|
specs or the keyword ``all``. For each spec, the projection used will
|
||||||
@@ -1151,18 +972,11 @@ the projection under ``all`` before reaching those entries.
|
|||||||
Activating environment views
|
Activating environment views
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
The ``spack env activate <env>`` has two effects:
|
The ``spack env activate`` command will put the default view for the
|
||||||
|
environment into the user's path, in addition to activating the
|
||||||
1. It activates the environment so that further Spack commands such
|
environment for Spack commands. The arguments ``-v,--with-view`` and
|
||||||
as ``spack install`` will run in the context of the environment.
|
``-V,--without-view`` can be used to tune this behavior. The default
|
||||||
2. It activates the view so that environment variables such as
|
behavior is to activate with the environment view if there is one.
|
||||||
``PATH`` are updated to include the view.
|
|
||||||
|
|
||||||
Without further arguments, the ``default`` view of the environment is
|
|
||||||
activated. If a view with a different name has to be activated,
|
|
||||||
``spack env activate --with-view <name> <env>`` can be
|
|
||||||
used instead. You can also activate the environment without modifying
|
|
||||||
further environment variables using ``--without-view``.
|
|
||||||
|
|
||||||
The environment variables affected by the ``spack env activate``
|
The environment variables affected by the ``spack env activate``
|
||||||
command and the paths that are used to update them are determined by
|
command and the paths that are used to update them are determined by
|
||||||
@@ -1185,8 +999,8 @@ relevant variable if the path exists. For this reason, it is not
|
|||||||
recommended to use non-default projections with the default view of an
|
recommended to use non-default projections with the default view of an
|
||||||
environment.
|
environment.
|
||||||
|
|
||||||
The ``spack env deactivate`` command will remove the active view of
|
The ``spack env deactivate`` command will remove the default view of
|
||||||
the Spack environment from the user's environment variables.
|
the environment from the user's path.
|
||||||
|
|
||||||
|
|
||||||
.. _env-generate-depfile:
|
.. _env-generate-depfile:
|
||||||
@@ -1203,7 +1017,7 @@ other targets to depend on the environment installation.
|
|||||||
|
|
||||||
A typical workflow is as follows:
|
A typical workflow is as follows:
|
||||||
|
|
||||||
.. code-block:: console
|
.. code:: console
|
||||||
|
|
||||||
spack env create -d .
|
spack env create -d .
|
||||||
spack -e . add perl
|
spack -e . add perl
|
||||||
@@ -1257,7 +1071,7 @@ gets installed and is available for use in the ``env`` target.
|
|||||||
$(SPACK) -e . env depfile -o $@ --make-prefix spack
|
$(SPACK) -e . env depfile -o $@ --make-prefix spack
|
||||||
|
|
||||||
env: spack/env
|
env: spack/env
|
||||||
$(info environment installed!)
|
$(info Environment installed!)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf spack.lock env.mk spack/
|
rm -rf spack.lock env.mk spack/
|
||||||
@@ -1296,7 +1110,7 @@ its dependencies. This can be useful when certain flags should only apply to
|
|||||||
dependencies. Below we show a use case where a spec is installed with verbose
|
dependencies. Below we show a use case where a spec is installed with verbose
|
||||||
output (``spack install --verbose``) while its dependencies are installed silently:
|
output (``spack install --verbose``) while its dependencies are installed silently:
|
||||||
|
|
||||||
.. code-block:: console
|
.. code:: console
|
||||||
|
|
||||||
$ spack env depfile -o Makefile
|
$ spack env depfile -o Makefile
|
||||||
|
|
||||||
@@ -1318,7 +1132,7 @@ This can be accomplished through the generated ``[<prefix>/]SPACK_PACKAGE_IDS``
|
|||||||
variable. Assuming we have an active and concrete environment, we generate the
|
variable. Assuming we have an active and concrete environment, we generate the
|
||||||
associated ``Makefile`` with a prefix ``example``:
|
associated ``Makefile`` with a prefix ``example``:
|
||||||
|
|
||||||
.. code-block:: console
|
.. code:: console
|
||||||
|
|
||||||
$ spack env depfile -o env.mk --make-prefix example
|
$ spack env depfile -o env.mk --make-prefix example
|
||||||
|
|
||||||
@@ -1345,11 +1159,11 @@ index once every package is pushed. Note how this target uses the generated
|
|||||||
example/push/%: example/install/%
|
example/push/%: example/install/%
|
||||||
@mkdir -p $(dir $@)
|
@mkdir -p $(dir $@)
|
||||||
$(info About to push $(SPEC) to a buildcache)
|
$(info About to push $(SPEC) to a buildcache)
|
||||||
$(SPACK) -e . buildcache push --only=package $(BUILDCACHE_DIR) /$(HASH)
|
$(SPACK) -e . buildcache create --allow-root --only=package --directory $(BUILDCACHE_DIR) /$(HASH)
|
||||||
@touch $@
|
@touch $@
|
||||||
|
|
||||||
push: $(addprefix example/push/,$(example/SPACK_PACKAGE_IDS))
|
push: $(addprefix example/push/,$(example/SPACK_PACKAGE_IDS))
|
||||||
$(info Updating the buildcache index)
|
$(info Updating the buildcache index)
|
||||||
$(SPACK) -e . buildcache update-index $(BUILDCACHE_DIR)
|
$(SPACK) -e . buildcache update-index --directory $(BUILDCACHE_DIR)
|
||||||
$(info Done!)
|
$(info Done!)
|
||||||
@touch $@
|
@touch $@
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -9,42 +9,46 @@
|
|||||||
Custom Extensions
|
Custom Extensions
|
||||||
=================
|
=================
|
||||||
|
|
||||||
*Spack extensions* allow you to extend Spack capabilities by deploying your
|
*Spack extensions* permit you to extend Spack capabilities by deploying your
|
||||||
own custom commands or logic in an arbitrary location on your filesystem.
|
own custom commands or logic in an arbitrary location on your filesystem.
|
||||||
This might be extremely useful e.g. to develop and maintain a command whose purpose is
|
This might be extremely useful e.g. to develop and maintain a command whose purpose is
|
||||||
too specific to be considered for reintegration into the mainline or to
|
too specific to be considered for reintegration into the mainline or to
|
||||||
evolve a command through its early stages before starting a discussion to merge
|
evolve a command through its early stages before starting a discussion to merge
|
||||||
it upstream.
|
it upstream.
|
||||||
|
|
||||||
From Spack's point of view an extension is any path in your filesystem which
|
From Spack's point of view an extension is any path in your filesystem which
|
||||||
respects the following naming and layout for files:
|
respects a prescribed naming and layout for files:
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
spack-scripting/ # The top level directory must match the format 'spack-{extension_name}'
|
spack-scripting/ # The top level directory must match the format 'spack-{extension_name}'
|
||||||
├── pytest.ini # Optional file if the extension ships its own tests
|
├── pytest.ini # Optional file if the extension ships its own tests
|
||||||
├── scripting # Folder that may contain modules that are needed for the extension commands
|
├── scripting # Folder that may contain modules that are needed for the extension commands
|
||||||
│ ├── cmd # Folder containing extension commands
|
│ └── cmd # Folder containing extension commands
|
||||||
│ │ └── filter.py # A new command that will be available
|
│ └── filter.py # A new command that will be available
|
||||||
│ └── functions.py # Module with internal details
|
├── tests # Tests for this extension
|
||||||
└── tests # Tests for this extension
|
|
||||||
│ ├── conftest.py
|
│ ├── conftest.py
|
||||||
│ └── test_filter.py
|
│ └── test_filter.py
|
||||||
└── templates # Templates that may be needed by the extension
|
└── templates # Templates that may be needed by the extension
|
||||||
|
|
||||||
In the example above, the extension is named *scripting*. It adds an additional command
|
In the example above the extension named *scripting* adds an additional command (``filter``)
|
||||||
(``spack filter``) and unit tests to verify its behavior.
|
and unit tests to verify its behavior. The code for this example can be
|
||||||
|
obtained by cloning the corresponding git repository:
|
||||||
|
|
||||||
The extension can import any core Spack module in its implementation. When loaded by
|
.. TODO: write an ad-hoc "hello world" extension and make it part of the spack organization
|
||||||
the ``spack`` command, the extension itself is imported as a Python package in the
|
|
||||||
``spack.extensions`` namespace. In the example above, since the extension is named
|
|
||||||
"scripting", the corresponding Python module is ``spack.extensions.scripting``.
|
|
||||||
|
|
||||||
The code for this example extension can be obtained by cloning the corresponding git repository:
|
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
$ git -C /tmp clone https://github.com/spack/spack-scripting.git
|
$ cd ~/
|
||||||
|
$ mkdir tmp && cd tmp
|
||||||
|
$ git clone https://github.com/alalazo/spack-scripting.git
|
||||||
|
Cloning into 'spack-scripting'...
|
||||||
|
remote: Counting objects: 11, done.
|
||||||
|
remote: Compressing objects: 100% (7/7), done.
|
||||||
|
remote: Total 11 (delta 0), reused 11 (delta 0), pack-reused 0
|
||||||
|
Receiving objects: 100% (11/11), done.
|
||||||
|
|
||||||
|
As you can see by inspecting the sources, Python modules that are part of the extension
|
||||||
|
can import any core Spack module.
|
||||||
|
|
||||||
---------------------------------
|
---------------------------------
|
||||||
Configure Spack to Use Extensions
|
Configure Spack to Use Extensions
|
||||||
@@ -57,7 +61,7 @@ paths to ``config.yaml``. In the case of our example this means ensuring that:
|
|||||||
|
|
||||||
config:
|
config:
|
||||||
extensions:
|
extensions:
|
||||||
- /tmp/spack-scripting
|
- ~/tmp/spack-scripting
|
||||||
|
|
||||||
is part of your configuration file. Once this is setup any command that the extension provides
|
is part of your configuration file. Once this is setup any command that the extension provides
|
||||||
will be available from the command line:
|
will be available from the command line:
|
||||||
@@ -82,68 +86,37 @@ will be available from the command line:
|
|||||||
--implicit select specs that are not installed or were installed implicitly
|
--implicit select specs that are not installed or were installed implicitly
|
||||||
--output OUTPUT where to dump the result
|
--output OUTPUT where to dump the result
|
||||||
|
|
||||||
The corresponding unit tests can be run giving the appropriate options to ``spack unit-test``:
|
The corresponding unit tests can be run giving the appropriate options
|
||||||
|
to ``spack unit-test``:
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
$ spack unit-test --extension=scripting
|
$ spack unit-test --extension=scripting
|
||||||
========================================== test session starts ===========================================
|
|
||||||
platform linux -- Python 3.11.5, pytest-7.4.3, pluggy-1.3.0
|
============================================================== test session starts ===============================================================
|
||||||
rootdir: /home/culpo/github/spack-scripting
|
platform linux2 -- Python 2.7.15rc1, pytest-3.2.5, py-1.4.34, pluggy-0.4.0
|
||||||
configfile: pytest.ini
|
rootdir: /home/mculpo/tmp/spack-scripting, inifile: pytest.ini
|
||||||
testpaths: tests
|
|
||||||
plugins: xdist-3.5.0
|
|
||||||
collected 5 items
|
collected 5 items
|
||||||
|
|
||||||
tests/test_filter.py ..... [100%]
|
tests/test_filter.py ...XX
|
||||||
|
============================================================ short test summary info =============================================================
|
||||||
|
XPASS tests/test_filter.py::test_filtering_specs[flags3-specs3-expected3]
|
||||||
|
XPASS tests/test_filter.py::test_filtering_specs[flags4-specs4-expected4]
|
||||||
|
|
||||||
========================================== slowest 30 durations ==========================================
|
=========================================================== slowest 20 test durations ============================================================
|
||||||
2.31s setup tests/test_filter.py::test_filtering_specs[kwargs0-specs0-expected0]
|
3.74s setup tests/test_filter.py::test_filtering_specs[flags0-specs0-expected0]
|
||||||
0.57s call tests/test_filter.py::test_filtering_specs[kwargs2-specs2-expected2]
|
0.17s call tests/test_filter.py::test_filtering_specs[flags3-specs3-expected3]
|
||||||
0.56s call tests/test_filter.py::test_filtering_specs[kwargs4-specs4-expected4]
|
0.16s call tests/test_filter.py::test_filtering_specs[flags2-specs2-expected2]
|
||||||
0.54s call tests/test_filter.py::test_filtering_specs[kwargs3-specs3-expected3]
|
0.15s call tests/test_filter.py::test_filtering_specs[flags1-specs1-expected1]
|
||||||
0.54s call tests/test_filter.py::test_filtering_specs[kwargs1-specs1-expected1]
|
0.13s call tests/test_filter.py::test_filtering_specs[flags4-specs4-expected4]
|
||||||
0.48s call tests/test_filter.py::test_filtering_specs[kwargs0-specs0-expected0]
|
0.08s call tests/test_filter.py::test_filtering_specs[flags0-specs0-expected0]
|
||||||
0.01s setup tests/test_filter.py::test_filtering_specs[kwargs4-specs4-expected4]
|
0.04s teardown tests/test_filter.py::test_filtering_specs[flags4-specs4-expected4]
|
||||||
0.01s setup tests/test_filter.py::test_filtering_specs[kwargs2-specs2-expected2]
|
0.00s setup tests/test_filter.py::test_filtering_specs[flags4-specs4-expected4]
|
||||||
0.01s setup tests/test_filter.py::test_filtering_specs[kwargs1-specs1-expected1]
|
0.00s setup tests/test_filter.py::test_filtering_specs[flags3-specs3-expected3]
|
||||||
0.01s setup tests/test_filter.py::test_filtering_specs[kwargs3-specs3-expected3]
|
0.00s setup tests/test_filter.py::test_filtering_specs[flags1-specs1-expected1]
|
||||||
|
0.00s setup tests/test_filter.py::test_filtering_specs[flags2-specs2-expected2]
|
||||||
(5 durations < 0.005s hidden. Use -vv to show these durations.)
|
0.00s teardown tests/test_filter.py::test_filtering_specs[flags2-specs2-expected2]
|
||||||
=========================================== 5 passed in 5.06s ============================================
|
0.00s teardown tests/test_filter.py::test_filtering_specs[flags1-specs1-expected1]
|
||||||
|
0.00s teardown tests/test_filter.py::test_filtering_specs[flags0-specs0-expected0]
|
||||||
---------------------------------------
|
0.00s teardown tests/test_filter.py::test_filtering_specs[flags3-specs3-expected3]
|
||||||
Registering Extensions via Entry Points
|
====================================================== 3 passed, 2 xpassed in 4.51 seconds =======================================================
|
||||||
---------------------------------------
|
|
||||||
|
|
||||||
.. note::
|
|
||||||
Python version >= 3.8 is required to register extensions via entry points.
|
|
||||||
|
|
||||||
Spack can be made aware of extensions that are installed as part of a python package. To do so, register a function that returns the extension path, or paths, to the ``"spack.extensions"`` entry point. Consider the Python package ``my_package`` that includes a Spack extension:
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
my-package/
|
|
||||||
├── src
|
|
||||||
│ ├── my_package
|
|
||||||
│ │ └── __init__.py
|
|
||||||
│ └── spack-scripting/ # the spack extensions
|
|
||||||
└── pyproject.toml
|
|
||||||
|
|
||||||
adding the following to ``my_package``'s ``pyproject.toml`` will make the ``spack-scripting`` extension visible to Spack when ``my_package`` is installed:
|
|
||||||
|
|
||||||
.. code-block:: toml
|
|
||||||
|
|
||||||
[project.entry_points."spack.extenions"]
|
|
||||||
my_package = "my_package:get_extension_path"
|
|
||||||
|
|
||||||
The function ``my_package.get_extension_path`` in ``my_package/__init__.py`` might look like
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
import importlib.resources
|
|
||||||
|
|
||||||
def get_extension_path():
|
|
||||||
dirname = importlib.resources.files("my_package").joinpath("spack-scripting")
|
|
||||||
if dirname.exists():
|
|
||||||
return str(dirname)
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
@@ -1,77 +0,0 @@
|
|||||||
.. Copyright 2013-2024 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)
|
|
||||||
|
|
||||||
==========================
|
|
||||||
Frequently Asked Questions
|
|
||||||
==========================
|
|
||||||
|
|
||||||
This page contains answers to frequently asked questions about Spack.
|
|
||||||
If you have questions that are not answered here, feel free to ask on
|
|
||||||
`Slack <https://slack.spack.io>`_ or `GitHub Discussions
|
|
||||||
<https://github.com/spack/spack/discussions>`_. If you've learned the
|
|
||||||
answer to a question that you think should be here, please consider
|
|
||||||
contributing to this page.
|
|
||||||
|
|
||||||
.. _faq-concretizer-precedence:
|
|
||||||
|
|
||||||
-----------------------------------------------------
|
|
||||||
Why does Spack pick particular versions and variants?
|
|
||||||
-----------------------------------------------------
|
|
||||||
|
|
||||||
This question comes up in a variety of forms:
|
|
||||||
|
|
||||||
1. Why does Spack seem to ignore my package preferences from ``packages.yaml`` config?
|
|
||||||
2. Why does Spack toggle a variant instead of using the default from the ``package.py`` file?
|
|
||||||
|
|
||||||
The short answer is that Spack always picks an optimal configuration
|
|
||||||
based on a complex set of criteria\ [#f1]_. These criteria are more nuanced
|
|
||||||
than always choosing the latest versions or default variants.
|
|
||||||
|
|
||||||
.. note::
|
|
||||||
|
|
||||||
As a rule of thumb: requirements + constraints > reuse > preferences > defaults.
|
|
||||||
|
|
||||||
The following set of criteria (from lowest to highest precedence) explain
|
|
||||||
common cases where concretization output may seem surprising at first.
|
|
||||||
|
|
||||||
1. :ref:`Package preferences <package-preferences>` configured in ``packages.yaml``
|
|
||||||
override variant defaults from ``package.py`` files, and influence the optimal
|
|
||||||
ordering of versions. Preferences are specified as follows:
|
|
||||||
|
|
||||||
.. code-block:: yaml
|
|
||||||
|
|
||||||
packages:
|
|
||||||
foo:
|
|
||||||
version: [1.0, 1.1]
|
|
||||||
variants: ~mpi
|
|
||||||
|
|
||||||
2. :ref:`Reuse concretization <concretizer-options>` configured in ``concretizer.yaml``
|
|
||||||
overrides preferences, since it's typically faster to reuse an existing spec than to
|
|
||||||
build a preferred one from sources. When build caches are enabled, specs may be reused
|
|
||||||
from a remote location too. Reuse concretization is configured as follows:
|
|
||||||
|
|
||||||
.. code-block:: yaml
|
|
||||||
|
|
||||||
concretizer:
|
|
||||||
reuse: dependencies # other options are 'true' and 'false'
|
|
||||||
|
|
||||||
3. :ref:`Package requirements <package-requirements>` configured in ``packages.yaml``,
|
|
||||||
and constraints from the command line as well as ``package.py`` files override all
|
|
||||||
of the above. Requirements are specified as follows:
|
|
||||||
|
|
||||||
.. code-block:: yaml
|
|
||||||
|
|
||||||
packages:
|
|
||||||
foo:
|
|
||||||
require:
|
|
||||||
- "@1.2: +mpi"
|
|
||||||
|
|
||||||
Requirements and constraints restrict the set of possible solutions, while reuse
|
|
||||||
behavior and preferences influence what an optimal solution looks like.
|
|
||||||
|
|
||||||
|
|
||||||
.. rubric:: Footnotes
|
|
||||||
|
|
||||||
.. [#f1] The exact list of criteria can be retrieved with the ``spack solve`` command
|
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -21,7 +21,7 @@ be present on the machine where Spack is run:
|
|||||||
:header-rows: 1
|
:header-rows: 1
|
||||||
|
|
||||||
These requirements can be easily installed on most modern Linux systems;
|
These requirements can be easily installed on most modern Linux systems;
|
||||||
on macOS, the Command Line Tools package is required, and a full XCode suite
|
on macOS, the Command Line Tools package is required, and a full XCode suite
|
||||||
may be necessary for some packages such as Qt and apple-gl. Spack is designed
|
may be necessary for some packages such as Qt and apple-gl. Spack is designed
|
||||||
to run on HPC platforms like Cray. Not all packages should be expected
|
to run on HPC platforms like Cray. Not all packages should be expected
|
||||||
to work on all platforms.
|
to work on all platforms.
|
||||||
@@ -35,22 +35,25 @@ A build matrix showing which packages are working on which systems is shown belo
|
|||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
apt update
|
apt update
|
||||||
apt install bzip2 ca-certificates file g++ gcc gfortran git gzip lsb-release patch python3 tar unzip xz-utils zstd
|
apt install build-essential ca-certificates coreutils curl environment-modules gfortran git gpg lsb-release python3 python3-distutils python3-venv unzip zip
|
||||||
|
|
||||||
.. tab-item:: RHEL
|
.. tab-item:: RHEL
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
dnf install epel-release
|
yum update -y
|
||||||
dnf group install "Development Tools"
|
yum install -y epel-release
|
||||||
dnf install gcc-gfortran redhat-lsb-core python3 unzip
|
yum update -y
|
||||||
|
yum --enablerepo epel groupinstall -y "Development Tools"
|
||||||
|
yum --enablerepo epel install -y curl findutils gcc-c++ gcc gcc-gfortran git gnupg2 hostname iproute redhat-lsb-core make patch python3 python3-pip python3-setuptools unzip
|
||||||
|
python3 -m pip install boto3
|
||||||
|
|
||||||
.. tab-item:: macOS Brew
|
.. tab-item:: macOS Brew
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
brew update
|
brew update
|
||||||
brew install gcc git zip
|
brew install curl gcc git gnupg zip
|
||||||
|
|
||||||
------------
|
------------
|
||||||
Installation
|
Installation
|
||||||
@@ -61,15 +64,10 @@ Getting Spack is easy. You can clone it from the `github repository
|
|||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
$ git clone -c feature.manyFiles=true --depth=2 https://github.com/spack/spack.git
|
$ git clone -c feature.manyFiles=true https://github.com/spack/spack.git
|
||||||
|
|
||||||
This will create a directory called ``spack``.
|
This will create a directory called ``spack``.
|
||||||
|
|
||||||
.. note::
|
|
||||||
``-c feature.manyFiles=true`` improves git's performance on repositories with 1,000+ files.
|
|
||||||
|
|
||||||
``--depth=2`` prunes the git history to reduce the size of the Spack installation.
|
|
||||||
|
|
||||||
.. _shell-support:
|
.. _shell-support:
|
||||||
|
|
||||||
^^^^^^^^^^^^^
|
^^^^^^^^^^^^^
|
||||||
@@ -255,10 +253,9 @@ Compiler configuration
|
|||||||
|
|
||||||
Spack has the ability to build packages with multiple compilers and
|
Spack has the ability to build packages with multiple compilers and
|
||||||
compiler versions. Compilers can be made available to Spack by
|
compiler versions. Compilers can be made available to Spack by
|
||||||
specifying them manually in ``compilers.yaml`` or ``packages.yaml``,
|
specifying them manually in ``compilers.yaml``, or automatically by
|
||||||
or automatically by running ``spack compiler find``, but for
|
running ``spack compiler find``, but for convenience Spack will
|
||||||
convenience Spack will automatically detect compilers the first time
|
automatically detect compilers the first time it needs them.
|
||||||
it needs them.
|
|
||||||
|
|
||||||
.. _cmd-spack-compilers:
|
.. _cmd-spack-compilers:
|
||||||
|
|
||||||
@@ -323,7 +320,7 @@ installed, but you know that new compilers have been added to your
|
|||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
$ module load gcc/4.9.0
|
$ module load gcc-4.9.0
|
||||||
$ spack compiler find
|
$ spack compiler find
|
||||||
==> Added 1 new compiler to ~/.spack/linux/compilers.yaml
|
==> Added 1 new compiler to ~/.spack/linux/compilers.yaml
|
||||||
gcc@4.9.0
|
gcc@4.9.0
|
||||||
@@ -371,8 +368,7 @@ Manual compiler configuration
|
|||||||
|
|
||||||
If auto-detection fails, you can manually configure a compiler by
|
If auto-detection fails, you can manually configure a compiler by
|
||||||
editing your ``~/.spack/<platform>/compilers.yaml`` file. You can do this by running
|
editing your ``~/.spack/<platform>/compilers.yaml`` file. You can do this by running
|
||||||
``spack config edit compilers``, which will open the file in
|
``spack config edit compilers``, which will open the file in your ``$EDITOR``.
|
||||||
:ref:`your favorite editor <controlling-the-editor>`.
|
|
||||||
|
|
||||||
Each compiler configuration in the file looks like this:
|
Each compiler configuration in the file looks like this:
|
||||||
|
|
||||||
@@ -463,54 +459,6 @@ specification. The operations available to modify the environment are ``set``, `
|
|||||||
prepend_path: # Similar for append|remove_path
|
prepend_path: # Similar for append|remove_path
|
||||||
LD_LIBRARY_PATH: /ld/paths/added/by/setvars/sh
|
LD_LIBRARY_PATH: /ld/paths/added/by/setvars/sh
|
||||||
|
|
||||||
.. note::
|
|
||||||
|
|
||||||
Spack is in the process of moving compilers from a separate
|
|
||||||
attribute to be handled like all other packages. As part of this
|
|
||||||
process, the ``compilers.yaml`` section will eventually be replaced
|
|
||||||
by configuration in the ``packages.yaml`` section. This new
|
|
||||||
configuration is now available, although it is not yet the default
|
|
||||||
behavior.
|
|
||||||
|
|
||||||
Compilers can also be configured as external packages in the
|
|
||||||
``packages.yaml`` config file. Any external package for a compiler
|
|
||||||
(e.g. ``gcc`` or ``llvm``) will be treated as a configured compiler
|
|
||||||
assuming the paths to the compiler executables are determinable from
|
|
||||||
the prefix.
|
|
||||||
|
|
||||||
If the paths to the compiler executable are not determinable from the
|
|
||||||
prefix, you can add them to the ``extra_attributes`` field. Similarly,
|
|
||||||
all other fields from the compilers config can be added to the
|
|
||||||
``extra_attributes`` field for an external representing a compiler.
|
|
||||||
|
|
||||||
Note that the format for the ``paths`` field in the
|
|
||||||
``extra_attributes`` section is different than in the ``compilers``
|
|
||||||
config. For compilers configured as external packages, the section is
|
|
||||||
named ``compilers`` and the dictionary maps language names (``c``,
|
|
||||||
``cxx``, ``fortran``) to paths, rather than using the names ``cc``,
|
|
||||||
``fc``, and ``f77``.
|
|
||||||
|
|
||||||
.. code-block:: yaml
|
|
||||||
|
|
||||||
packages:
|
|
||||||
gcc:
|
|
||||||
external:
|
|
||||||
- spec: gcc@12.2.0 arch=linux-rhel8-skylake
|
|
||||||
prefix: /usr
|
|
||||||
extra_attributes:
|
|
||||||
environment:
|
|
||||||
set:
|
|
||||||
GCC_ROOT: /usr
|
|
||||||
external:
|
|
||||||
- spec: llvm+clang@15.0.0 arch=linux-rhel8-skylake
|
|
||||||
prefix: /usr
|
|
||||||
extra_attributes:
|
|
||||||
compilers:
|
|
||||||
c: /usr/bin/clang-with-suffix
|
|
||||||
cxx: /usr/bin/clang++-with-extra-info
|
|
||||||
fortran: /usr/bin/gfortran
|
|
||||||
extra_rpaths:
|
|
||||||
- /usr/lib/llvm/
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
Build Your Own Compiler
|
Build Your Own Compiler
|
||||||
@@ -677,7 +625,7 @@ Fortran.
|
|||||||
|
|
||||||
compilers:
|
compilers:
|
||||||
- compiler:
|
- compiler:
|
||||||
# ...
|
...
|
||||||
paths:
|
paths:
|
||||||
cc: /usr/bin/clang
|
cc: /usr/bin/clang
|
||||||
cxx: /usr/bin/clang++
|
cxx: /usr/bin/clang++
|
||||||
@@ -1369,6 +1317,187 @@ This will write the private key to the file `dinosaur.priv`.
|
|||||||
or for help on an issue or the Spack slack.
|
or for help on an issue or the Spack slack.
|
||||||
|
|
||||||
|
|
||||||
|
.. _cray-support:
|
||||||
|
|
||||||
|
-------------
|
||||||
|
Spack on Cray
|
||||||
|
-------------
|
||||||
|
|
||||||
|
Spack differs slightly when used on a Cray system. The architecture spec
|
||||||
|
can differentiate between the front-end and back-end processor and operating system.
|
||||||
|
For example, on Edison at NERSC, the back-end target processor
|
||||||
|
is "Ivy Bridge", so you can specify to use the back-end this way:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ spack install zlib target=ivybridge
|
||||||
|
|
||||||
|
You can also use the operating system to build against the back-end:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ spack install zlib os=CNL10
|
||||||
|
|
||||||
|
Notice that the name includes both the operating system name and the major
|
||||||
|
version number concatenated together.
|
||||||
|
|
||||||
|
Alternatively, if you want to build something for the front-end,
|
||||||
|
you can specify the front-end target processor. The processor for a login node
|
||||||
|
on Edison is "Sandy bridge" so we specify on the command line like so:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ spack install zlib target=sandybridge
|
||||||
|
|
||||||
|
And the front-end operating system is:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ spack install zlib os=SuSE11
|
||||||
|
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
Cray compiler detection
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
Spack can detect compilers using two methods. For the front-end, we treat
|
||||||
|
everything the same. The difference lies in back-end compiler detection.
|
||||||
|
Back-end compiler detection is made via the Tcl module avail command.
|
||||||
|
Once it detects the compiler it writes the appropriate PrgEnv and compiler
|
||||||
|
module name to compilers.yaml and sets the paths to each compiler with Cray\'s
|
||||||
|
compiler wrapper names (i.e. cc, CC, ftn). During build time, Spack will load
|
||||||
|
the correct PrgEnv and compiler module and will call appropriate wrapper.
|
||||||
|
|
||||||
|
The compilers.yaml config file will also differ. There is a
|
||||||
|
modules section that is filled with the compiler's Programming Environment
|
||||||
|
and module name. On other systems, this field is empty []:
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
- compiler:
|
||||||
|
modules:
|
||||||
|
- PrgEnv-intel
|
||||||
|
- intel/15.0.109
|
||||||
|
|
||||||
|
As mentioned earlier, the compiler paths will look different on a Cray system.
|
||||||
|
Since most compilers are invoked using cc, CC and ftn, the paths for each
|
||||||
|
compiler are replaced with their respective Cray compiler wrapper names:
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
paths:
|
||||||
|
cc: cc
|
||||||
|
cxx: CC
|
||||||
|
f77: ftn
|
||||||
|
fc: ftn
|
||||||
|
|
||||||
|
As opposed to an explicit path to the compiler executable. This allows Spack
|
||||||
|
to call the Cray compiler wrappers during build time.
|
||||||
|
|
||||||
|
For more on compiler configuration, check out :ref:`compiler-config`.
|
||||||
|
|
||||||
|
Spack sets the default Cray link type to dynamic, to better match other
|
||||||
|
other platforms. Individual packages can enable static linking (which is the
|
||||||
|
default outside of Spack on cray systems) using the ``-static`` flag.
|
||||||
|
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
Setting defaults and using Cray modules
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
If you want to use default compilers for each PrgEnv and also be able
|
||||||
|
to load cray external modules, you will need to set up a ``packages.yaml``.
|
||||||
|
|
||||||
|
Here's an example of an external configuration for cray modules:
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
packages:
|
||||||
|
mpich:
|
||||||
|
externals:
|
||||||
|
- spec: "mpich@7.3.1%gcc@5.2.0 arch=cray_xc-haswell-CNL10"
|
||||||
|
modules:
|
||||||
|
- cray-mpich
|
||||||
|
- spec: "mpich@7.3.1%intel@16.0.0.109 arch=cray_xc-haswell-CNL10"
|
||||||
|
modules:
|
||||||
|
- cray-mpich
|
||||||
|
all:
|
||||||
|
providers:
|
||||||
|
mpi: [mpich]
|
||||||
|
|
||||||
|
This tells Spack that for whatever package that depends on mpi, load the
|
||||||
|
cray-mpich module into the environment. You can then be able to use whatever
|
||||||
|
environment variables, libraries, etc, that are brought into the environment
|
||||||
|
via module load.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
For Cray-provided packages, it is best to use ``modules:`` instead of ``prefix:``
|
||||||
|
in ``packages.yaml``, because the Cray Programming Environment heavily relies on
|
||||||
|
modules (e.g., loading the ``cray-mpich`` module adds MPI libraries to the
|
||||||
|
compiler wrapper link line).
|
||||||
|
|
||||||
|
You can set the default compiler that Spack can use for each compiler type.
|
||||||
|
If you want to use the Cray defaults, then set them under ``all:`` in packages.yaml.
|
||||||
|
In the compiler field, set the compiler specs in your order of preference.
|
||||||
|
Whenever you build with that compiler type, Spack will concretize to that version.
|
||||||
|
|
||||||
|
Here is an example of a full packages.yaml used at NERSC
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
packages:
|
||||||
|
mpich:
|
||||||
|
externals:
|
||||||
|
- spec: "mpich@7.3.1%gcc@5.2.0 arch=cray_xc-CNL10-ivybridge"
|
||||||
|
modules:
|
||||||
|
- cray-mpich
|
||||||
|
- spec: "mpich@7.3.1%intel@16.0.0.109 arch=cray_xc-SuSE11-ivybridge"
|
||||||
|
modules:
|
||||||
|
- cray-mpich
|
||||||
|
buildable: False
|
||||||
|
netcdf:
|
||||||
|
externals:
|
||||||
|
- spec: "netcdf@4.3.3.1%gcc@5.2.0 arch=cray_xc-CNL10-ivybridge"
|
||||||
|
modules:
|
||||||
|
- cray-netcdf
|
||||||
|
- spec: "netcdf@4.3.3.1%intel@16.0.0.109 arch=cray_xc-CNL10-ivybridge"
|
||||||
|
modules:
|
||||||
|
- cray-netcdf
|
||||||
|
buildable: False
|
||||||
|
hdf5:
|
||||||
|
externals:
|
||||||
|
- spec: "hdf5@1.8.14%gcc@5.2.0 arch=cray_xc-CNL10-ivybridge"
|
||||||
|
modules:
|
||||||
|
- cray-hdf5
|
||||||
|
- spec: "hdf5@1.8.14%intel@16.0.0.109 arch=cray_xc-CNL10-ivybridge"
|
||||||
|
modules:
|
||||||
|
- cray-hdf5
|
||||||
|
buildable: False
|
||||||
|
all:
|
||||||
|
compiler: [gcc@5.2.0, intel@16.0.0.109]
|
||||||
|
providers:
|
||||||
|
mpi: [mpich]
|
||||||
|
|
||||||
|
Here we tell spack that whenever we want to build with gcc use version 5.2.0 or
|
||||||
|
if we want to build with intel compilers, use version 16.0.0.109. We add a spec
|
||||||
|
for each compiler type for each cray modules. This ensures that for each
|
||||||
|
compiler on our system we can use that external module.
|
||||||
|
|
||||||
|
For more on external packages check out the section :ref:`sec-external-packages`.
|
||||||
|
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
Using Linux containers on Cray machines
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
Spack uses environment variables particular to the Cray programming
|
||||||
|
environment to determine which systems are Cray platforms. These
|
||||||
|
environment variables may be propagated into containers that are not
|
||||||
|
using the Cray programming environment.
|
||||||
|
|
||||||
|
To ensure that Spack does not autodetect the Cray programming
|
||||||
|
environment, unset the environment variable ``MODULEPATH``. This
|
||||||
|
will cause Spack to treat a linux container on a Cray system as a base
|
||||||
|
linux distro.
|
||||||
|
|
||||||
.. _windows_support:
|
.. _windows_support:
|
||||||
|
|
||||||
----------------
|
----------------
|
||||||
@@ -1377,7 +1506,7 @@ Spack On Windows
|
|||||||
|
|
||||||
Windows support for Spack is currently under development. While this work is still in an early stage,
|
Windows support for Spack is currently under development. While this work is still in an early stage,
|
||||||
it is currently possible to set up Spack and perform a few operations on Windows. This section will guide
|
it is currently possible to set up Spack and perform a few operations on Windows. This section will guide
|
||||||
you through the steps needed to install Spack and start running it on a fresh Windows machine.
|
you through the steps needed to install Spack and start running it on a fresh Windows machine.
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
Step 1: Install prerequisites
|
Step 1: Install prerequisites
|
||||||
@@ -1387,7 +1516,7 @@ To use Spack on Windows, you will need the following packages:
|
|||||||
|
|
||||||
Required:
|
Required:
|
||||||
* Microsoft Visual Studio
|
* Microsoft Visual Studio
|
||||||
* Python
|
* Python
|
||||||
* Git
|
* Git
|
||||||
|
|
||||||
Optional:
|
Optional:
|
||||||
@@ -1402,8 +1531,6 @@ Microsoft Visual Studio
|
|||||||
"""""""""""""""""""""""
|
"""""""""""""""""""""""
|
||||||
|
|
||||||
Microsoft Visual Studio provides the only Windows C/C++ compiler that is currently supported by Spack.
|
Microsoft Visual Studio provides the only Windows C/C++ compiler that is currently supported by Spack.
|
||||||
Spack additionally requires that the Windows SDK (including WGL) to be installed as part of your
|
|
||||||
visual studio installation as it is required to build many packages from source.
|
|
||||||
|
|
||||||
We require several specific components to be included in the Visual Studio installation.
|
We require several specific components to be included in the Visual Studio installation.
|
||||||
One is the C/C++ toolset, which can be selected as "Desktop development with C++" or "C++ build tools,"
|
One is the C/C++ toolset, which can be selected as "Desktop development with C++" or "C++ build tools,"
|
||||||
@@ -1411,7 +1538,6 @@ depending on installation type (Professional, Build Tools, etc.) The other requ
|
|||||||
"C++ CMake tools for Windows," which can be selected from among the optional packages.
|
"C++ CMake tools for Windows," which can be selected from among the optional packages.
|
||||||
This provides CMake and Ninja for use during Spack configuration.
|
This provides CMake and Ninja for use during Spack configuration.
|
||||||
|
|
||||||
|
|
||||||
If you already have Visual Studio installed, you can make sure these components are installed by
|
If you already have Visual Studio installed, you can make sure these components are installed by
|
||||||
rerunning the installer. Next to your installation, select "Modify" and look at the
|
rerunning the installer. Next to your installation, select "Modify" and look at the
|
||||||
"Installation details" pane on the right.
|
"Installation details" pane on the right.
|
||||||
@@ -1421,8 +1547,8 @@ Intel Fortran
|
|||||||
"""""""""""""
|
"""""""""""""
|
||||||
|
|
||||||
For Fortran-based packages on Windows, we strongly recommend Intel's oneAPI Fortran compilers.
|
For Fortran-based packages on Windows, we strongly recommend Intel's oneAPI Fortran compilers.
|
||||||
The suite is free to download from Intel's website, located at
|
The suite is free to download from Intel's website, located at
|
||||||
https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/fortran-compiler.html.
|
https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/fortran-compiler.html#gs.70t5tw.
|
||||||
The executable of choice for Spack will be Intel's Beta Compiler, ifx, which supports the classic
|
The executable of choice for Spack will be Intel's Beta Compiler, ifx, which supports the classic
|
||||||
compiler's (ifort's) frontend and runtime libraries by using LLVM.
|
compiler's (ifort's) frontend and runtime libraries by using LLVM.
|
||||||
|
|
||||||
@@ -1471,8 +1597,8 @@ in a Windows CMD prompt.
|
|||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
If you chose to install Spack into a directory on Windows that is set up to require Administrative
|
If you chose to install Spack into a directory on Windows that is set up to require Administrative
|
||||||
Privileges, Spack will require elevated privileges to run.
|
Privleges, Spack will require elevated privleges to run.
|
||||||
Administrative Privileges can be denoted either by default such as
|
Administrative Privleges can be denoted either by default such as
|
||||||
``C:\Program Files``, or aministrator applied administrative restrictions
|
``C:\Program Files``, or aministrator applied administrative restrictions
|
||||||
on a directory that spack installs files to such as ``C:\Users``
|
on a directory that spack installs files to such as ``C:\Users``
|
||||||
|
|
||||||
@@ -1480,14 +1606,16 @@ in a Windows CMD prompt.
|
|||||||
Step 3: Run and configure Spack
|
Step 3: Run and configure Spack
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
On Windows, Spack supports both primary native shells, Powershell and the traditional command prompt.
|
To use Spack, run ``bin\spack_cmd.bat`` (you may need to Run as Administrator) from the top-level spack
|
||||||
To use Spack, pick your favorite shell, and run ``bin\spack_cmd.bat`` or ``share/spack/setup-env.ps1``
|
directory. This will provide a Windows command prompt with an environment properly set up with Spack
|
||||||
(you may need to Run as Administrator) from the top-level spack
|
and its prerequisites. If you receive a warning message that Python is not in your ``PATH``
|
||||||
directory. This will provide a Spack enabled shell. If you receive a warning message that Python is not in your ``PATH``
|
|
||||||
(which may happen if you installed Python from the website and not the Windows Store) add the location
|
(which may happen if you installed Python from the website and not the Windows Store) add the location
|
||||||
of the Python executable to your ``PATH`` now. You can permanently add Python to your ``PATH`` variable
|
of the Python executable to your ``PATH`` now. You can permanently add Python to your ``PATH`` variable
|
||||||
by using the ``Edit the system environment variables`` utility in Windows Control Panel.
|
by using the ``Edit the system environment variables`` utility in Windows Control Panel.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
Alternatively, Powershell can be used in place of CMD
|
||||||
|
|
||||||
To configure Spack, first run the following command inside the Spack console:
|
To configure Spack, first run the following command inside the Spack console:
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
@@ -1552,7 +1680,7 @@ and not tabs, so ensure that this is the case when editing one directly.
|
|||||||
|
|
||||||
.. note:: Cygwin
|
.. note:: Cygwin
|
||||||
The use of Cygwin is not officially supported by Spack and is not tested.
|
The use of Cygwin is not officially supported by Spack and is not tested.
|
||||||
However Spack will not prevent this, so use if choosing to use Spack
|
However Spack will not throw an error, so use if choosing to use Spack
|
||||||
with Cygwin, know that no functionality is garunteed.
|
with Cygwin, know that no functionality is garunteed.
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^
|
||||||
@@ -1566,12 +1694,21 @@ Spack console via:
|
|||||||
|
|
||||||
spack install cpuinfo
|
spack install cpuinfo
|
||||||
|
|
||||||
If in the previous step, you did not have CMake or Ninja installed, running the command above should install both packages
|
If in the previous step, you did not have CMake or Ninja installed, running the command above should boostrap both packages
|
||||||
|
|
||||||
.. note:: Spec Syntax Caveats
|
"""""""""""""""""""""""""""
|
||||||
Windows has a few idiosyncrasies when it comes to the Spack spec syntax and the use of certain shells
|
Windows Compatible Packages
|
||||||
See the Spack spec syntax doc for more information
|
"""""""""""""""""""""""""""
|
||||||
|
|
||||||
|
Not all spack packages currently have Windows support. Some are inherently incompatible with the
|
||||||
|
platform, and others simply have yet to be ported. To view the current set of packages with Windows
|
||||||
|
support, the list command should be used via `spack list -t windows`. If there's a package you'd like
|
||||||
|
to install on Windows but is not in that list, feel free to reach out to request the port or contribute
|
||||||
|
the port yourself.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
This is by no means a comprehensive list, some packages may have ports that were not tagged
|
||||||
|
while others may just work out of the box on Windows and have not been tagged as such.
|
||||||
|
|
||||||
^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^
|
||||||
For developers
|
For developers
|
||||||
@@ -1581,3 +1718,6 @@ The intent is to provide a Windows installer that will automatically set up
|
|||||||
Python, Git, and Spack, instead of requiring the user to do so manually.
|
Python, Git, and Spack, instead of requiring the user to do so manually.
|
||||||
Instructions for creating the installer are at
|
Instructions for creating the installer are at
|
||||||
https://github.com/spack/spack/blob/develop/lib/spack/spack/cmd/installer/README.md
|
https://github.com/spack/spack/blob/develop/lib/spack/spack/cmd/installer/README.md
|
||||||
|
|
||||||
|
Alternatively a pre-built copy of the Windows installer is available as an artifact of Spack's Windows CI
|
||||||
|
available at each run of the CI on develop or any PR.
|
||||||
|
@@ -1,138 +0,0 @@
|
|||||||
.. Copyright 2013-2024 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)
|
|
||||||
|
|
||||||
==========================
|
|
||||||
Using External GPU Support
|
|
||||||
==========================
|
|
||||||
|
|
||||||
Many packages come with a ``+cuda`` or ``+rocm`` variant. With no added
|
|
||||||
configuration Spack will download and install the needed components.
|
|
||||||
It may be preferable to use existing system support: the following sections
|
|
||||||
help with using a system installation of GPU libraries.
|
|
||||||
|
|
||||||
-----------------------------------
|
|
||||||
Using an External ROCm Installation
|
|
||||||
-----------------------------------
|
|
||||||
|
|
||||||
Spack breaks down ROCm into many separate component packages. The following
|
|
||||||
is an example ``packages.yaml`` that organizes a consistent set of ROCm
|
|
||||||
components for use by dependent packages:
|
|
||||||
|
|
||||||
.. code-block:: yaml
|
|
||||||
|
|
||||||
packages:
|
|
||||||
all:
|
|
||||||
compiler: [rocmcc@=5.3.0]
|
|
||||||
variants: amdgpu_target=gfx90a
|
|
||||||
hip:
|
|
||||||
buildable: false
|
|
||||||
externals:
|
|
||||||
- spec: hip@5.3.0
|
|
||||||
prefix: /opt/rocm-5.3.0/hip
|
|
||||||
hsa-rocr-dev:
|
|
||||||
buildable: false
|
|
||||||
externals:
|
|
||||||
- spec: hsa-rocr-dev@5.3.0
|
|
||||||
prefix: /opt/rocm-5.3.0/
|
|
||||||
llvm-amdgpu:
|
|
||||||
buildable: false
|
|
||||||
externals:
|
|
||||||
- spec: llvm-amdgpu@5.3.0
|
|
||||||
prefix: /opt/rocm-5.3.0/llvm/
|
|
||||||
comgr:
|
|
||||||
buildable: false
|
|
||||||
externals:
|
|
||||||
- spec: comgr@5.3.0
|
|
||||||
prefix: /opt/rocm-5.3.0/
|
|
||||||
hipsparse:
|
|
||||||
buildable: false
|
|
||||||
externals:
|
|
||||||
- spec: hipsparse@5.3.0
|
|
||||||
prefix: /opt/rocm-5.3.0/
|
|
||||||
hipblas:
|
|
||||||
buildable: false
|
|
||||||
externals:
|
|
||||||
- spec: hipblas@5.3.0
|
|
||||||
prefix: /opt/rocm-5.3.0/
|
|
||||||
rocblas:
|
|
||||||
buildable: false
|
|
||||||
externals:
|
|
||||||
- spec: rocblas@5.3.0
|
|
||||||
prefix: /opt/rocm-5.3.0/
|
|
||||||
rocprim:
|
|
||||||
buildable: false
|
|
||||||
externals:
|
|
||||||
- spec: rocprim@5.3.0
|
|
||||||
prefix: /opt/rocm-5.3.0/rocprim/
|
|
||||||
|
|
||||||
This is in combination with the following compiler definition:
|
|
||||||
|
|
||||||
.. code-block:: yaml
|
|
||||||
|
|
||||||
compilers:
|
|
||||||
- compiler:
|
|
||||||
spec: rocmcc@=5.3.0
|
|
||||||
paths:
|
|
||||||
cc: /opt/rocm-5.3.0/bin/amdclang
|
|
||||||
cxx: /opt/rocm-5.3.0/bin/amdclang++
|
|
||||||
f77: null
|
|
||||||
fc: /opt/rocm-5.3.0/bin/amdflang
|
|
||||||
operating_system: rhel8
|
|
||||||
target: x86_64
|
|
||||||
|
|
||||||
This includes the following considerations:
|
|
||||||
|
|
||||||
- Each of the listed externals specifies ``buildable: false`` to force Spack
|
|
||||||
to use only the externals we defined.
|
|
||||||
- ``spack external find`` can automatically locate some of the ``hip``/``rocm``
|
|
||||||
packages, but not all of them, and furthermore not in a manner that
|
|
||||||
guarantees a complementary set if multiple ROCm installations are available.
|
|
||||||
- The ``prefix`` is the same for several components, but note that others
|
|
||||||
require listing one of the subdirectories as a prefix.
|
|
||||||
|
|
||||||
-----------------------------------
|
|
||||||
Using an External CUDA Installation
|
|
||||||
-----------------------------------
|
|
||||||
|
|
||||||
CUDA is split into fewer components and is simpler to specify:
|
|
||||||
|
|
||||||
.. code-block:: yaml
|
|
||||||
|
|
||||||
packages:
|
|
||||||
all:
|
|
||||||
variants:
|
|
||||||
- cuda_arch=70
|
|
||||||
cuda:
|
|
||||||
buildable: false
|
|
||||||
externals:
|
|
||||||
- spec: cuda@11.0.2
|
|
||||||
prefix: /opt/cuda/cuda-11.0.2/
|
|
||||||
|
|
||||||
where ``/opt/cuda/cuda-11.0.2/lib/`` contains ``libcudart.so``.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-----------------------------------
|
|
||||||
Using an External OpenGL API
|
|
||||||
-----------------------------------
|
|
||||||
Depending on whether we have a graphics card or not, we may choose to use OSMesa or GLX to implement the OpenGL API.
|
|
||||||
|
|
||||||
If a graphics card is unavailable, OSMesa is recommended and can typically be built with Spack.
|
|
||||||
However, if we prefer to utilize the system GLX tailored to our graphics card, we need to declare it as an external. Here's how to do it:
|
|
||||||
|
|
||||||
|
|
||||||
.. code-block:: yaml
|
|
||||||
|
|
||||||
packages:
|
|
||||||
libglx:
|
|
||||||
require: [opengl]
|
|
||||||
opengl:
|
|
||||||
buildable: false
|
|
||||||
externals:
|
|
||||||
- prefix: /usr/
|
|
||||||
spec: opengl@4.6
|
|
||||||
|
|
||||||
Note that prefix has to be the root of both the libraries and the headers, using is /usr not the path the the lib.
|
|
||||||
To know which spec for opengl is available use ``cd /usr/include/GL && grep -Ri gl_version``.
|
|
BIN
lib/spack/docs/images/pr-commit.png
Normal file
BIN
lib/spack/docs/images/pr-commit.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 44 KiB |
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user