Tutorial setup

If you have not done the prior sections, you’ll need to start the docker image:

docker run -it ghcr.io/spack/tutorial:isc23

and then set Spack up like this:

git clone --depth=100 --branch=releases/v0.20 https://github.com/spack/spack
. spack/share/spack/setup-env.sh
spack tutorial -y
spack bootstrap now
spack compiler find

See the Basic Installation Tutorial for full details on setup. For more help, join us in the #tutorial channel on Slack – get an invitation at slack.spack.io

Scripting with Spack

This tutorial introduces advanced Spack features related to scripting. Specifically, we will show you how to write scripts using spack find and spack python. Earlier sections of the tutorial demonstrated using spack find to list and search installed packages. The spack python command gives you access to all of Spack’s internal APIs, allowing you to write more complex queries, for example.

Since Spack has an extensive API, we’ll only scratch the surface here. We’ll give you enough information to start writing your own scripts and to find what you need, with a little digging.

Setting up the tutorial

Before proceeding, let’s ensure the outputs for this segment are reasonable. Since you may have a lot of packages installed from earlier sections of the tutorial, we want to perform a little cleanup.

Let’s remove gcc@8.3.0 and re-install hdf5 and zlib@clang using the following commands:

$ spack uninstall -ay
==> Successfully uninstalled gcc@12.1.0%gcc@11.3.0~binutils+bootstrap~graphite~nvptx~piclibs~profiled~strip build_system=autotools build_type=RelWithDebInfo languages=c,c++,fortran patches=cc6112d arch=linux-ubuntu22.04-x86_64_v3/s5e5zwr
==> Successfully uninstalled gmake@4.4.1%gcc@11.3.0~guile build_system=autotools arch=linux-ubuntu22.04-x86_64_v3/guaj3kb
==> Successfully uninstalled gawk@5.2.1%gcc@11.3.0~nls build_system=autotools arch=linux-ubuntu22.04-x86_64_v3/6lk2khk
==> Successfully uninstalled mpc@1.3.1%gcc@11.3.0 build_system=autotools libs=shared,static arch=linux-ubuntu22.04-x86_64_v3/3qvnliw
==> Successfully uninstalled mpfr@4.2.0%gcc@11.3.0 build_system=autotools libs=shared,static arch=linux-ubuntu22.04-x86_64_v3/aiys7vc
==> Successfully uninstalled texinfo@7.0.3%gcc@11.3.0 build_system=autotools arch=linux-ubuntu22.04-x86_64_v3/tcpqkls
==> Successfully uninstalled gettext@0.21.1%gcc@11.3.0+bzip2+curses+git~libunistring+libxml2+tar+xz build_system=autotools arch=linux-ubuntu22.04-x86_64_v3/p4obvgx
==> Successfully uninstalled tar@1.34%gcc@11.3.0 build_system=autotools zip=pigz arch=linux-ubuntu22.04-x86_64_v3/e77cf6a
==> Successfully uninstalled pigz@2.7%gcc@11.3.0 build_system=makefile arch=linux-ubuntu22.04-x86_64_v3/aln73eo
==> Successfully uninstalled libxml2@2.10.3%gcc@11.3.0~python build_system=autotools arch=linux-ubuntu22.04-x86_64_v3/pcbenki
==> Successfully uninstalled xz@5.4.1%gcc@11.3.0~pic build_system=autotools libs=shared,static arch=linux-ubuntu22.04-x86_64_v3/4kpkw5a
==> Successfully uninstalled autoconf-archive@2023.02.20%gcc@11.3.0 build_system=autotools arch=linux-ubuntu22.04-x86_64_v3/5wwl7c6
==> Successfully uninstalled gmp@6.2.1%gcc@11.3.0+cxx build_system=autotools libs=shared,static patches=69ad2e2 arch=linux-ubuntu22.04-x86_64_v3/7kxi3rr
==> Successfully uninstalled libtool@2.4.7%gcc@11.3.0 build_system=autotools arch=linux-ubuntu22.04-x86_64_v3/qkvj7am
==> Successfully uninstalled automake@1.16.5%gcc@11.3.0 build_system=autotools arch=linux-ubuntu22.04-x86_64_v3/oa3w4kf
==> Successfully uninstalled autoconf@2.69%gcc@11.3.0 build_system=autotools patches=35c4492,7793209,a49dd5b arch=linux-ubuntu22.04-x86_64_v3/t4nuen3
==> Successfully uninstalled perl@5.36.0%gcc@11.3.0+cpanm+open+shared+threads build_system=generic arch=linux-ubuntu22.04-x86_64_v3/j5tavds
==> Successfully uninstalled zlib@1.2.13%gcc@11.3.0+optimize+pic+shared build_system=makefile arch=linux-ubuntu22.04-x86_64_v3/mntflxr
==> Successfully uninstalled gdbm@1.23%gcc@11.3.0 build_system=autotools arch=linux-ubuntu22.04-x86_64_v3/ba4juc3
==> Successfully uninstalled readline@8.2%gcc@11.3.0 build_system=autotools patches=bbf97f1 arch=linux-ubuntu22.04-x86_64_v3/tddm2ff
==> Successfully uninstalled ncurses@6.4%gcc@11.3.0~symlinks+termlib abi=none build_system=autotools arch=linux-ubuntu22.04-x86_64_v3/4dokmxj
==> Successfully uninstalled pkgconf@1.9.5%gcc@11.3.0 build_system=autotools arch=linux-ubuntu22.04-x86_64_v3/mh73nkp
==> Successfully uninstalled berkeley-db@18.1.40%gcc@11.3.0+cxx~docs+stl build_system=autotools patches=26090f4,b231fcc arch=linux-ubuntu22.04-x86_64_v3/7sohpaz
==> Successfully uninstalled m4@1.4.19%gcc@11.3.0+sigsegv build_system=autotools patches=9dc5fbd,bfdffa7 arch=linux-ubuntu22.04-x86_64_v3/llbjfk2
==> Successfully uninstalled libsigsegv@2.14%gcc@11.3.0 build_system=autotools arch=linux-ubuntu22.04-x86_64_v3/okig24f
==> Successfully uninstalled zstd@1.5.5%gcc@11.3.0+programs build_system=makefile compression=none libs=shared,static arch=linux-ubuntu22.04-x86_64_v3/qoo4rlo
==> Successfully uninstalled bzip2@1.0.8%gcc@11.3.0~debug~pic+shared build_system=generic arch=linux-ubuntu22.04-x86_64_v3/dca2qyg
==> Successfully uninstalled diffutils@3.9%gcc@11.3.0 build_system=autotools arch=linux-ubuntu22.04-x86_64_v3/zdl3dic
==> Successfully uninstalled libiconv@1.17%gcc@11.3.0 build_system=autotools libs=shared,static arch=linux-ubuntu22.04-x86_64_v3/7wr75ce
$ spack compiler rm gcc@12.1.0
==> Removed compiler gcc@12.1.0
$ spack install hdf5
==> Installing pkgconf-1.9.5-mh73nkpzo36xqeaagdrh3qppvmn6zdn6
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-pkgconf-1.9.5-mh73nkpzo36xqeaagdrh3qppvmn6zdn6.spec.json.sig
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/pkgconf-1.9.5/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-pkgconf-1.9.5-mh73nkpzo36xqeaagdrh3qppvmn6zdn6.spack
==> Extracting pkgconf-1.9.5-mh73nkpzo36xqeaagdrh3qppvmn6zdn6 from binary cache
==> pkgconf: Successfully installed pkgconf-1.9.5-mh73nkpzo36xqeaagdrh3qppvmn6zdn6
  Search: 0.00s.  Fetch: 0.11s.  Install: 0.04s.  Total: 0.15s
