Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
56c58e3
Extend gitignore
alalazo Jun 16, 2026
c428650
basics: split "Installing Packages" into subsections
alalazo Jun 16, 2026
11a3bbb
Add a paragraph explaining the overall spack architecture
alalazo Jun 16, 2026
3bbae8f
Update releases/v1.1 -> releases/v1.2
alalazo Jun 16, 2026
9468048
Move high-level highlights to introduction
alalazo Jun 16, 2026
0497b30
Minor fixes
alalazo Jun 16, 2026
e2cb0da
Shorten and improve "Installing Packages"
alalazo Jun 16, 2026
074848a
Demote Compiler flags
alalazo Jun 16, 2026
d2bff02
Reorder "Spec Syntax" subsections
alalazo Jun 16, 2026
5b6f960
Move "Querying Installations" into its own section
alalazo Jun 16, 2026
d047d4b
Add intro to "Spec Syntax"
alalazo Jun 16, 2026
ebc16a3
Update output
alalazo Jun 16, 2026
87c3593
Fix "Installing Packages"
alalazo Jun 16, 2026
31d6044
Fix "Transitive Dependencies"
alalazo Jun 16, 2026
d0dd491
Fix "Transitive Dependencies"
alalazo Jun 16, 2026
7f90404
Fix "Virtual Dependencies"
alalazo Jun 16, 2026
6242ad4
First draft
alalazo Jun 16, 2026
8bb5b6e
Add missing output
alalazo Jun 16, 2026
1586d86
Polish the section
alalazo Jun 17, 2026
dba308b
Polish the section
alalazo Jun 17, 2026
54b8a19
Temporarily disable output generation
alalazo Jun 17, 2026
90d1609
Mechanical update of the environment section
alalazo Jun 17, 2026
6bf8c20
Minor fixes
alalazo Jun 18, 2026
5bafd0f
Don't use a non-matching temporary environment
alalazo Jun 18, 2026
86b5008
Shorten introduction, but maintain the same content
alalazo Jun 18, 2026
eec5264
Improved "Working with environments" section
alalazo Jun 18, 2026
069509d
Improved "Working with environments" section
alalazo Jun 18, 2026
0b3d07c
Added an "Environment on disk" section
alalazo Jun 18, 2026
a5f3f3f
Added an "Environment on disk" section
alalazo Jun 18, 2026
220ba06
Added an "Environment on disk" section
alalazo Jun 18, 2026
f879ed5
Added a "Configuring environments" section
alalazo Jun 18, 2026
c9f8171
Trimmed redundant section
alalazo Jun 18, 2026
20409cb
First complete draft of the "Environments" tutorial
alalazo Jun 18, 2026
2a335e3
Minor fixes
alalazo Jun 18, 2026
7933c1b
Minor fixes
alalazo Jun 18, 2026
cfae192
Less notes in the initial section
alalazo Jun 18, 2026
a9e5b12
Merge branch 'main' into isc26/environments-update
alecbcs Jun 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
141 changes: 52 additions & 89 deletions outputs/environments.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,10 @@ export SPACK_COLOR=never
. "$project/init_spack.sh"
. share/spack/setup-env.sh

####
# Introduction for "basic" installation if basics section not being used
####
#example environments/clone "git clone --depth=100 --branch=$tutorial_branch https://github.com/spack/spack.git ~/spack"
#example environments/clone "cd ~/spack"

#cd ~/spack || exit
#export SPACK_ROOT=~/spack

#. share/spack/setup-env.sh
#spack config add "config:suppress_gpg_warnings:true"

#example environments/source-setup ". share/spack/setup-env.sh"

#example environments/gmake "spack install gmake"

#example environments/gmake-1 "spack install gmake@4.3"

#example environments/find-gmake "spack find -p gmake"

#example environments/ls-dot-spack 'ls "$(spack location -i gmake@4.4)/.spack"'

#example environments/mirror "spack mirror add tutorial /mirror"
# spack mirror add --unsigned tutorial /mirror
#example environments/mirror "spack buildcache keys --install --trust"

####
# Usual Environment output
####
# Working with Environments

example environments/find-no-env-1 "spack find"

Expand All @@ -58,64 +34,25 @@ spack env deactivate
example environments/env-status-2 "spack env status"
example environments/env-status-2 "spack find"

example --tee environments/env-fail-install-1 "spack env activate myproject"
spack env activate myproject
example --expect-error environments/env-fail-install-1 "spack install tcl"

example environments/env-add-1 "spack add tcl"
example environments/env-add-1 "spack add trilinos"
example environments/env-add-1 "spack find"

example environments/env-install-1 "spack install"
example environments/env-add-find-1 "spack find"

example environments/find-env-2 "spack find"
example environments/env-concretize-1 "spack concretize"

example environments/use-tcl-1 "which tclsh"
example environments/env-find-c-1 "spack find -c"

example environments/env-create-2 "spack env create myproject2"
example --tee environments/env-create-2 "spack env activate myproject2"
spack env activate myproject2
example environments/env-create-2 "spack add scr trilinos"
example environments/env-create-2 "spack install"
example environments/env-create-2 "spack find"
example --tee environments/env-install-1 "spack install"

