From de8232b0f2e2de0518a947d33b915ad7ce7d6e09 Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Mon, 30 Oct 2023 09:38:41 +0100 Subject: [PATCH] tutorial: zlib -> gmake --- docker/config.yaml | 4 --- outputs/basics.sh | 32 +++++++++---------- .../basics/{find-zlib.out => find-gmake.out} | 0 .../{find-lf-zlib.out => find-lf-gmake.out} | 0 .../basics/{zlib-1.2.8.out => gmake-4.3.out} | 0 outputs/basics/{zlib-O3.out => gmake-O3.out} | 0 .../{zlib-clang.out => gmake-clang.out} | 0 .../{zlib-gcc-10.4.0.out => gmake-gcc-10.out} | 0 outputs/basics/{zlib.out => gmake.out} | 0 ...tcl-zlib-clang.out => tcl-gmake-clang.out} | 0 .../{tcl-zlib-hash.out => tcl-gmake-hash.out} | 0 ...uninstall-zlib.out => uninstall-gmake.out} | 0 .../{versions-zlib.out => versions-gmake.out} | 0 outputs/environments.sh | 14 ++++---- ...ect-zlib-1.out => myproject-zlib-ng-1.out} | 0 tutorial_basics.rst | 30 ++++++++--------- tutorial_environments.rst | 4 +-- 17 files changed, 40 insertions(+), 44 deletions(-) rename outputs/basics/{find-zlib.out => find-gmake.out} (100%) rename outputs/basics/{find-lf-zlib.out => find-lf-gmake.out} (100%) rename outputs/basics/{zlib-1.2.8.out => gmake-4.3.out} (100%) rename outputs/basics/{zlib-O3.out => gmake-O3.out} (100%) rename outputs/basics/{zlib-clang.out => gmake-clang.out} (100%) rename outputs/basics/{zlib-gcc-10.4.0.out => gmake-gcc-10.out} (100%) rename outputs/basics/{zlib.out => gmake.out} (100%) rename outputs/basics/{tcl-zlib-clang.out => tcl-gmake-clang.out} (100%) rename outputs/basics/{tcl-zlib-hash.out => tcl-gmake-hash.out} (100%) rename outputs/basics/{uninstall-zlib.out => uninstall-gmake.out} (100%) rename outputs/basics/{versions-zlib.out => versions-gmake.out} (100%) rename outputs/environments/{myproject-zlib-1.out => myproject-zlib-ng-1.out} (100%) diff --git a/docker/config.yaml b/docker/config.yaml index bab9994c15..d35ef8e81b 100644 --- a/docker/config.yaml +++ b/docker/config.yaml @@ -1,6 +1,2 @@ config: suppress_gpg_warnings: true - # This is needed to be able to use zlib@1.2.11 - # or earlier as of v0.18.0 - deprecated: true - diff --git a/outputs/basics.sh b/outputs/basics.sh index 4349174426..06981a1953 100755 --- a/outputs/basics.sh +++ b/outputs/basics.sh @@ -15,35 +15,35 @@ cd ~/spack || exit . share/spack/setup-env.sh spack config add "config:suppress_gpg_warnings:true" -example basics/source-setup ". share/spack/setup-env.sh" +example basics/source-setup ". share/spack/setup-env.sh" # spack list example basics/list "spack list" example basics/list-py "spack list 'py-*'" # spack install -example basics/zlib "spack install zlib" +example basics/gmake "spack install gmake" example basics/mirror "spack mirror add tutorial /mirror" example basics/mirror "spack buildcache keys --install --trust" -example basics/zlib-clang "spack install zlib %clang" +example basics/gmake-clang "spack install gmake %clang" -example basics/versions-zlib "spack versions zlib" -example basics/zlib-1.2.8 "spack install zlib@1.2.8" -example basics/zlib-gcc-10.4.0 "spack install zlib %gcc@10" +example basics/versions-gmake "spack versions gmake" +example basics/gmake-4.3 "spack install gmake@4.3" +example basics/gmake-gcc-10 "spack install gmake %gcc@10" -example basics/zlib-O3 "spack install zlib@1.2.8 cflags=-O3" +example basics/gmake-O3 "spack install gmake@4.3 cflags=-O3" example basics/find "spack find" example basics/find-lf "spack find -lf" example basics/tcl "spack install tcl" -example basics/tcl-zlib-clang "spack install tcl ^zlib@1.2.8 %clang" +example basics/tcl-gmake-clang "spack install tcl ^gmake@4.3 %clang" -zlib_hash=$(spack find --format "{hash:3}" zlib cflags=-O3) -example basics/tcl-zlib-hash "spack install tcl ^/${zlib_hash}" +gmake_hash=$(spack find --format "{hash:3}" gmake cflags=-O3) +example basics/tcl-gmake-hash "spack install tcl ^/${gmake_hash}" example basics/find-ldf "spack find -ldf" @@ -66,15 +66,15 @@ example basics/graph-trilinos "spack graph trilinos" example basics/find-d-tcl "spack find -d tcl" -example basics/find-zlib "spack find zlib" +example basics/find-gmake "spack find gmake" -example basics/uninstall-zlib "spack uninstall -y zlib %gcc@10" +example basics/uninstall-gmake "spack uninstall -y gmake %gcc@10" -example basics/find-lf-zlib "spack find -lf zlib" +example basics/find-lf-gmake "spack find -lf gmake" -zlib_hash="$(spack find --format '{hash:3}' zlib@1.2.8 %clang)" -example --expect-error basics/uninstall-needed "spack uninstall zlib/$zlib_hash" -example basics/uninstall-r-needed "spack uninstall -y -R zlib/$zlib_hash" +gmake_hash="$(spack find --format '{hash:3}' gmake@4.3 %clang)" +example --expect-error basics/uninstall-needed "spack uninstall gmake/$gmake_hash" +example basics/uninstall-r-needed "spack uninstall -y -R gmake/$gmake_hash" example --expect-error basics/uninstall-ambiguous "spack uninstall trilinos" diff --git a/outputs/basics/find-zlib.out b/outputs/basics/find-gmake.out similarity index 100% rename from outputs/basics/find-zlib.out rename to outputs/basics/find-gmake.out diff --git a/outputs/basics/find-lf-zlib.out b/outputs/basics/find-lf-gmake.out similarity index 100% rename from outputs/basics/find-lf-zlib.out rename to outputs/basics/find-lf-gmake.out diff --git a/outputs/basics/zlib-1.2.8.out b/outputs/basics/gmake-4.3.out similarity index 100% rename from outputs/basics/zlib-1.2.8.out rename to outputs/basics/gmake-4.3.out diff --git a/outputs/basics/zlib-O3.out b/outputs/basics/gmake-O3.out similarity index 100% rename from outputs/basics/zlib-O3.out rename to outputs/basics/gmake-O3.out diff --git a/outputs/basics/zlib-clang.out b/outputs/basics/gmake-clang.out similarity index 100% rename from outputs/basics/zlib-clang.out rename to outputs/basics/gmake-clang.out diff --git a/outputs/basics/zlib-gcc-10.4.0.out b/outputs/basics/gmake-gcc-10.out similarity index 100% rename from outputs/basics/zlib-gcc-10.4.0.out rename to outputs/basics/gmake-gcc-10.out diff --git a/outputs/basics/zlib.out b/outputs/basics/gmake.out similarity index 100% rename from outputs/basics/zlib.out rename to outputs/basics/gmake.out diff --git a/outputs/basics/tcl-zlib-clang.out b/outputs/basics/tcl-gmake-clang.out similarity index 100% rename from outputs/basics/tcl-zlib-clang.out rename to outputs/basics/tcl-gmake-clang.out diff --git a/outputs/basics/tcl-zlib-hash.out b/outputs/basics/tcl-gmake-hash.out similarity index 100% rename from outputs/basics/tcl-zlib-hash.out rename to outputs/basics/tcl-gmake-hash.out diff --git a/outputs/basics/uninstall-zlib.out b/outputs/basics/uninstall-gmake.out similarity index 100% rename from outputs/basics/uninstall-zlib.out rename to outputs/basics/uninstall-gmake.out diff --git a/outputs/basics/versions-zlib.out b/outputs/basics/versions-gmake.out similarity index 100% rename from outputs/basics/versions-zlib.out rename to outputs/basics/versions-gmake.out diff --git a/outputs/environments.sh b/outputs/environments.sh index e6cf0fc5f7..90276eda21 100755 --- a/outputs/environments.sh +++ b/outputs/environments.sh @@ -10,12 +10,12 @@ rm -rf "${raw_outputs:?}/environments" # In the basics section a bunch of packages were already installed, # they are referenced here. Reinstall them so we can generate outputs # independently. -spack install zlib \ - zlib %clang \ - zlib@1.2.8 \ - zlib@1.2.8 cflags=-O3 \ +spack install gmake \ + gmake %clang \ + gmake@4.3 \ + gmake@4.3 cflags=-O3 \ tcl \ - tcl ^zlib cflags=-O3 \ + tcl ^gmake cflags=-O3 \ hdf5 \ hdf5~mpi \ hdf5+hl+mpi ^mpich \ @@ -114,10 +114,10 @@ int main(int argc, char **argv) { MPI_Finalize(); } EOF -example environments/use-mpi-1 'mpicc ./mpi-hello.c -I$(spack location -i zlib)/include' +example environments/use-mpi-1 'mpicc ./mpi-hello.c -I$(spack location -i zlib-ng)/include' example environments/use-mpi-1 "mpirun -n 4 ./a.out" -example environments/myproject-zlib-1 "spack find zlib" +example environments/myproject-zlib-ng-1 "spack find zlib-ng" example --tee environments/filenames-1 "spack cd -e myproject" spack cd -e myproject diff --git a/outputs/environments/myproject-zlib-1.out b/outputs/environments/myproject-zlib-ng-1.out similarity index 100% rename from outputs/environments/myproject-zlib-1.out rename to outputs/environments/myproject-zlib-ng-1.out diff --git a/tutorial_basics.rst b/tutorial_basics.rst index 1c02c0b25b..ee38a48c47 100644 --- a/tutorial_basics.rst +++ b/tutorial_basics.rst @@ -70,7 +70,7 @@ Installing Packages Installing a package with Spack is very simple. To install a piece of software, simply type ``spack install ``. -.. literalinclude:: outputs/basics/zlib.out +.. literalinclude:: outputs/basics/gmake.out :language: console Spack can install software either from source or from a binary @@ -94,7 +94,7 @@ Spack's spec syntax is the interface by which we can request specific configurations of the package. The ``%`` sigil is used to specify compilers. -.. literalinclude:: outputs/basics/zlib-clang.out +.. literalinclude:: outputs/basics/gmake-clang.out :language: console Note that this installation is located separately from the previous @@ -103,18 +103,18 @@ allows Spack to support arbitrarily versioned software. You can check for particular versions before requesting them. We will use the ``spack versions`` command to see the available versions, and then -install a different version of ``zlib``. +install a different version of ``gmake``. -.. literalinclude:: outputs/basics/versions-zlib.out +.. literalinclude:: outputs/basics/versions-gmake.out :language: console The ``@`` sigil is used to specify versions, both of packages and of compilers. -.. literalinclude:: outputs/basics/zlib-1.2.8.out +.. literalinclude:: outputs/basics/gmake-4.3.out :language: console -.. literalinclude:: outputs/basics/zlib-gcc-10.4.0.out +.. literalinclude:: outputs/basics/gmake-gcc-10.out :language: console The spec syntax also includes compiler flags. Spack accepts @@ -123,7 +123,7 @@ The spec syntax also includes compiler flags. Spack accepts the command line if they include spaces. These values are injected into the compile line automatically by the Spack compiler wrappers. -.. literalinclude:: outputs/basics/zlib-O3.out +.. literalinclude:: outputs/basics/gmake-O3.out :language: console The ``spack find`` command is used to query installed packages. Note that @@ -154,12 +154,12 @@ Dependencies can be explicitly requested using the ``^`` sigil. Note that the spec syntax is recursive. Anything we could specify about the top-level package, we can also specify about a dependency using ``^``. -.. literalinclude:: outputs/basics/tcl-zlib-clang.out +.. literalinclude:: outputs/basics/tcl-gmake-clang.out :language: console Packages can also be referred to from the command line by their package hash. Using the ``spack find -lf`` command earlier we saw that the hash -of our optimized installation of zlib (``cflags="-O3"``) began with +of our optimized installation of gmake (``cflags="-O3"``) began with ``iswfl``. We can now explicitly build with that package without typing the entire spec, by using the ``/`` sigil to refer to it by hash. As with other tools like Git, you do not need to specify an *entire* hash on the @@ -167,7 +167,7 @@ command line. You can specify just enough digits to identify a hash uniquely. If a hash prefix is ambiguous (i.e., two or more installed packages share the prefix) then Spack will report an error. -.. literalinclude:: outputs/basics/tcl-zlib-hash.out +.. literalinclude:: outputs/basics/tcl-gmake-hash.out :language: console The ``spack find`` command can also take a ``-d`` flag, which can show @@ -223,7 +223,7 @@ DAG as a graph. .. literalinclude:: outputs/basics/graph-hdf5.out :language: console -HDF5 is more complicated than our basic example of zlib and +HDF5 is more complicated than our basic example of gmake and Tcl, but it's still within the realm of software that an experienced HPC user could reasonably expect to manually install given a bit of time. Now let's look at an even more complicated package. @@ -278,22 +278,22 @@ complicated packages. The output can be changed to the Graphviz Uninstalling Packages --------------------- -Earlier we installed many configurations each of zlib and Tcl. Now we +Earlier we installed many configurations each of gmake and Tcl. Now we will go through and uninstall some of those packages that we didn't really need. .. literalinclude:: outputs/basics/find-d-tcl.out :language: console -.. literalinclude:: outputs/basics/find-zlib.out +.. literalinclude:: outputs/basics/find-gmake.out :language: console We can uninstall packages by spec using the same syntax as install. -.. literalinclude:: outputs/basics/uninstall-zlib.out +.. literalinclude:: outputs/basics/uninstall-gmake.out :language: console -.. literalinclude:: outputs/basics/find-lf-zlib.out +.. literalinclude:: outputs/basics/find-lf-gmake.out :language: console We can also uninstall packages by referring only to their hash. diff --git a/tutorial_environments.rst b/tutorial_environments.rst index 27d636191d..b94ef45f28 100644 --- a/tutorial_environments.rst +++ b/tutorial_environments.rst @@ -60,7 +60,7 @@ Let's look at the output of ``spack find`` at this point in the tutorial. This is a complete, but cluttered list of the installed packages and their dependencies. It contains packages built with both ``openmpi`` and ``mpich``, as well as multiple variants of other packages, like -``hdf5`` and ``zlib``. The query mechanism we learned about with +``hdf5`` and ``zlib-ng``. The query mechanism we learned about with ``spack find`` can help, but it would be nice if we could start from a clean slate without losing what we've already installed. @@ -519,7 +519,7 @@ and the version of ``zlib`` used to build the program is printed. We can confirm the version of ``zlib`` used to build the program is in our environment using ``spack find``: -.. literalinclude:: outputs/environments/myproject-zlib-1.out +.. literalinclude:: outputs/environments/myproject-zlib-ng-1.out :language: console Note that the reported version *does* match that of our installation.