[+] /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/pkgconf-1.9.5-mh73nkpzo36xqeaagdrh3qppvmn6zdn6
==> Installing ca-certificates-mozilla-2023-01-10-5pxkrf4bc5g6uuwm4apyvbm3mhmokm44
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-ca-certificates-mozilla-2023-01-10-5pxkrf4bc5g6uuwm4apyvbm3mhmokm44.spec.json.sig
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/ca-certificates-mozilla-2023-01-10/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-ca-certificates-mozilla-2023-01-10-5pxkrf4bc5g6uuwm4apyvbm3mhmokm44.spack
==> Extracting ca-certificates-mozilla-2023-01-10-5pxkrf4bc5g6uuwm4apyvbm3mhmokm44 from binary cache
==> ca-certificates-mozilla: Successfully installed ca-certificates-mozilla-2023-01-10-5pxkrf4bc5g6uuwm4apyvbm3mhmokm44
  Search: 0.00s.  Fetch: 0.01s.  Install: 0.02s.  Total: 0.03s
[+] /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/ca-certificates-mozilla-2023-01-10-5pxkrf4bc5g6uuwm4apyvbm3mhmokm44
==> Installing berkeley-db-18.1.40-7sohpazzvalaxarn3pxs4du7qrcde7vf
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-berkeley-db-18.1.40-7sohpazzvalaxarn3pxs4du7qrcde7vf.spec.json.sig
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/berkeley-db-18.1.40/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-berkeley-db-18.1.40-7sohpazzvalaxarn3pxs4du7qrcde7vf.spack
==> Extracting berkeley-db-18.1.40-7sohpazzvalaxarn3pxs4du7qrcde7vf from binary cache
==> berkeley-db: Successfully installed berkeley-db-18.1.40-7sohpazzvalaxarn3pxs4du7qrcde7vf
  Search: 0.00s.  Fetch: 0.01s.  Install: 0.10s.  Total: 0.11s
[+] /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/berkeley-db-18.1.40-7sohpazzvalaxarn3pxs4du7qrcde7vf
==> Installing libiconv-1.17-7wr75cescbtfyjppbbvswfpurs3gtxyf
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-libiconv-1.17-7wr75cescbtfyjppbbvswfpurs3gtxyf.spec.json.sig
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/libiconv-1.17/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-libiconv-1.17-7wr75cescbtfyjppbbvswfpurs3gtxyf.spack
==> Extracting libiconv-1.17-7wr75cescbtfyjppbbvswfpurs3gtxyf from binary cache
==> libiconv: Successfully installed libiconv-1.17-7wr75cescbtfyjppbbvswfpurs3gtxyf
  Search: 0.00s.  Fetch: 0.01s.  Install: 0.07s.  Total: 0.08s
[+] /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/libiconv-1.17-7wr75cescbtfyjppbbvswfpurs3gtxyf
==> Installing zlib-1.2.13-mntflxrgekkm5lbpbl5r66lh2ieted4y
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-zlib-1.2.13-mntflxrgekkm5lbpbl5r66lh2ieted4y.spec.json.sig
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/zlib-1.2.13/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-zlib-1.2.13-mntflxrgekkm5lbpbl5r66lh2ieted4y.spack
==> Extracting zlib-1.2.13-mntflxrgekkm5lbpbl5r66lh2ieted4y from binary cache
==> zlib: Successfully installed zlib-1.2.13-mntflxrgekkm5lbpbl5r66lh2ieted4y
  Search: 0.00s.  Fetch: 0.01s.  Install: 0.02s.  Total: 0.03s
[+] /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/zlib-1.2.13-mntflxrgekkm5lbpbl5r66lh2ieted4y
==> Installing gmake-4.4.1-guaj3kbmbrdgqupr5u3zd42ga3kong7l
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-gmake-4.4.1-guaj3kbmbrdgqupr5u3zd42ga3kong7l.spec.json.sig
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/gmake-4.4.1/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-gmake-4.4.1-guaj3kbmbrdgqupr5u3zd42ga3kong7l.spack
==> Extracting gmake-4.4.1-guaj3kbmbrdgqupr5u3zd42ga3kong7l from binary cache
==> gmake: Successfully installed gmake-4.4.1-guaj3kbmbrdgqupr5u3zd42ga3kong7l
  Search: 0.00s.  Fetch: 0.01s.  Install: 0.03s.  Total: 0.03s
[+] /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/gmake-4.4.1-guaj3kbmbrdgqupr5u3zd42ga3kong7l
==> Installing libsigsegv-2.14-okig24f4hxju4we3kmbfzfwu3egktfhh
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-libsigsegv-2.14-okig24f4hxju4we3kmbfzfwu3egktfhh.spec.json.sig
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/libsigsegv-2.14/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-libsigsegv-2.14-okig24f4hxju4we3kmbfzfwu3egktfhh.spack
==> Extracting libsigsegv-2.14-okig24f4hxju4we3kmbfzfwu3egktfhh from binary cache
==> libsigsegv: Successfully installed libsigsegv-2.14-okig24f4hxju4we3kmbfzfwu3egktfhh
  Search: 0.00s.  Fetch: 0.01s.  Install: 0.02s.  Total: 0.03s
[+] /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/libsigsegv-2.14-okig24f4hxju4we3kmbfzfwu3egktfhh
==> Installing util-macros-1.19.3-pmmxgx45h2jphgpmscd5d2ohyjcppotq
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-util-macros-1.19.3-pmmxgx45h2jphgpmscd5d2ohyjcppotq.spec.json.sig
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/util-macros-1.19.3/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-util-macros-1.19.3-pmmxgx45h2jphgpmscd5d2ohyjcppotq.spack
==> Extracting util-macros-1.19.3-pmmxgx45h2jphgpmscd5d2ohyjcppotq from binary cache
==> util-macros: Successfully installed util-macros-1.19.3-pmmxgx45h2jphgpmscd5d2ohyjcppotq
  Search: 0.00s.  Fetch: 0.01s.  Install: 0.01s.  Total: 0.03s