example --expect-error environments/env-uninstall-1 "spack uninstall -y trilinos"
example environments/env-uninstall-1 "spack find"
example environments/find-env-2 "spack find"

example environments/env-remove-1 "spack remove trilinos"
example environments/env-remove-1 "spack find"
example environments/env-remove-1 "spack concretize"
example environments/env-remove-1 "spack find"
example environments/use-tcl-1 "which tclsh"

example --tee environments/env-swap-1 "spack env activate myproject"
example --tee environments/show-mpicc-1 "spack env activate myproject"
spack env activate myproject
example environments/env-swap-1 "spack find"

example environments/config-get-1 'EDITOR=cat spack config edit'

# The file is edited by hand here
# We mock that by using `spack config add`
spack config add packages:mpi:require:[mpich]

example environments/concretize-f-1 "spack concretize --force"
# spack install

example --tee environments/incremental-1 "spack env activate --temp"
spack env activate --temp
example environments/incremental-1 "spack install --add python"

# v1.1: Spack concretizer regression causes the following command to hang
# seemingly indefinitely. (Have tested waiting 1h 15m before giving up.)
# example environments/incremental-1 "spack install --add py-numpy@1.20 2>&1 | tail -n1"

# These commands should be fine, although we had a transient failure with them
example environments/incremental-2 "spack add py-numpy@1.20"
example environments/incremental-2 "spack concretize -f"

spack env deactivate

example --tee environments/show-mpicc-1 "spack env activate myproject2"
spack env activate myproject2
example environments/show-mpicc-1 "spack env status"
example environments/show-mpicc-1 "which mpicc"

Expand Down Expand Up @@ -145,16 +82,55 @@ EOF
example environments/use-mpi-1 'mpicc ./mpi-hello.c -I$(spack location -i zlib-ng)/include'
example environments/use-mpi-1 "mpirun -n 2 ./a.out"

example environments/myproject-zlib-ng-1 "spack find zlib-ng"
example environments/env-create-2 "spack env create myproject2"
example --tee environments/env-create-2 "spack env activate myproject2"
spack env activate myproject2
example environments/env-create-2 "spack add scr trilinos"
# concretize + install are shown as a code-block in the docs; run them here without capturing
spack concretize
spack install

example environments/env-create-2-find "spack find"

# Basic removal workflow on scr (used only by myproject2), split for the docs
example environments/env-remove-scr-1 "spack remove scr"
example environments/env-remove-scr-2 "spack find"
example environments/env-remove-scr-3 "spack concretize"
example environments/env-remove-scr-4 "spack find"

# trilinos is shared with myproject: uninstalling it is refused
example --expect-error environments/env-uninstall-1 "spack uninstall -y trilinos"

# spack remove takes it out of myproject2 without deleting the shared install
example environments/env-remove-1 "spack remove trilinos"
example environments/env-remove-1 "spack concretize"

example --tee environments/env-swap-1 "spack env activate myproject"
spack env activate myproject
example environments/env-swap-1 "spack find"

# Environments on disk

example --tee environments/filenames-1 "spack cd -e myproject"
spack cd -e myproject
example environments/filenames-1 "pwd"
example environments/filenames-1 "ls"

example environments/cat-config-1 "cat spack.yaml"
example environments/lockfile-1 "jq < spack.lock | head -30"
example environments/env-list-2 "spack env list"
cd

# Configuring environments

# The file is edited by hand here
# We mock that by using `spack config add`
spack config add packages:mpi:require:[mpich]

example environments/cat-config-1 "cat spack.yaml"
example environments/concretize-1 "spack concretize"
example environments/concretize-f-1 "spack concretize --force"
# spack install

# Reproducing builds

example environments/independent-create-1 "cd"
cd || exit
Expand All @@ -163,25 +139,12 @@ example environments/independent-create-1 "cd code"
cd code || exit
example environments/independent-create-1 "spack env create -d ."

example environments/independent-create-2 "ls"
example environments/independent-create-2 "cat spack.yaml"

example environments/env-list-3 "spack env list"

example --tee environments/install-independent-1 "spack env activate ."
spack env activate .
# mock a hand-edit from before we activated
spack add trilinos
spack add openmpi
example environments/install-independent-1 "spack install"

example environments/add-independent-1 "spack add hdf5@5.5.1"
example environments/add-independent-1 "cat spack.yaml"

example environments/remove-independent-1 "spack remove hdf5"
example environments/remove-independent-1 "cat spack.yaml"

example environments/lockfile-1 "jq < spack.lock | head -30"
example --tee environments/install-independent-1 "spack install"

example environments/create-from-file-1 "spack env create abstract spack.yaml"

Expand Down
16 changes: 0 additions & 16 deletions outputs/environments/add-independent-1.out

This file was deleted.

3 changes: 0 additions & 3 deletions outputs/environments/cat-config-1.out
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,3 @@ spack:
view: true
concretizer:
unify: true
packages:
mpi:
require: [mpich]
2 changes: 2 additions & 0 deletions outputs/environments/concretize-1.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
$ spack concretize
==> No new specs to concretize.
Loading
Loading