Skip to content

Commit

Permalink
spack backports branch + toolchain updates (#273)
Browse files Browse the repository at this point in the history
  • Loading branch information
haampie committed Nov 7, 2023
1 parent d2b7072 commit 5846a34
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 52 deletions.
2 changes: 1 addition & 1 deletion outputs/defs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fi
raw_outputs="${PROJECT}/raw"

# used by scripts
tutorial_branch=releases/v0.21
tutorial_branch=backports/v0.21.0

print_status() {
printf "\n%b: %s\n\n" "\033[1;35m$1\033[0m" "$2"
Expand Down
10 changes: 5 additions & 5 deletions outputs/modules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ spack install lmod

. "$(spack location -i lmod)/lmod/lmod/init/bash"
. share/spack/setup-env.sh
spack install gcc@12.1.0
spack install gcc@12

example --tee modules/spack-load-gcc "spack load gcc@12.1.0"
spack load gcc@12.1.0
example --tee modules/spack-load-gcc "spack load gcc@12"
spack load gcc@12
example modules/spack-load-gcc "which gcc"

example modules/add-compiler "spack compiler add"
Expand All @@ -44,7 +44,7 @@ spack install py-scipy ^openblas
example --tee modules/module-avail-2 "module avail"

gcc_hash="$(spack find --format '{hash:7}' gcc)"
gcc_module="gcc-12.1.0-gcc-11.3.0-${gcc_hash}"
gcc_module="gcc/12.3.0-gcc-11.4.0-${gcc_hash}"
example --tee modules/module-show-1 "module show $gcc_module"

spack config add "modules:default:tcl:all:filter:exclude_env_vars:['C_INCLUDE_PATH', 'CPLUS_INCLUDE_PATH', 'LIBRARY_PATH']"
Expand All @@ -53,7 +53,7 @@ example modules/tcl-refresh-1 "spack module tcl refresh -y"
example --tee modules/module-show-2 "module show $gcc_module"


spack config add "modules:default:tcl:exclude:['%gcc@11.3.0']"
spack config add "modules:default:tcl:exclude:['%gcc@11']"
example modules/tcl-refresh-2 "spack module tcl refresh --delete-tree -y"
example --tee modules/module-avail-3 "module avail"

Expand Down
6 changes: 3 additions & 3 deletions outputs/scripting.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ project="$(dirname "$0")"
rm -rf "${raw_outputs:?}/scripting"
. "$project/init_spack.sh"

spack install gcc@12.1.0
spack compiler find "$(spack location -i gcc@12.1.0)"
spack install gcc@12
spack compiler find "$(spack location -i gcc@12)"

example scripting/setup "spack uninstall -ay"
example scripting/setup "spack compiler rm gcc@12.1.0"
example scripting/setup "spack compiler rm gcc@12"
example scripting/setup "spack install hdf5"
example scripting/setup "spack install zlib%clang"

Expand Down
6 changes: 3 additions & 3 deletions outputs/stacks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spack compiler find
example stacks/setup-0 "spack env create -d ."
fake_example stacks/setup-0 "spack env activate ." ". /home/spack/spack/share/spack/setup-env.sh && spack env activate ."
spack env activate .
example stacks/setup-0 "spack add gcc@12.1.0 %gcc@11.3.0"
example stacks/setup-0 "spack add gcc@12 %gcc@11"

#cat "$project/stacks/examples/0.spack.stack.yaml" > spack.yaml

Expand Down Expand Up @@ -53,7 +53,7 @@ example stacks/view-0 "spack concretize"
example stacks/view-0 "ls views/default"
example stacks/view-0 "ls views/default/lib"
example stacks/view-0 "ls views/full"
example stacks/view-0 "ls views/full/gcc-12.1.0"
example stacks/view-0 "ls views/full/gcc-12.3.0"

cat "$project/stacks/examples/7.spack.stack.yaml" > spack.yaml

Expand All @@ -62,7 +62,7 @@ example stacks/view-1 "ls views/default"
example stacks/view-1 "ls views/default/lib"
example stacks/view-1 "ls views/full"

example stacks/modules-0 "spack add lmod%gcc@11.3.0"
example stacks/modules-0 "spack add lmod%gcc@11"
example stacks/modules-0 "spack concretize"
example stacks/modules-0 "spack install"

Expand Down
2 changes: 1 addition & 1 deletion outputs/stacks/examples/0.spack.stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
spack:
# add package specs to the `specs` list
specs:
- gcc@=12.1.0%gcc@11.3.0
- gcc@12%gcc@11
view: false
concretizer:
unify: true
2 changes: 1 addition & 1 deletion outputs/stacks/examples/5.spack.stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spack:
- serial_packages: [py-scipy]

specs:
- gcc@=12.1.0%gcc@11.3.0
- gcc@12%gcc@11
- matrix:
- [$mpi_packages]
- [$^mpis]
Expand Down
2 changes: 1 addition & 1 deletion outputs/stacks/examples/6.spack.stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spack:
- serial_packages: [py-scipy]

specs:
- gcc@=12.1.0%gcc@11.3.0
- gcc@12%gcc@11
- matrix:
- [$mpi_packages]
- [$^mpis]
Expand Down
2 changes: 1 addition & 1 deletion outputs/stacks/examples/7.spack.stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spack:
- serial_packages: [py-scipy]

specs:
- gcc@=12.1.0%gcc@11.3.0
- gcc@12%gcc@11
- matrix:
- [$mpi_packages]
- [$^mpis]
Expand Down
2 changes: 1 addition & 1 deletion tutorial_basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ added to the configuration.

We can add GCC to Spack as an available compiler using the ``spack
compiler add`` command. This will allow future packages to build with
``gcc@12.1.0``. To avoid having to copy and paste GCC's path, we can use
``gcc@12.3.0``. To avoid having to copy and paste GCC's path, we can use
``spack location -i`` to get the installation prefix.

.. literalinclude:: outputs/basics/compiler-add-location.out
Expand Down
20 changes: 10 additions & 10 deletions tutorial_configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ configuration file as follows:
compilers::
- compiler:
spec: gcc@11.3.0
spec: gcc@11.4.0
paths:
cc: /usr/bin/gcc
cxx: /usr/bin/g++
Expand Down Expand Up @@ -180,7 +180,7 @@ level underneath the top-level 'spack' key. For example the above
view: true
compilers::
- compiler:
spec: gcc@11.3.0
spec: gcc@11.4.0
paths:
cc: /usr/bin/gcc
cxx: /usr/bin/g++
Expand Down Expand Up @@ -249,7 +249,7 @@ active environment):
environment: {}
extra_rpaths: []
- compiler:
spec: gcc@11.3.0
spec: gcc@11.4.0
paths:
cc: /usr/bin/gcc
cxx: /usr/bin/g++
Expand Down Expand Up @@ -311,14 +311,14 @@ We can verify that our new compiler works by invoking it now:
This new compiler also works on Fortran codes. We'll show it by
compiling a small package using as a build dependency ``cmake%gcc@11.3.0``
compiling a small package using as a build dependency ``cmake%gcc@11.4.0``
since it is already available in our binary cache:

.. code-block:: console
$ spack install --reuse cmake %gcc@11.3.0
$ spack install --reuse cmake %gcc@11.4.0
...
$ spack install --no-cache --reuse json-fortran %clang@7.0.0-gfortran ^cmake%gcc@11.3.0
$ spack install --no-cache --reuse json-fortran %clang@7.0.0-gfortran ^cmake%gcc@11.4.0
...
Expand Down Expand Up @@ -573,7 +573,7 @@ this package and where it can be found:
require: ~mpi
perl:
externals:
- spec: perl@5.26.1 %gcc@11.3.0
- spec: perl@5.26.1 %gcc@11.4.0
prefix: /usr
Expand Down Expand Up @@ -614,7 +614,7 @@ not allowed to build its own Perl. We'll go with the latter.
require: ~mpi
perl:
externals:
- spec: perl@5.26.1 %gcc@11.3.0
- spec: perl@5.26.1 %gcc@11.4.0
prefix: /usr
buildable: false
Expand Down Expand Up @@ -646,12 +646,12 @@ HDF5 to build with MPI by default again:
mpi: [mpich, openmpi]
perl:
externals:
- spec: perl@5.26.1 %gcc@11.3.0
- spec: perl@5.26.1 %gcc@11.4.0
prefix: /usr
buildable: false
mpich:
externals:
- spec: mpich@3.3%gcc@11.3.0
- spec: mpich@3.3%gcc@11.4.0
prefix: /usr
mpi:
buildable: false
Expand Down
42 changes: 21 additions & 21 deletions tutorial_modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,15 @@ Add a new compiler
The second step is to build a recent compiler. On first use, Spack
scans the environment and automatically locates the compiler(s)
already available on the system. For this tutorial, however, we want
to use ``gcc@12.1.0``.
to use ``gcc@12.3.0``.


.. code-block:: console
$ spack install gcc@12.1.0
$ spack install gcc@12.3.0
You can get this in your environment using ``spack load gcc@12.1.0``:
You can get this in your environment using ``spack load gcc@12.3.0``:

.. literalinclude:: outputs/modules/spack-load-gcc.out
:language: console
Expand All @@ -113,7 +113,7 @@ To check which compilers are available you can use ``spack compiler list``:
.. literalinclude:: outputs/modules/list-compiler.out
:language: console

Finally, when you confirmed ``gcc@12.1.0`` is properly registered, clean the environment
Finally, when you confirmed ``gcc@12.3.0`` is properly registered, clean the environment
with ``spack unload``:

.. code-block:: console
Expand Down Expand Up @@ -343,7 +343,7 @@ Prevent some module files from being generated
Another common request at many sites is to avoid exposing software that
is only needed as an intermediate step when building a newer stack.
Let's try to prevent the generation of
module files for anything that is compiled with ``gcc@11.3.0`` (the OS provided compiler).
module files for anything that is compiled with ``gcc@11.4.0`` (the OS provided compiler).

To do this you should add the ``exclude`` keyword to ``${SPACK_ROOT}/etc/spack/modules.yaml``:

Expand All @@ -354,7 +354,7 @@ To do this you should add the ``exclude`` keyword to ``${SPACK_ROOT}/etc/spack/m
default:
tcl:
exclude:
- '%gcc@11.3.0'
- '%gcc@11.4.0'
all:
filter:
exclude_env_vars:
Expand All @@ -375,8 +375,8 @@ directory.


if you look closely you'll see though that we went too far in
excluding modules: the module for ``gcc@12.1.0`` disappeared as it was
bootstrapped with ``gcc@11.3.0``. To specify exceptions to the ``exclude``
excluding modules: the module for ``gcc@12.3.0`` disappeared as it was
bootstrapped with ``gcc@11.4.0``. To specify exceptions to the ``exclude``
rules you can use ``include``:

.. code-block:: yaml
Expand All @@ -388,7 +388,7 @@ rules you can use ``include``:
include:
- gcc
exclude:
- '%gcc@11.3.0'
- '%gcc@11.4.0'
all:
filter:
exclude_env_vars:
Expand All @@ -401,7 +401,7 @@ rules you can use ``include``:
.. literalinclude:: outputs/modules/tcl-refresh-3.out
:language: console

you'll see that now the module for ``gcc@12.1.0`` has reappeared:
you'll see that now the module for ``gcc@12.3.0`` has reappeared:

.. literalinclude:: outputs/modules/module-avail-4.out
:language: console
Expand All @@ -420,7 +420,7 @@ packages. In this case you only need to add the following line:
include:
- gcc
exclude:
- '%gcc@11.3.0'
- '%gcc@11.4.0'
all:
filter:
exclude_env_vars:
Expand Down Expand Up @@ -449,7 +449,7 @@ use the ``hash_length`` keyword in the configuration file:
include:
- gcc
exclude:
- '%gcc@11.3.0'
- '%gcc@11.4.0'
all:
filter:
exclude_env_vars:
Expand Down Expand Up @@ -483,7 +483,7 @@ the names are formatted to differentiate them:
include:
- gcc
exclude:
- '%gcc@11.3.0'
- '%gcc@11.4.0'
all:
conflict:
- '{name}'
Expand Down Expand Up @@ -538,7 +538,7 @@ is installed. You can achieve this with Spack by adding an
include:
- gcc
exclude:
- '%gcc@11.3.0'
- '%gcc@11.4.0'
all:
conflict:
- '{name}'
Expand Down Expand Up @@ -590,7 +590,7 @@ only certain packages. You can for instance apply modifications to the
include:
- gcc
exclude:
- '%gcc@11.3.0'
- '%gcc@11'
all:
conflict:
- '{name}'
Expand Down Expand Up @@ -642,7 +642,7 @@ directive and assigning it the value ``direct``:
include:
- gcc
exclude:
- '%gcc@11.3.0'
- '%gcc@11'
all:
conflict:
- '{name}'
Expand Down Expand Up @@ -750,7 +750,7 @@ After these modifications your configuration file should look like:
include:
- gcc
exclude:
- '%gcc@11.3.0'
- '%gcc@11'
all:
filter:
exclude_env_vars:
Expand Down Expand Up @@ -885,7 +885,7 @@ remove the remaining suffix projection for ``lapack``:
include:
- gcc
exclude:
- '%gcc@11.3.0'
- '%gcc@11'
all:
filter:
exclude_env_vars:
Expand Down Expand Up @@ -1046,7 +1046,7 @@ it's ``netlib-scalapack``:
include:
- gcc
exclude:
- '%gcc@11.3.0'
- '%gcc@11'
- readline
all:
filter:
Expand Down Expand Up @@ -1091,13 +1091,13 @@ the right e-mail address where to ask for it!
Restore settings for future sections
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

For future sections of the tutorial, we will not use the ``gcc@12.1.0``
For future sections of the tutorial, we will not use the ``gcc@12.3.0``
compiler. Since it is currently the default compiler (our current
default is the most recent version of gcc available), we will remove
it now.

.. code-block:: console
$ spack compiler rm gcc@12.1.0
$ spack compiler rm gcc@12.3.0
This will ensure the rest of the tutorial goes smoothly for you.

0 comments on commit 5846a34

Please sign in to comment.