[+] /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/util-macros-1.19.3-pmmxgx45h2jphgpmscd5d2ohyjcppotq
==> Installing xz-5.4.1-4kpkw5anjs35mccxgsw24ooonnpk7pkx
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-xz-5.4.1-4kpkw5anjs35mccxgsw24ooonnpk7pkx.spec.json.sig
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/xz-5.4.1/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-xz-5.4.1-4kpkw5anjs35mccxgsw24ooonnpk7pkx.spack
==> Extracting xz-5.4.1-4kpkw5anjs35mccxgsw24ooonnpk7pkx from binary cache
==> xz: Successfully installed xz-5.4.1-4kpkw5anjs35mccxgsw24ooonnpk7pkx
  Search: 0.00s.  Fetch: 0.01s.  Install: 0.09s.  Total: 0.10s
[+] /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/xz-5.4.1-4kpkw5anjs35mccxgsw24ooonnpk7pkx
==> Installing zstd-1.5.5-qoo4rlopj4vqbc6k633cu3tzawtfjjvh
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-zstd-1.5.5-qoo4rlopj4vqbc6k633cu3tzawtfjjvh.spec.json.sig
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/zstd-1.5.5/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-zstd-1.5.5-qoo4rlopj4vqbc6k633cu3tzawtfjjvh.spack
==> Extracting zstd-1.5.5-qoo4rlopj4vqbc6k633cu3tzawtfjjvh from binary cache
==> zstd: Successfully installed zstd-1.5.5-qoo4rlopj4vqbc6k633cu3tzawtfjjvh
  Search: 0.00s.  Fetch: 0.01s.  Install: 0.05s.  Total: 0.06s
[+] /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/zstd-1.5.5-qoo4rlopj4vqbc6k633cu3tzawtfjjvh
==> Installing ncurses-6.4-4dokmxjlgawyprrnkewx3aiwppdbwbts
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-ncurses-6.4-4dokmxjlgawyprrnkewx3aiwppdbwbts.spec.json.sig
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/ncurses-6.4/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-ncurses-6.4-4dokmxjlgawyprrnkewx3aiwppdbwbts.spack
==> Extracting ncurses-6.4-4dokmxjlgawyprrnkewx3aiwppdbwbts from binary cache
==> ncurses: Successfully installed ncurses-6.4-4dokmxjlgawyprrnkewx3aiwppdbwbts
  Search: 0.00s.  Fetch: 0.01s.  Install: 0.50s.  Total: 0.51s
[+] /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/ncurses-6.4-4dokmxjlgawyprrnkewx3aiwppdbwbts
==> Installing diffutils-3.9-zdl3dicv5j27w25e54v52bww5n3h4c74
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-diffutils-3.9-zdl3dicv5j27w25e54v52bww5n3h4c74.spec.json.sig
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/diffutils-3.9/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-diffutils-3.9-zdl3dicv5j27w25e54v52bww5n3h4c74.spack
==> Extracting diffutils-3.9-zdl3dicv5j27w25e54v52bww5n3h4c74 from binary cache
==> diffutils: Successfully installed diffutils-3.9-zdl3dicv5j27w25e54v52bww5n3h4c74
  Search: 0.00s.  Fetch: 0.01s.  Install: 0.06s.  Total: 0.07s
[+] /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/diffutils-3.9-zdl3dicv5j27w25e54v52bww5n3h4c74
==> Installing pigz-2.7-aln73eomrjghrlg6q2ida2rr4ylvg2cp
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-pigz-2.7-aln73eomrjghrlg6q2ida2rr4ylvg2cp.spec.json.sig
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/pigz-2.7/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-pigz-2.7-aln73eomrjghrlg6q2ida2rr4ylvg2cp.spack
==> Extracting pigz-2.7-aln73eomrjghrlg6q2ida2rr4ylvg2cp from binary cache
==> pigz: Successfully installed pigz-2.7-aln73eomrjghrlg6q2ida2rr4ylvg2cp
  Search: 0.00s.  Fetch: 0.01s.  Install: 0.02s.  Total: 0.03s
[+] /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/pigz-2.7-aln73eomrjghrlg6q2ida2rr4ylvg2cp
==> Installing libxml2-2.10.3-pcbenkircucqrjzgyud6xzgxfptjz6x6
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-libxml2-2.10.3-pcbenkircucqrjzgyud6xzgxfptjz6x6.spec.json.sig
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/libxml2-2.10.3/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-libxml2-2.10.3-pcbenkircucqrjzgyud6xzgxfptjz6x6.spack
==> Extracting libxml2-2.10.3-pcbenkircucqrjzgyud6xzgxfptjz6x6 from binary cache
==> libxml2: Successfully installed libxml2-2.10.3-pcbenkircucqrjzgyud6xzgxfptjz6x6
  Search: 0.00s.  Fetch: 0.01s.  Install: 0.11s.  Total: 0.13s
[+] /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/libxml2-2.10.3-pcbenkircucqrjzgyud6xzgxfptjz6x6
==> Installing readline-8.2-tddm2ffpgbcwobqdzn57di2n7oeqxryv
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-readline-8.2-tddm2ffpgbcwobqdzn57di2n7oeqxryv.spec.json.sig
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/readline-8.2/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-readline-8.2-tddm2ffpgbcwobqdzn57di2n7oeqxryv.spack
==> Extracting readline-8.2-tddm2ffpgbcwobqdzn57di2n7oeqxryv from binary cache
==> readline: Successfully installed readline-8.2-tddm2ffpgbcwobqdzn57di2n7oeqxryv
  Search: 0.00s.  Fetch: 0.01s.  Install: 0.06s.  Total: 0.07s
[+] /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/readline-8.2-tddm2ffpgbcwobqdzn57di2n7oeqxryv
==> Installing libedit-3.1-20210216-3gz2afaph66ogjiulkaek2mksnpxhtwu
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-libedit-3.1-20210216-3gz2afaph66ogjiulkaek2mksnpxhtwu.spec.json.sig
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/libedit-3.1-20210216/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-libedit-3.1-20210216-3gz2afaph66ogjiulkaek2mksnpxhtwu.spack
==> Extracting libedit-3.1-20210216-3gz2afaph66ogjiulkaek2mksnpxhtwu from binary cache
==> libedit: Successfully installed libedit-3.1-20210216-3gz2afaph66ogjiulkaek2mksnpxhtwu
  Search: 0.00s.  Fetch: 0.01s.  Install: 0.05s.  Total: 0.06s
[+] /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/libedit-3.1-20210216-3gz2afaph66ogjiulkaek2mksnpxhtwu
==> Installing bzip2-1.0.8-dca2qygvz7nc6q6ci2ikw7ltc2v4pryo
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-bzip2-1.0.8-dca2qygvz7nc6q6ci2ikw7ltc2v4pryo.spec.json.sig
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/bzip2-1.0.8/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-bzip2-1.0.8-dca2qygvz7nc6q6ci2ikw7ltc2v4pryo.spack
==> Extracting bzip2-1.0.8-dca2qygvz7nc6q6ci2ikw7ltc2v4pryo from binary cache
==> bzip2: Successfully installed bzip2-1.0.8-dca2qygvz7nc6q6ci2ikw7ltc2v4pryo
  Search: 0.00s.  Fetch: 0.01s.  Install: 0.03s.  Total: 0.04s
