Compare commits
2 Commits
hs/fix/sim
...
sync-depen
Author | SHA1 | Date | |
---|---|---|---|
![]() |
e3fc937b32 | ||
![]() |
977f6ce65c |
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"image": "ghcr.io/spack/ubuntu20.04-runner-amd64-gcc-11.4:2023.08.01",
|
|
||||||
"postCreateCommand": "./.devcontainer/postCreateCommand.sh"
|
|
||||||
}
|
|
@@ -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
|
|
11
.github/dependabot.yml
vendored
11
.github/dependabot.yml
vendored
@@ -5,10 +5,13 @@ updates:
|
|||||||
directory: "/"
|
directory: "/"
|
||||||
schedule:
|
schedule:
|
||||||
interval: "daily"
|
interval: "daily"
|
||||||
# Requirements to run style checks and build documentation
|
# Requirements to build documentation
|
||||||
- package-ecosystem: "pip"
|
- package-ecosystem: "pip"
|
||||||
directories:
|
directory: "/lib/spack/docs"
|
||||||
- "/.github/workflows/requirements/style/*"
|
schedule:
|
||||||
- "/lib/spack/docs"
|
interval: "daily"
|
||||||
|
# Requirements to run style checks
|
||||||
|
- package-ecosystem: "pip"
|
||||||
|
directory: "/.github/workflows/style"
|
||||||
schedule:
|
schedule:
|
||||||
interval: "daily"
|
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
|
|
||||||
-->
|
|
46
.github/workflows/audit.yaml
vendored
46
.github/workflows/audit.yaml
vendored
@@ -17,57 +17,33 @@ 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: ${{ matrix.operating_system }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
system:
|
operating_system: ["ubuntu-latest", "macos-latest"]
|
||||||
- { 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@692973e3d937129bcbf40652eb9f2f61becf3332
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # @v2
|
||||||
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f
|
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # @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 setuptools pytest 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)
|
||||||
if: ${{ inputs.with_coverage == 'true' && runner.os != 'Windows' }}
|
if: ${{ inputs.with_coverage == 'true' }}
|
||||||
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) audit externals
|
||||||
coverage run $(which spack) -d audit externals
|
|
||||||
coverage combine
|
coverage combine
|
||||||
coverage xml
|
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
|
$(which spack) audit externals
|
||||||
spack -d audit externals
|
- uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # @v2.1.0
|
||||||
- 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: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673
|
|
||||||
if: ${{ inputs.with_coverage == 'true' }}
|
if: ${{ inputs.with_coverage == 'true' }}
|
||||||
with:
|
with:
|
||||||
flags: unittests,audits
|
flags: unittests,audits
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
|
||||||
verbose: 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.4
|
|
||||||
$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
|
391
.github/workflows/bootstrap.yml
vendored
391
.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@b4ffde65f46336ab88eb53be808477a3936bae11
|
||||||
|
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.5
|
||||||
|
spack bootstrap disable github-actions-v0.4
|
||||||
|
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@b4ffde65f46336ab88eb53be808477a3936bae11
|
||||||
|
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.5
|
||||||
|
spack bootstrap disable github-actions-v0.4
|
||||||
|
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@b4ffde65f46336ab88eb53be808477a3936bae11
|
||||||
|
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,9 +133,15 @@ 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@692973e3d937129bcbf40652eb9f2f61becf3332
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
|
||||||
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
|
||||||
@@ -49,56 +151,194 @@ jobs:
|
|||||||
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", "windows-latest"]
|
|
||||||
steps:
|
steps:
|
||||||
- name: Setup macOS
|
- name: Install dependencies
|
||||||
if: ${{ matrix.runner != 'ubuntu-latest' && matrix.runner != 'windows-latest' }}
|
|
||||||
run: |
|
run: |
|
||||||
brew install cmake bison tree
|
brew install cmake bison@2.7 tree
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
|
||||||
with:
|
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # @v2
|
||||||
fetch-depth: 0
|
|
||||||
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f
|
|
||||||
with:
|
with:
|
||||||
python-version: "3.12"
|
python-version: "3.12"
|
||||||
- name: Bootstrap clingo
|
- name: Bootstrap clingo
|
||||||
env:
|
|
||||||
SETUP_SCRIPT_EXT: ${{ matrix.runner == 'windows-latest' && 'ps1' || 'sh' }}
|
|
||||||
SETUP_SCRIPT_SOURCE: ${{ matrix.runner == 'windows-latest' && './' || 'source ' }}
|
|
||||||
USER_SCOPE_PARENT_DIR: ${{ matrix.runner == 'windows-latest' && '$env:userprofile' || '$HOME' }}
|
|
||||||
VALIDATE_LAST_EXIT: ${{ matrix.runner == 'windows-latest' && './share/spack/qa/validate_last_exit.ps1' || '' }}
|
|
||||||
run: |
|
run: |
|
||||||
${{ env.SETUP_SCRIPT_SOURCE }}share/spack/setup-env.${{ env.SETUP_SCRIPT_EXT }}
|
source share/spack/setup-env.sh
|
||||||
|
export PATH=/usr/local/opt/bison@2.7/bin:$PATH
|
||||||
spack bootstrap disable github-actions-v0.5
|
spack bootstrap disable github-actions-v0.5
|
||||||
spack bootstrap disable github-actions-v0.4
|
spack bootstrap disable github-actions-v0.4
|
||||||
spack external find --not-buildable cmake bison
|
spack external find --not-buildable cmake bison
|
||||||
spack -d solve zlib
|
spack -d solve zlib
|
||||||
${{ env.VALIDATE_LAST_EXIT }}
|
tree ~/.spack/bootstrap/store/
|
||||||
tree ${{ env.USER_SCOPE_PARENT_DIR }}/.spack/bootstrap/store/
|
|
||||||
|
|
||||||
gnupg-sources:
|
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: |
|
run: |
|
||||||
brew install tree gawk
|
brew install tree
|
||||||
sudo rm -rf $(command -v gpg gpg2)
|
|
||||||
- name: Setup Ubuntu
|
|
||||||
if: ${{ matrix.runner == 'ubuntu-latest' }}
|
|
||||||
run: sudo rm -rf $(command -v gpg gpg2 patchelf)
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
|
||||||
|
- name: Bootstrap clingo
|
||||||
|
run: |
|
||||||
|
set -ex
|
||||||
|
for ver in '3.7' '3.8' '3.9' '3.10' '3.11' ; 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"
|
||||||
|
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@b4ffde65f46336ab88eb53be808477a3936bae11
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
- name: Setup repo
|
||||||
|
run: |
|
||||||
|
git --version
|
||||||
|
. .github/workflows/setup_git.sh
|
||||||
|
- name: Bootstrap clingo
|
||||||
|
run: |
|
||||||
|
set -ex
|
||||||
|
for ver in '3.7' '3.8' '3.9' '3.10' '3.11' ; 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"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if (($not_found)) ; then
|
||||||
|
echo Required python version $ver not found in runner!
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
ubuntu-gnupg-binaries:
|
||||||
|
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
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
|
||||||
|
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 GnuPG
|
||||||
|
shell: runuser -u spack-test -- bash {0}
|
||||||
|
run: |
|
||||||
|
source share/spack/setup-env.sh
|
||||||
|
spack bootstrap disable github-actions-v0.4
|
||||||
|
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@b4ffde65f46336ab88eb53be808477a3936bae11
|
||||||
|
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 GnuPG
|
||||||
|
shell: runuser -u spack-test -- bash {0}
|
||||||
|
run: |
|
||||||
|
source share/spack/setup-env.sh
|
||||||
|
spack solve zlib
|
||||||
|
spack bootstrap disable github-actions-v0.5
|
||||||
|
spack bootstrap disable github-actions-v0.4
|
||||||
|
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@b4ffde65f46336ab88eb53be808477a3936bae11
|
||||||
|
- name: Bootstrap GnuPG
|
||||||
|
run: |
|
||||||
|
source share/spack/setup-env.sh
|
||||||
|
spack bootstrap disable github-actions-v0.4
|
||||||
|
spack bootstrap disable spack-install
|
||||||
|
spack -d gpg list
|
||||||
|
tree ~/.spack/bootstrap/store/
|
||||||
|
|
||||||
|
macos-gnupg-sources:
|
||||||
|
runs-on: macos-latest
|
||||||
|
steps:
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
brew install gawk tree
|
||||||
|
# Remove GnuPG since we want to bootstrap it
|
||||||
|
sudo rm -rf /usr/local/bin/gpg
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
|
||||||
- name: Bootstrap GnuPG
|
- name: Bootstrap GnuPG
|
||||||
run: |
|
run: |
|
||||||
source share/spack/setup-env.sh
|
source share/spack/setup-env.sh
|
||||||
@@ -108,63 +348,10 @@ jobs:
|
|||||||
spack -d gpg list
|
spack -d gpg list
|
||||||
tree ~/.spack/bootstrap/store/
|
tree ~/.spack/bootstrap/store/
|
||||||
|
|
||||||
from-binaries:
|
|
||||||
runs-on: ${{ matrix.runner }}
|
# [1] Distros that have patched git to resolve CVE-2022-24765 (e.g. Ubuntu patching v2.25.1)
|
||||||
strategy:
|
# introduce breaking behaviorso we have to set `safe.directory` in gitconfig ourselves.
|
||||||
matrix:
|
# See:
|
||||||
runner: ['macos-13', 'macos-14', "ubuntu-latest"]
|
# - https://github.blog/2022-04-12-git-security-vulnerability-announced/
|
||||||
steps:
|
# - https://github.com/actions/checkout/issues/760
|
||||||
- name: Setup macOS
|
# - http://changelogs.ubuntu.com/changelogs/pool/main/g/git/git_2.25.1-1ubuntu3.3/changelog
|
||||||
if: ${{ matrix.runner != 'ubuntu-latest' }}
|
|
||||||
run: |
|
|
||||||
brew install tree
|
|
||||||
# Remove GnuPG since we want to bootstrap it
|
|
||||||
sudo rm -rf /usr/local/bin/gpg
|
|
||||||
- name: Setup Ubuntu
|
|
||||||
if: ${{ matrix.runner == 'ubuntu-latest' }}
|
|
||||||
run: |
|
|
||||||
sudo rm -rf $(which gpg) $(which gpg2) $(which patchelf)
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f
|
|
||||||
with:
|
|
||||||
python-version: |
|
|
||||||
3.8
|
|
||||||
3.9
|
|
||||||
3.10
|
|
||||||
3.11
|
|
||||||
3.12
|
|
||||||
- name: Set bootstrap sources
|
|
||||||
run: |
|
|
||||||
source share/spack/setup-env.sh
|
|
||||||
spack bootstrap disable github-actions-v0.4
|
|
||||||
spack bootstrap disable spack-install
|
|
||||||
- name: Bootstrap clingo
|
|
||||||
run: |
|
|
||||||
set -e
|
|
||||||
for ver in '3.8' '3.9' '3.10' '3.11' '3.12' ; do
|
|
||||||
not_found=1
|
|
||||||
ver_dir="$(find $RUNNER_TOOL_CACHE/Python -wholename "*/${ver}.*/*/bin" | grep . || true)"
|
|
||||||
if [[ -d "$ver_dir" ]] ; then
|
|
||||||
echo "Testing $ver_dir"
|
|
||||||
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/bin/bootstrap-test.sh
|
|
||||||
export PATH="$old_path"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
if (($not_found)) ; then
|
|
||||||
echo Required python version $ver not found in runner!
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
- name: Bootstrap GnuPG
|
|
||||||
run: |
|
|
||||||
source share/spack/setup-env.sh
|
|
||||||
spack -d gpg list
|
|
||||||
tree ~/.spack/bootstrap/store/
|
|
||||||
|
41
.github/workflows/build-containers.yml
vendored
41
.github/workflows/build-containers.yml
vendored
@@ -40,24 +40,24 @@ jobs:
|
|||||||
# 1: Platforms to build for
|
# 1: Platforms to build for
|
||||||
# 2: Base image (e.g. ubuntu:22.04)
|
# 2: Base image (e.g. ubuntu:22.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-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'],
|
[almalinux8, 'linux/amd64,linux/arm64,linux/ppc64le', 'almalinux:8'],
|
||||||
[almalinux9, 'linux/amd64,linux/arm64,linux/ppc64le', 'almalinux:9'],
|
[almalinux9, 'linux/amd64,linux/arm64,linux/ppc64le', 'almalinux:9'],
|
||||||
[rockylinux8, 'linux/amd64,linux/arm64', 'rockylinux:8'],
|
[rockylinux8, 'linux/amd64,linux/arm64', 'rockylinux:8'],
|
||||||
[rockylinux9, 'linux/amd64,linux/arm64', 'rockylinux:9'],
|
[rockylinux9, 'linux/amd64,linux/arm64', 'rockylinux:9'],
|
||||||
[fedora39, 'linux/amd64,linux/arm64,linux/ppc64le', 'fedora:39'],
|
[fedora37, 'linux/amd64,linux/arm64,linux/ppc64le', 'fedora:37'],
|
||||||
[fedora40, 'linux/amd64,linux/arm64,linux/ppc64le', 'fedora:40']]
|
[fedora38, 'linux/amd64,linux/arm64,linux/ppc64le', 'fedora:38']]
|
||||||
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@692973e3d937129bcbf40652eb9f2f61becf3332
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # @v2
|
||||||
|
|
||||||
- uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81
|
- uses: docker/metadata-action@31cebacef4805868f9ce9a0cb03ee36c32df2ac4
|
||||||
id: docker_meta
|
id: docker_meta
|
||||||
with:
|
with:
|
||||||
images: |
|
images: |
|
||||||
@@ -76,7 +76,7 @@ jobs:
|
|||||||
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 +87,19 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Upload Dockerfile
|
- name: Upload Dockerfile
|
||||||
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a
|
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
|
||||||
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@68827325e0b33c7199eb31dd4e31fbe9023e06e3
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db
|
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226
|
||||||
|
|
||||||
- name: Log in to GitHub Container Registry
|
- name: Log in to GitHub Container Registry
|
||||||
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
|
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
@@ -107,27 +107,18 @@ 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@343f7c4344506bcbf9b4de18042ae17996df046d
|
||||||
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@5cd11c3a4ced054e52742c5fd54dca954e0edd85
|
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56
|
||||||
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' }}
|
||||||
|
cache-from: type=gha
|
||||||
|
cache-to: type=gha,mode=max
|
||||||
tags: ${{ steps.docker_meta.outputs.tags }}
|
tags: ${{ steps.docker_meta.outputs.tags }}
|
||||||
labels: ${{ steps.docker_meta.outputs.labels }}
|
labels: ${{ steps.docker_meta.outputs.labels }}
|
||||||
|
|
||||||
merge-dockerfiles:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: deploy-images
|
|
||||||
steps:
|
|
||||||
- name: Merge Artifacts
|
|
||||||
uses: actions/upload-artifact/merge@834a144ee995460fba8ed112a2fc961b36a5ec5a
|
|
||||||
with:
|
|
||||||
name: dockerfiles
|
|
||||||
pattern: dockerfiles_*
|
|
||||||
delete-merged: true
|
|
||||||
|
20
.github/workflows/ci.yaml
vendored
20
.github/workflows/ci.yaml
vendored
@@ -18,7 +18,6 @@ jobs:
|
|||||||
prechecks:
|
prechecks:
|
||||||
needs: [ changes ]
|
needs: [ changes ]
|
||||||
uses: ./.github/workflows/valid-style.yml
|
uses: ./.github/workflows/valid-style.yml
|
||||||
secrets: inherit
|
|
||||||
with:
|
with:
|
||||||
with_coverage: ${{ needs.changes.outputs.core }}
|
with_coverage: ${{ needs.changes.outputs.core }}
|
||||||
all-prechecks:
|
all-prechecks:
|
||||||
@@ -36,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@692973e3d937129bcbf40652eb9f2f61becf3332
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # @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
|
||||||
@@ -53,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'
|
||||||
@@ -78,14 +70,16 @@ 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' }}
|
||||||
|
needs: [ prechecks ]
|
||||||
|
uses: ./.github/workflows/windows_python.yml
|
||||||
all:
|
all:
|
||||||
needs: [ unit-tests, bootstrap ]
|
needs: [ windows, unit-tests, bootstrap ]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Success
|
- name: Success
|
||||||
|
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
|
4
.github/workflows/nightly-win-builds.yml
vendored
4
.github/workflows/nightly-win-builds.yml
vendored
@@ -14,10 +14,10 @@ jobs:
|
|||||||
build-paraview-deps:
|
build-paraview-deps:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f
|
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c
|
||||||
with:
|
with:
|
||||||
python-version: 3.9
|
python-version: 3.9
|
||||||
- name: Install Python packages
|
- name: Install Python packages
|
||||||
|
@@ -1,7 +0,0 @@
|
|||||||
black==24.8.0
|
|
||||||
clingo==5.7.1
|
|
||||||
flake8==7.1.1
|
|
||||||
isort==5.13.2
|
|
||||||
mypy==1.8.0
|
|
||||||
types-six==1.16.21.20240513
|
|
||||||
vermin==1.6.0
|
|
7
.github/workflows/style/requirements.txt
vendored
Normal file
7
.github/workflows/style/requirements.txt
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
black==23.11.0
|
||||||
|
clingo==5.6.2
|
||||||
|
flake8==6.1.0
|
||||||
|
isort==5.12.0
|
||||||
|
mypy==1.7.1
|
||||||
|
types-six==1.16.21.9
|
||||||
|
vermin==1.6.0
|
92
.github/workflows/unit_tests.yaml
vendored
92
.github/workflows/unit_tests.yaml
vendored
@@ -16,34 +16,45 @@ jobs:
|
|||||||
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', '3.12']
|
||||||
|
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
|
||||||
|
concretizer: 'clingo'
|
||||||
on_develop: false
|
on_develop: false
|
||||||
- python-version: '3.11'
|
- python-version: '3.11'
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
|
concretizer: 'clingo'
|
||||||
on_develop: false
|
on_develop: false
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # @v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f
|
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # @v2
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
- name: Install System packages
|
- name: Install System packages
|
||||||
@@ -61,7 +72,7 @@ jobs:
|
|||||||
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,24 +85,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
|
||||||
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: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673
|
- uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d
|
||||||
with:
|
with:
|
||||||
flags: unittests,linux,${{ matrix.concretizer }}
|
flags: unittests,linux,${{ matrix.concretizer }}
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
|
||||||
verbose: true
|
|
||||||
# Test shell integration
|
# Test shell integration
|
||||||
shell:
|
shell:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # @v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f
|
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # @v2
|
||||||
with:
|
with:
|
||||||
python-version: '3.11'
|
python-version: '3.11'
|
||||||
- name: Install System packages
|
- name: Install System packages
|
||||||
@@ -106,17 +116,15 @@ jobs:
|
|||||||
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: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673
|
- uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d
|
||||||
with:
|
with:
|
||||||
flags: shelltests,linux
|
flags: shelltests,linux
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
|
||||||
verbose: 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
|
||||||
@@ -129,13 +137,13 @@ 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@692973e3d937129bcbf40652eb9f2f61becf3332
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # @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 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
|
||||||
@@ -148,10 +156,10 @@ jobs:
|
|||||||
clingo-cffi:
|
clingo-cffi:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # @v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f
|
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # @v2
|
||||||
with:
|
with:
|
||||||
python-version: '3.11'
|
python-version: '3.11'
|
||||||
- name: Install System packages
|
- name: Install System packages
|
||||||
@@ -166,29 +174,27 @@ jobs:
|
|||||||
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 unit tests (full suite with coverage)
|
- name: Run unit tests (full suite with coverage)
|
||||||
env:
|
env:
|
||||||
COVERAGE: true
|
COVERAGE: true
|
||||||
|
SPACK_TEST_SOLVER: clingo
|
||||||
run: |
|
run: |
|
||||||
share/spack/qa/run-unit-tests
|
share/spack/qa/run-unit-tests
|
||||||
- uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673
|
- uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # @v2.1.0
|
||||||
with:
|
with:
|
||||||
flags: unittests,linux,clingo
|
flags: unittests,linux,clingo
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
|
||||||
verbose: 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.11"]
|
python-version: ["3.11"]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # @v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f
|
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # @v2
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
- name: Install Python packages
|
- name: Install Python packages
|
||||||
@@ -200,48 +206,16 @@ jobs:
|
|||||||
brew install dash fish gcc gnupg2 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
|
||||||
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 --verbose --cov --cov-config=pyproject.toml --cov-report=xml:coverage.xml "${common_args[@]}"
|
||||||
- uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673
|
- uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d
|
||||||
with:
|
with:
|
||||||
flags: unittests,macos
|
flags: unittests,macos
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
|
||||||
verbose: 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@692973e3d937129bcbf40652eb9f2f61becf3332
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f
|
|
||||||
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
|
|
||||||
run: |
|
|
||||||
spack unit-test -x --verbose --cov --cov-config=pyproject.toml
|
|
||||||
./share/spack/qa/validate_last_exit.ps1
|
|
||||||
coverage combine -a
|
|
||||||
coverage xml
|
|
||||||
- uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673
|
|
||||||
with:
|
|
||||||
flags: unittests,windows
|
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
|
||||||
verbose: true
|
|
||||||
|
19
.github/workflows/valid-style.yml
vendored
19
.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@692973e3d937129bcbf40652eb9f2f61becf3332
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
|
||||||
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f
|
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c
|
||||||
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 setuptools
|
||||||
pip install -r .github/workflows/requirements/style/requirements.txt
|
pip install -r .github/workflows/style/requirements.txt
|
||||||
- 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,28 +35,27 @@ jobs:
|
|||||||
style:
|
style:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f
|
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c
|
||||||
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 setuptools
|
||||||
pip install -r .github/workflows/requirements/style/requirements.txt
|
pip install -r .github/workflows/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'
|
||||||
@@ -70,13 +69,13 @@ 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@692973e3d937129bcbf40652eb9f2f61becf3332
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # @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 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: Bootstrap Spack development environment
|
- name: Bootstrap Spack development environment
|
||||||
|
79
.github/workflows/windows_python.yml
vendored
Normal file
79
.github/workflows/windows_python.yml
vendored
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
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@b4ffde65f46336ab88eb53be808477a3936bae11
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c
|
||||||
|
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/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@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d
|
||||||
|
with:
|
||||||
|
flags: unittests,windows
|
||||||
|
unit-tests-cmd:
|
||||||
|
runs-on: windows-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c
|
||||||
|
with:
|
||||||
|
python-version: 3.9
|
||||||
|
- name: Install Python packages
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip pywin32 setuptools 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@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d
|
||||||
|
with:
|
||||||
|
flags: unittests,windows
|
||||||
|
build-abseil:
|
||||||
|
runs-on: windows-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c
|
||||||
|
with:
|
||||||
|
python-version: 3.9
|
||||||
|
- name: Install Python packages
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip pywin32 setuptools coverage
|
||||||
|
- name: Build Test
|
||||||
|
run: |
|
||||||
|
spack compiler find
|
||||||
|
spack -d external find cmake ninja
|
||||||
|
spack -d install abseil-cpp
|
366
CHANGELOG.md
366
CHANGELOG.md
@@ -1,369 +1,3 @@
|
|||||||
|
|
||||||
# v0.22.0 (2024-05-12)
|
|
||||||
|
|
||||||
`v0.22.0` is a major feature release.
|
|
||||||
|
|
||||||
## Features in this release
|
|
||||||
|
|
||||||
1. **Compiler dependencies**
|
|
||||||
|
|
||||||
We are in the process of making compilers proper dependencies in Spack, and a number
|
|
||||||
of changes in `v0.22` support that effort. You may notice nodes in your dependency
|
|
||||||
graphs for compiler runtime libraries like `gcc-runtime` or `libgfortran`, and you
|
|
||||||
may notice that Spack graphs now include `libc`. We've also begun moving compiler
|
|
||||||
configuration from `compilers.yaml` to `packages.yaml` to make it consistent with
|
|
||||||
other externals. We are trying to do this with the least disruption possible, so
|
|
||||||
your existing `compilers.yaml` files should still work. We expect to be done with
|
|
||||||
this transition by the `v0.23` release in November.
|
|
||||||
|
|
||||||
* #41104: Packages compiled with `%gcc` on Linux, macOS and FreeBSD now depend on a
|
|
||||||
new package `gcc-runtime`, which contains a copy of the shared compiler runtime
|
|
||||||
libraries. This enables gcc runtime libraries to be installed and relocated when
|
|
||||||
using a build cache. When building minimal Spack-generated container images it is
|
|
||||||
no longer necessary to install libgfortran, libgomp etc. using the system package
|
|
||||||
manager.
|
|
||||||
|
|
||||||
* #42062: Packages compiled with `%oneapi` now depend on a new package
|
|
||||||
`intel-oneapi-runtime`. This is similar to `gcc-runtime`, and the runtimes can
|
|
||||||
provide virtuals and compilers can inject dependencies on virtuals into compiled
|
|
||||||
packages. This allows us to model library soname compatibility and allows
|
|
||||||
compilers like `%oneapi` to provide virtuals like `sycl` (which can also be
|
|
||||||
provided by standalone libraries). Note that until we have an agreement in place
|
|
||||||
with intel, Intel packages are marked `redistribute(source=False, binary=False)`
|
|
||||||
and must be downloaded outside of Spack.
|
|
||||||
|
|
||||||
* #43272: changes to the optimization criteria of the solver improve the hit-rate of
|
|
||||||
buildcaches by a fair amount. The solver more relaxed compatibility rules and will
|
|
||||||
not try to strictly match compilers or targets of reused specs. Users can still
|
|
||||||
enforce the previous strict behavior with `require:` sections in `packages.yaml`.
|
|
||||||
Note that to enforce correct linking, Spack will *not* reuse old `%gcc` and
|
|
||||||
`%oneapi` specs that do not have the runtime libraries as a dependency.
|
|
||||||
|
|
||||||
* #43539: Spack will reuse specs built with compilers that are *not* explicitly
|
|
||||||
configured in `compilers.yaml`. Because we can now keep runtime libraries in build
|
|
||||||
cache, we do not require you to also have a local configured compiler to *use* the
|
|
||||||
runtime libraries. This improves reuse in buildcaches and avoids conflicts with OS
|
|
||||||
updates that happen underneath Spack.
|
|
||||||
|
|
||||||
* #43190: binary compatibility on `linux` is now based on the `libc` version,
|
|
||||||
instead of on the `os` tag. Spack builds now detect the host `libc` (`glibc` or
|
|
||||||
`musl`) and add it as an implicit external node in the dependency graph. Binaries
|
|
||||||
with a `libc` with the same name and a version less than or equal to that of the
|
|
||||||
detected `libc` can be reused. This is only on `linux`, not `macos` or `Windows`.
|
|
||||||
|
|
||||||
* #43464: each package that can provide a compiler is now detectable using `spack
|
|
||||||
external find`. External packages defining compiler paths are effectively used as
|
|
||||||
compilers, and `spack external find -t compiler` can be used as a substitute for
|
|
||||||
`spack compiler find`. More details on this transition are in
|
|
||||||
[the docs](https://spack.readthedocs.io/en/latest/getting_started.html#manual-compiler-configuration)
|
|
||||||
|
|
||||||
2. **Improved `spack find` UI for Environments**
|
|
||||||
|
|
||||||
If you're working in an enviroment, you likely care about:
|
|
||||||
|
|
||||||
* What are the roots
|
|
||||||
* Which ones are installed / not installed
|
|
||||||
* What's been added that still needs to be concretized
|
|
||||||
|
|
||||||
We've tweaked `spack find` in environments to show this information much more
|
|
||||||
clearly. Installation status is shown next to each root, so you can see what is
|
|
||||||
installed. Roots are also shown in bold in the list of installed packages. There is
|
|
||||||
also a new option for `spack find -r` / `--only-roots` that will only show env
|
|
||||||
roots, if you don't want to look at all the installed specs.
|
|
||||||
|
|
||||||
More details in #42334.
|
|
||||||
|
|
||||||
3. **Improved command-line string quoting**
|
|
||||||
|
|
||||||
We are making some breaking changes to how Spack parses specs on the CLI in order to
|
|
||||||
respect shell quoting instead of trying to fight it. If you (sadly) had to write
|
|
||||||
something like this on the command line:
|
|
||||||
|
|
||||||
```
|
|
||||||
spack install zlib cflags=\"-O2 -g\"
|
|
||||||
```
|
|
||||||
|
|
||||||
That will now result in an error, but you can now write what you probably expected
|
|
||||||
to work in the first place:
|
|
||||||
|
|
||||||
```
|
|
||||||
spack install zlib cflags="-O2 -g"
|
|
||||||
```
|
|
||||||
|
|
||||||
Quoted can also now include special characters, so you can supply flags like:
|
|
||||||
|
|
||||||
```
|
|
||||||
spack intall zlib ldflags='-Wl,-rpath=$ORIGIN/_libs'
|
|
||||||
```
|
|
||||||
|
|
||||||
To reduce ambiguity in parsing, we now require that you *not* put spaces around `=`
|
|
||||||
and `==` when for flags or variants. This would not have broken before but will now
|
|
||||||
result in an error:
|
|
||||||
|
|
||||||
```
|
|
||||||
spack install zlib cflags = "-O2 -g"
|
|
||||||
```
|
|
||||||
|
|
||||||
More details and discussion in #30634.
|
|
||||||
|
|
||||||
4. **Revert default `spack install` behavior to `--reuse`**
|
|
||||||
|
|
||||||
We changed the default concretizer behavior from `--reuse` to `--reuse-deps` in
|
|
||||||
#30990 (in `v0.20`), which meant that *every* `spack install` invocation would
|
|
||||||
attempt to build a new version of the requested package / any environment roots.
|
|
||||||
While this is a common ask for *upgrading* and for *developer* workflows, we don't
|
|
||||||
think it should be the default for a package manager.
|
|
||||||
|
|
||||||
We are going to try to stick to this policy:
|
|
||||||
1. Prioritize reuse and build as little as possible by default.
|
|
||||||
2. Only upgrade or install duplicates if they are explicitly asked for, or if there
|
|
||||||
is a known security issue that necessitates an upgrade.
|
|
||||||
|
|
||||||
With the install command you now have three options:
|
|
||||||
|
|
||||||
* `--reuse` (default): reuse as many existing installations as possible.
|
|
||||||
* `--reuse-deps` / `--fresh-roots`: upgrade (freshen) roots but reuse dependencies if possible.
|
|
||||||
* `--fresh`: install fresh versions of requested packages (roots) and their dependencies.
|
|
||||||
|
|
||||||
We've also introduced `--fresh-roots` as an alias for `--reuse-deps` to make it more clear
|
|
||||||
that it may give you fresh versions. More details in #41302 and #43988.
|
|
||||||
|
|
||||||
5. **More control over reused specs**
|
|
||||||
|
|
||||||
You can now control which packages to reuse and how. There is a new
|
|
||||||
`concretizer:reuse` config option, which accepts the following properties:
|
|
||||||
|
|
||||||
- `roots`: `true` to reuse roots, `false` to reuse just dependencies
|
|
||||||
- `exclude`: list of constraints used to select which specs *not* to reuse
|
|
||||||
- `include`: list of constraints used to select which specs *to* reuse
|
|
||||||
- `from`: list of sources for reused specs (some combination of `local`,
|
|
||||||
`buildcache`, or `external`)
|
|
||||||
|
|
||||||
For example, to reuse only specs compiled with GCC, you could write:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
concretizer:
|
|
||||||
reuse:
|
|
||||||
roots: true
|
|
||||||
include:
|
|
||||||
- "%gcc"
|
|
||||||
```
|
|
||||||
|
|
||||||
Or, if `openmpi` must be used from externals, and it must be the only external used:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
concretizer:
|
|
||||||
reuse:
|
|
||||||
roots: true
|
|
||||||
from:
|
|
||||||
- type: local
|
|
||||||
exclude: ["openmpi"]
|
|
||||||
- type: buildcache
|
|
||||||
exclude: ["openmpi"]
|
|
||||||
- type: external
|
|
||||||
include: ["openmpi"]
|
|
||||||
```
|
|
||||||
|
|
||||||
6. **New `redistribute()` directive**
|
|
||||||
|
|
||||||
Some packages can't be redistributed in source or binary form. We need an explicit
|
|
||||||
way to say that in a package.
|
|
||||||
|
|
||||||
Now there is a `redistribute()` directive so that package authors can write:
|
|
||||||
|
|
||||||
```python
|
|
||||||
class MyPackage(Package):
|
|
||||||
redistribute(source=False, binary=False)
|
|
||||||
```
|
|
||||||
|
|
||||||
Like other directives, this works with `when=`:
|
|
||||||
|
|
||||||
```python
|
|
||||||
class MyPackage(Package):
|
|
||||||
# 12.0 and higher are proprietary
|
|
||||||
redistribute(source=False, binary=False, when="@12.0:")
|
|
||||||
|
|
||||||
# can't redistribute when we depend on some proprietary dependency
|
|
||||||
redistribute(source=False, binary=False, when="^proprietary-dependency")
|
|
||||||
```
|
|
||||||
|
|
||||||
More in #20185.
|
|
||||||
|
|
||||||
7. **New `conflict:` and `prefer:` syntax for package preferences**
|
|
||||||
|
|
||||||
Previously, you could express conflicts and preferences in `packages.yaml` through
|
|
||||||
some contortions with `require:`:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
packages:
|
|
||||||
zlib-ng:
|
|
||||||
require:
|
|
||||||
- one_of: ["%clang", "@:"] # conflict on %clang
|
|
||||||
- any_of: ["+shared", "@:"] # strong preference for +shared
|
|
||||||
```
|
|
||||||
|
|
||||||
You can now use `require:` and `prefer:` for a much more readable configuration:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
packages:
|
|
||||||
zlib-ng:
|
|
||||||
conflict:
|
|
||||||
- "%clang"
|
|
||||||
prefer:
|
|
||||||
- "+shared"
|
|
||||||
```
|
|
||||||
|
|
||||||
See [the documentation](https://spack.readthedocs.io/en/latest/packages_yaml.html#conflicts-and-strong-preferences)
|
|
||||||
and #41832 for more details.
|
|
||||||
|
|
||||||
8. **`include_concrete` in environments**
|
|
||||||
|
|
||||||
You may want to build on the *concrete* contents of another environment without
|
|
||||||
changing that environment. You can now include the concrete specs from another
|
|
||||||
environment's `spack.lock` with `include_concrete`:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
spack:
|
|
||||||
specs: []
|
|
||||||
concretizer:
|
|
||||||
unify: true
|
|
||||||
include_concrete:
|
|
||||||
- /path/to/environment1
|
|
||||||
- /path/to/environment2
|
|
||||||
```
|
|
||||||
|
|
||||||
Now, when *this* environment is concretized, it will bring in the already concrete
|
|
||||||
specs from `environment1` and `environment2`, and build on top of them without
|
|
||||||
changing them. This is useful if you have phased deployments, where old deployments
|
|
||||||
should not be modified but you want to use as many of them as possible. More details
|
|
||||||
in #33768.
|
|
||||||
|
|
||||||
9. **`python-venv` isolation**
|
|
||||||
|
|
||||||
Spack has unique requirements for Python because it:
|
|
||||||
1. installs every package in its own independent directory, and
|
|
||||||
2. allows users to register *external* python installations.
|
|
||||||
|
|
||||||
External installations may contain their own installed packages that can interfere
|
|
||||||
with Spack installations, and some distributions (Debian and Ubuntu) even change the
|
|
||||||
`sysconfig` in ways that alter the installation layout of installed Python packages
|
|
||||||
(e.g., with the addition of a `/local` prefix on Debian or Ubuntu). To isolate Spack
|
|
||||||
from these and other issues, we now insert a small `python-venv` package in between
|
|
||||||
`python` and packages that need to install Python code. This isolates Spack's build
|
|
||||||
environment, isolates Spack from any issues with an external python, and resolves a
|
|
||||||
large number of issues we've had with Python installations.
|
|
||||||
|
|
||||||
See #40773 for further details.
|
|
||||||
|
|
||||||
## New commands, options, and directives
|
|
||||||
|
|
||||||
* Allow packages to be pushed to build cache after install from source (#42423)
|
|
||||||
* `spack develop`: stage build artifacts in same root as non-dev builds #41373
|
|
||||||
* Don't delete `spack develop` build artifacts after install (#43424)
|
|
||||||
* `spack find`: add options for local/upstream only (#42999)
|
|
||||||
* `spack logs`: print log files for packages (either partially built or installed) (#42202)
|
|
||||||
* `patch`: support reversing patches (#43040)
|
|
||||||
* `develop`: Add -b/--build-directory option to set build_directory package attribute (#39606)
|
|
||||||
* `spack list`: add `--namesapce` / `--repo` option (#41948)
|
|
||||||
* directives: add `checked_by` field to `license()`, add some license checks
|
|
||||||
* `spack gc`: add options for environments and build dependencies (#41731)
|
|
||||||
* Add `--create` to `spack env activate` (#40896)
|
|
||||||
|
|
||||||
## Performance improvements
|
|
||||||
|
|
||||||
* environment.py: fix excessive re-reads (#43746)
|
|
||||||
* ruamel yaml: fix quadratic complexity bug (#43745)
|
|
||||||
* Refactor to improve `spec format` speed (#43712)
|
|
||||||
* Do not acquire a write lock on the env post install if no views (#43505)
|
|
||||||
* asp.py: fewer calls to `spec.copy()` (#43715)
|
|
||||||
* spec.py: early return in `__str__`
|
|
||||||
* avoid `jinja2` import at startup unless needed (#43237)
|
|
||||||
|
|
||||||
## Other new features of note
|
|
||||||
|
|
||||||
* `archspec`: update to `v0.2.4`: support for Windows, bugfixes for `neoverse-v1` and
|
|
||||||
`neoverse-v2` detection.
|
|
||||||
* `spack config get`/`blame`: with no args, show entire config
|
|
||||||
* `spack env create <env>`: dir if dir-like (#44024)
|
|
||||||
* ASP-based solver: update os compatibility for macOS (#43862)
|
|
||||||
* Add handling of custom ssl certs in urllib ops (#42953)
|
|
||||||
* Add ability to rename environments (#43296)
|
|
||||||
* Add config option and compiler support to reuse across OS's (#42693)
|
|
||||||
* Support for prereleases (#43140)
|
|
||||||
* Only reuse externals when configured (#41707)
|
|
||||||
* Environments: Add support for including views (#42250)
|
|
||||||
|
|
||||||
## Binary caches
|
|
||||||
* Build cache: make signed/unsigned a mirror property (#41507)
|
|
||||||
* tools stack
|
|
||||||
|
|
||||||
## Removals, deprecations, and syntax changes
|
|
||||||
* remove `dpcpp` compiler and package (#43418)
|
|
||||||
* spack load: remove --only argument (#42120)
|
|
||||||
|
|
||||||
## Notable Bugfixes
|
|
||||||
* repo.py: drop deleted packages from provider cache (#43779)
|
|
||||||
* Allow `+` in module file names (#41999)
|
|
||||||
* `cmd/python`: use runpy to allow multiprocessing in scripts (#41789)
|
|
||||||
* Show extension commands with spack -h (#41726)
|
|
||||||
* Support environment variable expansion inside module projections (#42917)
|
|
||||||
* Alert user to failed concretizations (#42655)
|
|
||||||
* shell: fix zsh color formatting for PS1 in environments (#39497)
|
|
||||||
* spack mirror create --all: include patches (#41579)
|
|
||||||
|
|
||||||
## Spack community stats
|
|
||||||
|
|
||||||
* 7,994 total packages; 525 since `v0.21.0`
|
|
||||||
* 178 new Python packages, 5 new R packages
|
|
||||||
* 358 people contributed to this release
|
|
||||||
* 344 committers to packages
|
|
||||||
* 45 committers to core
|
|
||||||
|
|
||||||
# v0.21.2 (2024-03-01)
|
|
||||||
|
|
||||||
## Bugfixes
|
|
||||||
|
|
||||||
- Containerize: accommodate nested or pre-existing spack-env paths (#41558)
|
|
||||||
- Fix setup-env script, when going back and forth between instances (#40924)
|
|
||||||
- Fix using fully-qualified namespaces from root specs (#41957)
|
|
||||||
- Fix a bug when a required provider is requested for multiple virtuals (#42088)
|
|
||||||
- OCI buildcaches:
|
|
||||||
- only push in parallel when forking (#42143)
|
|
||||||
- use pickleable errors (#42160)
|
|
||||||
- Fix using sticky variants in externals (#42253)
|
|
||||||
- Fix a rare issue with conditional requirements and multi-valued variants (#42566)
|
|
||||||
|
|
||||||
## Package updates
|
|
||||||
- rust: add v1.75, rework a few variants (#41161,#41903)
|
|
||||||
- py-transformers: add v4.35.2 (#41266)
|
|
||||||
- mgard: fix OpenMP on AppleClang (#42933)
|
|
||||||
|
|
||||||
# v0.21.1 (2024-01-11)
|
|
||||||
|
|
||||||
## New features
|
|
||||||
- Add support for reading buildcaches created by Spack v0.22 (#41773)
|
|
||||||
|
|
||||||
## Bugfixes
|
|
||||||
|
|
||||||
- spack graph: fix coloring with environments (#41240)
|
|
||||||
- spack info: sort variants in --variants-by-name (#41389)
|
|
||||||
- Spec.format: error on old style format strings (#41934)
|
|
||||||
- ASP-based solver:
|
|
||||||
- fix infinite recursion when computing concretization errors (#41061)
|
|
||||||
- don't error for type mismatch on preferences (#41138)
|
|
||||||
- don't emit spurious debug output (#41218)
|
|
||||||
- Improve the error message for deprecated preferences (#41075)
|
|
||||||
- Fix MSVC preview version breaking clingo build on Windows (#41185)
|
|
||||||
- Fix multi-word aliases (#41126)
|
|
||||||
- Add a warning for unconfigured compiler (#41213)
|
|
||||||
- environment: fix an issue with deconcretization/reconcretization of specs (#41294)
|
|
||||||
- buildcache: don't error if a patch is missing, when installing from binaries (#41986)
|
|
||||||
- Multiple improvements to unit-tests (#41215,#41369,#41495,#41359,#41361,#41345,#41342,#41308,#41226)
|
|
||||||
|
|
||||||
## Package updates
|
|
||||||
- root: add a webgui patch to address security issue (#41404)
|
|
||||||
- BerkeleyGW: update source urls (#38218)
|
|
||||||
|
|
||||||
# v0.21.0 (2023-11-11)
|
# v0.21.0 (2023-11-11)
|
||||||
|
|
||||||
`v0.21.0` is a major feature release.
|
`v0.21.0` is a major feature release.
|
||||||
|
20
CITATION.cff
20
CITATION.cff
@@ -31,17 +31,13 @@ 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"
|
title: "The Spack Package Manager: Bringing Order to HPC Software Chaos"
|
||||||
abstract: >-
|
abstract: >-
|
||||||
Large HPC centers spend considerable time supporting software for thousands of users, but the
|
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.
|
||||||
complexity of HPC software is quickly outpacing the capabilities of existing software management
|
Scientific applications require specific versions of compilers, MPI, and other dependency libraries, so using a single, standard software stack is infeasible.
|
||||||
tools. Scientific applications require specific versions of compilers, MPI, and other dependency
|
However, managing many configurations is difficult because the configuration space is combinatorial in size.
|
||||||
libraries, so using a single, standard software stack is infeasible. However, managing many
|
We introduce Spack, a tool used at Lawrence Livermore National Laboratory to manage this complexity.
|
||||||
configurations is difficult because the configuration space is combinatorial in size. We
|
Spack provides a novel, re- cursive specification syntax to invoke parametric builds of packages and dependencies.
|
||||||
introduce Spack, a tool used at Lawrence Livermore National Laboratory to manage this complexity.
|
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.
|
||||||
Spack provides a novel, re- cursive specification syntax to invoke parametric builds of packages
|
We show through real-world use cases that Spack supports diverse and demanding applications, bringing order to HPC software chaos.
|
||||||
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"
|
title: "The Spack Package Manager: Bringing Order to HPC Software Chaos"
|
||||||
type: conference-paper
|
type: conference-paper
|
||||||
@@ -75,7 +71,7 @@ preferred-citation:
|
|||||||
type: doi
|
type: doi
|
||||||
value: 10.1145/2807591.2807623
|
value: 10.1145/2807591.2807623
|
||||||
- description: "The DOE Document Release Number of the work"
|
- description: "The DOE Document Release Number of the work"
|
||||||
type: other
|
type: other
|
||||||
value: "LLNL-CONF-669890"
|
value: "LLNL-CONF-669890"
|
||||||
authors:
|
authors:
|
||||||
- family-names: "Gamblin"
|
- family-names: "Gamblin"
|
||||||
|
@@ -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
|
||||||
|
43
README.md
43
README.md
@@ -1,38 +1,17 @@
|
|||||||
<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>
|
[](https://matrix.to/#/#spack-space:matrix.org)
|
||||||
<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.
|
||||||
|
|
||||||
@@ -88,7 +67,7 @@ Resources:
|
|||||||
[bridged](https://github.com/matrix-org/matrix-appservice-slack#matrix-appservice-slack) to Slack.
|
[bridged](https://github.com/matrix-org/matrix-appservice-slack#matrix-appservice-slack) to Slack.
|
||||||
* [**Github Discussions**](https://github.com/spack/spack/discussions):
|
* [**Github Discussions**](https://github.com/spack/spack/discussions):
|
||||||
for Q&A and discussions. Note the pinned discussions for announcements.
|
for Q&A and discussions. Note the pinned discussions for announcements.
|
||||||
* **X**: [@spackpm](https://twitter.com/spackpm). Be sure to
|
* **Twitter**: [@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):
|
* **Mailing list**: [groups.google.com/d/forum/spack](https://groups.google.com/d/forum/spack):
|
||||||
only for announcements. Please use other venues for discussions.
|
only for announcements. Please use other venues for discussions.
|
||||||
|
@@ -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)
|
||||||
|
@@ -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 "$@"
|
||||||
|
@@ -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)
|
||||||
@@ -188,27 +188,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
|
||||||
|
@@ -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)
|
||||||
@@ -144,5 +144,3 @@ switch($SpackSubCommand)
|
|||||||
"unload" {Invoke-SpackLoad}
|
"unload" {Invoke-SpackLoad}
|
||||||
default {python "$Env:SPACK_ROOT/bin/spack" $SpackCMD_params $SpackSubCommand $SpackSubCommandArgs}
|
default {python "$Env:SPACK_ROOT/bin/spack" $SpackCMD_params $SpackSubCommand $SpackSubCommandArgs}
|
||||||
}
|
}
|
||||||
|
|
||||||
exit $LASTEXITCODE
|
|
||||||
|
@@ -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)
|
||||||
|
@@ -15,7 +15,7 @@ concretizer:
|
|||||||
# 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. If `dependencies`, we'll only reuse dependencies but
|
||||||
# give you a fresh concretization for your root specs.
|
# give you a fresh concretization for your root specs.
|
||||||
reuse: true
|
reuse: dependencies
|
||||||
# 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
|
||||||
@@ -42,8 +42,3 @@ concretizer:
|
|||||||
# "minimal": allows the duplication of 'build-tools' nodes only (e.g. py-setuptools, cmake etc.)
|
# "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)
|
# "full" (experimental): allows separation of the entire build-tool stack (e.g. the entire "cmake" subDAG)
|
||||||
strategy: minimal
|
strategy: minimal
|
||||||
# Option to specify compatiblity 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: {}
|
|
||||||
|
@@ -101,12 +101,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
|
||||||
@@ -170,6 +164,23 @@ 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
|
||||||
|
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,6 +19,7 @@ packages:
|
|||||||
- apple-clang
|
- apple-clang
|
||||||
- clang
|
- clang
|
||||||
- gcc
|
- gcc
|
||||||
|
- intel
|
||||||
providers:
|
providers:
|
||||||
elf: [libelf]
|
elf: [libelf]
|
||||||
fuse: [macfuse]
|
fuse: [macfuse]
|
||||||
|
@@ -15,20 +15,15 @@
|
|||||||
# -------------------------------------------------------------------------
|
# -------------------------------------------------------------------------
|
||||||
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-oneapi-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]
|
||||||
@@ -39,11 +34,9 @@ packages:
|
|||||||
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]
|
||||||
@@ -64,7 +57,6 @@ 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]
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
config:
|
config:
|
||||||
locks: false
|
locks: false
|
||||||
|
concretizer: clingo
|
||||||
build_stage::
|
build_stage::
|
||||||
- '$spack/.staging'
|
- '$spack/.staging'
|
||||||
stage_name: '{name}-{version}-{hash:7}'
|
stage_name: '{name}-{version}-{hash:7}'
|
||||||
|
@@ -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)
|
||||||
|
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)
|
||||||
@@ -865,7 +865,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:
|
||||||
|
|
||||||
@@ -959,86 +959,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:
|
||||||
@@ -1198,9 +1119,6 @@ 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
|
``4.2``. As a short-hand, ``@3`` is equivalent to the range ``@3:3`` and
|
||||||
includes any version with major version ``3``.
|
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
|
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
|
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``,
|
scheme that omits the zero patch version number: ``3.2``, ``3.2.1``,
|
||||||
@@ -1212,10 +1130,6 @@ 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
|
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``.
|
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
|
||||||
and commits. Spack will stage and build based off the ``git``
|
and commits. Spack will stage and build based off the ``git``
|
||||||
@@ -1433,12 +1347,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:
|
||||||
|
|
||||||
@@ -1774,6 +1698,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)
|
||||||
@@ -220,40 +220,6 @@ section of the configuration:
|
|||||||
|
|
||||||
.. _binary_caches_oci:
|
.. _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
|
OCI / Docker V2 registries as build cache
|
||||||
-----------------------------------------
|
-----------------------------------------
|
||||||
|
@@ -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 @@ 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 +101,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 +175,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,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,86 +21,23 @@ is the following:
|
|||||||
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: dependencies`` is the default.
|
||||||
|
|
||||||
.. seealso::
|
.. seealso::
|
||||||
|
|
||||||
|
@@ -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)
|
||||||
@@ -147,15 +147,6 @@ example, the ``bash`` shell is used to run the ``autogen.sh`` script.
|
|||||||
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
|
||||||
"""""""""""""""""""""""""""""""""""""""
|
"""""""""""""""""""""""""""""""""""""""
|
||||||
|
@@ -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)
|
||||||
|
@@ -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)
|
||||||
@@ -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
|
||||||
|
@@ -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)
|
||||||
|
@@ -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,7 +25,7 @@ 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. Search for ``oneAPI`` at `<packages.spack.io>`_ for the full
|
||||||
list of available oneAPI packages, or use::
|
list of available oneAPI packages, or use::
|
||||||
|
|
||||||
spack list -d oneAPI
|
spack list -d oneAPI
|
||||||
|
@@ -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
|
||||||
|
@@ -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)
|
||||||
@@ -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>`_
|
||||||
@@ -140,7 +140,7 @@ 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
|
||||||
|
|
||||||
|
@@ -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)
|
||||||
|
@@ -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)
|
||||||
@@ -173,72 +173,6 @@ arguments to ``Makefile.PL`` or ``Build.PL`` by overriding
|
|||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
^^^^^^^
|
|
||||||
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)
|
||||||
@@ -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)
|
||||||
|
@@ -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)
|
||||||
|
@@ -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)
|
||||||
|
@@ -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)
|
||||||
|
@@ -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)
|
||||||
|
@@ -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)
|
||||||
@@ -11,8 +11,7 @@ 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)
|
||||||
@@ -199,14 +199,12 @@ 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", "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"),
|
||||||
@@ -217,7 +215,6 @@ def setup(sphinx):
|
|||||||
("py:class", "spack.spec.InstallStatus"),
|
("py:class", "spack.spec.InstallStatus"),
|
||||||
("py:class", "spack.spec.SpecfileReaderBase"),
|
("py:class", "spack.spec.SpecfileReaderBase"),
|
||||||
("py:class", "spack.install_test.Pb"),
|
("py:class", "spack.install_test.Pb"),
|
||||||
("py:class", "spack.filesystem_view.SimpleFilesystemView"),
|
|
||||||
]
|
]
|
||||||
|
|
||||||
# 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.
|
||||||
|
@@ -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``
|
||||||
--------------------
|
--------------------
|
||||||
|
@@ -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)
|
||||||
@@ -73,12 +73,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 +196,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:
|
||||||
|
|
||||||
------------------------
|
------------------------
|
||||||
|
@@ -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,34 @@
|
|||||||
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``.
|
||||||
|
|
||||||
~~~~~~~~~~~~~~~~~~~~
|
.. seealso::
|
||||||
|
|
||||||
|
This page is a reference for generating recipes to build container images.
|
||||||
|
It means that your environment is built from scratch inside the container
|
||||||
|
runtime.
|
||||||
|
|
||||||
|
Since v0.21, Spack can also create container images from existing package installations
|
||||||
|
on your host system. See :ref:`binary_caches_oci` for more information on
|
||||||
|
that topic.
|
||||||
|
|
||||||
|
--------------------
|
||||||
A Quick Introduction
|
A Quick Introduction
|
||||||
~~~~~~~~~~~~~~~~~~~~
|
--------------------
|
||||||
|
|
||||||
Consider having a Spack environment like the following:
|
Consider having a Spack environment like the following:
|
||||||
|
|
||||||
@@ -109,8 +47,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 +114,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,18 +132,21 @@ 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``
|
||||||
@@ -224,12 +165,12 @@ The OS that are currently supported are summarized in the table below:
|
|||||||
* - Rocky Linux 9
|
* - Rocky Linux 9
|
||||||
- ``rockylinux:9``
|
- ``rockylinux:9``
|
||||||
- ``spack/rockylinux9``
|
- ``spack/rockylinux9``
|
||||||
* - Fedora Linux 39
|
* - Fedora Linux 37
|
||||||
- ``fedora:39``
|
- ``fedora:37``
|
||||||
- ``spack/fedora39``
|
- ``spack/fedora37``
|
||||||
* - Fedora Linux 40
|
* - Fedora Linux 38
|
||||||
- ``fedora:40``
|
- ``fedora:38``
|
||||||
- ``spack/fedora40``
|
- ``spack/fedora38``
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -245,9 +186,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
|
||||||
@@ -288,18 +229,18 @@ under the ``container`` attribute of environments:
|
|||||||
|
|
||||||
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 +445,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,9 +468,9 @@ 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
|
Extending the Jinja2 Templates
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
------------------------------
|
||||||
|
|
||||||
The Dockerfile and the Singularity definition file that Spack can generate are based on
|
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.
|
a few Jinja2 templates that are rendered according to the environment being containerized.
|
||||||
@@ -650,9 +591,9 @@ The recipe that gets generated contains the two extra instruction that we added
|
|||||||
|
|
||||||
.. _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:
|
||||||
@@ -749,13 +690,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 +707,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 +728,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)
|
||||||
|
@@ -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)
|
||||||
@@ -357,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.
|
||||||
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^
|
||||||
@@ -552,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:
|
||||||
|
|
||||||
@@ -1071,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,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)
|
||||||
@@ -142,17 +142,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 does not already
|
|
||||||
exist.
|
|
||||||
|
|
||||||
.. 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
|
||||||
@@ -172,36 +161,21 @@ environment will remove the view from the user environment.
|
|||||||
Anonymous Environments
|
Anonymous Environments
|
||||||
^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
Apart from managed environments, Spack also supports anonymous environments.
|
Any directory can be treated as an environment if it contains a file
|
||||||
|
``spack.yaml``. To load an anonymous environment, use:
|
||||||
Anonymous environments can be placed in any directory of choice.
|
|
||||||
|
|
||||||
.. 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 anonymous
|
|
||||||
environments.
|
|
||||||
|
|
||||||
To create an anonymous 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 anonymous 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 anonymous environment in a temporary directory for you:
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ spack env activate --temp
|
|
||||||
|
|
||||||
|
In this case Spack simply creates a ``spack.yaml`` file in the requested
|
||||||
|
directory.
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
Environment Sensitive Commands
|
Environment Sensitive Commands
|
||||||
@@ -427,23 +401,6 @@ that git clone if ``foo`` is in the environment.
|
|||||||
Further development on ``foo`` can be tested by reinstalling 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
|
||||||
^^^^^^^
|
^^^^^^^
|
||||||
@@ -460,125 +417,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:
|
||||||
|
|
||||||
------------------------
|
------------------------
|
||||||
@@ -619,11 +457,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``.
|
||||||
@@ -930,85 +768,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
|
||||||
@@ -1022,7 +807,7 @@ directories.
|
|||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
spack:
|
spack:
|
||||||
# ...
|
...
|
||||||
view:
|
view:
|
||||||
mpis:
|
mpis:
|
||||||
root: /path/to/view
|
root: /path/to/view
|
||||||
@@ -1053,10 +838,59 @@ 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
|
||||||
@@ -1086,17 +920,6 @@ function, as shown in the example below:
|
|||||||
^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
|
||||||
be the first non-``all`` entry that the spec satisfies, or ``all`` if
|
be the first non-``all`` entry that the spec satisfies, or ``all`` if
|
||||||
@@ -1122,18 +945,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
|
||||||
@@ -1156,8 +972,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:
|
||||||
@@ -1174,7 +990,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
|
||||||
@@ -1267,7 +1083,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
|
||||||
|
|
||||||
@@ -1289,7 +1105,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
|
||||||
|
|
||||||
@@ -1316,7 +1132,7 @@ 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 push --allow-root --only=package $(BUILDCACHE_DIR) /$(HASH)
|
||||||
@touch $@
|
@touch $@
|
||||||
|
|
||||||
push: $(addprefix example/push/,$(example/SPACK_PACKAGE_IDS))
|
push: $(addprefix example/push/,$(example/SPACK_PACKAGE_IDS))
|
||||||
|
@@ -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)
|
||||||
@@ -111,39 +111,3 @@ The corresponding unit tests can be run giving the appropriate options to ``spac
|
|||||||
|
|
||||||
(5 durations < 0.005s hidden. Use -vv to show these durations.)
|
(5 durations < 0.005s hidden. Use -vv to show these durations.)
|
||||||
=========================================== 5 passed in 5.06s ============================================
|
=========================================== 5 passed in 5.06s ============================================
|
||||||
|
|
||||||
---------------------------------------
|
|
||||||
Registering Extensions via Entry Points
|
|
||||||
---------------------------------------
|
|
||||||
|
|
||||||
.. 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,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)
|
||||||
@@ -250,10 +250,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:
|
||||||
|
|
||||||
@@ -458,54 +457,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
|
||||||
@@ -672,7 +623,7 @@ Fortran.
|
|||||||
|
|
||||||
compilers:
|
compilers:
|
||||||
- compiler:
|
- compiler:
|
||||||
# ...
|
...
|
||||||
paths:
|
paths:
|
||||||
cc: /usr/bin/clang
|
cc: /usr/bin/clang
|
||||||
cxx: /usr/bin/clang++
|
cxx: /usr/bin/clang++
|
||||||
@@ -1364,6 +1315,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:
|
||||||
|
|
||||||
----------------
|
----------------
|
||||||
@@ -1397,8 +1529,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,"
|
||||||
@@ -1406,7 +1536,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.
|
||||||
|
@@ -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)
|
||||||
|
@@ -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)
|
||||||
@@ -10,7 +10,7 @@ Modules (modules.yaml)
|
|||||||
======================
|
======================
|
||||||
|
|
||||||
The use of module systems to manage user environment in a controlled way
|
The use of module systems to manage user environment in a controlled way
|
||||||
is a common practice at HPC centers that is sometimes embraced also by
|
is a common practice at HPC centers that is often embraced also by
|
||||||
individual programmers on their development machines. To support this
|
individual programmers on their development machines. To support this
|
||||||
common practice Spack integrates with `Environment Modules
|
common practice Spack integrates with `Environment Modules
|
||||||
<http://modules.sourceforge.net/>`_ and `Lmod
|
<http://modules.sourceforge.net/>`_ and `Lmod
|
||||||
@@ -21,38 +21,14 @@ Modules are one of several ways you can use Spack packages. For other
|
|||||||
options that may fit your use case better, you should also look at
|
options that may fit your use case better, you should also look at
|
||||||
:ref:`spack load <spack-load>` and :ref:`environments <environments>`.
|
:ref:`spack load <spack-load>` and :ref:`environments <environments>`.
|
||||||
|
|
||||||
-----------
|
----------------------------
|
||||||
Quick start
|
Using module files via Spack
|
||||||
-----------
|
----------------------------
|
||||||
|
|
||||||
In the current version of Spack, module files are not generated by default. To get started, you
|
If you have installed a supported module system you should be able to
|
||||||
can generate module files for all currently installed packages by running either
|
run ``module avail`` to see what module
|
||||||
|
files have been installed. Here is sample output of those programs,
|
||||||
.. code-block:: console
|
showing lots of installed packages:
|
||||||
|
|
||||||
$ spack module tcl refresh
|
|
||||||
|
|
||||||
or
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ spack module lmod refresh
|
|
||||||
|
|
||||||
Spack can also generate module files for all future installations automatically through the
|
|
||||||
following configuration:
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ spack config add modules:default:enable:[tcl]
|
|
||||||
|
|
||||||
or
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ spack config add modules:default:enable:[lmod]
|
|
||||||
|
|
||||||
Assuming you have a module system installed, you should now be able to use the ``module`` command
|
|
||||||
to interact with them:
|
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
@@ -89,17 +65,33 @@ scheme used at your site.
|
|||||||
Module file customization
|
Module file customization
|
||||||
-------------------------
|
-------------------------
|
||||||
|
|
||||||
|
Module files are generated by post-install hooks after the successful
|
||||||
|
installation of a package.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
Spack only generates modulefiles when a package is installed. If
|
||||||
|
you attempt to install a package and it is already installed, Spack
|
||||||
|
will not regenerate modulefiles for the package. This may lead to
|
||||||
|
inconsistent modulefiles if the Spack module configuration has
|
||||||
|
changed since the package was installed, either by editing a file
|
||||||
|
or changing scopes or environments.
|
||||||
|
|
||||||
|
Later in this section there is a subsection on :ref:`regenerating
|
||||||
|
modules <cmd-spack-module-refresh>` that will allow you to bring
|
||||||
|
your modules to a consistent state.
|
||||||
|
|
||||||
The table below summarizes the essential information associated with
|
The table below summarizes the essential information associated with
|
||||||
the different file formats that can be generated by Spack:
|
the different file formats that can be generated by Spack:
|
||||||
|
|
||||||
|
|
||||||
+-----------+--------------+------------------------------+----------------------------------------------+----------------------+
|
+-----------------------------+--------------------+-------------------------------+----------------------------------------------+----------------------+
|
||||||
| | Hierarchical | **Default root directory** | **Default template file** | **Compatible tools** |
|
| | **Hook name** | **Default root directory** | **Default template file** | **Compatible tools** |
|
||||||
+===========+==============+==============================+==============================================+======================+
|
+=============================+====================+===============================+==============================================+======================+
|
||||||
| ``tcl`` | No | share/spack/modules | share/spack/templates/modules/modulefile.tcl | Env. Modules/Lmod |
|
| **Tcl - Non-Hierarchical** | ``tcl`` | share/spack/modules | share/spack/templates/modules/modulefile.tcl | Env. Modules/Lmod |
|
||||||
+-----------+--------------+------------------------------+----------------------------------------------+----------------------+
|
+-----------------------------+--------------------+-------------------------------+----------------------------------------------+----------------------+
|
||||||
| ``lmod`` | Yes | share/spack/lmod | share/spack/templates/modules/modulefile.lua | Lmod |
|
| **Lua - Hierarchical** | ``lmod`` | share/spack/lmod | share/spack/templates/modules/modulefile.lua | Lmod |
|
||||||
+-----------+--------------+------------------------------+----------------------------------------------+----------------------+
|
+-----------------------------+--------------------+-------------------------------+----------------------------------------------+----------------------+
|
||||||
|
|
||||||
|
|
||||||
Spack ships with sensible defaults for the generation of module files, but
|
Spack ships with sensible defaults for the generation of module files, but
|
||||||
@@ -110,7 +102,7 @@ In general you can override or extend the default behavior by:
|
|||||||
2. writing specific rules in the ``modules.yaml`` configuration file
|
2. writing specific rules in the ``modules.yaml`` configuration file
|
||||||
3. writing your own templates to override or extend the defaults
|
3. writing your own templates to override or extend the defaults
|
||||||
|
|
||||||
The former method lets you express changes in the run-time environment
|
The former method let you express changes in the run-time environment
|
||||||
that are needed to use the installed software properly, e.g. injecting variables
|
that are needed to use the installed software properly, e.g. injecting variables
|
||||||
from language interpreters into their extensions. The latter two instead permit to
|
from language interpreters into their extensions. The latter two instead permit to
|
||||||
fine tune the filesystem layout, content and creation of module files to meet
|
fine tune the filesystem layout, content and creation of module files to meet
|
||||||
@@ -118,62 +110,79 @@ site specific conventions.
|
|||||||
|
|
||||||
.. _overide-api-calls-in-package-py:
|
.. _overide-api-calls-in-package-py:
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
Setting environment variables dynamically in ``package.py``
|
Override API calls in ``package.py``
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
There are two methods that you can implement in any ``package.py`` to dynamically affect the
|
There are two methods that you can override in any ``package.py`` to affect the
|
||||||
content of the module files generated by Spack. The most important one is
|
content of the module files generated by Spack. The first one:
|
||||||
``setup_run_environment``, which can be used to set environment variables in the module file that
|
|
||||||
depend on the spec:
|
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
def setup_run_environment(self, env):
|
def setup_run_environment(self, env):
|
||||||
if self.spec.satisfies("+foo"):
|
pass
|
||||||
env.set("FOO", "bar")
|
|
||||||
|
|
||||||
The second, less commonly used, is ``setup_dependent_run_environment(self, env, dependent_spec)``,
|
can alter the content of the module file associated with the same package where it is overridden.
|
||||||
which allows a dependency to set variables in the module file of its dependents. This is typically
|
The second method:
|
||||||
used in packages like ``python``, ``r``, or ``perl`` to prepend the dependent's prefix to the
|
|
||||||
search path of the interpreter (``PYTHONPATH``, ``R_LIBS``, ``PERL5LIB`` resp.), so it can locate
|
|
||||||
the packages at runtime.
|
|
||||||
|
|
||||||
For example, a simplified version of the ``python`` package could look like this:
|
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
def setup_dependent_run_environment(self, env, dependent_spec):
|
def setup_dependent_run_environment(self, env, dependent_spec):
|
||||||
if dependent_spec.package.extends(self.spec):
|
pass
|
||||||
env.prepend_path("PYTHONPATH", dependent_spec.prefix.lib.python)
|
|
||||||
|
|
||||||
and would make any package that ``extends("python")`` have its library directory added to the
|
can instead inject run-time environment modifications in the module files of packages
|
||||||
``PYTHONPATH`` environment variable in the module file. It's much more convenient to set this
|
that depend on it. In both cases you need to fill ``env`` with the desired
|
||||||
variable here, than to repeat it in every Python extension's ``setup_run_environment`` method.
|
list of environment modifications.
|
||||||
|
|
||||||
|
.. admonition:: The ``r`` package and callback APIs
|
||||||
|
|
||||||
|
An example in which it is crucial to override both methods
|
||||||
|
is given by the ``r`` package. This package installs libraries and headers
|
||||||
|
in non-standard locations and it is possible to prepend the appropriate directory
|
||||||
|
to the corresponding environment variables:
|
||||||
|
|
||||||
|
================== =================================
|
||||||
|
LD_LIBRARY_PATH ``self.prefix/rlib/R/lib``
|
||||||
|
PKG_CONFIG_PATH ``self.prefix/rlib/pkgconfig``
|
||||||
|
================== =================================
|
||||||
|
|
||||||
|
with the following snippet:
|
||||||
|
|
||||||
|
.. literalinclude:: _spack_root/var/spack/repos/builtin/packages/r/package.py
|
||||||
|
:pyobject: R.setup_run_environment
|
||||||
|
|
||||||
|
The ``r`` package also knows which environment variable should be modified
|
||||||
|
to make language extensions provided by other packages available, and modifies
|
||||||
|
it appropriately in the override of the second method:
|
||||||
|
|
||||||
|
.. literalinclude:: _spack_root/var/spack/repos/builtin/packages/r/package.py
|
||||||
|
:pyobject: R.setup_dependent_run_environment
|
||||||
|
|
||||||
.. _modules-yaml:
|
.. _modules-yaml:
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
The ``modules.yaml`` config file and module sets
|
Write a configuration file
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
The configuration files that control module generation behavior are named ``modules.yaml``. The
|
The configuration files that control module generation behavior
|
||||||
default configuration looks like this:
|
are named ``modules.yaml``. The default configuration:
|
||||||
|
|
||||||
.. literalinclude:: _spack_root/etc/spack/defaults/modules.yaml
|
.. literalinclude:: _spack_root/etc/spack/defaults/modules.yaml
|
||||||
:language: yaml
|
:language: yaml
|
||||||
|
|
||||||
You can define one or more **module sets**, each of which can be configured separately with regard
|
activates the hooks to generate ``tcl`` module files and inspects
|
||||||
to install location, naming scheme, inclusion and exclusion, autoloading, et cetera.
|
the installation folder of each package for the presence of a set of subdirectories
|
||||||
|
(``bin``, ``man``, ``share/man``, etc.). If any is found its full path is prepended
|
||||||
|
to the environment variables listed below the folder name.
|
||||||
|
|
||||||
The default module set is aptly named ``default``. All
|
Spack modules can be configured for multiple module sets. The default
|
||||||
:ref:`Spack commands that operate on modules <maintaining-module-files>` apply to the ``default``
|
module set is named ``default``. All Spack commands which operate on
|
||||||
module set, unless another module set is specified explicitly (with the ``--name`` flag).
|
modules default to apply the ``default`` module set, but can be
|
||||||
|
applied to any module set in the configuration.
|
||||||
|
|
||||||
|
"""""""""""""""""""""""""
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
Changing the modules root
|
Changing the modules root
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
"""""""""""""""""""""""""
|
||||||
|
|
||||||
As shown in the table above, the default module root for ``lmod`` is
|
As shown in the table above, the default module root for ``lmod`` is
|
||||||
``$spack/share/spack/lmod`` and the default root for ``tcl`` is
|
``$spack/share/spack/lmod`` and the default root for ``tcl`` is
|
||||||
@@ -189,7 +198,7 @@ set by changing the ``roots`` key of the configuration.
|
|||||||
my_custom_lmod_modules:
|
my_custom_lmod_modules:
|
||||||
roots:
|
roots:
|
||||||
lmod: /path/to/install/custom/lmod/modules
|
lmod: /path/to/install/custom/lmod/modules
|
||||||
# ...
|
...
|
||||||
|
|
||||||
This configuration will create two module sets. The default module set
|
This configuration will create two module sets. The default module set
|
||||||
will install its ``tcl`` modules to ``/path/to/install/tcl/modules``
|
will install its ``tcl`` modules to ``/path/to/install/tcl/modules``
|
||||||
@@ -215,32 +224,25 @@ location could be confusing to users of your modules. In the next
|
|||||||
section, we will discuss enabling and disabling module types (module
|
section, we will discuss enabling and disabling module types (module
|
||||||
file generators) for each module set.
|
file generators) for each module set.
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
""""""""""""""""""""
|
||||||
Automatically generating module files
|
Activate other hooks
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
""""""""""""""""""""
|
||||||
|
|
||||||
Spack can be configured to automatically generate module files as part of package installation.
|
Any other module file generator shipped with Spack can be activated adding it to the
|
||||||
This is done by adding the desired module systems to the ``enable`` list.
|
list under the ``enable`` key in the module file. Currently the only generator that
|
||||||
|
is not active by default is ``lmod``, which produces hierarchical lua module files.
|
||||||
|
|
||||||
|
Each module system can then be configured separately. In fact, you should list configuration
|
||||||
|
options that affect a particular type of module files under a top level key corresponding
|
||||||
|
to the generator being customized:
|
||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
modules:
|
modules:
|
||||||
default:
|
default:
|
||||||
enable:
|
enable:
|
||||||
- tcl
|
- tcl
|
||||||
- lmod
|
- lmod
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
Configuring ``tcl`` and ``lmod`` modules
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
You can configure the behavior of either module system separately, under a key corresponding to
|
|
||||||
the generator being customized:
|
|
||||||
|
|
||||||
.. code-block:: yaml
|
|
||||||
|
|
||||||
modules:
|
|
||||||
default:
|
|
||||||
tcl:
|
tcl:
|
||||||
# contains environment modules specific customizations
|
# contains environment modules specific customizations
|
||||||
lmod:
|
lmod:
|
||||||
@@ -251,82 +253,16 @@ either change the layout of the module files on the filesystem, or they will aff
|
|||||||
their content. For the latter point it is possible to use anonymous specs
|
their content. For the latter point it is possible to use anonymous specs
|
||||||
to fine tune the set of packages on which the modifications should be applied.
|
to fine tune the set of packages on which the modifications should be applied.
|
||||||
|
|
||||||
.. _autoloading-dependencies:
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
Autoloading and hiding dependencies
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
A module file should set the variables that are needed for an application to work. But since an
|
|
||||||
application often has many dependencies, where should all the environment variables for those be
|
|
||||||
set? In Spack the rule is that each package sets the runtime variables that are needed by the
|
|
||||||
package itself, and no more. This way, dependencies can be loaded standalone too, and duplication
|
|
||||||
of environment variables is avoided.
|
|
||||||
|
|
||||||
That means however that if you want to use an application, you need to load the modules for all its
|
|
||||||
dependencies. Of course this is not something you would want users to do manually.
|
|
||||||
|
|
||||||
Since Spack knows the dependency graph of every package, it can easily generate module files that
|
|
||||||
automatically load the modules for its dependencies recursively. It is enabled by default for both
|
|
||||||
Lmod and Environment Modules under the ``autoload: direct`` config option. The former system has
|
|
||||||
builtin support through the ``depends_on`` function, the latter simply uses a ``module load``
|
|
||||||
statement. Both module systems (at least in newer versions) do reference counting, so that if a
|
|
||||||
module is loaded by two different modules, it will only be unloaded after the others are.
|
|
||||||
|
|
||||||
The ``autoload`` key accepts the values:
|
|
||||||
|
|
||||||
* ``none``: no autoloading
|
|
||||||
* ``run``: autoload direct *run* type dependencies
|
|
||||||
* ``direct``: autoload direct *link and run* type dependencies
|
|
||||||
* ``all``: autoload all dependencies
|
|
||||||
|
|
||||||
In case of ``run`` and ``direct``, a ``module load`` triggers a recursive load.
|
|
||||||
|
|
||||||
The ``direct`` option is most correct: there are cases where pure link dependencies need to set
|
|
||||||
variables for themselves, or need to have variables of their own dependencies set.
|
|
||||||
|
|
||||||
In practice however, ``run`` is often sufficient, and may make ``module load`` snappier.
|
|
||||||
|
|
||||||
The ``all`` option is discouraged and seldomly used.
|
|
||||||
|
|
||||||
A common complaint about autoloading is the large number of modules that are visible to the user.
|
|
||||||
Spack has a solution for this as well: ``hide_implicits: true``. This ensures that only those
|
|
||||||
packages you've explicitly installed are exposed by ``module avail``, but still allows for
|
|
||||||
autoloading of hidden dependencies. Lmod should support hiding implicits in general, while
|
|
||||||
Environment Modules requires version 4.7 or higher.
|
|
||||||
|
|
||||||
.. note::
|
|
||||||
If supported by your module system, we highly encourage the following configuration that enables
|
|
||||||
autoloading and hiding of implicits. It ensures all runtime variables are set correctly,
|
|
||||||
including those for dependencies, without overwhelming the user with a large number of available
|
|
||||||
modules. Further, it makes it easier to get readable module names without collisions, see the
|
|
||||||
section below on :ref:`modules-projections`.
|
|
||||||
|
|
||||||
.. code-block:: yaml
|
|
||||||
|
|
||||||
modules:
|
|
||||||
default:
|
|
||||||
tcl:
|
|
||||||
hide_implicits: true
|
|
||||||
all:
|
|
||||||
autoload: direct # or `run`
|
|
||||||
lmod:
|
|
||||||
hide_implicits: true
|
|
||||||
all:
|
|
||||||
autoload: direct # or `run`
|
|
||||||
|
|
||||||
.. _anonymous_specs:
|
.. _anonymous_specs:
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
""""""""""""""""""""""""""""
|
||||||
Setting environment variables for selected packages in config
|
Selection by anonymous specs
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
""""""""""""""""""""""""""""
|
||||||
|
|
||||||
In the configuration file you can filter particular specs, and make further changes to the
|
In the configuration file you can use *anonymous specs* (i.e. specs
|
||||||
environment variables that go into their module files. This is very powerful when you want to avoid
|
that **are not required to have a root package** and are thus used just
|
||||||
:ref:`modifying the package itself <overide-api-calls-in-package-py>`, or when you want to set
|
to express constraints) to apply certain modifications on a selected set
|
||||||
certain variables on multiple selected packages at once.
|
of the installed software. For instance, in the snippet below:
|
||||||
|
|
||||||
For instance, in the snippet below:
|
|
||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
@@ -369,28 +305,12 @@ the variable ``FOOBAR`` will be unset.
|
|||||||
.. note::
|
.. note::
|
||||||
Order does matter
|
Order does matter
|
||||||
The modifications associated with the ``all`` keyword are always evaluated
|
The modifications associated with the ``all`` keyword are always evaluated
|
||||||
first, no matter where they appear in the configuration file. All the other changes to
|
first, no matter where they appear in the configuration file. All the other
|
||||||
environment variables for matching specs are evaluated from top to bottom.
|
spec constraints are instead evaluated top to bottom.
|
||||||
|
|
||||||
.. warning::
|
""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
As general advice, it's often better to set as few unnecessary variables as possible. For
|
|
||||||
example, the following seemingly innocent and potentially useful configuration
|
|
||||||
|
|
||||||
.. code-block:: yaml
|
|
||||||
|
|
||||||
all:
|
|
||||||
environment:
|
|
||||||
set:
|
|
||||||
"{name}_ROOT": "{prefix}"
|
|
||||||
|
|
||||||
sets ``BINUTILS_ROOT`` to its prefix in modules for ``binutils``, which happens to break
|
|
||||||
the ``gcc`` compiler: it uses this variable as its default search path for certain object
|
|
||||||
files and libraries, and by merely setting it, everything fails to link.
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
Exclude or include specific module files
|
Exclude or include specific module files
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
You can use anonymous specs also to prevent module files from being written or
|
You can use anonymous specs also to prevent module files from being written or
|
||||||
to force them to be written. Consider the case where you want to hide from users
|
to force them to be written. Consider the case where you want to hide from users
|
||||||
@@ -410,19 +330,14 @@ you will prevent the generation of module files for any package that
|
|||||||
is compiled with ``gcc@4.4.7``, with the only exception of any ``gcc``
|
is compiled with ``gcc@4.4.7``, with the only exception of any ``gcc``
|
||||||
or any ``llvm`` installation.
|
or any ``llvm`` installation.
|
||||||
|
|
||||||
It is safe to combine ``exclude`` and ``autoload``
|
|
||||||
:ref:`mentioned above <autoloading-dependencies>`. When ``exclude`` prevents a module file to be
|
|
||||||
generated for a dependency, the ``autoload`` feature will simply not generate a statement to load
|
|
||||||
it.
|
|
||||||
|
|
||||||
|
|
||||||
.. _modules-projections:
|
.. _modules-projections:
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
"""""""""""""""""""""""""""""""
|
||||||
Customize the naming of modules
|
Customize the naming of modules
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
"""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
The names of environment modules generated by Spack are not always easy to
|
The names of environment modules generated by spack are not always easy to
|
||||||
fully comprehend due to the long hash in the name. There are three module
|
fully comprehend due to the long hash in the name. There are three module
|
||||||
configuration options to help with that. The first is a global setting to
|
configuration options to help with that. The first is a global setting to
|
||||||
adjust the hash length. It can be set anywhere from 0 to 32 and has a default
|
adjust the hash length. It can be set anywhere from 0 to 32 and has a default
|
||||||
@@ -438,13 +353,6 @@ shows how to set hash length in the module file names:
|
|||||||
tcl:
|
tcl:
|
||||||
hash_length: 7
|
hash_length: 7
|
||||||
|
|
||||||
.. tip::
|
|
||||||
|
|
||||||
Using ``hide_implicits: true`` (see :ref:`autoloading-dependencies`) vastly reduces the number
|
|
||||||
modules exposed to the user. The hidden modules always contain the hash in their name, and are
|
|
||||||
not influenced by the ``hash_length`` setting. Hidden implicits thus make it easier to use a
|
|
||||||
short hash length or no hash at all, without risking name conflicts.
|
|
||||||
|
|
||||||
To help make module names more readable, and to help alleviate name conflicts
|
To help make module names more readable, and to help alleviate name conflicts
|
||||||
with a short hash, one can use the ``suffixes`` option in the modules
|
with a short hash, one can use the ``suffixes`` option in the modules
|
||||||
configuration file. This option will add strings to modules that match a spec.
|
configuration file. This option will add strings to modules that match a spec.
|
||||||
@@ -457,12 +365,12 @@ For instance, the following config options,
|
|||||||
tcl:
|
tcl:
|
||||||
all:
|
all:
|
||||||
suffixes:
|
suffixes:
|
||||||
^python@3.12: 'python-3.12'
|
^python@2.7.12: 'python-2.7.12'
|
||||||
^openblas: 'openblas'
|
^openblas: 'openblas'
|
||||||
|
|
||||||
will add a ``python-3.12`` version string to any packages compiled with
|
will add a ``python-2.7.12`` version string to any packages compiled with
|
||||||
Python matching the spec, ``python@3.12``. This is useful to know which
|
python matching the spec, ``python@2.7.12``. This is useful to know which
|
||||||
version of Python a set of Python extensions is associated with. Likewise, the
|
version of python a set of python extensions is associated with. Likewise, the
|
||||||
``openblas`` string is attached to any program that has openblas in the spec,
|
``openblas`` string is attached to any program that has openblas in the spec,
|
||||||
most likely via the ``+blas`` variant specification.
|
most likely via the ``+blas`` variant specification.
|
||||||
|
|
||||||
@@ -560,11 +468,41 @@ that are already in the Lmod hierarchy.
|
|||||||
For hierarchies that are deeper than three layers ``lmod spider`` may have some issues.
|
For hierarchies that are deeper than three layers ``lmod spider`` may have some issues.
|
||||||
See `this discussion on the Lmod project <https://github.com/TACC/Lmod/issues/114>`_.
|
See `this discussion on the Lmod project <https://github.com/TACC/Lmod/issues/114>`_.
|
||||||
|
|
||||||
|
""""""""""""""""""""""
|
||||||
|
Select default modules
|
||||||
|
""""""""""""""""""""""
|
||||||
|
|
||||||
|
By default, when multiple modules of the same name share a directory,
|
||||||
|
the highest version number will be the default module. This behavior
|
||||||
|
of the ``module`` command can be overridden with a symlink named
|
||||||
|
``default`` to the desired default module. If you wish to configure
|
||||||
|
default modules with Spack, add a ``defaults`` key to your modules
|
||||||
|
configuration:
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
modules:
|
||||||
|
my-module-set:
|
||||||
|
tcl:
|
||||||
|
defaults:
|
||||||
|
- gcc@10.2.1
|
||||||
|
- hdf5@1.2.10+mpi+hl%gcc
|
||||||
|
|
||||||
|
These defaults may be arbitrarily specific. For any package that
|
||||||
|
satisfies a default, Spack will generate the module file in the
|
||||||
|
appropriate path, and will generate a default symlink to the module
|
||||||
|
file as well.
|
||||||
|
|
||||||
|
.. warning::
|
||||||
|
If Spack is configured to generate multiple default packages in the
|
||||||
|
same directory, the last modulefile to be generated will be the
|
||||||
|
default module.
|
||||||
|
|
||||||
.. _customize-env-modifications:
|
.. _customize-env-modifications:
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
"""""""""""""""""""""""""""""""""""
|
||||||
Customize environment modifications
|
Customize environment modifications
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
"""""""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
You can control which prefixes in a Spack package are added to
|
You can control which prefixes in a Spack package are added to
|
||||||
environment variables with the ``prefix_inspections`` section; this
|
environment variables with the ``prefix_inspections`` section; this
|
||||||
@@ -662,9 +600,9 @@ stack to users who are likely to inspect the modules to find full
|
|||||||
paths to software, when it is desirable to present the users with a
|
paths to software, when it is desirable to present the users with a
|
||||||
simpler set of paths than those generated by the Spack install tree.
|
simpler set of paths than those generated by the Spack install tree.
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
""""""""""""""""""""""""""""""""""""
|
||||||
Filter out environment modifications
|
Filter out environment modifications
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
""""""""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
Modifications to certain environment variables in module files are there by
|
Modifications to certain environment variables in module files are there by
|
||||||
default, for instance because they are generated by prefix inspections.
|
default, for instance because they are generated by prefix inspections.
|
||||||
@@ -684,37 +622,49 @@ do so by using the ``exclude_env_vars``:
|
|||||||
The configuration above will generate module files that will not contain
|
The configuration above will generate module files that will not contain
|
||||||
modifications to either ``CPATH`` or ``LIBRARY_PATH``.
|
modifications to either ``CPATH`` or ``LIBRARY_PATH``.
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
Select default modules
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
By default, when multiple modules of the same name share a directory,
|
.. _autoloading-dependencies:
|
||||||
the highest version number will be the default module. This behavior
|
|
||||||
of the ``module`` command can be overridden with a symlink named
|
"""""""""""""""""""""
|
||||||
``default`` to the desired default module. If you wish to configure
|
Autoload dependencies
|
||||||
default modules with Spack, add a ``defaults`` key to your modules
|
"""""""""""""""""""""
|
||||||
configuration:
|
|
||||||
|
Often it is required for a module to have its (transient) dependencies loaded as well.
|
||||||
|
One example where this is useful is when one package needs to use executables provided
|
||||||
|
by its dependency; when the dependency is autoloaded, the executable will be in the
|
||||||
|
PATH. Similarly for scripting languages such as Python, packages and their dependencies
|
||||||
|
have to be loaded together.
|
||||||
|
|
||||||
|
Autoloading is enabled by default for Lmod and Environment Modules. The former
|
||||||
|
has builtin support for through the ``depends_on`` function. The latter uses
|
||||||
|
``module load`` statement to load and track dependencies.
|
||||||
|
|
||||||
|
Autoloading can also be enabled conditionally:
|
||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
modules:
|
modules:
|
||||||
my-module-set:
|
default:
|
||||||
tcl:
|
tcl:
|
||||||
defaults:
|
all:
|
||||||
- gcc@10.2.1
|
autoload: none
|
||||||
- hdf5@1.2.10+mpi+hl%gcc
|
^python:
|
||||||
|
autoload: direct
|
||||||
|
|
||||||
These defaults may be arbitrarily specific. For any package that
|
The configuration file above will produce module files that will
|
||||||
satisfies a default, Spack will generate the module file in the
|
load their direct dependencies if the package installed depends on ``python``.
|
||||||
appropriate path, and will generate a default symlink to the module
|
The allowed values for the ``autoload`` statement are either ``none``,
|
||||||
file as well.
|
``direct`` or ``all``.
|
||||||
|
|
||||||
.. warning::
|
.. note::
|
||||||
If Spack is configured to generate multiple default packages in the
|
Tcl prerequisites
|
||||||
same directory, the last modulefile to be generated will be the
|
In the ``tcl`` section of the configuration file it is possible to use
|
||||||
default module.
|
the ``prerequisites`` directive that accepts the same values as
|
||||||
|
``autoload``. It will produce module files that have a ``prereq``
|
||||||
.. _maintaining-module-files:
|
statement, which autoloads dependencies on Environment Modules when its
|
||||||
|
``auto_handling`` configuration option is enabled. If Environment Modules
|
||||||
|
is installed with Spack, ``auto_handling`` is enabled by default starting
|
||||||
|
version 4.2. Otherwise it is enabled by default since version 5.0.
|
||||||
|
|
||||||
------------------------
|
------------------------
|
||||||
Maintaining Module Files
|
Maintaining Module Files
|
||||||
|
@@ -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)
|
||||||
@@ -97,35 +97,6 @@ Each package version and compiler listed in an external should
|
|||||||
have entries in Spack's packages and compiler configuration, even
|
have entries in Spack's packages and compiler configuration, even
|
||||||
though the package and compiler may not ever be built.
|
though the package and compiler may not ever be built.
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
Extra attributes for external packages
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
Sometimes external packages require additional attributes to be used
|
|
||||||
effectively. This information can be defined on a per-package basis
|
|
||||||
and stored in the ``extra_attributes`` section of the external package
|
|
||||||
configuration. In addition to per-package information, this section
|
|
||||||
can be used to define environment modifications to be performed
|
|
||||||
whenever the package is used. For example, if an external package is
|
|
||||||
built without ``rpath`` support, it may require ``LD_LIBRARY_PATH``
|
|
||||||
settings to find its dependencies. This could be configured as
|
|
||||||
follows:
|
|
||||||
|
|
||||||
.. code-block:: yaml
|
|
||||||
|
|
||||||
packages:
|
|
||||||
mpich:
|
|
||||||
externals:
|
|
||||||
- spec: mpich@3.3 %clang@12.0.0 +hwloc
|
|
||||||
prefix: /path/to/mpich
|
|
||||||
extra_attributes:
|
|
||||||
environment:
|
|
||||||
prepend_path:
|
|
||||||
LD_LIBRARY_PATH: /path/to/hwloc/lib64
|
|
||||||
|
|
||||||
See :ref:`configuration_environment_variables` for more information on
|
|
||||||
how to configure environment modifications in Spack config files.
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
Prevent packages from being built from sources
|
Prevent packages from being built from sources
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
@@ -487,56 +458,6 @@ present. For instance with a configuration like:
|
|||||||
|
|
||||||
you will use ``mvapich2~cuda %gcc`` as an ``mpi`` provider.
|
you will use ``mvapich2~cuda %gcc`` as an ``mpi`` provider.
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
Conflicts and strong preferences
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
If the semantic of requirements is too strong, you can also express "strong preferences" and "conflicts"
|
|
||||||
from configuration files:
|
|
||||||
|
|
||||||
.. code-block:: yaml
|
|
||||||
|
|
||||||
packages:
|
|
||||||
all:
|
|
||||||
prefer:
|
|
||||||
- '%clang'
|
|
||||||
conflict:
|
|
||||||
- '+shared'
|
|
||||||
|
|
||||||
The ``prefer`` and ``conflict`` sections can be used whenever a ``require`` section is allowed.
|
|
||||||
The argument is always a list of constraints, and each constraint can be either a simple string,
|
|
||||||
or a more complex object:
|
|
||||||
|
|
||||||
.. code-block:: yaml
|
|
||||||
|
|
||||||
packages:
|
|
||||||
all:
|
|
||||||
conflict:
|
|
||||||
- spec: '%clang'
|
|
||||||
when: 'target=x86_64_v3'
|
|
||||||
message: 'reason why clang cannot be used'
|
|
||||||
|
|
||||||
The ``spec`` attribute is mandatory, while both ``when`` and ``message`` are optional.
|
|
||||||
|
|
||||||
.. note::
|
|
||||||
|
|
||||||
Requirements allow for expressing both "strong preferences" and "conflicts".
|
|
||||||
The syntax for doing so, though, may not be immediately clear. For
|
|
||||||
instance, if we want to prevent any package from using ``%clang``, we can set:
|
|
||||||
|
|
||||||
.. code-block:: yaml
|
|
||||||
|
|
||||||
packages:
|
|
||||||
all:
|
|
||||||
require:
|
|
||||||
- one_of: ['%clang', '@:']
|
|
||||||
|
|
||||||
Since only one of the requirements must hold, and ``@:`` is always true, the rule above is
|
|
||||||
equivalent to a conflict. For "strong preferences" we need to substitute the ``one_of`` policy
|
|
||||||
with ``any_of``.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.. _package-preferences:
|
.. _package-preferences:
|
||||||
|
|
||||||
-------------------
|
-------------------
|
||||||
@@ -647,8 +568,6 @@ manually placed files within the install prefix are owned by the
|
|||||||
assigned group. If no group is assigned, Spack will allow the OS
|
assigned group. If no group is assigned, Spack will allow the OS
|
||||||
default behavior to go as expected.
|
default behavior to go as expected.
|
||||||
|
|
||||||
.. _assigning-package-attributes:
|
|
||||||
|
|
||||||
----------------------------
|
----------------------------
|
||||||
Assigning Package Attributes
|
Assigning Package Attributes
|
||||||
----------------------------
|
----------------------------
|
||||||
@@ -659,11 +578,10 @@ You can assign class-level attributes in the configuration:
|
|||||||
|
|
||||||
packages:
|
packages:
|
||||||
mpileaks:
|
mpileaks:
|
||||||
package_attributes:
|
# Override existing attributes
|
||||||
# Override existing attributes
|
url: http://www.somewhereelse.com/mpileaks-1.0.tar.gz
|
||||||
url: http://www.somewhereelse.com/mpileaks-1.0.tar.gz
|
# ... or add new ones
|
||||||
# ... or add new ones
|
x: 1
|
||||||
x: 1
|
|
||||||
|
|
||||||
Attributes set this way will be accessible to any method executed
|
Attributes set this way will be accessible to any method executed
|
||||||
in the package.py file (e.g. the ``install()`` method). Values for these
|
in the package.py file (e.g. the ``install()`` method). Values for these
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -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)
|
||||||
@@ -253,6 +253,17 @@ can easily happen if it is not updated frequently, this behavior ensures that
|
|||||||
spack has a way to know for certain about the status of any concrete spec on
|
spack has a way to know for certain about the status of any concrete spec on
|
||||||
the remote mirror, but can slow down pipeline generation significantly.
|
the remote mirror, but can slow down pipeline generation significantly.
|
||||||
|
|
||||||
|
The ``--optimize`` argument is experimental and runs the generated pipeline
|
||||||
|
document through a series of optimization passes designed to reduce the size
|
||||||
|
of the generated file.
|
||||||
|
|
||||||
|
The ``--dependencies`` is also experimental and disables what in Gitlab is
|
||||||
|
referred to as DAG scheduling, internally using the ``dependencies`` keyword
|
||||||
|
rather than ``needs`` to list dependency jobs. The drawback of using this option
|
||||||
|
is that before any job can begin, all jobs in previous stages must first
|
||||||
|
complete. The benefit is that Gitlab allows more dependencies to be listed
|
||||||
|
when using ``dependencies`` instead of ``needs``.
|
||||||
|
|
||||||
The optional ``--output-file`` argument should be an absolute path (including
|
The optional ``--output-file`` argument should be an absolute path (including
|
||||||
file name) to the generated pipeline, and if not given, the default is
|
file name) to the generated pipeline, and if not given, the default is
|
||||||
``./.gitlab-ci.yml``.
|
``./.gitlab-ci.yml``.
|
||||||
@@ -799,7 +810,7 @@ generated by ``spack ci generate``. You also want your generated rebuild jobs
|
|||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
spack:
|
spack:
|
||||||
# ...
|
...
|
||||||
ci:
|
ci:
|
||||||
pipeline-gen:
|
pipeline-gen:
|
||||||
- build-job:
|
- build-job:
|
||||||
|
@@ -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)
|
||||||
@@ -17,7 +17,7 @@ experimental software separately from the built-in repository. Spack
|
|||||||
allows you to configure local repositories using either the
|
allows you to configure local repositories using either the
|
||||||
``repos.yaml`` or the ``spack repo`` command.
|
``repos.yaml`` or the ``spack repo`` command.
|
||||||
|
|
||||||
A package repository is a directory structured like this::
|
A package repository a directory structured like this::
|
||||||
|
|
||||||
repo/
|
repo/
|
||||||
repo.yaml
|
repo.yaml
|
||||||
@@ -476,3 +476,9 @@ implemented using Python's built-in `sys.path
|
|||||||
:py:mod:`spack.repo` module implements a custom `Python importer
|
:py:mod:`spack.repo` module implements a custom `Python importer
|
||||||
<https://docs.python.org/2/library/imp.html>`_.
|
<https://docs.python.org/2/library/imp.html>`_.
|
||||||
|
|
||||||
|
.. warning::
|
||||||
|
|
||||||
|
The mechanism for extending packages is not yet extensively tested,
|
||||||
|
and extending packages across repositories imposes inter-repo
|
||||||
|
dependencies, which may be hard to manage. Use this feature at your
|
||||||
|
own risk, but let us know if you have a use case for it.
|
||||||
|
@@ -1,13 +1,13 @@
|
|||||||
sphinx==7.4.7
|
sphinx==7.2.6
|
||||||
sphinxcontrib-programoutput==0.17
|
sphinxcontrib-programoutput==0.17
|
||||||
sphinx_design==0.6.1
|
sphinx_design==0.5.0
|
||||||
sphinx-rtd-theme==2.0.0
|
sphinx-rtd-theme==2.0.0
|
||||||
python-levenshtein==0.25.1
|
python-levenshtein==0.23.0
|
||||||
docutils==0.20.1
|
docutils==0.20.1
|
||||||
pygments==2.18.0
|
pygments==2.17.2
|
||||||
urllib3==2.2.2
|
urllib3==2.1.0
|
||||||
pytest==8.3.2
|
pytest==7.4.3
|
||||||
isort==5.13.2
|
isort==5.12.0
|
||||||
black==24.8.0
|
black==23.11.0
|
||||||
flake8==7.1.1
|
flake8==6.1.0
|
||||||
mypy==1.11.1
|
mypy==1.7.1
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 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)
|
||||||
@@ -142,7 +142,7 @@ Reputational Key
|
|||||||
----------------
|
----------------
|
||||||
|
|
||||||
The Reputational Key is the public facing key used to sign complete groups of
|
The Reputational Key is the public facing key used to sign complete groups of
|
||||||
development and release packages. Only one key pair exists in this class of
|
development and release packages. Only one key pair exsits in this class of
|
||||||
keys. In contrast to the Intermediate CI Key the Reputational Key *should* be
|
keys. In contrast to the Intermediate CI Key the Reputational Key *should* be
|
||||||
used to verify package integrity. At the end of develop and release pipeline a
|
used to verify package integrity. At the end of develop and release pipeline a
|
||||||
final pipeline job pulls down all signed package metadata built by the pipeline,
|
final pipeline job pulls down all signed package metadata built by the pipeline,
|
||||||
@@ -272,7 +272,7 @@ Internal Implementation
|
|||||||
|
|
||||||
The technical implementation of the pipeline signing process includes components
|
The technical implementation of the pipeline signing process includes components
|
||||||
defined in Amazon Web Services, the Kubernetes cluster, at affilicated
|
defined in Amazon Web Services, the Kubernetes cluster, at affilicated
|
||||||
institutions, and the GitLab/GitLab Runner deployment. We present the technical
|
institutions, and the GitLab/GitLab Runner deployment. We present the techincal
|
||||||
implementation in two interdependent sections. The first addresses how secrets
|
implementation in two interdependent sections. The first addresses how secrets
|
||||||
are managed through the lifecycle of a develop or release pipeline. The second
|
are managed through the lifecycle of a develop or release pipeline. The second
|
||||||
section describes how Gitlab Runner and pipelines are configured and managed to
|
section describes how Gitlab Runner and pipelines are configured and managed to
|
||||||
@@ -295,7 +295,7 @@ infrastructure.
|
|||||||
-----------------------
|
-----------------------
|
||||||
|
|
||||||
Multiple intermediate CI signing keys exist, one Intermediate CI Key for jobs
|
Multiple intermediate CI signing keys exist, one Intermediate CI Key for jobs
|
||||||
run in AWS, and one key for each affiliated institution (e.g. University of
|
run in AWS, and one key for each affiliated institution (e.g. Univerity of
|
||||||
Oregon). Here we describe how the Intermediate CI Key is managed in AWS:
|
Oregon). Here we describe how the Intermediate CI Key is managed in AWS:
|
||||||
|
|
||||||
The Intermediate CI Key (including the Signing Intermediate CI Private Key is
|
The Intermediate CI Key (including the Signing Intermediate CI Private Key is
|
||||||
@@ -305,7 +305,7 @@ contains an ASCII-armored export of just the *public* components of the
|
|||||||
Reputational Key. This secret also contains the *public* components of each of
|
Reputational Key. This secret also contains the *public* components of each of
|
||||||
the affiliated institutions' Intermediate CI Key. These are potentially needed
|
the affiliated institutions' Intermediate CI Key. These are potentially needed
|
||||||
to verify dependent packages which may have been found in the public mirror or
|
to verify dependent packages which may have been found in the public mirror or
|
||||||
built by a protected job running on an affiliated institution's infrastructure
|
built by a protected job running on an affiliated institution's infrastrcuture
|
||||||
in an earlier stage of the pipeline.
|
in an earlier stage of the pipeline.
|
||||||
|
|
||||||
Procedurally the ``spack-intermediate-ci-signing-key`` secret is used in
|
Procedurally the ``spack-intermediate-ci-signing-key`` secret is used 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)
|
||||||
|
349
lib/spack/env/cc
vendored
349
lib/spack/env/cc
vendored
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh -f
|
#!/bin/sh -f
|
||||||
# shellcheck disable=SC2034 # evals in this script fool shellcheck
|
# shellcheck disable=SC2034 # evals in this script fool shellcheck
|
||||||
#
|
#
|
||||||
# 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)
|
||||||
@@ -47,8 +47,7 @@ SPACK_F77_RPATH_ARG
|
|||||||
SPACK_FC_RPATH_ARG
|
SPACK_FC_RPATH_ARG
|
||||||
SPACK_LINKER_ARG
|
SPACK_LINKER_ARG
|
||||||
SPACK_SHORT_SPEC
|
SPACK_SHORT_SPEC
|
||||||
SPACK_SYSTEM_DIRS
|
SPACK_SYSTEM_DIRS"
|
||||||
SPACK_MANAGED_DIRS"
|
|
||||||
|
|
||||||
# Optional parameters that aren't required to be set
|
# Optional parameters that aren't required to be set
|
||||||
|
|
||||||
@@ -174,44 +173,20 @@ preextend() {
|
|||||||
unset IFS
|
unset IFS
|
||||||
}
|
}
|
||||||
|
|
||||||
execute() {
|
# system_dir PATH
|
||||||
# dump the full command if the caller supplies SPACK_TEST_COMMAND=dump-args
|
# test whether a path is a system directory
|
||||||
if [ -n "${SPACK_TEST_COMMAND=}" ]; then
|
system_dir() {
|
||||||
case "$SPACK_TEST_COMMAND" in
|
IFS=':' # SPACK_SYSTEM_DIRS is colon-separated
|
||||||
dump-args)
|
path="$1"
|
||||||
IFS="$lsep"
|
for sd in $SPACK_SYSTEM_DIRS; do
|
||||||
for arg in $full_command_list; do
|
if [ "${path}" = "${sd}" ] || [ "${path}" = "${sd}/" ]; then
|
||||||
echo "$arg"
|
# success if path starts with a system prefix
|
||||||
done
|
unset IFS
|
||||||
unset IFS
|
return 0
|
||||||
exit
|
fi
|
||||||
;;
|
done
|
||||||
dump-env-*)
|
unset IFS
|
||||||
var=${SPACK_TEST_COMMAND#dump-env-}
|
return 1 # fail if path starts no system prefix
|
||||||
eval "printf '%s\n' \"\$0: \$var: \$$var\""
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
die "Unknown test command: '$SPACK_TEST_COMMAND'"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
|
|
||||||
#
|
|
||||||
# Write the input and output commands to debug logs if it's asked for.
|
|
||||||
#
|
|
||||||
if [ "$SPACK_DEBUG" = TRUE ]; then
|
|
||||||
input_log="$SPACK_DEBUG_LOG_DIR/spack-cc-$SPACK_DEBUG_LOG_ID.in.log"
|
|
||||||
output_log="$SPACK_DEBUG_LOG_DIR/spack-cc-$SPACK_DEBUG_LOG_ID.out.log"
|
|
||||||
echo "[$mode] $command $input_command" >> "$input_log"
|
|
||||||
IFS="$lsep"
|
|
||||||
echo "[$mode] "$full_command_list >> "$output_log"
|
|
||||||
unset IFS
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Execute the full command, preserving spaces with IFS set
|
|
||||||
# to the alarm bell separator.
|
|
||||||
IFS="$lsep"; exec $full_command_list
|
|
||||||
exit
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Fail with a clear message if the input contains any bell characters.
|
# Fail with a clear message if the input contains any bell characters.
|
||||||
@@ -226,18 +201,6 @@ for param in $params; do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# eval this because SPACK_MANAGED_DIRS and SPACK_SYSTEM_DIRS are inputs we don't wanna loop over.
|
|
||||||
# moving the eval inside the function would eval it every call.
|
|
||||||
eval "\
|
|
||||||
path_order() {
|
|
||||||
case \"\$1\" in
|
|
||||||
$SPACK_MANAGED_DIRS) return 0 ;;
|
|
||||||
$SPACK_SYSTEM_DIRS) return 2 ;;
|
|
||||||
/*) return 1 ;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
"
|
|
||||||
|
|
||||||
# Check if optional parameters are defined
|
# Check if optional parameters are defined
|
||||||
# If we aren't asking for debug flags, don't add them
|
# If we aren't asking for debug flags, don't add them
|
||||||
if [ -z "${SPACK_ADD_DEBUG_FLAGS:-}" ]; then
|
if [ -z "${SPACK_ADD_DEBUG_FLAGS:-}" ]; then
|
||||||
@@ -271,17 +234,12 @@ fi
|
|||||||
# ld link
|
# ld link
|
||||||
# ccld compile & link
|
# ccld compile & link
|
||||||
|
|
||||||
# Note. SPACK_ALWAYS_XFLAGS are applied for all compiler invocations,
|
|
||||||
# including version checks (SPACK_XFLAGS variants are not applied
|
|
||||||
# for version checks).
|
|
||||||
command="${0##*/}"
|
command="${0##*/}"
|
||||||
comp="CC"
|
comp="CC"
|
||||||
vcheck_flags=""
|
|
||||||
case "$command" in
|
case "$command" in
|
||||||
cpp)
|
cpp)
|
||||||
mode=cpp
|
mode=cpp
|
||||||
debug_flags="-g"
|
debug_flags="-g"
|
||||||
vcheck_flags="${SPACK_ALWAYS_CPPFLAGS}"
|
|
||||||
;;
|
;;
|
||||||
cc|c89|c99|gcc|clang|armclang|icc|icx|pgcc|nvc|xlc|xlc_r|fcc|amdclang|cl.exe|craycc)
|
cc|c89|c99|gcc|clang|armclang|icc|icx|pgcc|nvc|xlc|xlc_r|fcc|amdclang|cl.exe|craycc)
|
||||||
command="$SPACK_CC"
|
command="$SPACK_CC"
|
||||||
@@ -289,15 +247,13 @@ case "$command" in
|
|||||||
comp="CC"
|
comp="CC"
|
||||||
lang_flags=C
|
lang_flags=C
|
||||||
debug_flags="-g"
|
debug_flags="-g"
|
||||||
vcheck_flags="${SPACK_ALWAYS_CFLAGS}"
|
|
||||||
;;
|
;;
|
||||||
c++|CC|g++|clang++|armclang++|icpc|icpx|pgc++|nvc++|xlc++|xlc++_r|FCC|amdclang++|crayCC)
|
c++|CC|g++|clang++|armclang++|icpc|icpx|dpcpp|pgc++|nvc++|xlc++|xlc++_r|FCC|amdclang++|crayCC)
|
||||||
command="$SPACK_CXX"
|
command="$SPACK_CXX"
|
||||||
language="C++"
|
language="C++"
|
||||||
comp="CXX"
|
comp="CXX"
|
||||||
lang_flags=CXX
|
lang_flags=CXX
|
||||||
debug_flags="-g"
|
debug_flags="-g"
|
||||||
vcheck_flags="${SPACK_ALWAYS_CXXFLAGS}"
|
|
||||||
;;
|
;;
|
||||||
ftn|f90|fc|f95|gfortran|flang|armflang|ifort|ifx|pgfortran|nvfortran|xlf90|xlf90_r|nagfor|frt|amdflang|crayftn)
|
ftn|f90|fc|f95|gfortran|flang|armflang|ifort|ifx|pgfortran|nvfortran|xlf90|xlf90_r|nagfor|frt|amdflang|crayftn)
|
||||||
command="$SPACK_FC"
|
command="$SPACK_FC"
|
||||||
@@ -305,7 +261,6 @@ case "$command" in
|
|||||||
comp="FC"
|
comp="FC"
|
||||||
lang_flags=F
|
lang_flags=F
|
||||||
debug_flags="-g"
|
debug_flags="-g"
|
||||||
vcheck_flags="${SPACK_ALWAYS_FFLAGS}"
|
|
||||||
;;
|
;;
|
||||||
f77|xlf|xlf_r|pgf77)
|
f77|xlf|xlf_r|pgf77)
|
||||||
command="$SPACK_F77"
|
command="$SPACK_F77"
|
||||||
@@ -313,7 +268,6 @@ case "$command" in
|
|||||||
comp="F77"
|
comp="F77"
|
||||||
lang_flags=F
|
lang_flags=F
|
||||||
debug_flags="-g"
|
debug_flags="-g"
|
||||||
vcheck_flags="${SPACK_ALWAYS_FFLAGS}"
|
|
||||||
;;
|
;;
|
||||||
ld|ld.gold|ld.lld)
|
ld|ld.gold|ld.lld)
|
||||||
mode=ld
|
mode=ld
|
||||||
@@ -414,11 +368,7 @@ unset IFS
|
|||||||
export PATH="$new_dirs"
|
export PATH="$new_dirs"
|
||||||
|
|
||||||
if [ "$mode" = vcheck ]; then
|
if [ "$mode" = vcheck ]; then
|
||||||
full_command_list="$command"
|
exec "${command}" "$@"
|
||||||
args="$@"
|
|
||||||
extend full_command_list vcheck_flags
|
|
||||||
extend full_command_list args
|
|
||||||
execute
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Darwin's linker has a -r argument that merges object files together.
|
# Darwin's linker has a -r argument that merges object files together.
|
||||||
@@ -470,12 +420,11 @@ input_command="$*"
|
|||||||
parse_Wl() {
|
parse_Wl() {
|
||||||
while [ $# -ne 0 ]; do
|
while [ $# -ne 0 ]; do
|
||||||
if [ "$wl_expect_rpath" = yes ]; then
|
if [ "$wl_expect_rpath" = yes ]; then
|
||||||
path_order "$1"
|
if system_dir "$1"; then
|
||||||
case $? in
|
append return_system_rpath_dirs_list "$1"
|
||||||
0) append return_spack_store_rpath_dirs_list "$1" ;;
|
else
|
||||||
1) append return_rpath_dirs_list "$1" ;;
|
append return_rpath_dirs_list "$1"
|
||||||
2) append return_system_rpath_dirs_list "$1" ;;
|
fi
|
||||||
esac
|
|
||||||
wl_expect_rpath=no
|
wl_expect_rpath=no
|
||||||
else
|
else
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@@ -483,25 +432,21 @@ parse_Wl() {
|
|||||||
arg="${1#-rpath=}"
|
arg="${1#-rpath=}"
|
||||||
if [ -z "$arg" ]; then
|
if [ -z "$arg" ]; then
|
||||||
shift; continue
|
shift; continue
|
||||||
|
elif system_dir "$arg"; then
|
||||||
|
append return_system_rpath_dirs_list "$arg"
|
||||||
|
else
|
||||||
|
append return_rpath_dirs_list "$arg"
|
||||||
fi
|
fi
|
||||||
path_order "$arg"
|
|
||||||
case $? in
|
|
||||||
0) append return_spack_store_rpath_dirs_list "$arg" ;;
|
|
||||||
1) append return_rpath_dirs_list "$arg" ;;
|
|
||||||
2) append return_system_rpath_dirs_list "$arg" ;;
|
|
||||||
esac
|
|
||||||
;;
|
;;
|
||||||
--rpath=*)
|
--rpath=*)
|
||||||
arg="${1#--rpath=}"
|
arg="${1#--rpath=}"
|
||||||
if [ -z "$arg" ]; then
|
if [ -z "$arg" ]; then
|
||||||
shift; continue
|
shift; continue
|
||||||
|
elif system_dir "$arg"; then
|
||||||
|
append return_system_rpath_dirs_list "$arg"
|
||||||
|
else
|
||||||
|
append return_rpath_dirs_list "$arg"
|
||||||
fi
|
fi
|
||||||
path_order "$arg"
|
|
||||||
case $? in
|
|
||||||
0) append return_spack_store_rpath_dirs_list "$arg" ;;
|
|
||||||
1) append return_rpath_dirs_list "$arg" ;;
|
|
||||||
2) append return_system_rpath_dirs_list "$arg" ;;
|
|
||||||
esac
|
|
||||||
;;
|
;;
|
||||||
-rpath|--rpath)
|
-rpath|--rpath)
|
||||||
wl_expect_rpath=yes
|
wl_expect_rpath=yes
|
||||||
@@ -528,20 +473,12 @@ categorize_arguments() {
|
|||||||
|
|
||||||
return_other_args_list=""
|
return_other_args_list=""
|
||||||
return_isystem_was_used=""
|
return_isystem_was_used=""
|
||||||
|
|
||||||
return_isystem_spack_store_include_dirs_list=""
|
|
||||||
return_isystem_system_include_dirs_list=""
|
return_isystem_system_include_dirs_list=""
|
||||||
return_isystem_include_dirs_list=""
|
return_isystem_include_dirs_list=""
|
||||||
|
|
||||||
return_spack_store_include_dirs_list=""
|
|
||||||
return_system_include_dirs_list=""
|
return_system_include_dirs_list=""
|
||||||
return_include_dirs_list=""
|
return_include_dirs_list=""
|
||||||
|
|
||||||
return_spack_store_lib_dirs_list=""
|
|
||||||
return_system_lib_dirs_list=""
|
return_system_lib_dirs_list=""
|
||||||
return_lib_dirs_list=""
|
return_lib_dirs_list=""
|
||||||
|
|
||||||
return_spack_store_rpath_dirs_list=""
|
|
||||||
return_system_rpath_dirs_list=""
|
return_system_rpath_dirs_list=""
|
||||||
return_rpath_dirs_list=""
|
return_rpath_dirs_list=""
|
||||||
|
|
||||||
@@ -589,7 +526,7 @@ categorize_arguments() {
|
|||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
replaced="$after$stripped"
|
replaced="$after$stripped"
|
||||||
|
|
||||||
# it matched, remove it
|
# it matched, remove it
|
||||||
shift
|
shift
|
||||||
@@ -609,32 +546,29 @@ categorize_arguments() {
|
|||||||
arg="${1#-isystem}"
|
arg="${1#-isystem}"
|
||||||
return_isystem_was_used=true
|
return_isystem_was_used=true
|
||||||
if [ -z "$arg" ]; then shift; arg="$1"; fi
|
if [ -z "$arg" ]; then shift; arg="$1"; fi
|
||||||
path_order "$arg"
|
if system_dir "$arg"; then
|
||||||
case $? in
|
append return_isystem_system_include_dirs_list "$arg"
|
||||||
0) append return_isystem_spack_store_include_dirs_list "$arg" ;;
|
else
|
||||||
1) append return_isystem_include_dirs_list "$arg" ;;
|
append return_isystem_include_dirs_list "$arg"
|
||||||
2) append return_isystem_system_include_dirs_list "$arg" ;;
|
fi
|
||||||
esac
|
|
||||||
;;
|
;;
|
||||||
-I*)
|
-I*)
|
||||||
arg="${1#-I}"
|
arg="${1#-I}"
|
||||||
if [ -z "$arg" ]; then shift; arg="$1"; fi
|
if [ -z "$arg" ]; then shift; arg="$1"; fi
|
||||||
path_order "$arg"
|
if system_dir "$arg"; then
|
||||||
case $? in
|
append return_system_include_dirs_list "$arg"
|
||||||
0) append return_spack_store_include_dirs_list "$arg" ;;
|
else
|
||||||
1) append return_include_dirs_list "$arg" ;;
|
append return_include_dirs_list "$arg"
|
||||||
2) append return_system_include_dirs_list "$arg" ;;
|
fi
|
||||||
esac
|
|
||||||
;;
|
;;
|
||||||
-L*)
|
-L*)
|
||||||
arg="${1#-L}"
|
arg="${1#-L}"
|
||||||
if [ -z "$arg" ]; then shift; arg="$1"; fi
|
if [ -z "$arg" ]; then shift; arg="$1"; fi
|
||||||
path_order "$arg"
|
if system_dir "$arg"; then
|
||||||
case $? in
|
append return_system_lib_dirs_list "$arg"
|
||||||
0) append return_spack_store_lib_dirs_list "$arg" ;;
|
else
|
||||||
1) append return_lib_dirs_list "$arg" ;;
|
append return_lib_dirs_list "$arg"
|
||||||
2) append return_system_lib_dirs_list "$arg" ;;
|
fi
|
||||||
esac
|
|
||||||
;;
|
;;
|
||||||
-l*)
|
-l*)
|
||||||
# -loopopt=0 is generated erroneously in autoconf <= 2.69,
|
# -loopopt=0 is generated erroneously in autoconf <= 2.69,
|
||||||
@@ -667,32 +601,29 @@ categorize_arguments() {
|
|||||||
break
|
break
|
||||||
elif [ "$xlinker_expect_rpath" = yes ]; then
|
elif [ "$xlinker_expect_rpath" = yes ]; then
|
||||||
# Register the path of -Xlinker -rpath <other args> -Xlinker <path>
|
# Register the path of -Xlinker -rpath <other args> -Xlinker <path>
|
||||||
path_order "$1"
|
if system_dir "$1"; then
|
||||||
case $? in
|
append return_system_rpath_dirs_list "$1"
|
||||||
0) append return_spack_store_rpath_dirs_list "$1" ;;
|
else
|
||||||
1) append return_rpath_dirs_list "$1" ;;
|
append return_rpath_dirs_list "$1"
|
||||||
2) append return_system_rpath_dirs_list "$1" ;;
|
fi
|
||||||
esac
|
|
||||||
xlinker_expect_rpath=no
|
xlinker_expect_rpath=no
|
||||||
else
|
else
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-rpath=*)
|
-rpath=*)
|
||||||
arg="${1#-rpath=}"
|
arg="${1#-rpath=}"
|
||||||
path_order "$arg"
|
if system_dir "$arg"; then
|
||||||
case $? in
|
append return_system_rpath_dirs_list "$arg"
|
||||||
0) append return_spack_store_rpath_dirs_list "$arg" ;;
|
else
|
||||||
1) append return_rpath_dirs_list "$arg" ;;
|
append return_rpath_dirs_list "$arg"
|
||||||
2) append return_system_rpath_dirs_list "$arg" ;;
|
fi
|
||||||
esac
|
|
||||||
;;
|
;;
|
||||||
--rpath=*)
|
--rpath=*)
|
||||||
arg="${1#--rpath=}"
|
arg="${1#--rpath=}"
|
||||||
path_order "$arg"
|
if system_dir "$arg"; then
|
||||||
case $? in
|
append return_system_rpath_dirs_list "$arg"
|
||||||
0) append return_spack_store_rpath_dirs_list "$arg" ;;
|
else
|
||||||
1) append return_rpath_dirs_list "$arg" ;;
|
append return_rpath_dirs_list "$arg"
|
||||||
2) append return_system_rpath_dirs_list "$arg" ;;
|
fi
|
||||||
esac
|
|
||||||
;;
|
;;
|
||||||
-rpath|--rpath)
|
-rpath|--rpath)
|
||||||
xlinker_expect_rpath=yes
|
xlinker_expect_rpath=yes
|
||||||
@@ -730,25 +661,16 @@ categorize_arguments() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
categorize_arguments "$@"
|
categorize_arguments "$@"
|
||||||
|
include_dirs_list="$return_include_dirs_list"
|
||||||
spack_store_include_dirs_list="$return_spack_store_include_dirs_list"
|
lib_dirs_list="$return_lib_dirs_list"
|
||||||
system_include_dirs_list="$return_system_include_dirs_list"
|
rpath_dirs_list="$return_rpath_dirs_list"
|
||||||
include_dirs_list="$return_include_dirs_list"
|
system_include_dirs_list="$return_system_include_dirs_list"
|
||||||
|
system_lib_dirs_list="$return_system_lib_dirs_list"
|
||||||
spack_store_lib_dirs_list="$return_spack_store_lib_dirs_list"
|
system_rpath_dirs_list="$return_system_rpath_dirs_list"
|
||||||
system_lib_dirs_list="$return_system_lib_dirs_list"
|
isystem_was_used="$return_isystem_was_used"
|
||||||
lib_dirs_list="$return_lib_dirs_list"
|
isystem_system_include_dirs_list="$return_isystem_system_include_dirs_list"
|
||||||
|
isystem_include_dirs_list="$return_isystem_include_dirs_list"
|
||||||
spack_store_rpath_dirs_list="$return_spack_store_rpath_dirs_list"
|
other_args_list="$return_other_args_list"
|
||||||
system_rpath_dirs_list="$return_system_rpath_dirs_list"
|
|
||||||
rpath_dirs_list="$return_rpath_dirs_list"
|
|
||||||
|
|
||||||
isystem_spack_store_include_dirs_list="$return_isystem_spack_store_include_dirs_list"
|
|
||||||
isystem_system_include_dirs_list="$return_isystem_system_include_dirs_list"
|
|
||||||
isystem_include_dirs_list="$return_isystem_include_dirs_list"
|
|
||||||
|
|
||||||
isystem_was_used="$return_isystem_was_used"
|
|
||||||
other_args_list="$return_other_args_list"
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Add flags from Spack's cppflags, cflags, cxxflags, fcflags, fflags, and
|
# Add flags from Spack's cppflags, cflags, cxxflags, fcflags, fflags, and
|
||||||
@@ -775,7 +697,6 @@ case "$mode" in
|
|||||||
cc|ccld)
|
cc|ccld)
|
||||||
case $lang_flags in
|
case $lang_flags in
|
||||||
F)
|
F)
|
||||||
extend spack_flags_list SPACK_ALWAYS_FFLAGS
|
|
||||||
extend spack_flags_list SPACK_FFLAGS
|
extend spack_flags_list SPACK_FFLAGS
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -785,7 +706,6 @@ esac
|
|||||||
# C preprocessor flags come before any C/CXX flags
|
# C preprocessor flags come before any C/CXX flags
|
||||||
case "$mode" in
|
case "$mode" in
|
||||||
cpp|as|cc|ccld)
|
cpp|as|cc|ccld)
|
||||||
extend spack_flags_list SPACK_ALWAYS_CPPFLAGS
|
|
||||||
extend spack_flags_list SPACK_CPPFLAGS
|
extend spack_flags_list SPACK_CPPFLAGS
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -796,11 +716,9 @@ case "$mode" in
|
|||||||
cc|ccld)
|
cc|ccld)
|
||||||
case $lang_flags in
|
case $lang_flags in
|
||||||
C)
|
C)
|
||||||
extend spack_flags_list SPACK_ALWAYS_CFLAGS
|
|
||||||
extend spack_flags_list SPACK_CFLAGS
|
extend spack_flags_list SPACK_CFLAGS
|
||||||
;;
|
;;
|
||||||
CXX)
|
CXX)
|
||||||
extend spack_flags_list SPACK_ALWAYS_CXXFLAGS
|
|
||||||
extend spack_flags_list SPACK_CXXFLAGS
|
extend spack_flags_list SPACK_CXXFLAGS
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -812,7 +730,7 @@ esac
|
|||||||
|
|
||||||
# Linker flags
|
# Linker flags
|
||||||
case "$mode" in
|
case "$mode" in
|
||||||
ccld)
|
ld|ccld)
|
||||||
extend spack_flags_list SPACK_LDFLAGS
|
extend spack_flags_list SPACK_LDFLAGS
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -820,25 +738,16 @@ esac
|
|||||||
IFS="$lsep"
|
IFS="$lsep"
|
||||||
categorize_arguments $spack_flags_list
|
categorize_arguments $spack_flags_list
|
||||||
unset IFS
|
unset IFS
|
||||||
|
spack_flags_include_dirs_list="$return_include_dirs_list"
|
||||||
spack_flags_isystem_spack_store_include_dirs_list="$return_isystem_spack_store_include_dirs_list"
|
spack_flags_lib_dirs_list="$return_lib_dirs_list"
|
||||||
spack_flags_isystem_system_include_dirs_list="$return_isystem_system_include_dirs_list"
|
spack_flags_rpath_dirs_list="$return_rpath_dirs_list"
|
||||||
spack_flags_isystem_include_dirs_list="$return_isystem_include_dirs_list"
|
spack_flags_system_include_dirs_list="$return_system_include_dirs_list"
|
||||||
|
spack_flags_system_lib_dirs_list="$return_system_lib_dirs_list"
|
||||||
spack_flags_spack_store_include_dirs_list="$return_spack_store_include_dirs_list"
|
spack_flags_system_rpath_dirs_list="$return_system_rpath_dirs_list"
|
||||||
spack_flags_system_include_dirs_list="$return_system_include_dirs_list"
|
spack_flags_isystem_was_used="$return_isystem_was_used"
|
||||||
spack_flags_include_dirs_list="$return_include_dirs_list"
|
spack_flags_isystem_system_include_dirs_list="$return_isystem_system_include_dirs_list"
|
||||||
|
spack_flags_isystem_include_dirs_list="$return_isystem_include_dirs_list"
|
||||||
spack_flags_spack_store_lib_dirs_list="$return_spack_store_lib_dirs_list"
|
spack_flags_other_args_list="$return_other_args_list"
|
||||||
spack_flags_system_lib_dirs_list="$return_system_lib_dirs_list"
|
|
||||||
spack_flags_lib_dirs_list="$return_lib_dirs_list"
|
|
||||||
|
|
||||||
spack_flags_spack_store_rpath_dirs_list="$return_spack_store_rpath_dirs_list"
|
|
||||||
spack_flags_system_rpath_dirs_list="$return_system_rpath_dirs_list"
|
|
||||||
spack_flags_rpath_dirs_list="$return_rpath_dirs_list"
|
|
||||||
|
|
||||||
spack_flags_isystem_was_used="$return_isystem_was_used"
|
|
||||||
spack_flags_other_args_list="$return_other_args_list"
|
|
||||||
|
|
||||||
|
|
||||||
# On macOS insert headerpad_max_install_names linker flag
|
# On macOS insert headerpad_max_install_names linker flag
|
||||||
@@ -858,13 +767,11 @@ if [ "$mode" = ccld ] || [ "$mode" = ld ]; then
|
|||||||
# Append RPATH directories. Note that in the case of the
|
# Append RPATH directories. Note that in the case of the
|
||||||
# top-level package these directories may not exist yet. For dependencies
|
# top-level package these directories may not exist yet. For dependencies
|
||||||
# it is assumed that paths have already been confirmed.
|
# it is assumed that paths have already been confirmed.
|
||||||
extend spack_store_rpath_dirs_list SPACK_STORE_RPATH_DIRS
|
|
||||||
extend rpath_dirs_list SPACK_RPATH_DIRS
|
extend rpath_dirs_list SPACK_RPATH_DIRS
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$mode" = ccld ] || [ "$mode" = ld ]; then
|
if [ "$mode" = ccld ] || [ "$mode" = ld ]; then
|
||||||
extend spack_store_lib_dirs_list SPACK_STORE_LINK_DIRS
|
|
||||||
extend lib_dirs_list SPACK_LINK_DIRS
|
extend lib_dirs_list SPACK_LINK_DIRS
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -891,50 +798,38 @@ case "$mode" in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
case "$mode" in
|
|
||||||
cpp|cc|as|ccld)
|
|
||||||
if [ "$spack_flags_isystem_was_used" = "true" ] || [ "$isystem_was_used" = "true" ]; then
|
|
||||||
extend isystem_spack_store_include_dirs_list SPACK_STORE_INCLUDE_DIRS
|
|
||||||
extend isystem_include_dirs_list SPACK_INCLUDE_DIRS
|
|
||||||
else
|
|
||||||
extend spack_store_include_dirs_list SPACK_STORE_INCLUDE_DIRS
|
|
||||||
extend include_dirs_list SPACK_INCLUDE_DIRS
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Finally, reassemble the command line.
|
# Finally, reassemble the command line.
|
||||||
#
|
#
|
||||||
args_list="$flags_list"
|
args_list="$flags_list"
|
||||||
|
|
||||||
# Include search paths partitioned by (in store, non-sytem, system)
|
# Insert include directories just prior to any system include directories
|
||||||
# NOTE: adding ${lsep} to the prefix here turns every added element into two
|
# NOTE: adding ${lsep} to the prefix here turns every added element into two
|
||||||
extend args_list spack_flags_spack_store_include_dirs_list -I
|
extend args_list spack_flags_include_dirs_list "-I"
|
||||||
extend args_list spack_store_include_dirs_list -I
|
extend args_list include_dirs_list "-I"
|
||||||
|
|
||||||
extend args_list spack_flags_include_dirs_list -I
|
|
||||||
extend args_list include_dirs_list -I
|
|
||||||
|
|
||||||
extend args_list spack_flags_isystem_spack_store_include_dirs_list "-isystem${lsep}"
|
|
||||||
extend args_list isystem_spack_store_include_dirs_list "-isystem${lsep}"
|
|
||||||
|
|
||||||
extend args_list spack_flags_isystem_include_dirs_list "-isystem${lsep}"
|
extend args_list spack_flags_isystem_include_dirs_list "-isystem${lsep}"
|
||||||
extend args_list isystem_include_dirs_list "-isystem${lsep}"
|
extend args_list isystem_include_dirs_list "-isystem${lsep}"
|
||||||
|
|
||||||
|
case "$mode" in
|
||||||
|
cpp|cc|as|ccld)
|
||||||
|
if [ "$spack_flags_isystem_was_used" = "true" ]; then
|
||||||
|
extend args_list SPACK_INCLUDE_DIRS "-isystem${lsep}"
|
||||||
|
elif [ "$isystem_was_used" = "true" ]; then
|
||||||
|
extend args_list SPACK_INCLUDE_DIRS "-isystem${lsep}"
|
||||||
|
else
|
||||||
|
extend args_list SPACK_INCLUDE_DIRS "-I"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
extend args_list spack_flags_system_include_dirs_list -I
|
extend args_list spack_flags_system_include_dirs_list -I
|
||||||
extend args_list system_include_dirs_list -I
|
extend args_list system_include_dirs_list -I
|
||||||
|
|
||||||
extend args_list spack_flags_isystem_system_include_dirs_list "-isystem${lsep}"
|
extend args_list spack_flags_isystem_system_include_dirs_list "-isystem${lsep}"
|
||||||
extend args_list isystem_system_include_dirs_list "-isystem${lsep}"
|
extend args_list isystem_system_include_dirs_list "-isystem${lsep}"
|
||||||
|
|
||||||
# Library search paths partitioned by (in store, non-sytem, system)
|
# Library search paths
|
||||||
extend args_list spack_flags_spack_store_lib_dirs_list "-L"
|
|
||||||
extend args_list spack_store_lib_dirs_list "-L"
|
|
||||||
|
|
||||||
extend args_list spack_flags_lib_dirs_list "-L"
|
extend args_list spack_flags_lib_dirs_list "-L"
|
||||||
extend args_list lib_dirs_list "-L"
|
extend args_list lib_dirs_list "-L"
|
||||||
|
|
||||||
extend args_list spack_flags_system_lib_dirs_list "-L"
|
extend args_list spack_flags_system_lib_dirs_list "-L"
|
||||||
extend args_list system_lib_dirs_list "-L"
|
extend args_list system_lib_dirs_list "-L"
|
||||||
|
|
||||||
@@ -944,12 +839,8 @@ case "$mode" in
|
|||||||
if [ -n "$dtags_to_add" ] ; then
|
if [ -n "$dtags_to_add" ] ; then
|
||||||
append args_list "$linker_arg$dtags_to_add"
|
append args_list "$linker_arg$dtags_to_add"
|
||||||
fi
|
fi
|
||||||
extend args_list spack_flags_spack_store_rpath_dirs_list "$rpath"
|
|
||||||
extend args_list spack_store_rpath_dirs_list "$rpath"
|
|
||||||
|
|
||||||
extend args_list spack_flags_rpath_dirs_list "$rpath"
|
extend args_list spack_flags_rpath_dirs_list "$rpath"
|
||||||
extend args_list rpath_dirs_list "$rpath"
|
extend args_list rpath_dirs_list "$rpath"
|
||||||
|
|
||||||
extend args_list spack_flags_system_rpath_dirs_list "$rpath"
|
extend args_list spack_flags_system_rpath_dirs_list "$rpath"
|
||||||
extend args_list system_rpath_dirs_list "$rpath"
|
extend args_list system_rpath_dirs_list "$rpath"
|
||||||
;;
|
;;
|
||||||
@@ -957,12 +848,8 @@ case "$mode" in
|
|||||||
if [ -n "$dtags_to_add" ] ; then
|
if [ -n "$dtags_to_add" ] ; then
|
||||||
append args_list "$dtags_to_add"
|
append args_list "$dtags_to_add"
|
||||||
fi
|
fi
|
||||||
extend args_list spack_flags_spack_store_rpath_dirs_list "-rpath${lsep}"
|
|
||||||
extend args_list spack_store_rpath_dirs_list "-rpath${lsep}"
|
|
||||||
|
|
||||||
extend args_list spack_flags_rpath_dirs_list "-rpath${lsep}"
|
extend args_list spack_flags_rpath_dirs_list "-rpath${lsep}"
|
||||||
extend args_list rpath_dirs_list "-rpath${lsep}"
|
extend args_list rpath_dirs_list "-rpath${lsep}"
|
||||||
|
|
||||||
extend args_list spack_flags_system_rpath_dirs_list "-rpath${lsep}"
|
extend args_list spack_flags_system_rpath_dirs_list "-rpath${lsep}"
|
||||||
extend args_list system_rpath_dirs_list "-rpath${lsep}"
|
extend args_list system_rpath_dirs_list "-rpath${lsep}"
|
||||||
;;
|
;;
|
||||||
@@ -990,4 +877,40 @@ if [ -n "$SPACK_CCACHE_BINARY" ]; then
|
|||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
execute
|
# dump the full command if the caller supplies SPACK_TEST_COMMAND=dump-args
|
||||||
|
if [ -n "${SPACK_TEST_COMMAND=}" ]; then
|
||||||
|
case "$SPACK_TEST_COMMAND" in
|
||||||
|
dump-args)
|
||||||
|
IFS="$lsep"
|
||||||
|
for arg in $full_command_list; do
|
||||||
|
echo "$arg"
|
||||||
|
done
|
||||||
|
unset IFS
|
||||||
|
exit
|
||||||
|
;;
|
||||||
|
dump-env-*)
|
||||||
|
var=${SPACK_TEST_COMMAND#dump-env-}
|
||||||
|
eval "printf '%s\n' \"\$0: \$var: \$$var\""
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
die "Unknown test command: '$SPACK_TEST_COMMAND'"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
#
|
||||||
|
# Write the input and output commands to debug logs if it's asked for.
|
||||||
|
#
|
||||||
|
if [ "$SPACK_DEBUG" = TRUE ]; then
|
||||||
|
input_log="$SPACK_DEBUG_LOG_DIR/spack-cc-$SPACK_DEBUG_LOG_ID.in.log"
|
||||||
|
output_log="$SPACK_DEBUG_LOG_DIR/spack-cc-$SPACK_DEBUG_LOG_ID.out.log"
|
||||||
|
echo "[$mode] $command $input_command" >> "$input_log"
|
||||||
|
IFS="$lsep"
|
||||||
|
echo "[$mode] "$full_command_list >> "$output_log"
|
||||||
|
unset IFS
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Execute the full command, preserving spaces with IFS set
|
||||||
|
# to the alarm bell separator.
|
||||||
|
IFS="$lsep"; exec $full_command_list
|
||||||
|
|
||||||
|
4
lib/spack/external/__init__.py
vendored
4
lib/spack/external/__init__.py
vendored
@@ -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 @@
|
|||||||
|
|
||||||
* Homepage: https://pypi.python.org/pypi/archspec
|
* Homepage: https://pypi.python.org/pypi/archspec
|
||||||
* Usage: Labeling, comparison and detection of microarchitectures
|
* Usage: Labeling, comparison and detection of microarchitectures
|
||||||
* Version: 0.2.5-dev (commit 7e6740012b897ae4a950f0bba7e9726b767e921f)
|
* Version: 0.2.2 (commit 1dc58a5776dd77e6fc6e4ba5626af5b1fb24996e)
|
||||||
|
|
||||||
astunparse
|
astunparse
|
||||||
----------------
|
----------------
|
||||||
|
24
lib/spack/external/_vendoring/distro/distro.py
vendored
24
lib/spack/external/_vendoring/distro/distro.py
vendored
@@ -1265,29 +1265,27 @@ def _distro_release_info(self) -> Dict[str, str]:
|
|||||||
match = _DISTRO_RELEASE_BASENAME_PATTERN.match(basename)
|
match = _DISTRO_RELEASE_BASENAME_PATTERN.match(basename)
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
with os.scandir(self.etc_dir) as it:
|
basenames = [
|
||||||
etc_files = [
|
basename
|
||||||
p.path for p in it
|
for basename in os.listdir(self.etc_dir)
|
||||||
if p.is_file() and p.name not in _DISTRO_RELEASE_IGNORE_BASENAMES
|
if basename not in _DISTRO_RELEASE_IGNORE_BASENAMES
|
||||||
]
|
and os.path.isfile(os.path.join(self.etc_dir, basename))
|
||||||
|
]
|
||||||
# We sort for repeatability in cases where there are multiple
|
# We sort for repeatability in cases where there are multiple
|
||||||
# distro specific files; e.g. CentOS, Oracle, Enterprise all
|
# distro specific files; e.g. CentOS, Oracle, Enterprise all
|
||||||
# containing `redhat-release` on top of their own.
|
# containing `redhat-release` on top of their own.
|
||||||
etc_files.sort()
|
basenames.sort()
|
||||||
except OSError:
|
except OSError:
|
||||||
# This may occur when /etc is not readable but we can't be
|
# This may occur when /etc is not readable but we can't be
|
||||||
# sure about the *-release files. Check common entries of
|
# sure about the *-release files. Check common entries of
|
||||||
# /etc for information. If they turn out to not be there the
|
# /etc for information. If they turn out to not be there the
|
||||||
# error is handled in `_parse_distro_release_file()`.
|
# error is handled in `_parse_distro_release_file()`.
|
||||||
etc_files = [
|
basenames = _DISTRO_RELEASE_BASENAMES
|
||||||
os.path.join(self.etc_dir, basename)
|
for basename in basenames:
|
||||||
for basename in _DISTRO_RELEASE_BASENAMES
|
match = _DISTRO_RELEASE_BASENAME_PATTERN.match(basename)
|
||||||
]
|
|
||||||
|
|
||||||
for filepath in etc_files:
|
|
||||||
match = _DISTRO_RELEASE_BASENAME_PATTERN.match(os.path.basename(filepath))
|
|
||||||
if match is None:
|
if match is None:
|
||||||
continue
|
continue
|
||||||
|
filepath = os.path.join(self.etc_dir, basename)
|
||||||
distro_info = self._parse_distro_release_file(filepath)
|
distro_info = self._parse_distro_release_file(filepath)
|
||||||
# The name is always present if the pattern matches.
|
# The name is always present if the pattern matches.
|
||||||
if "name" not in distro_info:
|
if "name" not in distro_info:
|
||||||
|
173
lib/spack/external/_vendoring/jsonschema/_format.py
vendored
173
lib/spack/external/_vendoring/jsonschema/_format.py
vendored
@@ -231,6 +231,96 @@ def is_host_name(instance):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
# The built-in `idna` codec only implements RFC 3890, so we go elsewhere.
|
||||||
|
import idna
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
@_checks_drafts(draft7="idn-hostname", raises=idna.IDNAError)
|
||||||
|
def is_idn_host_name(instance):
|
||||||
|
if not isinstance(instance, str_types):
|
||||||
|
return True
|
||||||
|
idna.encode(instance)
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
import rfc3987
|
||||||
|
except ImportError:
|
||||||
|
try:
|
||||||
|
from rfc3986_validator import validate_rfc3986
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
@_checks_drafts(name="uri")
|
||||||
|
def is_uri(instance):
|
||||||
|
if not isinstance(instance, str_types):
|
||||||
|
return True
|
||||||
|
return validate_rfc3986(instance, rule="URI")
|
||||||
|
|
||||||
|
@_checks_drafts(
|
||||||
|
draft6="uri-reference",
|
||||||
|
draft7="uri-reference",
|
||||||
|
raises=ValueError,
|
||||||
|
)
|
||||||
|
def is_uri_reference(instance):
|
||||||
|
if not isinstance(instance, str_types):
|
||||||
|
return True
|
||||||
|
return validate_rfc3986(instance, rule="URI_reference")
|
||||||
|
|
||||||
|
else:
|
||||||
|
@_checks_drafts(draft7="iri", raises=ValueError)
|
||||||
|
def is_iri(instance):
|
||||||
|
if not isinstance(instance, str_types):
|
||||||
|
return True
|
||||||
|
return rfc3987.parse(instance, rule="IRI")
|
||||||
|
|
||||||
|
@_checks_drafts(draft7="iri-reference", raises=ValueError)
|
||||||
|
def is_iri_reference(instance):
|
||||||
|
if not isinstance(instance, str_types):
|
||||||
|
return True
|
||||||
|
return rfc3987.parse(instance, rule="IRI_reference")
|
||||||
|
|
||||||
|
@_checks_drafts(name="uri", raises=ValueError)
|
||||||
|
def is_uri(instance):
|
||||||
|
if not isinstance(instance, str_types):
|
||||||
|
return True
|
||||||
|
return rfc3987.parse(instance, rule="URI")
|
||||||
|
|
||||||
|
@_checks_drafts(
|
||||||
|
draft6="uri-reference",
|
||||||
|
draft7="uri-reference",
|
||||||
|
raises=ValueError,
|
||||||
|
)
|
||||||
|
def is_uri_reference(instance):
|
||||||
|
if not isinstance(instance, str_types):
|
||||||
|
return True
|
||||||
|
return rfc3987.parse(instance, rule="URI_reference")
|
||||||
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
from strict_rfc3339 import validate_rfc3339
|
||||||
|
except ImportError:
|
||||||
|
try:
|
||||||
|
from rfc3339_validator import validate_rfc3339
|
||||||
|
except ImportError:
|
||||||
|
validate_rfc3339 = None
|
||||||
|
|
||||||
|
if validate_rfc3339:
|
||||||
|
@_checks_drafts(name="date-time")
|
||||||
|
def is_datetime(instance):
|
||||||
|
if not isinstance(instance, str_types):
|
||||||
|
return True
|
||||||
|
return validate_rfc3339(instance)
|
||||||
|
|
||||||
|
@_checks_drafts(draft7="time")
|
||||||
|
def is_time(instance):
|
||||||
|
if not isinstance(instance, str_types):
|
||||||
|
return True
|
||||||
|
return is_datetime("1970-01-01T" + instance)
|
||||||
|
|
||||||
|
|
||||||
@_checks_drafts(name="regex", raises=re.error)
|
@_checks_drafts(name="regex", raises=re.error)
|
||||||
def is_regex(instance):
|
def is_regex(instance):
|
||||||
if not isinstance(instance, str_types):
|
if not isinstance(instance, str_types):
|
||||||
@@ -250,3 +340,86 @@ def is_draft3_time(instance):
|
|||||||
if not isinstance(instance, str_types):
|
if not isinstance(instance, str_types):
|
||||||
return True
|
return True
|
||||||
return datetime.datetime.strptime(instance, "%H:%M:%S")
|
return datetime.datetime.strptime(instance, "%H:%M:%S")
|
||||||
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
import webcolors
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
def is_css_color_code(instance):
|
||||||
|
return webcolors.normalize_hex(instance)
|
||||||
|
|
||||||
|
@_checks_drafts(draft3="color", raises=(ValueError, TypeError))
|
||||||
|
def is_css21_color(instance):
|
||||||
|
if (
|
||||||
|
not isinstance(instance, str_types) or
|
||||||
|
instance.lower() in webcolors.css21_names_to_hex
|
||||||
|
):
|
||||||
|
return True
|
||||||
|
return is_css_color_code(instance)
|
||||||
|
|
||||||
|
def is_css3_color(instance):
|
||||||
|
if instance.lower() in webcolors.css3_names_to_hex:
|
||||||
|
return True
|
||||||
|
return is_css_color_code(instance)
|
||||||
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
import jsonpointer
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
@_checks_drafts(
|
||||||
|
draft6="json-pointer",
|
||||||
|
draft7="json-pointer",
|
||||||
|
raises=jsonpointer.JsonPointerException,
|
||||||
|
)
|
||||||
|
def is_json_pointer(instance):
|
||||||
|
if not isinstance(instance, str_types):
|
||||||
|
return True
|
||||||
|
return jsonpointer.JsonPointer(instance)
|
||||||
|
|
||||||
|
# TODO: I don't want to maintain this, so it
|
||||||
|
# needs to go either into jsonpointer (pending
|
||||||
|
# https://github.com/stefankoegl/python-json-pointer/issues/34) or
|
||||||
|
# into a new external library.
|
||||||
|
@_checks_drafts(
|
||||||
|
draft7="relative-json-pointer",
|
||||||
|
raises=jsonpointer.JsonPointerException,
|
||||||
|
)
|
||||||
|
def is_relative_json_pointer(instance):
|
||||||
|
# Definition taken from:
|
||||||
|
# https://tools.ietf.org/html/draft-handrews-relative-json-pointer-01#section-3
|
||||||
|
if not isinstance(instance, str_types):
|
||||||
|
return True
|
||||||
|
non_negative_integer, rest = [], ""
|
||||||
|
for i, character in enumerate(instance):
|
||||||
|
if character.isdigit():
|
||||||
|
non_negative_integer.append(character)
|
||||||
|
continue
|
||||||
|
|
||||||
|
if not non_negative_integer:
|
||||||
|
return False
|
||||||
|
|
||||||
|
rest = instance[i:]
|
||||||
|
break
|
||||||
|
return (rest == "#") or jsonpointer.JsonPointer(rest)
|
||||||
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
import uritemplate.exceptions
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
@_checks_drafts(
|
||||||
|
draft6="uri-template",
|
||||||
|
draft7="uri-template",
|
||||||
|
raises=uritemplate.exceptions.InvalidTemplate,
|
||||||
|
)
|
||||||
|
def is_uri_template(
|
||||||
|
instance,
|
||||||
|
template_validator=uritemplate.Validator().force_balanced_braces(),
|
||||||
|
):
|
||||||
|
template = uritemplate.URITemplate(instance)
|
||||||
|
return template_validator.validate(template)
|
||||||
|
@@ -497,7 +497,7 @@ def copy_attributes(self, t, memo=None):
|
|||||||
Tag.attrib, merge_attrib]:
|
Tag.attrib, merge_attrib]:
|
||||||
if hasattr(self, a):
|
if hasattr(self, a):
|
||||||
if memo is not None:
|
if memo is not None:
|
||||||
setattr(t, a, copy.deepcopy(getattr(self, a), memo))
|
setattr(t, a, copy.deepcopy(getattr(self, a, memo)))
|
||||||
else:
|
else:
|
||||||
setattr(t, a, getattr(self, a))
|
setattr(t, a, getattr(self, a))
|
||||||
# fmt: on
|
# fmt: on
|
||||||
|
3
lib/spack/external/archspec/__init__.py
vendored
3
lib/spack/external/archspec/__init__.py
vendored
@@ -1,3 +1,2 @@
|
|||||||
"""Init file to avoid namespace packages"""
|
"""Init file to avoid namespace packages"""
|
||||||
|
__version__ = "0.2.2"
|
||||||
__version__ = "0.2.4"
|
|
||||||
|
1
lib/spack/external/archspec/__main__.py
vendored
1
lib/spack/external/archspec/__main__.py
vendored
@@ -3,7 +3,6 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from .cli import main
|
from .cli import main
|
||||||
|
|
||||||
sys.exit(main())
|
sys.exit(main())
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user