[+] /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/bzip2-1.0.8-dca2qygvz7nc6q6ci2ikw7ltc2v4pryo
==> Installing m4-1.4.19-llbjfk2fqzzlgbnubr345ym5mg2nrcfu
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-m4-1.4.19-llbjfk2fqzzlgbnubr345ym5mg2nrcfu.spec.json.sig
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/m4-1.4.19/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-m4-1.4.19-llbjfk2fqzzlgbnubr345ym5mg2nrcfu.spack
==> Extracting m4-1.4.19-llbjfk2fqzzlgbnubr345ym5mg2nrcfu from binary cache
==> m4: Successfully installed m4-1.4.19-llbjfk2fqzzlgbnubr345ym5mg2nrcfu
  Search: 0.00s.  Fetch: 0.01s.  Install: 0.05s.  Total: 0.06s
[+] /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/m4-1.4.19-llbjfk2fqzzlgbnubr345ym5mg2nrcfu
==> Installing gdbm-1.23-ba4juc3qtagyyn5vkmuxzentr6qrtzmr
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-gdbm-1.23-ba4juc3qtagyyn5vkmuxzentr6qrtzmr.spec.json.sig
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/gdbm-1.23/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-gdbm-1.23-ba4juc3qtagyyn5vkmuxzentr6qrtzmr.spack
==> Extracting gdbm-1.23-ba4juc3qtagyyn5vkmuxzentr6qrtzmr from binary cache
==> gdbm: Successfully installed gdbm-1.23-ba4juc3qtagyyn5vkmuxzentr6qrtzmr
  Search: 0.00s.  Fetch: 0.01s.  Install: 0.06s.  Total: 0.07s
[+] /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/gdbm-1.23-ba4juc3qtagyyn5vkmuxzentr6qrtzmr
==> Installing tar-1.34-e77cf6ahyuvzxeaojxrc5meo7cbwfbxo
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-tar-1.34-e77cf6ahyuvzxeaojxrc5meo7cbwfbxo.spec.json.sig
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/tar-1.34/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-tar-1.34-e77cf6ahyuvzxeaojxrc5meo7cbwfbxo.spack
==> Extracting tar-1.34-e77cf6ahyuvzxeaojxrc5meo7cbwfbxo from binary cache
==> tar: Successfully installed tar-1.34-e77cf6ahyuvzxeaojxrc5meo7cbwfbxo
  Search: 0.00s.  Fetch: 0.01s.  Install: 0.09s.  Total: 0.10s
[+] /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/tar-1.34-e77cf6ahyuvzxeaojxrc5meo7cbwfbxo
==> Installing libtool-2.4.7-qkvj7amqg5545llggv4k4jkgslrncfdu
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-libtool-2.4.7-qkvj7amqg5545llggv4k4jkgslrncfdu.spec.json.sig
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/libtool-2.4.7/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-libtool-2.4.7-qkvj7amqg5545llggv4k4jkgslrncfdu.spack
==> Extracting libtool-2.4.7-qkvj7amqg5545llggv4k4jkgslrncfdu from binary cache
==> libtool: Successfully installed libtool-2.4.7-qkvj7amqg5545llggv4k4jkgslrncfdu
  Search: 0.00s.  Fetch: 0.01s.  Install: 0.06s.  Total: 0.07s
[+] /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/libtool-2.4.7-qkvj7amqg5545llggv4k4jkgslrncfdu
==> Installing perl-5.36.0-j5tavdsri7znb4h7q57mu67bnx54p2fb
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-perl-5.36.0-j5tavdsri7znb4h7q57mu67bnx54p2fb.spec.json.sig
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/perl-5.36.0/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-perl-5.36.0-j5tavdsri7znb4h7q57mu67bnx54p2fb.spack
==> Extracting perl-5.36.0-j5tavdsri7znb4h7q57mu67bnx54p2fb from binary cache
==> perl: Successfully installed perl-5.36.0-j5tavdsri7znb4h7q57mu67bnx54p2fb
  Search: 0.00s.  Fetch: 0.02s.  Install: 0.71s.  Total: 0.74s
[+] /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/perl-5.36.0-j5tavdsri7znb4h7q57mu67bnx54p2fb
==> Installing gettext-0.21.1-p4obvgx4436lyrtjhu3xvosfkyjpgi7o
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-gettext-0.21.1-p4obvgx4436lyrtjhu3xvosfkyjpgi7o.spec.json.sig
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/gettext-0.21.1/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-gettext-0.21.1-p4obvgx4436lyrtjhu3xvosfkyjpgi7o.spack
==> Extracting gettext-0.21.1-p4obvgx4436lyrtjhu3xvosfkyjpgi7o from binary cache
==> gettext: Successfully installed gettext-0.21.1-p4obvgx4436lyrtjhu3xvosfkyjpgi7o
  Search: 0.00s.  Fetch: 0.02s.  Install: 0.55s.  Total: 0.57s
[+] /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/gettext-0.21.1-p4obvgx4436lyrtjhu3xvosfkyjpgi7o
==> Installing libpciaccess-0.17-ajkyiz5txltunmwxkrwz3xs6ymqaafnf
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-libpciaccess-0.17-ajkyiz5txltunmwxkrwz3xs6ymqaafnf.spec.json.sig
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/libpciaccess-0.17/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-libpciaccess-0.17-ajkyiz5txltunmwxkrwz3xs6ymqaafnf.spack
==> Extracting libpciaccess-0.17-ajkyiz5txltunmwxkrwz3xs6ymqaafnf from binary cache
==> libpciaccess: Successfully installed libpciaccess-0.17-ajkyiz5txltunmwxkrwz3xs6ymqaafnf
  Search: 0.00s.  Fetch: 0.01s.  Install: 0.03s.  Total: 0.04s
[+] /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/libpciaccess-0.17-ajkyiz5txltunmwxkrwz3xs6ymqaafnf
==> Installing bison-3.8.2-iavvoedsn6sibxs2v54fd5s7636sa5gv
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-bison-3.8.2-iavvoedsn6sibxs2v54fd5s7636sa5gv.spec.json.sig
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/bison-3.8.2/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-bison-3.8.2-iavvoedsn6sibxs2v54fd5s7636sa5gv.spack
==> Extracting bison-3.8.2-iavvoedsn6sibxs2v54fd5s7636sa5gv from binary cache
==> bison: Successfully installed bison-3.8.2-iavvoedsn6sibxs2v54fd5s7636sa5gv
  Search: 0.00s.  Fetch: 0.01s.  Install: 0.11s.  Total: 0.12s
[+] /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/bison-3.8.2-iavvoedsn6sibxs2v54fd5s7636sa5gv
==> Installing autoconf-2.69-t4nuen3izojzz42zd4numq2dbswdl7uq
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-autoconf-2.69-t4nuen3izojzz42zd4numq2dbswdl7uq.spec.json.sig
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/autoconf-2.69/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-autoconf-2.69-t4nuen3izojzz42zd4numq2dbswdl7uq.spack
==> Extracting autoconf-2.69-t4nuen3izojzz42zd4numq2dbswdl7uq from binary cache
==> autoconf: Successfully installed autoconf-2.69-t4nuen3izojzz42zd4numq2dbswdl7uq
  Search: 0.00s.  Fetch: 0.01s.  Install: 0.07s.  Total: 0.08s
[+] /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/autoconf-2.69-t4nuen3izojzz42zd4numq2dbswdl7uq
==> Installing libxcrypt-4.4.33-6oeb4y7sqnhpsqtr33bvbdsl2ekblcwz
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-libxcrypt-4.4.33-6oeb4y7sqnhpsqtr33bvbdsl2ekblcwz.spec.json.sig
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/libxcrypt-4.4.33/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-libxcrypt-4.4.33-6oeb4y7sqnhpsqtr33bvbdsl2ekblcwz.spack
==> Extracting libxcrypt-4.4.33-6oeb4y7sqnhpsqtr33bvbdsl2ekblcwz from binary cache
==> libxcrypt: Successfully installed libxcrypt-4.4.33-6oeb4y7sqnhpsqtr33bvbdsl2ekblcwz
  Search: 0.00s.  Fetch: 0.01s.  Install: 0.04s.  Total: 0.05s
[+] /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/libxcrypt-4.4.33-6oeb4y7sqnhpsqtr33bvbdsl2ekblcwz
==> Installing openssl-1.1.1t-w2by2b2vepifq7xzrf527sjpw5mjluyu
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-openssl-1.1.1t-w2by2b2vepifq7xzrf527sjpw5mjluyu.spec.json.sig
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/openssl-1.1.1t/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-openssl-1.1.1t-w2by2b2vepifq7xzrf527sjpw5mjluyu.spack
==> Extracting openssl-1.1.1t-w2by2b2vepifq7xzrf527sjpw5mjluyu from binary cache
==> openssl: Successfully installed openssl-1.1.1t-w2by2b2vepifq7xzrf527sjpw5mjluyu
  Search: 0.00s.  Fetch: 0.01s.  Install: 0.14s.  Total: 0.16s
[+] /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/openssl-1.1.1t-w2by2b2vepifq7xzrf527sjpw5mjluyu
==> Installing hwloc-2.9.1-h7l4t7laxg7kqchvcy42xtyev4kxjbti
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-hwloc-2.9.1-h7l4t7laxg7kqchvcy42xtyev4kxjbti.spec.json.sig
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/hwloc-2.9.1/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-hwloc-2.9.1-h7l4t7laxg7kqchvcy42xtyev4kxjbti.spack
==> Extracting hwloc-2.9.1-h7l4t7laxg7kqchvcy42xtyev4kxjbti from binary cache
==> hwloc: Successfully installed hwloc-2.9.1-h7l4t7laxg7kqchvcy42xtyev4kxjbti
  Search: 0.00s.  Fetch: 0.02s.  Install: 0.19s.  Total: 0.21s
[+] /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/hwloc-2.9.1-h7l4t7laxg7kqchvcy42xtyev4kxjbti
==> Installing automake-1.16.5-oa3w4kfggbgkzhefkp3dtnd4oxk3gni7
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-automake-1.16.5-oa3w4kfggbgkzhefkp3dtnd4oxk3gni7.spec.json.sig
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/automake-1.16.5/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-automake-1.16.5-oa3w4kfggbgkzhefkp3dtnd4oxk3gni7.spack
==> Extracting automake-1.16.5-oa3w4kfggbgkzhefkp3dtnd4oxk3gni7 from binary cache
==> automake: Successfully installed automake-1.16.5-oa3w4kfggbgkzhefkp3dtnd4oxk3gni7
  Search: 0.00s.  Fetch: 0.01s.  Install: 0.08s.  Total: 0.09s
[+] /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/automake-1.16.5-oa3w4kfggbgkzhefkp3dtnd4oxk3gni7
==> Installing krb5-1.20.1-a2oph6kjqh6feyfmkozogvu7ghzx2dfo
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-krb5-1.20.1-a2oph6kjqh6feyfmkozogvu7ghzx2dfo.spec.json.sig
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/krb5-1.20.1/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-krb5-1.20.1-a2oph6kjqh6feyfmkozogvu7ghzx2dfo.spack
==> Extracting krb5-1.20.1-a2oph6kjqh6feyfmkozogvu7ghzx2dfo from binary cache
==> krb5: Successfully installed krb5-1.20.1-a2oph6kjqh6feyfmkozogvu7ghzx2dfo
  Search: 0.00s.  Fetch: 0.01s.  Install: 0.15s.  Total: 0.16s
[+] /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/krb5-1.20.1-a2oph6kjqh6feyfmkozogvu7ghzx2dfo
==> Installing cmake-3.26.3-ofsadgmnqqs6fuj3wyl6bnk7obprvonx
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-cmake-3.26.3-ofsadgmnqqs6fuj3wyl6bnk7obprvonx.spec.json.sig
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/cmake-3.26.3/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-cmake-3.26.3-ofsadgmnqqs6fuj3wyl6bnk7obprvonx.spack
==> Extracting cmake-3.26.3-ofsadgmnqqs6fuj3wyl6bnk7obprvonx from binary cache
==> cmake: Successfully installed cmake-3.26.3-ofsadgmnqqs6fuj3wyl6bnk7obprvonx
  Search: 0.00s.  Fetch: 0.04s.  Install: 1.10s.  Total: 1.14s
[+] /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/cmake-3.26.3-ofsadgmnqqs6fuj3wyl6bnk7obprvonx
==> Installing libevent-2.1.12-pmjxzdssnbkv25jedy5shyhzsnj26ins
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-libevent-2.1.12-pmjxzdssnbkv25jedy5shyhzsnj26ins.spec.json.sig
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/libevent-2.1.12/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-libevent-2.1.12-pmjxzdssnbkv25jedy5shyhzsnj26ins.spack
==> Extracting libevent-2.1.12-pmjxzdssnbkv25jedy5shyhzsnj26ins from binary cache
==> libevent: Successfully installed libevent-2.1.12-pmjxzdssnbkv25jedy5shyhzsnj26ins
  Search: 0.00s.  Fetch: 0.01s.  Install: 0.10s.  Total: 0.11s
[+] /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/libevent-2.1.12-pmjxzdssnbkv25jedy5shyhzsnj26ins
==> Installing numactl-2.0.14-dwr5rmxxc4lav5ob4ylar5tu3rugjwkv
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-numactl-2.0.14-dwr5rmxxc4lav5ob4ylar5tu3rugjwkv.spec.json.sig
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/numactl-2.0.14/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-numactl-2.0.14-dwr5rmxxc4lav5ob4ylar5tu3rugjwkv.spack
==> Extracting numactl-2.0.14-dwr5rmxxc4lav5ob4ylar5tu3rugjwkv from binary cache
==> numactl: Successfully installed numactl-2.0.14-dwr5rmxxc4lav5ob4ylar5tu3rugjwkv
  Search: 0.00s.  Fetch: 0.01s.  Install: 0.04s.  Total: 0.05s
[+] /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/numactl-2.0.14-dwr5rmxxc4lav5ob4ylar5tu3rugjwkv
==> Installing openssh-9.3p1-zhdviyjva24bkvbxlqnswcecrp5gjvv5
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-openssh-9.3p1-zhdviyjva24bkvbxlqnswcecrp5gjvv5.spec.json.sig
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/openssh-9.3p1/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-openssh-9.3p1-zhdviyjva24bkvbxlqnswcecrp5gjvv5.spack
==> Extracting openssh-9.3p1-zhdviyjva24bkvbxlqnswcecrp5gjvv5 from binary cache
==> openssh: Successfully installed openssh-9.3p1-zhdviyjva24bkvbxlqnswcecrp5gjvv5
  Search: 0.00s.  Fetch: 0.01s.  Install: 0.13s.  Total: 0.15s
[+] /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/openssh-9.3p1-zhdviyjva24bkvbxlqnswcecrp5gjvv5
==> Installing pmix-4.2.3-uh4fmi5i7bajcqtiuae7qaii7yha7lnp
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-pmix-4.2.3-uh4fmi5i7bajcqtiuae7qaii7yha7lnp.spec.json.sig
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/pmix-4.2.3/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-pmix-4.2.3-uh4fmi5i7bajcqtiuae7qaii7yha7lnp.spack
==> Extracting pmix-4.2.3-uh4fmi5i7bajcqtiuae7qaii7yha7lnp from binary cache
==> pmix: Successfully installed pmix-4.2.3-uh4fmi5i7bajcqtiuae7qaii7yha7lnp
  Search: 0.00s.  Fetch: 0.02s.  Install: 0.19s.  Total: 0.21s
[+] /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/pmix-4.2.3-uh4fmi5i7bajcqtiuae7qaii7yha7lnp
==> Installing openmpi-4.1.5-6rh6midoapu7noq62iqyhph3zdcr4pzl
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-openmpi-4.1.5-6rh6midoapu7noq62iqyhph3zdcr4pzl.spec.json.sig
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/openmpi-4.1.5/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-openmpi-4.1.5-6rh6midoapu7noq62iqyhph3zdcr4pzl.spack
==> Extracting openmpi-4.1.5-6rh6midoapu7noq62iqyhph3zdcr4pzl from binary cache
==> openmpi: Successfully installed openmpi-4.1.5-6rh6midoapu7noq62iqyhph3zdcr4pzl
  Search: 0.00s.  Fetch: 0.02s.  Install: 0.38s.  Total: 0.40s
[+] /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/openmpi-4.1.5-6rh6midoapu7noq62iqyhph3zdcr4pzl
==> Installing hdf5-1.14.1-2-kzpm5bq6mw2th7i6jvfedanrdfe42bwv
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-hdf5-1.14.1-2-kzpm5bq6mw2th7i6jvfedanrdfe42bwv.spec.json.sig
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/hdf5-1.14.1-2/linux-ubuntu22.04-x86_64_v3-gcc-11.3.0-hdf5-1.14.1-2-kzpm5bq6mw2th7i6jvfedanrdfe42bwv.spack
==> Extracting hdf5-1.14.1-2-kzpm5bq6mw2th7i6jvfedanrdfe42bwv from binary cache
==> hdf5: Successfully installed hdf5-1.14.1-2-kzpm5bq6mw2th7i6jvfedanrdfe42bwv
  Search: 0.00s.  Fetch: 0.07s.  Install: 0.92s.  Total: 1.00s
[+] /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.3.0/hdf5-1.14.1-2-kzpm5bq6mw2th7i6jvfedanrdfe42bwv
$ spack install zlib%clang
==> Installing zlib-1.2.13-gephbceg3rl2e77o46xyzlk5e4kd3gt3
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3-clang-14.0.0-zlib-1.2.13-gephbceg3rl2e77o46xyzlk5e4kd3gt3.spec.json.sig
==> Fetching file:///mirror/build_cache/linux-ubuntu22.04-x86_64_v3/clang-14.0.0/zlib-1.2.13/linux-ubuntu22.04-x86_64_v3-clang-14.0.0-zlib-1.2.13-gephbceg3rl2e77o46xyzlk5e4kd3gt3.spack
==> Extracting zlib-1.2.13-gephbceg3rl2e77o46xyzlk5e4kd3gt3 from binary cache
==> zlib: Successfully installed zlib-1.2.13-gephbceg3rl2e77o46xyzlk5e4kd3gt3
  Search: 0.00s.  Fetch: 0.11s.  Install: 0.03s.  Total: 0.14s
[+] /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/clang-14.0.0/zlib-1.2.13-gephbceg3rl2e77o46xyzlk5e4kd3gt3

Now we are ready to use the Spack’s find and python subcommands to query the installed packages.

Scripting with spack find

So far, the output we’ve seen from spack find has been for human consumption. But you can take advantage of some advanced options of the command to generate machine-readable output suitable for piping to a script.

spack find --format

The main job of spack find is to show the user a bunch of concrete specs that correspond to installed packages. By default, we display them with some default attributes, like the @version suffix you’re used to seeing in the output.

The --format argument allows you to display the specs however you choose, using custom format strings. Format strings let you specify the names of particular parts of the specs you want displayed. Let’s see the first option in action.

Suppose you only want to display the name, version, and first ten (10) characters of the hash for every package installed in your Spack instance. You can generate that output with the following command:

$ spack find --format "{name} {version} {hash:10}"
autoconf 2.69 t4nuen3izo		       cmake 3.26.3 ofsadgmnqq	  hwloc 2.9.1 h7l4t7laxg	   libsigsegv 2.14 okig24f4hx	numactl 2.0.14 dwr5rmxxc4  pkgconf 1.9.5 mh73nkpzo3	  zlib 1.2.13 gephbceg3r
automake 1.16.5 oa3w4kfggb		       diffutils 3.9 zdl3dicv5j   krb5 1.20.1 a2oph6kjqh	   libtool 2.4.7 qkvj7amqg5	openmpi 4.1.5 6rh6midoap   pmix 4.2.3 uh4fmi5i7b	  zlib 1.2.13 mntflxrgek
berkeley-db 18.1.40 7sohpazzva		       gdbm 1.23 ba4juc3qta	  libedit 3.1-20210216 3gz2afaph6  libxcrypt 4.4.33 6oeb4y7sqn	openssh 9.3p1 zhdviyjva2   readline 8.2 tddm2ffpgb	  zstd 1.5.5 qoo4rlopj4
bison 3.8.2 iavvoedsn6			       gettext 0.21.1 p4obvgx443  libevent 2.1.12 pmjxzdssnb	   libxml2 2.10.3 pcbenkircu	openssl 1.1.1t w2by2b2vep  tar 1.34 e77cf6ahyu
bzip2 1.0.8 dca2qygvz7			       gmake 4.4.1 guaj3kbmbr	  libiconv 1.17 7wr75cescb	   m4 1.4.19 llbjfk2fqz 	perl 5.36.0 j5tavdsri7	   util-macros 1.19.3 pmmxgx45h2
ca-certificates-mozilla 2023-01-10 5pxkrf4bc5  hdf5 1.14.1-2 kzpm5bq6mw   libpciaccess 0.17 ajkyiz5txl	   ncurses 6.4 4dokmxjlga	pigz 2.7 aln73eomrj	   xz 5.4.1 4kpkw5anjs

Note that name, version, and hash are attributes of Spack’s internal Spec object and enclosing them in braces ensures they are output according to your format string.

Using spack find --format allows you to retrieve just the information you need to do things like pipe the output to typical UNIX command-line tools like sort or uniq.

spack find --json

Alternatively, you can get a serialized version of Spec objects in the JSON format using the --json option. For example, you can get attributes for all installations of zlib by entering:

$ spack find --json zlib
[
  {
    "name": "zlib",
    "version": "1.2.13",
    "arch": {
      "platform": "linux",
      "platform_os": "ubuntu22.04",
      "target": "x86_64_v3"
    },
    "compiler": {
      "name": "clang",
      "version": "14.0.0"
    },
    "namespace": "builtin",
    "parameters": {
      "build_system": "makefile",
      "optimize": true,
      "pic": true,
      "shared": true,
      "cflags": [],
      "cppflags": [],
      "cxxflags": [],
      "fflags": [],
      "ldflags": [],
      "ldlibs": []
    },
    "package_hash": "y6ahhnjjjsfh5dx2y7sci7fhthq5aolyl5dgwif57qqbtjxwdwbq====",
    "hash": "gephbceg3rl2e77o46xyzlk5e4kd3gt3"
  },
  {
    "name": "zlib",
    "version": "1.2.13",
    "arch": {
      "platform": "linux",
      "platform_os": "ubuntu22.04",
      "target": "x86_64_v3"
    },
    "compiler": {
      "name": "gcc",
      "version": "11.3.0"
    },
    "namespace": "builtin",
    "parameters": {
      "build_system": "makefile",
      "optimize": true,
      "pic": true,
      "shared": true,
      "cflags": [],
      "cppflags": [],
      "cxxflags": [],
      "fflags": [],
      "ldflags": [],
      "ldlibs": []
    },
    "package_hash": "y6ahhnjjjsfh5dx2y7sci7fhthq5aolyl5dgwif57qqbtjxwdwbq====",
    "hash": "mntflxrgekkm5lbpbl5r66lh2ieted4y"
  }

The spack find --json command gives you everything we know about the specs in a structured format. You can pipe its output to JSON filtering tools like jq to extract just the parts you want.

Check out the basic usage docs for more examples.

Introducing the spack python command

What if we need to perform more advanced queries?

Spack provides the spack python command to launch a python interpreter with Spack’s python modules available to import. It uses the underlying python for the rest of its commands. So you can write scripts to:

  • run Spack commands;
  • explore abstract and concretized specs; and
  • directly access other internal components of Spack.

Let’s launch a Spack-aware python interpreter by entering:

$ spack python
exit()
Spack version 0.20.0
Python 3.11.2, Linux x86_64
>>> exit()

Since we are in a python interpreter, use exit() to end the session and return to the terminal.

Accessing the Spec object

Now let’s take a look at the internal representation of the Spack Spec. As you already know, specs can be either abstract or concrete. The specs you’ve seen in package.py files (e.g., in the install() method) have been concrete, or fully specified. The specs you’ve typed on the command line have been abstract. Understanding the differences between the two types is key to using Spack’s internal API.

Let’s open another python interpreter with spack python, instantiate the zlib spec, and check a few properties of an abstract spec:

  >>> from spack.spec import Spec
  >>> s = Spec('zlib target=ivybridge')
  >>> s.concrete
  False
  >>> s.version
  Traceback (most recent call last):
    File "<console>", line 1, in <module>
    File "/home/spack/spack/lib/spack/spack/spec.py", line 3166, in version
      raise SpecError("Spec version is not concrete: " + str(self))
  SpecError: Spec version is not concrete: zlib arch=linux-None-ivybridge
  >>> s.versions
  [:]
  >>> str(s.architecture)
  linux-None-ivybridge

Notice that there are Spec properties and methods that are not accessible to abstract specs; specifically:

  • an exception – SpecError – is raised if we try to access its version;
  • there are no associated versions; and
  • the spec’s operating system is None.

Now, without exiting the interpreter, let’s concretize the spec and try again:

  >>> s.concretize()
  >>> s.concrete
  True
  >>> s.version
  Version('1.2.11')
  >>> s.versions
  [Version('1.2.11')]
  >>> str(s.architecture)
  linux-ubuntu18.04-ivybridge

Notice that the concretized spec now:

  • has a version;
  • has a single entry in its versions list; and
  • the operating system is now ubuntu18.04.

It is not necessary to store the intermediate abstract spec – you can use the .concretized() method as shorthand:

  >>> t = Spec('zlib target=ivybridge').concretized()
  >>> s == t
  True

Querying the Spack database

Even more powerful queries are available when we look at the information stored in the Spack database. The Database object in Spack is in the spack.store.db variable. We’ll interact with it mainly through the query() method. Let’s see the documentation available for query() using python’s built-in help() function:

  >>> import spack.store
  >>> help(spack.store.db.query)
  Help on method query in module spack.database:

  query(*args, **kwargs) method of spack.database.Database instance
      Query the Spack database including all upstream databases.

      Args:
          query_spec: queries iterate through specs in the database and
              return those that satisfy the supplied ``query_spec``. If
              query_spec is `any`, This will match all specs in the
              database.  If it is a spec, we'll evaluate
              ``spec.satisfies(query_spec)``

          known (bool or any, optional): Specs that are "known" are those
              for which Spack can locate a ``package.py`` file -- i.e.,
              Spack "knows" how to install them.  Specs that are unknown may
              represent packages that existed in a previous version of
              Spack, but have since either changed their name or
              been removed

          installed (bool or any, or InstallStatus or iterable of
              InstallStatus, optional): if ``True``, includes only installed
              specs in the search; if ``False`` only missing specs, and if
              ``any``, all specs in database. If an InstallStatus or iterable
              of InstallStatus, returns specs whose install status
              (installed, deprecated, or missing) matches (one of) the
              InstallStatus. (default: True)

          explicit (bool or any, optional): A spec that was installed
              following a specific user request is marked as explicit. If
              instead it was pulled-in as a dependency of a user requested
              spec it's considered implicit.

          start_date (datetime, optional): filters the query discarding
              specs that have been installed before ``start_date``.

          end_date (datetime, optional): filters the query discarding
              specs that have been installed after ``end_date``.

          hashes (container): list or set of hashes that we can use to
              restrict the search

      Returns:
          list of specs that match the query
  (END)

We will primarily make use of the query_spec argument.

Recall that queries using the spack find command are limited to queries of attributes with matching values, not values they do not have. In other words, we cannot use the spack find command for all packages that do not satisfy a certain criterion.

We can use the python interface to write these types of queries. For example, let’s find all packages that were compiled with gcc but do not depend on mpich. We can do this by using custom python code and Spack database queries. We will use the spack.cmd.display_specs for output to achieve the same printing functionality as the spack find command:

  >>> gcc_query_spec = Spec('%gcc')
  >>> gcc_specs = spack.store.db.query(gcc_query_spec)
  >>> result = filter(lambda spec: not spec.satisfies('^mpich'), gcc_specs)
  >>> import spack.cmd
  >>> spack.cmd.display_specs(result)
  -- linux-ubuntu18.04-x86_64 / gcc@7.5.0 -------------------------
  autoconf@2.69    libiconv@1.16        m4@1.4.18       perl@5.30.3         zlib@1.2.11
  automake@1.16.2  libpciaccess@0.13.5  ncurses@6.2     pkgconf@1.7.3
  gdbm@1.18.1      libsigsegv@2.12      numactl@2.0.12  readline@8.0
  hdf5@1.10.6      libtool@2.4.6        openmpi@3.1.6   util-macros@1.19.1
  hwloc@1.11.11    libxml2@2.9.10       patchelf@0.10   xz@5.2.5

Now we have a powerful query not available through spack find.

Let’s exit the interpreter to take us back to the command line:

>>> exit()

before generalizing the functionality for re-use.

Using scripts

Now let’s parameterize our script to accept arguments on the command line. With a few generalizations to use the include and exclude specs as arguments, we can create a powerful, general-purpose query script.

Open a file called find_exclude.py in your preferred editor and add the following code:

from spack.spec import Spec
import spack.store
import spack.cmd
import sys

include_spec = Spec(sys.argv[1])
exclude_spec = Spec(sys.argv[2])

all_included = spack.store.db.query(include_spec)
result = filter(lambda spec: not spec.satisfies(exclude_spec), all_included)

spack.cmd.display_specs(result)

Notice we added importing and using the system package (sys) to access the first and second command line arguments.

Now we can run our new script by entering the following:

$ spack python find_exclude.py %gcc ^mpich
-- linux-ubuntu22.04-x86_64_v3 / gcc@11.3.0 ---------------------
autoconf@2.69	     bzip2@1.0.8			 gdbm@1.23	 hwloc@2.9.1	       libiconv@1.17	  libxcrypt@4.4.33  numactl@2.0.14  perl@5.36.0    readline@8.2        zlib@1.2.13
automake@1.16.5      ca-certificates-mozilla@2023-01-10  gettext@0.21.1  krb5@1.20.1	       libpciaccess@0.17  libxml2@2.10.3    openmpi@4.1.5   pigz@2.7	   tar@1.34	       zstd@1.5.5
berkeley-db@18.1.40  cmake@3.26.3			 gmake@4.4.1	 libedit@3.1-20210216  libsigsegv@2.14	  m4@1.4.19	    openssh@9.3p1   pkgconf@1.9.5  util-macros@1.19.3
bison@3.8.2	     diffutils@3.9			 hdf5@1.14.1-2	 libevent@2.1.12       libtool@2.4.7	  ncurses@6.4	    openssl@1.1.1t  pmix@4.2.3	   xz@5.4.1

This is great for us, as long as we remember to use Spack’s python command to run it.

Using the spack-python executable

What if we want to make our script available for others to use without the hassle of having to remember to use spack python?

We can take advantage of the shebang line typically added as the first line of python executable files. But there is a catch, as we will soon see.

Open the find_exclude.py script we created above in your preferred editor and add the shebang line with spack python as the arguments to env:

#!/usr/bin/env spack-python
from spack.spec import Spec
import spack.store
import spack.cmd
import sys

include_spec = Spec(sys.argv[1])
exclude_spec = Spec(sys.argv[2])

all_included = spack.store.db.query(include_spec)
result = filter(lambda spec: not spec.satisfies(exclude_spec), all_included)

spack.cmd.display_specs(result)

Then exit our editor and add execute permissions to the script before running it as follows:

$ chmod u+x find_exclude.py
$ ./find_exclude.py %gcc ^mpich
-- linux-ubuntu22.04-x86_64_v3 / gcc@11.3.0 ---------------------
autoconf@2.69	     bzip2@1.0.8			 gdbm@1.23	 hwloc@2.9.1	       libiconv@1.17	  libxcrypt@4.4.33  numactl@2.0.14  perl@5.36.0    readline@8.2        zlib@1.2.13
automake@1.16.5      ca-certificates-mozilla@2023-01-10  gettext@0.21.1  krb5@1.20.1	       libpciaccess@0.17  libxml2@2.10.3    openmpi@4.1.5   pigz@2.7	   tar@1.34	       zstd@1.5.5
berkeley-db@18.1.40  cmake@3.26.3			 gmake@4.4.1	 libedit@3.1-20210216  libsigsegv@2.14	  m4@1.4.19	    openssh@9.3p1   pkgconf@1.9.5  util-macros@1.19.3
bison@3.8.2	     diffutils@3.9			 hdf5@1.14.1-2	 libevent@2.1.12       libtool@2.4.7	  ncurses@6.4	    openssl@1.1.1t  pmix@4.2.3	   xz@5.4.1

If you are lucky, it worked on your system, but there is no guarantee. Some systems only support a single argument on the shebang line (see here). spack-python, which is a wrapper script for spack python, solves this issue.

Bring up the file in your editor again and change the env argument to spack-python as follows:

#!/usr/bin/env spack-python
from spack.spec import Spec
import spack.store
import spack.cmd
import sys

include_spec = Spec(sys.argv[1])
exclude_spec = Spec(sys.argv[2])

all_included = spack.store.db.query(include_spec)
result = filter(lambda spec: not spec.satisfies(exclude_spec), all_included)

spack.cmd.display_specs(result)

Exit your editor and let’s run the script again:

$ ./find_exclude.py %gcc ^mpich
-- linux-ubuntu22.04-x86_64_v3 / gcc@11.3.0 ---------------------
autoconf@2.69	     bzip2@1.0.8			 gdbm@1.23	 hwloc@2.9.1	       libiconv@1.17	  libxcrypt@4.4.33  numactl@2.0.14  perl@5.36.0    readline@8.2        zlib@1.2.13
automake@1.16.5      ca-certificates-mozilla@2023-01-10  gettext@0.21.1  krb5@1.20.1	       libpciaccess@0.17  libxml2@2.10.3    openmpi@4.1.5   pigz@2.7	   tar@1.34	       zstd@1.5.5
berkeley-db@18.1.40  cmake@3.26.3			 gmake@4.4.1	 libedit@3.1-20210216  libsigsegv@2.14	  m4@1.4.19	    openssh@9.3p1   pkgconf@1.9.5  util-macros@1.19.3
bison@3.8.2	     diffutils@3.9			 hdf5@1.14.1-2	 libevent@2.1.12       libtool@2.4.7	  ncurses@6.4	    openssl@1.1.1t  pmix@4.2.3	   xz@5.4.1

Congratulations! It will now work on any system with Spack installed.

You now have the basic tools to create your own custom Spack queries and prototype ideas. We hope one day you’ll contribute them back to Spack.