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:sc25

and then set Spack up like this:

git clone --depth=2 --branch=releases/v1.1 https://github.com/spack/spack
. spack/share/spack/setup-env.sh
spack repo update builtin --tag v2025.11.0
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

Environments Tutorial

So far in this tutorial, we’ve covered the basic commands for managing individual packages:

Now we’ll explore Spack Environments — a powerful feature that let’s us manage collections of packages together in a documented and reproducible way. Spack environments are similar to virtual environments in other package managers (e.g., Python venv, Conda Environments, or nix-env).

What Makes a Spack Environment?

Spack environments are based around two key files that can be easily shared and reused across different systems:

  • spack.yaml – The main configuration file where we specify which packages to install, compilers to use, and other Spack settings.

  • spack.lock – A lockfile that captures the complete provenance of your environment, enabling reproduction of software environments.

Why Use Environments?

Managing complex software setups with multiple packages and varying configuration (like different MPI) can quickly become overwhelming. Spack environments solve this by letting you:

  • Establish standard software requirements for your project(s)

  • Set up consistent runtime environments for your users

  • Maintain reproducible development environments

  • Configure packages for CI/CD pipelines

  • Share and reproduce builds across different machines

  • Document your software stack for collaboration

  • And much more

Goals of this Tutorial

This tutorial will teach you the fundamentals of creating and using Spack environments.

We’ll cover:

  1. Command line basics – Creating and managing environments with Spack commands.

  2. Configuration files – Editing spack.yaml and understanding spack.lock.

  3. Environment types – Understanding Spack-managed vs. independent environments.

  4. Reproducible builds – Sharing and recreating environments across systems.

Environment Basics

Let’s look at the output of spack find at this point in the tutorial.

$ spack find
-- linux-ubuntu22.04-x86_64 / no compilers ----------------------
gcc@11.4.0  glibc@2.35

-- linux-ubuntu22.04-x86_64_v3 / %c,cxx,fortran=gcc@11.4.0 ------
mpich@4.3.2  openblas@0.3.30  openmpi@5.0.8  trilinos@16.1.0

-- linux-ubuntu22.04-x86_64_v3 / %c,cxx=clang@14.0.0 ------------
zlib-ng@2.2.4

-- linux-ubuntu22.04-x86_64_v3 / %c,cxx=gcc@11.4.0 --------------
berkeley-db@18.1.40  expat@2.7.3     hwloc@2.12.2	   openssh@9.9p1  texinfo@7.2
bison@3.8.2	     flex@2.6.3	     krb5@1.21.3	   openssl@3.6.0  zlib-ng@2.0.7
cmake@3.31.9	     gettext@0.23.1  libffi@3.5.2	   openssl@3.6.0  zlib-ng@2.2.4
cmake@3.31.9	     gettext@0.23.1  m4@1.4.20		   python@3.14.0  zstd@1.5.7
curl@8.15.0	     gmp@6.3.0	     ncurses@6.5-20250705  tcl@8.6.17
curl@8.15.0	     hwloc@2.12.2    nghttp2@1.48.0	   tcl@8.6.17

-- linux-ubuntu22.04-x86_64_v3 / %c=gcc@10.5.0 ------------------
gmake@4.4.1

-- linux-ubuntu22.04-x86_64_v3 / %c=gcc@11.4.0 ------------------
automake@1.16.5	  hdf5@1.14.6		libxcrypt@4.4.38  pkgconf@2.5.1
automake@1.16.5	  libbsd@0.12.2		libxml2@2.13.5	  pmix@6.0.0
bzip2@1.0.8	  libedit@3.1-20240808	libxml2@2.13.5	  prrte@4.0.0
diffutils@3.12	  libevent@2.1.12	mbedtls@2.28.9	  readline@8.3
findutils@4.10.0  libfabric@2.3.1	mpc@1.3.1	  sqlite@3.50.4
gawk@5.3.1	  libiconv@1.18		mpfr@4.2.1	  tar@1.35
gdbm@1.25	  libmd@1.1.0		numactl@2.0.18	  tar@1.35
gmake@4.4.1	  libpciaccess@0.17	perl@5.42.0	  util-linux-uuid@2.41
gmake@4.4.1	  libsigsegv@2.14	perl@5.42.0	  xz@5.6.3
hdf5@1.14.6	  libssh2@1.11.1	pigz@2.8	  yaksa@0.4
hdf5@1.14.6	  libtool@2.4.7		pigz@2.8

-- linux-ubuntu22.04-x86_64_v3 / %cxx=gcc@11.4.0 ----------------
kokkos@4.5.01  kokkos-kernels@4.5.01

-- linux-ubuntu22.04-x86_64_v3 / no compilers -------------------
autoconf@2.72			    gcc@10.5.0		glibc@2.35
autoconf@2.72			    gcc@11.4.0		llvm@14.0.0
autoconf-archive@2023.02.20	    gcc-runtime@10.5.0	util-macros@1.20.1
ca-certificates-mozilla@2025-08-12  gcc-runtime@11.4.0
compiler-wrapper@1.0		    gcc-runtime@11.4.0
==> 94 installed packages

This is a complete, but cluttered list of all our 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-ng.

The query mechanism we learned about with spack find can help, but it would be nice if we could see only the software that is relevant to our current project instead of seeing everything on the machine.

Creating and Activating Environments

Let’s create a new environment called myproject using the spack env create command:

$ spack env create myproject
==> Created environment myproject in: /home/spack/spack/var/spack/environments/myproject
==> Activate with: spack env activate myproject

To see all of our environments we’ve created so far we can run spack env list:

$ spack env list
==> 1 environments
    myproject

Note

Once we activate an environment it will show up highlighted in green in the list of environments.

Now let’s activate our environment by running the spack env activate command or spacktivate alias:

$ spack env activate myproject

Note

If we use the -p option for spack env activate, Spack will prepend the environment name to our shell prompt. This is a handy way to be reminded if and which environment you are in.

Once we activate an environment, spack find will only show what is in the current environment. For example, because we just created this environment the output below doesn’t show any installed packages.

$ spack find
==> In environment myproject
==> No root specs

==> 0 installed packages
==> 0 concretized packages to be installed (show with `spack find -c`)

Note

Although Spack doesn’t show all installed software packages when in an active environment, Spack will reuse packages across environments to save disk space and reduce build times.

Additionally the output now tells us that we’re in the myproject environment, so there is no need to panic when we no longer see our previously installed packages. It also states that there are no root specs. We’ll get back to what that means later.

While this detailed output is useful, if we only want to check what environment we’re are in, we can use spack env status:

$ spack env status
==> In environment myproject

To now exit out of this environment, we can use spack env deactivate or despacktivate if we’re feeling fancy.

After deactivating, we can see everything installed in this Spack instance:

$ despacktivate	   # short alias for 'spack env deactivate'
$ spack env status
==> No active environment
$ spack find
-- linux-ubuntu22.04-x86_64 / no compilers ----------------------
gcc@11.4.0  glibc@2.35

-- linux-ubuntu22.04-x86_64_v3 / %c,cxx,fortran=gcc@11.4.0 ------
mpich@4.3.2  openblas@0.3.30  openmpi@5.0.8  trilinos@16.1.0

-- linux-ubuntu22.04-x86_64_v3 / %c,cxx=clang@14.0.0 ------------
zlib-ng@2.2.4

-- linux-ubuntu22.04-x86_64_v3 / %c,cxx=gcc@11.4.0 --------------
berkeley-db@18.1.40  expat@2.7.3     hwloc@2.12.2	   openssh@9.9p1  texinfo@7.2
bison@3.8.2	     flex@2.6.3	     krb5@1.21.3	   openssl@3.6.0  zlib-ng@2.0.7
cmake@3.31.9	     gettext@0.23.1  libffi@3.5.2	   openssl@3.6.0  zlib-ng@2.2.4
cmake@3.31.9	     gettext@0.23.1  m4@1.4.20		   python@3.14.0  zstd@1.5.7
curl@8.15.0	     gmp@6.3.0	     ncurses@6.5-20250705  tcl@8.6.17
curl@8.15.0	     hwloc@2.12.2    nghttp2@1.48.0	   tcl@8.6.17

-- linux-ubuntu22.04-x86_64_v3 / %c=gcc@10.5.0 ------------------
gmake@4.4.1

-- linux-ubuntu22.04-x86_64_v3 / %c=gcc@11.4.0 ------------------
automake@1.16.5	  hdf5@1.14.6		libxcrypt@4.4.38  pkgconf@2.5.1
automake@1.16.5	  libbsd@0.12.2		libxml2@2.13.5	  pmix@6.0.0
bzip2@1.0.8	  libedit@3.1-20240808	libxml2@2.13.5	  prrte@4.0.0
diffutils@3.12	  libevent@2.1.12	mbedtls@2.28.9	  readline@8.3
findutils@4.10.0  libfabric@2.3.1	mpc@1.3.1	  sqlite@3.50.4
gawk@5.3.1	  libiconv@1.18		mpfr@4.2.1	  tar@1.35
gdbm@1.25	  libmd@1.1.0		numactl@2.0.18	  tar@1.35
gmake@4.4.1	  libpciaccess@0.17	perl@5.42.0	  util-linux-uuid@2.41
gmake@4.4.1	  libsigsegv@2.14	perl@5.42.0	  xz@5.6.3
hdf5@1.14.6	  libssh2@1.11.1	pigz@2.8	  yaksa@0.4
hdf5@1.14.6	  libtool@2.4.7		pigz@2.8

-- linux-ubuntu22.04-x86_64_v3 / %cxx=gcc@11.4.0 ----------------
kokkos@4.5.01  kokkos-kernels@4.5.01

-- linux-ubuntu22.04-x86_64_v3 / no compilers -------------------
autoconf@2.72			    gcc@10.5.0		glibc@2.35
autoconf@2.72			    gcc@11.4.0		llvm@14.0.0
autoconf-archive@2023.02.20	    gcc-runtime@10.5.0	util-macros@1.20.1
ca-certificates-mozilla@2025-08-12  gcc-runtime@11.4.0
compiler-wrapper@1.0		    gcc-runtime@11.4.0
==> 94 installed packages

Installing packages

Now that we understand how creation and activation work, let’s go back to our myproject environment and install a couple of packages, specifically, tcl and trilinos.

Let’s try the usual install commands we learned earlier:

$ spack env activate myproject
$ spack install tcl
==> Error: Cannot install 'tcl' because no matching specs are in the current environment.
 Specs can be added to the environment with 'spack add tcl',
 or as part of the install command with 'spack install --add tcl'

Environments are special in that we must add specs to the an environment before we can install them. This additional step helps prevent us from accidentally modifying a shared environment when installing new software.

spack add allows us to queue up several specs to be installed together. Let’s try it:

$ spack add tcl
==> Adding tcl to environment myproject
$ spack add trilinos
==> Adding trilinos to environment myproject
$ spack find
==> In environment myproject
==> 2 root specs
-- no arch / no compilers ---------------------------------------
 -  tcl	  -  trilinos

==> 0 installed packages
==> 0 concretized packages to be installed (show with `spack find -c`)

Now, tcl and trilinos have been registered as root specs in our environment. Root specs are packages that we’ve explicitly requested to be installed in an environment.

They’re called “roots” because they sit at the top of the dependency graph—when Spack installs these packages, with their respective dependency packages sitting below them.

Now, let’s install:

$ spack install
==> Concretized 2 specs
[+]  x74vmgr  tcl@8.6.17 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  ntccuj2	  ^compiler-wrapper@1.0 build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3
[e]  ml7cem5	  ^gcc@11.4.0~binutils+bootstrap~graphite~nvptx~piclibs~profiled~strip build_system=autotools build_type=RelWithDebInfo languages:='c,c++,fortran' platform=linux os=ubuntu22.04 target=x86_64_v3
[+]  nokfxva	  ^gcc-runtime@11.4.0 build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3
[e]  qg7qyaz	  ^glibc@2.35 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3
[+]  4obn7cg	  ^gmake@4.4.1~guile build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  qlavhjb	  ^zlib-ng@2.0.7 cflags=-O3 +compat+new_strategies+opt+pic+shared build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
 -   tj433ut  trilinos@16.1.0~adelus~adios2+amesos+amesos2+anasazi+aztec~basker+belos~boost~chaco~complex~cuda~cuda_constexpr~cuda_rdc~debug~dtk+epetra+epetraext~epetraextbtf~epetraextexperimental~epetraextgraphreorderings~exodus+explicit_template_instantiation~float+fortran~gtest~hdf5~hypre+ifpack+ifpack2~intrepid~intrepid2~ipo~isorropia+kokkos~mesquite~minitensor+ml+mpi+muelu~mumps~nox~openmp~pamgen~panzer~phalanx~piro~python~rocm~rocm_rdc~rol~rythmos+sacado~scorec~shards+shared~shylu~stk~stokhos~stratimikos~strumpack~suite-sparse~superlu-dist~teko~tempus~test~thyra+tpetra~trilinoscouplings~wrapper~x11~zoltan~zoltan2 build_system=cmake build_type=Release cxxstd=17 generator=make gotype=long_long platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx,fortran=gcc@11.4.0
[+]  ivvor7v	  ^cmake@3.31.9~doc+ncurses+ownlibs~qtgui build_system=generic build_type=Release platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  isdtvvd	      ^curl@8.15.0~gssapi~ldap~libidn2~librtmp~libssh+libssh2+nghttp2 build_system=autotools libs:=shared,static tls:=mbedtls,openssl platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  txa2olx		  ^libssh2@1.11.1+shared build_system=autotools crypto=mbedtls platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  bz3ghzh		  ^mbedtls@2.28.9+pic build_system=makefile build_type=Release libs:=shared,static platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  ft5kpbd		  ^nghttp2@1.48.0 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  cih4xrz		      ^diffutils@3.12 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  gv7wpik		  ^openssl@3.6.0~docs+shared build_system=generic certs=mozilla platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  etqlnw5		      ^ca-certificates-mozilla@2025-08-12 build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3
[+]  ncdxq3j	      ^ncurses@6.5-20250705~symlinks+termlib abi=none build_system=autotools patches:=7a351bc platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  4hos372	  ^hwloc@2.12.2~cairo~cuda~gl~level_zero~libudev+libxml2~nvml~opencl+pci~rocm build_system=autotools libs:=shared,static platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  txbwcin	      ^libpciaccess@0.17 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  hwxnwvm		  ^util-macros@1.20.1 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3
[+]  5trxrsw	      ^libxml2@2.13.5~http+pic~python+shared build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  qtepnkr		  ^libiconv@1.18 build_system=autotools libs:=shared,static platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  yzaocbs		  ^xz@5.6.3~pic build_system=autotools libs:=shared,static platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  f4qiprw	      ^pkgconf@2.5.1 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  k2pkvic	  ^kokkos@4.5.01~aggressive_vectorization~cmake_lang~compiler_warnings~complex_align~cuda~debug~debug_bounds_check~debug_dualview_modify_check~deprecated_code~examples~hip_relocatable_device_code~hpx~hpx_async_dispatch~hwloc~ipo~memkind~numactl~openmp~openmptarget+pic~rocm+serial+shared~sycl~tests~threads~tuning~wrapper build_system=cmake build_type=Release cxxstd=17 generator=make intel_gpu_arch=none platform=linux os=ubuntu22.04 target=x86_64_v3 %cxx=gcc@11.4.0
[+]  qknxuyj	  ^kokkos-kernels@4.5.01~blas~cblas~cublas~cuda~cusolver~cusparse~execspace_cuda~execspace_openmp~execspace_serial~execspace_threads~ipo~lapack~lapacke~memspace_cudaspace~memspace_cudauvmspace~mkl~openmp~rocblas~rocsolver~rocsparse~serial+shared~superlu~threads build_system=cmake build_type=Release generator=make layouts=left offsets:=int,size_t ordinals:=int scalars:=double platform=linux os=ubuntu22.04 target=x86_64_v3 %cxx=gcc@11.4.0
[+]  qz3ay7b	  ^openblas@0.3.30~bignuma~consistent_fpcsr+dynamic_dispatch+fortran+ilp64+locking+pic+shared build_system=makefile symbol_suffix=64_ threads=openmp platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx,fortran=gcc@11.4.0
[+]  tqxbnvo	  ^openmpi@5.0.8+atomics~cuda~debug+fortran~gpfs~internal-hwloc~internal-libevent~internal-pmix~ipv6~java~lustre~memchecker~openshmem~rocm~romio+rsh~static~two_level_namespace+vt+wrapper-rpath build_system=autotools fabrics:=none romio-filesystem:=none schedulers:=none platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx,fortran=gcc@11.4.0
[+]  fgsf5ij	      ^autoconf@2.72 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3
[+]  lxvpwti		  ^m4@1.4.20+sigsegv build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  bs5ujst		      ^libsigsegv@2.14 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  pzmnwzm	      ^automake@1.16.5 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  lprginh	      ^libevent@2.1.12+openssl build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  yt7ajy4	      ^libtool@2.4.7 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  irvryts		  ^findutils@4.10.0 build_system=autotools patches:=440b954 platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  cakgj4n		      ^gettext@0.23.1+bzip2+curses+git~libunistring+libxml2+pic+shared+tar+xz build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  lfgvgva			  ^tar@1.35 build_system=autotools zip=pigz platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  kaz756e			      ^pigz@2.8 build_system=makefile platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  foiizhd			      ^zstd@1.5.7+programs build_system=makefile compression:=none libs:=shared,static platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  yzbm5q6	      ^numactl@2.0.18 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  cxdcxo5	      ^openssh@9.9p1+gssapi build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  hnmy4fw		  ^krb5@1.21.3+shared build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  n7yzkyl		      ^bison@3.8.2~color build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  hdzcfgi		  ^libedit@3.1-20240808 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  yiij42p		  ^libxcrypt@4.4.38~obsolete_api build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  62kt5y4	      ^perl@5.42.0+cpanm+opcode+open+shared+threads build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  vdgigsw		  ^berkeley-db@18.1.40+cxx~docs+stl build_system=autotools patches:=26090f4,b231fcc platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  x7t4naj		  ^bzip2@1.0.8~debug~pic+shared build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  aq7qwy6		  ^gdbm@1.25 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  c6d2zlj		      ^readline@8.3 build_system=autotools patches:=21f0a03 platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  yqlblh6	      ^pmix@6.0.0~munge~python build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  buin62m	      ^prrte@4.0.0 build_system=autotools schedulers:=none platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  gmhq65u		  ^flex@2.6.3+lex~nls build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0

[+] /usr (external glibc-2.35-qg7qyazcn2fwrck5vgr3mxq3i4uxkhlo)
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/compiler-wrapper-1.0-ntccuj2fi3y7asqifeq3i4iylrbxakw2
[+] /usr (external gcc-11.4.0-ml7cem5pfeoluzbhb7jsiisemvoauaz5)
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/gcc-runtime-11.4.0-nokfxvaa4aklxfhoymvz6hlvbqw3kwnh
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/kokkos-4.5.01-k2pkvic65lggk6lukma2humh6t2axbo6
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/zstd-1.5.7-foiizhdg2mc4jdjtuddksbzvr64roxea
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/openblas-0.3.30-qz3ay7bveep7fy2v7vcln2zxc5ajfjxt
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/numactl-2.0.18-yzbm5q6nblzcjccy7kddijqdnkgkxvtp
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/libiconv-1.18-qtepnkrdvqazp3jmfnheapckbemejrhq
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/nghttp2-1.48.0-ft5kpbdiz6kctcooz4ksam37pskskehg
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/zlib-ng-2.0.7-qlavhjbsgqyboovfvsultjdwzz5nvthw
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/gmake-4.4.1-4obn7cgqfwoxyvmnpeedud63bsjhoqma
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/tcl-8.6.17-x74vmgrwo7h4ka3z3idhnde7xnuof3aq
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/pigz-2.8-kaz756eya6nj3ardls4b6aiaclkaux7i
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/openssl-3.6.0-gv7wpik32unrnickoxbgm5iqza572w6s
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/mbedtls-2.28.9-bz3ghzheol2ecbi3vpldgbb3yd7yblle
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/kokkos-kernels-4.5.01-qknxuyj5vbyheego7mbhhwqrooi7kght
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/xz-5.6.3-yzaocbs7geczi5d7qyvmqwrxi4r7dvph
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/libxcrypt-4.4.38-yiij42powrfh2mwjebwiqxmkvinutofr
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/libpciaccess-0.17-txbwcin227323qmxmg4opnj4r4tvenz4
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/ncurses-6.5-20250705-ncdxq3juvboefpavgmovg5rb5bx76ohz
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/bzip2-1.0.8-x7t4najic2jb46srjiebkrf55utda3nl
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/libevent-2.1.12-lprginh6npwjirdhmghjqjckaa7ukrri
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/libssh2-1.11.1-txa2olxuoxfkv7jdjrdw27djcf6fa5sz
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/libxml2-2.13.5-5trxrsws5dig3bf63uc4xzcbsywsqtjo
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/libedit-3.1-20240808-hdzcfgipukcqxsw7hjkksstbbz5otx3x
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/tar-1.35-lfgvgvawnpdxxz7prdfn4vsfgtwruxjc
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/curl-8.15.0-isdtvvdziidtozwacfgtdcv3cukd7uuz
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/hwloc-2.12.2-4hos3725nynk2bsskofvtcmk6pmtcjg4
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/gettext-0.23.1-cakgj4ntlncc4zsgty5z6sa7f7mwvlt7
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/cmake-3.31.9-ivvor7vdsqvplv65yyfragoxppyfi33t
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/pmix-6.0.0-yqlblh6p4u6vwmfhtffyrnxyqrliw2jm
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/krb5-1.21.3-hnmy4fwwly5s4xifp5roodj6opppwwiu
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/prrte-4.0.0-buin62mintd2cczzj6vsvai45vhpgg6w
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/openssh-9.9p1-cxdcxo5pdxc2nk7domxigdqiygg4757e
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/openmpi-5.0.8-tqxbnvoiw3nzds4xypcualamx3cvisln
==> Fetching file:///mirror/blobs/sha256/e8/e8e9738ee974efbf1676f64752e74a7548f6d7a2ef89385f32170c76234007e2
    [100%]   38.92 MB @	 421.3 GB/s
==> Extracting trilinos-16.1.0-tj433utqwna4zgloncl5jwlabsqgghcv from binary cache
==> trilinos: Successfully installed trilinos-16.1.0-tj433utqwna4zgloncl5jwlabsqgghcv
  Search: 0.00s.  Fetch: 0.23s.	 Install: 1.54s.  Extract: 1.36s.  Relocate: 0.15s.  Total: 1.77s
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/trilinos-16.1.0-tj433utqwna4zgloncl5jwlabsqgghcv
==> Installing trilinos-16.1.0-tj433utqwna4zgloncl5jwlabsqgghcv [37/37]
==> Updating view at /home/spack/spack/var/spack/environments/myproject/.spack-env/view

We can see that Spack reused existing installations of tcl and the dependencies of trilinos that were already present on the system, rather than rebuilding them from scratch.

Additionally, the environment’s view was automatically updated to include the installations. This means all the software in this environment has been added to our PATH, making the installed packages readily accessible from the command line while we have the environment activated.

Let’s now confirm the contents of the environment using spack find:

$ spack find
==> In environment myproject
==> 2 root specs
-- no arch / no compilers ---------------------------------------
[+] tcl	 [+] trilinos

-- linux-ubuntu22.04-x86_64_v3 / %c,cxx,fortran=gcc@11.4.0 ------
openblas@0.3.30	 openmpi@5.0.8	trilinos@16.1.0

-- linux-ubuntu22.04-x86_64_v3 / %c,cxx=gcc@11.4.0 --------------
berkeley-db@18.1.40  flex@2.6.3	     m4@1.4.20		   openssl@3.6.0
bison@3.8.2	     gettext@0.23.1  ncurses@6.5-20250705  tcl@8.6.17
cmake@3.31.9	     hwloc@2.12.2    nghttp2@1.48.0	   zlib-ng@2.0.7
curl@8.15.0	     krb5@1.21.3     openssh@9.9p1	   zstd@1.5.7

-- linux-ubuntu22.04-x86_64_v3 / %c=gcc@11.4.0 ------------------
automake@1.16.5	  gmake@4.4.1		libsigsegv@2.14	  mbedtls@2.28.9  pmix@6.0.0
bzip2@1.0.8	  libedit@3.1-20240808	libssh2@1.11.1	  numactl@2.0.18  prrte@4.0.0
diffutils@3.12	  libevent@2.1.12	libtool@2.4.7	  perl@5.42.0	  readline@8.3
findutils@4.10.0  libiconv@1.18		libxcrypt@4.4.38  pigz@2.8	  tar@1.35
gdbm@1.25	  libpciaccess@0.17	libxml2@2.13.5	  pkgconf@2.5.1	  xz@5.6.3

-- linux-ubuntu22.04-x86_64_v3 / %cxx=gcc@11.4.0 ----------------
kokkos@4.5.01  kokkos-kernels@4.5.01

-- linux-ubuntu22.04-x86_64_v3 / no compilers -------------------
autoconf@2.72			    gcc@11.4.0		util-macros@1.20.1
ca-certificates-mozilla@2025-08-12  gcc-runtime@11.4.0
compiler-wrapper@1.0		    glibc@2.35
==> 53 installed packages
==> 0 concretized packages to be installed (show with `spack find -c`)

We can see that the roots and all their dependencies have been installed.

Using Packages

Spack environments provide a convenient way to use your installed packages by automatically making them available in your shell environment. This is accomplished through a feature called environment views.

An environment view is a directory structure mirroring a standard Linux root filesystem with directories like /bin and /usr that contain symbolic links to all the packages installed in your Spack environment. When you activate an environment with spack env activate, Spack automatically:

  • Prepends the view’s bin directory to your PATH environment variable

  • Adds the view’s man directory to your MANPATH for manual pages

  • Updates CMAKE_PREFIX_PATH to include the view’s root directory

This means that executables, libraries, and other files from your environment’s packages become immediately accessible from your command line, just as if they were installed system-wide.

Let’s explore how views work using the tcl package we just installed in our myproject environment. The Tcl package includes a shell-like application called tclsh.

To see the path to tclsh let’s use the which command:

$ which tclsh
/home/spack/spack/var/spack/environments/myproject/.spack-env/view/bin/tclsh

Notice its path includes the name of our environment and a view subdirectory.

We can now run tclsh just like you would any other program that is in your path:

$ tclsh
% echo "hello world!"
hello world!
% exit

Removing Packages from Environments

One of Spack’s key features is that you can safely remove packages from specific environments without affecting other environments. This works because Spack environments only create links to shared package installations—they don’t contain the actual package files.

Let’s demonstrate this capability by creating a second environment. Imagine we have two projects:

  • myproject - requires trilinos

  • myproject2 - previously needed trilinos but no longer requires it

Let’s start by creating the myproject2 environment and installing both scr and trilinos:

$ spack env create myproject2
==> Created environment myproject2 in: /home/spack/spack/var/spack/environments/myproject2
==> Activate with: spack env activate myproject2
$ spack env activate myproject2
$ spack add scr trilinos
==> Adding scr to environment myproject2
==> Adding trilinos to environment myproject2
$ spack install
==> Concretized 2 specs
 -   f57s4no  scr@2.0.0+dtcmp~fortran~ipo+libyogrt async_api=NONE build_system=cmake build_type=Release cache_base=/dev/shm cntl_base=/dev/shm copy_config=none file_lock=FLOCK generator=make resource_manager=SLURM scr_config=scr.conf platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx,fortran=gcc@11.4.0
[+]  ivvor7v	  ^cmake@3.31.9~doc+ncurses+ownlibs~qtgui build_system=generic build_type=Release platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  isdtvvd	      ^curl@8.15.0~gssapi~ldap~libidn2~librtmp~libssh+libssh2+nghttp2 build_system=autotools libs:=shared,static tls:=mbedtls,openssl platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  txa2olx		  ^libssh2@1.11.1+shared build_system=autotools crypto=mbedtls platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  bz3ghzh		  ^mbedtls@2.28.9+pic build_system=makefile build_type=Release libs:=shared,static platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  ft5kpbd		  ^nghttp2@1.48.0 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  cih4xrz		      ^diffutils@3.12 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  gv7wpik		  ^openssl@3.6.0~docs+shared build_system=generic certs=mozilla platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  etqlnw5		      ^ca-certificates-mozilla@2025-08-12 build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3
[+]  ncdxq3j	      ^ncurses@6.5-20250705~symlinks+termlib abi=none build_system=autotools patches:=7a351bc platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  ntccuj2	  ^compiler-wrapper@1.0 build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3
 -   2kcmd2x	  ^dtcmp@1.1.5+shared build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
 -   bms4pwx	      ^lwgrp@1.0.6+shared build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[e]  ml7cem5	  ^gcc@11.4.0~binutils+bootstrap~graphite~nvptx~piclibs~profiled~strip build_system=autotools build_type=RelWithDebInfo languages:='c,c++,fortran' platform=linux os=ubuntu22.04 target=x86_64_v3
[+]  nokfxva	  ^gcc-runtime@11.4.0 build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3
[e]  qg7qyaz	  ^glibc@2.35 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3
[+]  4obn7cg	  ^gmake@4.4.1~guile build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
 -   ylblit5	  ^libyogrt@1.35~static build_system=autotools scheduler=slurm platform=linux os=ubuntu22.04 target=x86_64_v3 %c,fortran=gcc@11.4.0
 -   tc55ttm	      ^slurm@25-05-1-1~cgroup~gtk~hdf5~hwloc~mariadb~nvml~pam~pmix+readline~restd~rsmi build_system=autotools sysconfdir=PREFIX/etc platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
 -   arsxi4d		  ^glib@2.86.1+introspection~libmount~strip build_system=meson buildtype=release default_library:=shared tracing:=none platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
 -   brbwl6l		      ^elfutils@0.193~debuginfod+exeprefix+nls build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  foiizhd			  ^zstd@1.5.7+programs build_system=makefile compression:=none libs:=shared,static platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  cakgj4n		      ^gettext@0.23.1+bzip2+curses+git~libunistring+libxml2+pic+shared+tar+xz build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  lfgvgva			  ^tar@1.35 build_system=autotools zip=pigz platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  kaz756e			      ^pigz@2.8 build_system=makefile platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
 -   zktpj7s		      ^gobject-introspection@1.86.0~strip build_system=meson buildtype=release default_library:=shared platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
 -   dcark7n			  ^glib-bootstrap@2.86.1~strip build_system=meson buildtype=release default_library:=shared platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  zgro4tw		      ^libffi@3.5.2 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
 -   muzysky		      ^meson@1.8.5 build_system=python_pip patches:=0f0b1bd platform=linux os=ubuntu22.04 target=x86_64_v3
 -   hjc6yfd			  ^py-pip@25.1.1 build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3
 -   lnndrge			  ^py-setuptools@80.9.0 build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3
 -   hpfn7k7			  ^py-wheel@0.45.1 build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3
 -   2stmhpc		      ^ninja@1.13.0+re2c build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
 -   axmwics			  ^re2c@3.1 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
 -   z5vjj7q		      ^pcre2@10.44~jit+multibyte+pic build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
 -   rbf2x4i		      ^python@3.11.14+bz2+crypt+ctypes+dbm~debug+libxml2+lzma~optimizations+pic+pyexpat+pythoncmd+readline+shared+sqlite3+ssl~tkinter+uuid+zlib build_system=generic patches:=13fa8bf,b0615b2,ebdca64,f2fd060 platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  7yr5v6w			  ^expat@2.7.3+libbsd build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  ucrhsyw			      ^libbsd@0.12.2 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  gth3ii5				  ^libmd@1.1.0 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
 -   elvodyb			  ^sqlite@3.50.4+column_metadata+fts+rtree build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  n45otd3			  ^util-linux-uuid@2.41 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
 -   essoyki		      ^python-venv@1.0 build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3
 -   5viqezv		  ^json-c@0.18~ipo build_system=cmake build_type=Release generator=make platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
 -   7m7ijno		  ^lz4@1.10.0+pic build_system=makefile libs:=shared,static platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
 -   itsnhnf		  ^munge@0.5.15 build_system=autotools localstatedir=PREFIX/var platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
 -   4j7zjzs		      ^libgcrypt@1.11.2 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
 -   jerwaho			  ^libgpg-error@1.55 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  irhvzch			      ^gawk@5.3.1~nls build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  mj4re3l				  ^gmp@6.3.0+cxx build_system=autotools libs:=shared,static platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  m3nwalt				  ^mpfr@4.2.1 build_system=autotools libs:=shared,static patches:=3ec29a6 platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  7p7gq7u				      ^autoconf-archive@2023.02.20 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3
[+]  k6ygirs				      ^texinfo@7.2~xs build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  c6d2zlj		  ^readline@8.3 build_system=autotools patches:=21f0a03 platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  tqxbnvo	  ^openmpi@5.0.8+atomics~cuda~debug+fortran~gpfs~internal-hwloc~internal-libevent~internal-pmix~ipv6~java~lustre~memchecker~openshmem~rocm~romio+rsh~static~two_level_namespace+vt+wrapper-rpath build_system=autotools fabrics:=none romio-filesystem:=none schedulers:=none platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx,fortran=gcc@11.4.0
[+]  fgsf5ij	      ^autoconf@2.72 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3
[+]  lxvpwti		  ^m4@1.4.20+sigsegv build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  bs5ujst		      ^libsigsegv@2.14 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  pzmnwzm	      ^automake@1.16.5 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  lprginh	      ^libevent@2.1.12+openssl build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  yt7ajy4	      ^libtool@2.4.7 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  irvryts		  ^findutils@4.10.0 build_system=autotools patches:=440b954 platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  yzbm5q6	      ^numactl@2.0.18 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  cxdcxo5	      ^openssh@9.9p1+gssapi build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  hnmy4fw		  ^krb5@1.21.3+shared build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  n7yzkyl		      ^bison@3.8.2~color build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  hdzcfgi		  ^libedit@3.1-20240808 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  yiij42p		  ^libxcrypt@4.4.38~obsolete_api build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  62kt5y4	      ^perl@5.42.0+cpanm+opcode+open+shared+threads build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  vdgigsw		  ^berkeley-db@18.1.40+cxx~docs+stl build_system=autotools patches:=26090f4,b231fcc platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  x7t4naj		  ^bzip2@1.0.8~debug~pic+shared build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  aq7qwy6		  ^gdbm@1.25 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  f4qiprw	      ^pkgconf@2.5.1 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  yqlblh6	      ^pmix@6.0.0~munge~python build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  buin62m	      ^prrte@4.0.0 build_system=autotools schedulers:=none platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  gmhq65u		  ^flex@2.6.3+lex~nls build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
 -   eicmuq5	  ^pdsh@2.31+ssh+static_modules build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  qlavhjb	  ^zlib-ng@2.0.7 cflags=-O3 +compat+new_strategies+opt+pic+shared build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  tj433ut  trilinos@16.1.0~adelus~adios2+amesos+amesos2+anasazi+aztec~basker+belos~boost~chaco~complex~cuda~cuda_constexpr~cuda_rdc~debug~dtk+epetra+epetraext~epetraextbtf~epetraextexperimental~epetraextgraphreorderings~exodus+explicit_template_instantiation~float+fortran~gtest~hdf5~hypre+ifpack+ifpack2~intrepid~intrepid2~ipo~isorropia+kokkos~mesquite~minitensor+ml+mpi+muelu~mumps~nox~openmp~pamgen~panzer~phalanx~piro~python~rocm~rocm_rdc~rol~rythmos+sacado~scorec~shards+shared~shylu~stk~stokhos~stratimikos~strumpack~suite-sparse~superlu-dist~teko~tempus~test~thyra+tpetra~trilinoscouplings~wrapper~x11~zoltan~zoltan2 build_system=cmake build_type=Release cxxstd=17 generator=make gotype=long_long platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx,fortran=gcc@11.4.0
[+]  4hos372	  ^hwloc@2.12.2~cairo~cuda~gl~level_zero~libudev+libxml2~nvml~opencl+pci~rocm build_system=autotools libs:=shared,static platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  txbwcin	      ^libpciaccess@0.17 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  hwxnwvm		  ^util-macros@1.20.1 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3
[+]  5trxrsw	      ^libxml2@2.13.5~http+pic~python+shared build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  qtepnkr		  ^libiconv@1.18 build_system=autotools libs:=shared,static platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  yzaocbs		  ^xz@5.6.3~pic build_system=autotools libs:=shared,static platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  k2pkvic	  ^kokkos@4.5.01~aggressive_vectorization~cmake_lang~compiler_warnings~complex_align~cuda~debug~debug_bounds_check~debug_dualview_modify_check~deprecated_code~examples~hip_relocatable_device_code~hpx~hpx_async_dispatch~hwloc~ipo~memkind~numactl~openmp~openmptarget+pic~rocm+serial+shared~sycl~tests~threads~tuning~wrapper build_system=cmake build_type=Release cxxstd=17 generator=make intel_gpu_arch=none platform=linux os=ubuntu22.04 target=x86_64_v3 %cxx=gcc@11.4.0
[+]  qknxuyj	  ^kokkos-kernels@4.5.01~blas~cblas~cublas~cuda~cusolver~cusparse~execspace_cuda~execspace_openmp~execspace_serial~execspace_threads~ipo~lapack~lapacke~memspace_cudaspace~memspace_cudauvmspace~mkl~openmp~rocblas~rocsolver~rocsparse~serial+shared~superlu~threads build_system=cmake build_type=Release generator=make layouts=left offsets:=int,size_t ordinals:=int scalars:=double platform=linux os=ubuntu22.04 target=x86_64_v3 %cxx=gcc@11.4.0
[+]  qz3ay7b	  ^openblas@0.3.30~bignuma~consistent_fpcsr+dynamic_dispatch+fortran+ilp64+locking+pic+shared build_system=makefile symbol_suffix=64_ threads=openmp platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx,fortran=gcc@11.4.0

[+] /usr (external glibc-2.35-qg7qyazcn2fwrck5vgr3mxq3i4uxkhlo)
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/compiler-wrapper-1.0-ntccuj2fi3y7asqifeq3i4iylrbxakw2
[+] /usr (external gcc-11.4.0-ml7cem5pfeoluzbhb7jsiisemvoauaz5)
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/gcc-runtime-11.4.0-nokfxvaa4aklxfhoymvz6hlvbqw3kwnh
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/flex-2.6.3-gmhq65uhcnj2elzqkz3o7yg2652tmnqj
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/bzip2-1.0.8-x7t4najic2jb46srjiebkrf55utda3nl
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/libffi-3.5.2-zgro4twqg3qnq6hx6ohsjlejatth3rxa
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/openblas-0.3.30-qz3ay7bveep7fy2v7vcln2zxc5ajfjxt
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/ncurses-6.5-20250705-ncdxq3juvboefpavgmovg5rb5bx76ohz
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/kokkos-4.5.01-k2pkvic65lggk6lukma2humh6t2axbo6
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/zstd-1.5.7-foiizhdg2mc4jdjtuddksbzvr64roxea
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/zlib-ng-2.0.7-qlavhjbsgqyboovfvsultjdwzz5nvthw
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/gmp-6.3.0-mj4re3lp3bqk56rx5yblhufkzpmppdsu
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/nghttp2-1.48.0-ft5kpbdiz6kctcooz4ksam37pskskehg
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/gmake-4.4.1-4obn7cgqfwoxyvmnpeedud63bsjhoqma
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/kokkos-kernels-4.5.01-qknxuyj5vbyheego7mbhhwqrooi7kght
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/openssl-3.6.0-gv7wpik32unrnickoxbgm5iqza572w6s
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/readline-8.3-c6d2zljdklrjdya4xy236brmpdonc2xo
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/xz-5.6.3-yzaocbs7geczi5d7qyvmqwrxi4r7dvph
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/libpciaccess-0.17-txbwcin227323qmxmg4opnj4r4tvenz4
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/libxcrypt-4.4.38-yiij42powrfh2mwjebwiqxmkvinutofr
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/util-linux-uuid-2.41-n45otd3wy4fv7iawv52hiogfs63hxfpz
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/pkgconf-2.5.1-f4qiprwjcd2q3fp63uzgp47f3kw66r5h
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/libiconv-1.18-qtepnkrdvqazp3jmfnheapckbemejrhq
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/libsigsegv-2.14-bs5ujst3rrdcbj3r726bekzjfdddck4w
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/libmd-1.1.0-gth3ii5boey5akbsen5la4rgqpeaqkmx
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/mbedtls-2.28.9-bz3ghzheol2ecbi3vpldgbb3yd7yblle
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/mpfr-4.2.1-m3nwaltjkwzqahxlfylauzm5nxkuk2ud
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/numactl-2.0.18-yzbm5q6nblzcjccy7kddijqdnkgkxvtp
==> Fetching file:///mirror/blobs/sha256/86/86fb192e56f8ba22766223f66df8f1e23887592aa7ffce25814fcbee6906bc6f
    [100%]   61.89 MB @	 401.1 GB/s
==> Extracting pcre2-10.44-z5vjj7qwopnby63vu35fgh5ojadzfc4x from binary cache
==> pcre2: Successfully installed pcre2-10.44-z5vjj7qwopnby63vu35fgh5ojadzfc4x
  Search: 0.00s.  Fetch: 0.61s.	 Install: 0.13s.  Extract: 0.11s.  Relocate: 0.01s.  Total: 0.74s
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/pcre2-10.44-z5vjj7qwopnby63vu35fgh5ojadzfc4x
==> Installing pcre2-10.44-z5vjj7qwopnby63vu35fgh5ojadzfc4x [30/78]
==> Fetching file:///mirror/blobs/sha256/f8/f83982dcd606318ac47c8530943171a30020ac1dc394119c9413da51577c6921
    [100%]  248.04 KB @	 650.2 MB/s
==> Extracting pdsh-2.31-eicmuq5waz3gebhupmaxeo5bw5cl2gkm from binary cache
==> pdsh: Successfully installed pdsh-2.31-eicmuq5waz3gebhupmaxeo5bw5cl2gkm
  Search: 0.00s.  Fetch: 0.01s.	 Install: 0.03s.  Extract: 0.01s.  Relocate: 0.01s.  Total: 0.04s
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/pdsh-2.31-eicmuq5waz3gebhupmaxeo5bw5cl2gkm
==> Installing pdsh-2.31-eicmuq5waz3gebhupmaxeo5bw5cl2gkm [31/78]
==> Fetching file:///mirror/blobs/sha256/98/984402dc3a91c2e23afca6927d70333514be42924f8cae6884701da2f5f9452e
    [100%]  454.51 KB @	 749.1 MB/s
==> Extracting lz4-1.10.0-7m7ijnovafqfvcxitqrbveal5qgz57cy from binary cache
==> lz4: Successfully installed lz4-1.10.0-7m7ijnovafqfvcxitqrbveal5qgz57cy
  Search: 0.00s.  Fetch: 0.01s.	 Install: 0.04s.  Extract: 0.01s.  Relocate: 0.01s.  Total: 0.05s
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/lz4-1.10.0-7m7ijnovafqfvcxitqrbveal5qgz57cy
==> Installing lz4-1.10.0-7m7ijnovafqfvcxitqrbveal5qgz57cy [32/78]
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/berkeley-db-18.1.40-vdgigswy4fvttrivbedl4cp7bl72esma
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/pigz-2.8-kaz756eya6nj3ardls4b6aiaclkaux7i
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/libevent-2.1.12-lprginh6npwjirdhmghjqjckaa7ukrri
==> Fetching file:///mirror/blobs/sha256/14/1473c9741eeb9fda67f831dfb46a1acac67f2a7d7d368bf8c4f0daab1bfdac0a
    [100%]   11.28 MB @	 411.3 GB/s
==> Extracting sqlite-3.50.4-elvodybm3egmq2kdk74ca3jdhzcnxu77 from binary cache
==> sqlite: Successfully installed sqlite-3.50.4-elvodybm3egmq2kdk74ca3jdhzcnxu77
  Search: 0.00s.  Fetch: 0.02s.	 Install: 0.25s.  Extract: 0.21s.  Relocate: 0.02s.  Total: 0.28s
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/sqlite-3.50.4-elvodybm3egmq2kdk74ca3jdhzcnxu77
==> Installing sqlite-3.50.4-elvodybm3egmq2kdk74ca3jdhzcnxu77 [36/78]
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/gdbm-1.25-aq7qwy6yezwhtwdrsyqen65rmjmlth27
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/libedit-3.1-20240808-hdzcfgipukcqxsw7hjkksstbbz5otx3x
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/libxml2-2.13.5-5trxrsws5dig3bf63uc4xzcbsywsqtjo
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/m4-1.4.20-lxvpwtivihagmvso5cxgs3b7olqmac2g
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/libbsd-0.12.2-ucrhsywwalxwcqigisozcu2xvvhx3zwx
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/libssh2-1.11.1-txa2olxuoxfkv7jdjrdw27djcf6fa5sz
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/gawk-5.3.1-irhvzcha2sysowm6prf7zkvjitpykaxd
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/tar-1.35-lfgvgvawnpdxxz7prdfn4vsfgtwruxjc
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/perl-5.42.0-62kt5y4kl7uhwljviixr3m4dyf5vre7t
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/hwloc-2.12.2-4hos3725nynk2bsskofvtcmk6pmtcjg4
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/bison-3.8.2-n7yzkylf4gs7cnu6scau27gxbodinprr
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/expat-2.7.3-7yr5v6w2xu5f4bohfxjcsnb2snnwwj5m
==> Fetching file:///mirror/blobs/sha256/d3/d3f5d2b3248af7b87c689e35dc208c0b55bf7545702ff183e6b8fc8797d69ba0
    [100%]   61.26 MB @	 992.9 MB/s
==> Extracting libgpg-error-1.55-jerwahojdgk4ga5b5vopwmu4oto356qx from binary cache
==> libgpg-error: Successfully installed libgpg-error-1.55-jerwahojdgk4ga5b5vopwmu4oto356qx
  Search: 0.00s.  Fetch: 0.01s.	 Install: 0.07s.  Extract: 0.04s.  Relocate: 0.01s.  Total: 0.08s
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/libgpg-error-1.55-jerwahojdgk4ga5b5vopwmu4oto356qx
==> Installing libgpg-error-1.55-jerwahojdgk4ga5b5vopwmu4oto356qx [49/78]
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/gettext-0.23.1-cakgj4ntlncc4zsgty5z6sa7f7mwvlt7
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/curl-8.15.0-isdtvvdziidtozwacfgtdcv3cukd7uuz
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/pmix-6.0.0-yqlblh6p4u6vwmfhtffyrnxyqrliw2jm
==> Fetching file:///mirror/blobs/sha256/f0/f0630ac8ca8b34ca2e5a8b6a7f34e8381380338d790b092972e40958ac233379
    [100%]   62.75 MB @	 391.0 GB/s
==> Extracting libgcrypt-1.11.2-4j7zjzsf5hbmbypjyd4gqmpy6yp2esmn from binary cache
==> libgcrypt: Successfully installed libgcrypt-1.11.2-4j7zjzsf5hbmbypjyd4gqmpy6yp2esmn
  Search: 0.00s.  Fetch: 0.01s.	 Install: 0.09s.  Extract: 0.06s.  Relocate: 0.01s.  Total: 0.10s
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/libgcrypt-1.11.2-4j7zjzsf5hbmbypjyd4gqmpy6yp2esmn
==> Installing libgcrypt-1.11.2-4j7zjzsf5hbmbypjyd4gqmpy6yp2esmn [53/78]
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/krb5-1.21.3-hnmy4fwwly5s4xifp5roodj6opppwwiu
==> Fetching file:///mirror/blobs/sha256/b6/b6b9abd8adbf885c4a37c33a3d9d0cfa11ef5d2672db006596e7e84507ca9da6
    [100%]   11.52 MB @	 391.3 GB/s
==> Extracting elfutils-0.193-brbwl6lkh323duhprbcxlmwwk7zz2cs2 from binary cache
==> elfutils: Successfully installed elfutils-0.193-brbwl6lkh323duhprbcxlmwwk7zz2cs2
  Search: 0.00s.  Fetch: 0.02s.	 Install: 0.30s.  Extract: 0.24s.  Relocate: 0.04s.  Total: 0.32s
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/elfutils-0.193-brbwl6lkh323duhprbcxlmwwk7zz2cs2
==> Installing elfutils-0.193-brbwl6lkh323duhprbcxlmwwk7zz2cs2 [55/78]
==> Fetching file:///mirror/blobs/sha256/f3/f324b55f9e4991e98d187e352e9887e52789095963d66756c3be232aff8c8e27
    [100%]   78.97 MB @	 421.4 GB/s
==> Extracting python-3.11.14-rbf2x4id5wuf7yihgm6fv5vtm2qoc2bz from binary cache
==> python: Successfully installed python-3.11.14-rbf2x4id5wuf7yihgm6fv5vtm2qoc2bz
  Search: 0.00s.  Fetch: 0.12s.	 Install: 2.86s.  Extract: 2.73s.  Relocate: 0.11s.  Total: 2.98s
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/python-3.11.14-rbf2x4id5wuf7yihgm6fv5vtm2qoc2bz
==> Installing python-3.11.14-rbf2x4id5wuf7yihgm6fv5vtm2qoc2bz [56/78]
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/cmake-3.31.9-ivvor7vdsqvplv65yyfragoxppyfi33t
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/prrte-4.0.0-buin62mintd2cczzj6vsvai45vhpgg6w
==> Fetching file:///mirror/blobs/sha256/7b/7b48104f7cc2412a9dff3163ef24e4d2b052930a4524142ed495365591bd7e4d
    [100%]  737.51 KB @	 874.3 MB/s
==> Extracting munge-0.5.15-itsnhnf3jn5ual4k7intv62hnu54gplq from binary cache
==> munge: Successfully installed munge-0.5.15-itsnhnf3jn5ual4k7intv62hnu54gplq
  Search: 0.00s.  Fetch: 0.01s.	 Install: 0.07s.  Extract: 0.02s.  Relocate: 0.02s.  Total: 0.07s
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/munge-0.5.15-itsnhnf3jn5ual4k7intv62hnu54gplq
==> Installing munge-0.5.15-itsnhnf3jn5ual4k7intv62hnu54gplq [59/78]
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/openssh-9.9p1-cxdcxo5pdxc2nk7domxigdqiygg4757e
==> Fetching file:///mirror/blobs/sha256/fe/fe85e316a6e7a4eeb764a7d76ec7385fa5a8edff5afd996502eb8431a2b87bb1
    [100%]   28.60 MB @	 381.3 GB/s
==> Extracting re2c-3.1-axmwicsvaegxguyoex6hmu6irzrdis4j from binary cache
==> re2c: Successfully installed re2c-3.1-axmwicsvaegxguyoex6hmu6irzrdis4j
  Search: 0.00s.  Fetch: 0.05s.	 Install: 0.61s.  Extract: 0.53s.  Relocate: 0.05s.  Total: 0.65s
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/re2c-3.1-axmwicsvaegxguyoex6hmu6irzrdis4j
==> Installing re2c-3.1-axmwicsvaegxguyoex6hmu6irzrdis4j [61/78]
==> Fetching file:///mirror/blobs/sha256/ec/ec1ddbbebff6f1e9c98c88a0a8c55f4ae992aec98e27894b028f0df6256c35cc
    [100%]   14.82 KB @	 193.8 MB/s
==> Extracting python-venv-1.0-essoyki3al5aam2wqamlejoclcd7jf6o from binary cache
==> python-venv: Successfully installed python-venv-1.0-essoyki3al5aam2wqamlejoclcd7jf6o
  Search: 0.00s.  Fetch: 0.01s.	 Install: 0.04s.  Extract: 0.01s.  Relocate: 0.01s.  Total: 0.04s
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/python-venv-1.0-essoyki3al5aam2wqamlejoclcd7jf6o
==> Installing python-venv-1.0-essoyki3al5aam2wqamlejoclcd7jf6o [62/78]
==> Fetching file:///mirror/blobs/sha256/76/765ce3179ed21f8ff737269f5b252124b5b2c09de09da1e63b700f0e7ce364bd
    [100%]  136.37 KB @	 447.5 MB/s
==> Extracting json-c-0.18-5viqezvbwekimujkx7dj3xc6qlwzmqes from binary cache
==> json-c: Successfully installed json-c-0.18-5viqezvbwekimujkx7dj3xc6qlwzmqes
  Search: 0.00s.  Fetch: 0.01s.	 Install: 0.04s.  Extract: 0.01s.  Relocate: 0.01s.  Total: 0.04s
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/json-c-0.18-5viqezvbwekimujkx7dj3xc6qlwzmqes
==> Installing json-c-0.18-5viqezvbwekimujkx7dj3xc6qlwzmqes [63/78]
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/openmpi-5.0.8-tqxbnvoiw3nzds4xypcualamx3cvisln
==> Fetching file:///mirror/blobs/sha256/ef/ef80e301ee4675fd1d094d92c6c89df1015826b1c9e2b7795a56892985076466
    [100%]   63.36 MB @	 431.2 GB/s
==> Extracting ninja-1.13.0-2stmhpcux6apkymvlm34reuwmddvngjm from binary cache
==> ninja: Successfully installed ninja-1.13.0-2stmhpcux6apkymvlm34reuwmddvngjm
  Search: 0.00s.  Fetch: 0.01s.	 Install: 0.11s.  Extract: 0.07s.  Relocate: 0.01s.  Total: 0.12s
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/ninja-1.13.0-2stmhpcux6apkymvlm34reuwmddvngjm
==> Installing ninja-1.13.0-2stmhpcux6apkymvlm34reuwmddvngjm [65/78]
==> Fetching file:///mirror/blobs/sha256/e9/e9385bc06ccc9335669dfce96d50c968f72c2e1da765718ee6e473f9f7bf5ddd
    [100%]   64.10 MB @	 401.2 GB/s
==> Extracting py-pip-25.1.1-hjc6yfd2ld4jnbcfet6xvykaudvxcpqo from binary cache
==> py-pip: Successfully installed py-pip-25.1.1-hjc6yfd2ld4jnbcfet6xvykaudvxcpqo
  Search: 0.00s.  Fetch: 0.01s.	 Install: 0.25s.  Extract: 0.22s.  Relocate: 0.01s.  Total: 0.26s
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/py-pip-25.1.1-hjc6yfd2ld4jnbcfet6xvykaudvxcpqo
==> Installing py-pip-25.1.1-hjc6yfd2ld4jnbcfet6xvykaudvxcpqo [66/78]
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/trilinos-16.1.0-tj433utqwna4zgloncl5jwlabsqgghcv
==> Fetching file:///mirror/blobs/sha256/4e/4e20d0b5baf38fc8161ec027fe61f1d13aff2944c9a29f77d4055d6e1e86797b
    [100%]  206.80 KB @	 526.0 MB/s
==> Extracting lwgrp-1.0.6-bms4pwx7whtr74fbz6idyyk5lbgpv72z from binary cache
==> lwgrp: Successfully installed lwgrp-1.0.6-bms4pwx7whtr74fbz6idyyk5lbgpv72z
  Search: 0.00s.  Fetch: 0.01s.	 Install: 0.06s.  Extract: 0.01s.  Relocate: 0.03s.  Total: 0.07s
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/lwgrp-1.0.6-bms4pwx7whtr74fbz6idyyk5lbgpv72z
==> Installing lwgrp-1.0.6-bms4pwx7whtr74fbz6idyyk5lbgpv72z [68/78]
==> Fetching file:///mirror/blobs/sha256/3c/3c06621b6a1b6eae5ddbf0f7f1012b8bfa4ec87c2c1ea59f41b5796904509914
    [100%]   62.98 MB @	 401.1 GB/s
==> Extracting py-setuptools-80.9.0-lnndrgestzj7yvxxmosjz35ocyelfw5r from binary cache
==> py-setuptools: Successfully installed py-setuptools-80.9.0-lnndrgestzj7yvxxmosjz35ocyelfw5r
  Search: 0.00s.  Fetch: 0.01s.	 Install: 0.23s.  Extract: 0.20s.  Relocate: 0.01s.  Total: 0.24s
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/py-setuptools-80.9.0-lnndrgestzj7yvxxmosjz35ocyelfw5r
==> Installing py-setuptools-80.9.0-lnndrgestzj7yvxxmosjz35ocyelfw5r [69/78]
==> Fetching file:///mirror/blobs/sha256/9d/9d92b1a661974058164b24df8bd193ceb34c3fe67fa51f4dc6125a6bc3ee9cb9
    [100%]  195.10 KB @	 554.8 MB/s
==> Extracting py-wheel-0.45.1-hpfn7k7fkr5xsrlw6if6nj6n27a4jcrs from binary cache
==> py-wheel: Successfully installed py-wheel-0.45.1-hpfn7k7fkr5xsrlw6if6nj6n27a4jcrs
  Search: 0.00s.  Fetch: 0.01s.	 Install: 0.05s.  Extract: 0.02s.  Relocate: 0.01s.  Total: 0.06s
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/py-wheel-0.45.1-hpfn7k7fkr5xsrlw6if6nj6n27a4jcrs
==> Installing py-wheel-0.45.1-hpfn7k7fkr5xsrlw6if6nj6n27a4jcrs [70/78]
==> Fetching file:///mirror/blobs/sha256/da/dab766c9f7eacbe404c98b078983fbc786e0753e60b66fa7aea02aa5d4fbb13b
    [100%]  445.90 KB @	 706.6 MB/s
==> Extracting dtcmp-1.1.5-2kcmd2x76so5ites4co66qnkqukjenot from binary cache
==> dtcmp: Successfully installed dtcmp-1.1.5-2kcmd2x76so5ites4co66qnkqukjenot
  Search: 0.00s.  Fetch: 0.01s.	 Install: 0.07s.  Extract: 0.01s.  Relocate: 0.03s.  Total: 0.07s
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/dtcmp-1.1.5-2kcmd2x76so5ites4co66qnkqukjenot
==> Installing dtcmp-1.1.5-2kcmd2x76so5ites4co66qnkqukjenot [71/78]
==> Fetching file:///mirror/blobs/sha256/c2/c29415789f084e7cd6cc187c5ba7d9f21d853a2904022b388d0e79cfc44b9bb9
    [100%]   63.00 MB @	 461.2 GB/s
==> Extracting meson-1.8.5-muzyskyvwmojjs5n4yrw47b7gc4x7blx from binary cache
==> meson: Successfully installed meson-1.8.5-muzyskyvwmojjs5n4yrw47b7gc4x7blx
  Search: 0.00s.  Fetch: 0.01s.	 Install: 0.17s.  Extract: 0.14s.  Relocate: 0.01s.  Total: 0.18s
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/meson-1.8.5-muzyskyvwmojjs5n4yrw47b7gc4x7blx
==> Installing meson-1.8.5-muzyskyvwmojjs5n4yrw47b7gc4x7blx [72/78]
==> Fetching file:///mirror/blobs/sha256/ca/ca0d32fd119312ecd0f0c033989ac9375eaadaf248c7f962fdd000798bf36899
    [100%]   62.91 MB @	 371.2 GB/s
==> Extracting glib-bootstrap-2.86.1-dcark7n2gmwnwuev2tl5qxvreqvzmohg from binary cache
==> glib-bootstrap: Successfully installed glib-bootstrap-2.86.1-dcark7n2gmwnwuev2tl5qxvreqvzmohg
  Search: 0.00s.  Fetch: 0.01s.	 Install: 0.18s.  Extract: 0.12s.  Relocate: 0.04s.  Total: 0.19s
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/glib-bootstrap-2.86.1-dcark7n2gmwnwuev2tl5qxvreqvzmohg
==> Installing glib-bootstrap-2.86.1-dcark7n2gmwnwuev2tl5qxvreqvzmohg [73/78]
==> Fetching file:///mirror/blobs/sha256/9d/9d2712050063c20efa296dc725ff838b0c1fb390ef8de2324059f650e30194c6
    [100%]  703.32 KB @	 885.6 MB/s
==> Extracting gobject-introspection-1.86.0-zktpj7scqi6ts5hv2qc3pjhpg5ll6xam from binary cache
==> gobject-introspection: Successfully installed gobject-introspection-1.86.0-zktpj7scqi6ts5hv2qc3pjhpg5ll6xam
  Search: 0.00s.  Fetch: 0.01s.	 Install: 0.11s.  Extract: 0.05s.  Relocate: 0.04s.  Total: 0.12s
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/gobject-introspection-1.86.0-zktpj7scqi6ts5hv2qc3pjhpg5ll6xam
==> Installing gobject-introspection-1.86.0-zktpj7scqi6ts5hv2qc3pjhpg5ll6xam [74/78]
==> Fetching file:///mirror/blobs/sha256/46/46f8e18423962bf22ca352b9ae8668bd14fee258bd7dfb325ea74f13a0fc448b
    [100%]   67.61 MB @	 421.3 GB/s
==> Extracting glib-2.86.1-arsxi4dynj54sx2h3mcryrco7pml4yhf from binary cache
==> glib: Successfully installed glib-2.86.1-arsxi4dynj54sx2h3mcryrco7pml4yhf
  Search: 0.00s.  Fetch: 0.02s.	 Install: 0.34s.  Extract: 0.27s.  Relocate: 0.04s.  Total: 0.36s
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/glib-2.86.1-arsxi4dynj54sx2h3mcryrco7pml4yhf
==> Installing glib-2.86.1-arsxi4dynj54sx2h3mcryrco7pml4yhf [75/78]
==> Fetching file:///mirror/blobs/sha256/50/503cc5575e706d763d3e97d86c60f65e278f7956934c2d58a6e662fc1900d504
    [100%]  128.82 MB @	 501.4 GB/s
==> Extracting slurm-25-05-1-1-tc55ttmephfx5nx3s7o7lem6w2hbke34 from binary cache
==> slurm: Successfully installed slurm-25-05-1-1-tc55ttmephfx5nx3s7o7lem6w2hbke34
  Search: 0.00s.  Fetch: 0.19s.	 Install: 2.79s.  Extract: 2.59s.  Relocate: 0.16s.  Total: 2.98s
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/slurm-25-05-1-1-tc55ttmephfx5nx3s7o7lem6w2hbke34
==> Installing slurm-25-05-1-1-tc55ttmephfx5nx3s7o7lem6w2hbke34 [76/78]
==> Fetching file:///mirror/blobs/sha256/db/db4b142730ea960904b7d3bb553ffcecbd5c026e886dd14d21c5df2c15c13112
    [100%]   78.25 KB @	 339.0 MB/s
==> Extracting libyogrt-1.35-ylblit5vwtdqn2zoc7ghzfmmf46bgm5g from binary cache
==> libyogrt: Successfully installed libyogrt-1.35-ylblit5vwtdqn2zoc7ghzfmmf46bgm5g
  Search: 0.00s.  Fetch: 0.01s.	 Install: 0.08s.  Extract: 0.01s.  Relocate: 0.04s.  Total: 0.09s
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/libyogrt-1.35-ylblit5vwtdqn2zoc7ghzfmmf46bgm5g
==> Installing libyogrt-1.35-ylblit5vwtdqn2zoc7ghzfmmf46bgm5g [77/78]
==> Fetching file:///mirror/blobs/sha256/a3/a31530f079789b885e048110b4658d17b1c4c0eadbaab2058b20c349a62a4481
    [100%]   61.25 MB @	 991.3 MB/s
==> Extracting scr-2.0.0-f57s4noxfkoiizusmhjyjue2h3fn2yrc from binary cache
==> scr: Successfully installed scr-2.0.0-f57s4noxfkoiizusmhjyjue2h3fn2yrc
  Search: 0.00s.  Fetch: 0.01s.	 Install: 0.14s.  Extract: 0.03s.  Relocate: 0.07s.  Total: 0.15s
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/scr-2.0.0-f57s4noxfkoiizusmhjyjue2h3fn2yrc
==> Installing scr-2.0.0-f57s4noxfkoiizusmhjyjue2h3fn2yrc [78/78]
==> Updating view at /home/spack/spack/var/spack/environments/myproject2/.spack-env/view
$ spack find
==> In environment myproject2
==> 2 root specs
-- no arch / no compilers ---------------------------------------
[+] scr	 [+] trilinos

-- linux-ubuntu22.04-x86_64_v3 / %c,cxx,fortran=gcc@11.4.0 ------
openblas@0.3.30	 openmpi@5.0.8	scr@2.0.0  trilinos@16.1.0

-- linux-ubuntu22.04-x86_64_v3 / %c,cxx=gcc@11.4.0 --------------
berkeley-db@18.1.40  gettext@0.23.1	    lz4@1.10.0		  python@3.11.14
bison@3.8.2	     glib@2.86.1	    m4@1.4.20		  re2c@3.1
cmake@3.31.9	     glib-bootstrap@2.86.1  ncurses@6.5-20250705  texinfo@7.2
curl@8.15.0	     gmp@6.3.0		    nghttp2@1.48.0	  zlib-ng@2.0.7
elfutils@0.193	     hwloc@2.12.2	    ninja@1.13.0	  zstd@1.5.7
expat@2.7.3	     krb5@1.21.3	    openssh@9.9p1
flex@2.6.3	     libffi@3.5.2	    openssl@3.6.0

-- linux-ubuntu22.04-x86_64_v3 / %c,fortran=gcc@11.4.0 ----------
libyogrt@1.35

-- linux-ubuntu22.04-x86_64_v3 / %c=gcc@11.4.0 ------------------
automake@1.16.5		      libedit@3.1-20240808  libxml2@2.13.5  pmix@6.0.0
bzip2@1.0.8		      libevent@2.1.12	    lwgrp@1.0.6	    prrte@4.0.0
diffutils@3.12		      libgcrypt@1.11.2	    mbedtls@2.28.9  readline@8.3
dtcmp@1.1.5		      libgpg-error@1.55	    mpfr@4.2.1	    slurm@25-05-1-1
findutils@4.10.0	      libiconv@1.18	    munge@0.5.15    sqlite@3.50.4
gawk@5.3.1		      libmd@1.1.0	    numactl@2.0.18  tar@1.35
gdbm@1.25		      libpciaccess@0.17	    pcre2@10.44	    util-linux-uuid@2.41
gmake@4.4.1		      libsigsegv@2.14	    pdsh@2.31	    xz@5.6.3
gobject-introspection@1.86.0  libssh2@1.11.1	    perl@5.42.0
json-c@0.18		      libtool@2.4.7	    pigz@2.8
libbsd@0.12.2		      libxcrypt@4.4.38	    pkgconf@2.5.1

-- linux-ubuntu22.04-x86_64_v3 / %cxx=gcc@11.4.0 ----------------
kokkos@4.5.01  kokkos-kernels@4.5.01

-- linux-ubuntu22.04-x86_64_v3 / no compilers -------------------
autoconf@2.72			    gcc-runtime@11.4.0	  py-wheel@0.45.1
autoconf-archive@2023.02.20	    glibc@2.35		  python-venv@1.0
ca-certificates-mozilla@2025-08-12  meson@1.8.5		  util-macros@1.20.1
compiler-wrapper@1.0		    py-pip@25.1.1
gcc@11.4.0			    py-setuptools@80.9.0
==> 87 installed packages
==> 0 concretized packages to be installed (show with `spack find -c`)

Now we have two environments with different package combinations:

  • The myproject environment contains tcl and trilinos

  • The myproject2 environment contains scr and trilinos

Now let’s attempt to uninstall trilinos from myproject2 and examine what happens:

$ spack uninstall -y trilinos
==> Refusing to uninstall the following specs
    -- linux-ubuntu22.04-x86_64_v3 / %c,cxx,fortran=gcc@11.4.0 ------
    tj433ut trilinos@16.1.0

==> The following environments still reference these specs:
    myproject

==> Error: There are still dependents.
  use `spack remove` to remove the spec from the current environment
  use `spack env remove` to remove environments
  use `spack uninstall --force` to override
$ spack find
==> In environment myproject2
==> 2 root specs
-- no arch / no compilers ---------------------------------------
[+] scr	 [+] trilinos

-- linux-ubuntu22.04-x86_64_v3 / %c,cxx,fortran=gcc@11.4.0 ------
openblas@0.3.30	 openmpi@5.0.8	scr@2.0.0  trilinos@16.1.0

-- linux-ubuntu22.04-x86_64_v3 / %c,cxx=gcc@11.4.0 --------------
berkeley-db@18.1.40  gettext@0.23.1	    lz4@1.10.0		  python@3.11.14
bison@3.8.2	     glib@2.86.1	    m4@1.4.20		  re2c@3.1
cmake@3.31.9	     glib-bootstrap@2.86.1  ncurses@6.5-20250705  texinfo@7.2
curl@8.15.0	     gmp@6.3.0		    nghttp2@1.48.0	  zlib-ng@2.0.7
elfutils@0.193	     hwloc@2.12.2	    ninja@1.13.0	  zstd@1.5.7
expat@2.7.3	     krb5@1.21.3	    openssh@9.9p1
flex@2.6.3	     libffi@3.5.2	    openssl@3.6.0

-- linux-ubuntu22.04-x86_64_v3 / %c,fortran=gcc@11.4.0 ----------
libyogrt@1.35

-- linux-ubuntu22.04-x86_64_v3 / %c=gcc@11.4.0 ------------------
automake@1.16.5		      libedit@3.1-20240808  libxml2@2.13.5  pmix@6.0.0
bzip2@1.0.8		      libevent@2.1.12	    lwgrp@1.0.6	    prrte@4.0.0
diffutils@3.12		      libgcrypt@1.11.2	    mbedtls@2.28.9  readline@8.3
dtcmp@1.1.5		      libgpg-error@1.55	    mpfr@4.2.1	    slurm@25-05-1-1
findutils@4.10.0	      libiconv@1.18	    munge@0.5.15    sqlite@3.50.4
gawk@5.3.1		      libmd@1.1.0	    numactl@2.0.18  tar@1.35
gdbm@1.25		      libpciaccess@0.17	    pcre2@10.44	    util-linux-uuid@2.41
gmake@4.4.1		      libsigsegv@2.14	    pdsh@2.31	    xz@5.6.3
gobject-introspection@1.86.0  libssh2@1.11.1	    perl@5.42.0
json-c@0.18		      libtool@2.4.7	    pigz@2.8
libbsd@0.12.2		      libxcrypt@4.4.38	    pkgconf@2.5.1

-- linux-ubuntu22.04-x86_64_v3 / %cxx=gcc@11.4.0 ----------------
kokkos@4.5.01  kokkos-kernels@4.5.01

-- linux-ubuntu22.04-x86_64_v3 / no compilers -------------------
autoconf@2.72			    gcc-runtime@11.4.0	  py-wheel@0.45.1
autoconf-archive@2023.02.20	    glibc@2.35		  python-venv@1.0
ca-certificates-mozilla@2025-08-12  meson@1.8.5		  util-macros@1.20.1
compiler-wrapper@1.0		    py-pip@25.1.1
gcc@11.4.0			    py-setuptools@80.9.0
==> 87 installed packages
==> 0 concretized packages to be installed (show with `spack find -c`)

Notice that trilinos won’t be uninstalled because it’s still referenced in myproject. This safety feature prevents accidental removal of packages that other environments depend on.

Instead, if we want to remove trilinos from the myproject2 environment (without affecting it in other environments), we need to use spack remove:

$ spack remove trilinos
==> trilinos has been removed from /home/spack/spack/var/spack/environments/myproject2/spack.yaml
$ spack find
==> In environment myproject2
==> 1 root specs
-- no arch / no compilers ---------------------------------------
[+] scr

-- linux-ubuntu22.04-x86_64_v3 / %c,cxx,fortran=gcc@11.4.0 ------
openblas@0.3.30	 openmpi@5.0.8	scr@2.0.0  trilinos@16.1.0

-- linux-ubuntu22.04-x86_64_v3 / %c,cxx=gcc@11.4.0 --------------
berkeley-db@18.1.40  gettext@0.23.1	    lz4@1.10.0		  python@3.11.14
bison@3.8.2	     glib@2.86.1	    m4@1.4.20		  re2c@3.1
cmake@3.31.9	     glib-bootstrap@2.86.1  ncurses@6.5-20250705  texinfo@7.2
curl@8.15.0	     gmp@6.3.0		    nghttp2@1.48.0	  zlib-ng@2.0.7
elfutils@0.193	     hwloc@2.12.2	    ninja@1.13.0	  zstd@1.5.7
expat@2.7.3	     krb5@1.21.3	    openssh@9.9p1
flex@2.6.3	     libffi@3.5.2	    openssl@3.6.0

-- linux-ubuntu22.04-x86_64_v3 / %c,fortran=gcc@11.4.0 ----------
libyogrt@1.35

-- linux-ubuntu22.04-x86_64_v3 / %c=gcc@11.4.0 ------------------
automake@1.16.5		      libedit@3.1-20240808  libxml2@2.13.5  pmix@6.0.0
bzip2@1.0.8		      libevent@2.1.12	    lwgrp@1.0.6	    prrte@4.0.0
diffutils@3.12		      libgcrypt@1.11.2	    mbedtls@2.28.9  readline@8.3
dtcmp@1.1.5		      libgpg-error@1.55	    mpfr@4.2.1	    slurm@25-05-1-1
findutils@4.10.0	      libiconv@1.18	    munge@0.5.15    sqlite@3.50.4
gawk@5.3.1		      libmd@1.1.0	    numactl@2.0.18  tar@1.35
gdbm@1.25		      libpciaccess@0.17	    pcre2@10.44	    util-linux-uuid@2.41
gmake@4.4.1		      libsigsegv@2.14	    pdsh@2.31	    xz@5.6.3
gobject-introspection@1.86.0  libssh2@1.11.1	    perl@5.42.0
json-c@0.18		      libtool@2.4.7	    pigz@2.8
libbsd@0.12.2		      libxcrypt@4.4.38	    pkgconf@2.5.1

-- linux-ubuntu22.04-x86_64_v3 / %cxx=gcc@11.4.0 ----------------
kokkos@4.5.01  kokkos-kernels@4.5.01

-- linux-ubuntu22.04-x86_64_v3 / no compilers -------------------
autoconf@2.72			    gcc-runtime@11.4.0	  py-wheel@0.45.1
autoconf-archive@2023.02.20	    glibc@2.35		  python-venv@1.0
ca-certificates-mozilla@2025-08-12  meson@1.8.5		  util-macros@1.20.1
compiler-wrapper@1.0		    py-pip@25.1.1
gcc@11.4.0			    py-setuptools@80.9.0
==> 87 installed packages
==> 0 concretized packages to be installed (show with `spack find -c`)
$ spack concretize
==> No new specs to concretize.
==> Updating view at /home/spack/spack/var/spack/environments/myproject2/.spack-env/view
$ spack find
==> In environment myproject2
==> 1 root specs
-- no arch / no compilers ---------------------------------------
[+] scr

-- linux-ubuntu22.04-x86_64_v3 / %c,cxx,fortran=gcc@11.4.0 ------
openmpi@5.0.8  scr@2.0.0

-- linux-ubuntu22.04-x86_64_v3 / %c,cxx=gcc@11.4.0 --------------
berkeley-db@18.1.40  gettext@0.23.1	    lz4@1.10.0		  python@3.11.14
bison@3.8.2	     glib@2.86.1	    m4@1.4.20		  re2c@3.1
cmake@3.31.9	     glib-bootstrap@2.86.1  ncurses@6.5-20250705  texinfo@7.2
curl@8.15.0	     gmp@6.3.0		    nghttp2@1.48.0	  zlib-ng@2.0.7
elfutils@0.193	     hwloc@2.12.2	    ninja@1.13.0	  zstd@1.5.7
expat@2.7.3	     krb5@1.21.3	    openssh@9.9p1
flex@2.6.3	     libffi@3.5.2	    openssl@3.6.0

-- linux-ubuntu22.04-x86_64_v3 / %c,fortran=gcc@11.4.0 ----------
libyogrt@1.35

-- linux-ubuntu22.04-x86_64_v3 / %c=gcc@11.4.0 ------------------
automake@1.16.5		      libedit@3.1-20240808  libxml2@2.13.5  pmix@6.0.0
bzip2@1.0.8		      libevent@2.1.12	    lwgrp@1.0.6	    prrte@4.0.0
diffutils@3.12		      libgcrypt@1.11.2	    mbedtls@2.28.9  readline@8.3
dtcmp@1.1.5		      libgpg-error@1.55	    mpfr@4.2.1	    slurm@25-05-1-1
findutils@4.10.0	      libiconv@1.18	    munge@0.5.15    sqlite@3.50.4
gawk@5.3.1		      libmd@1.1.0	    numactl@2.0.18  tar@1.35
gdbm@1.25		      libpciaccess@0.17	    pcre2@10.44	    util-linux-uuid@2.41
gmake@4.4.1		      libsigsegv@2.14	    pdsh@2.31	    xz@5.6.3
gobject-introspection@1.86.0  libssh2@1.11.1	    perl@5.42.0
json-c@0.18		      libtool@2.4.7	    pigz@2.8
libbsd@0.12.2		      libxcrypt@4.4.38	    pkgconf@2.5.1

-- linux-ubuntu22.04-x86_64_v3 / no compilers -------------------
autoconf@2.72			    gcc-runtime@11.4.0	  py-wheel@0.45.1
autoconf-archive@2023.02.20	    glibc@2.35		  python-venv@1.0
ca-certificates-mozilla@2025-08-12  meson@1.8.5		  util-macros@1.20.1
compiler-wrapper@1.0		    py-pip@25.1.1
gcc@11.4.0			    py-setuptools@80.9.0
==> 83 installed packages
==> 0 concretized packages to be installed (show with `spack find -c`)

After running spack remove we’ll see that trilinos is no longer a root but is still present in the installed specs. Reconcretizing the environment, we’ll see the vestigial trilinos and its dependencies will be pruned and will no longer be listed in the environment at all.

We know trilinos is still needed for the myproject environment, so let’s switch back to that environment to confirm that it is still installed.

$ spack env activate myproject
$ spack find
==> In environment myproject
==> 2 root specs
-- no arch / no compilers ---------------------------------------
[+] tcl	 [+] trilinos

-- linux-ubuntu22.04-x86_64_v3 / %c,cxx,fortran=gcc@11.4.0 ------
openblas@0.3.30	 openmpi@5.0.8	trilinos@16.1.0

-- linux-ubuntu22.04-x86_64_v3 / %c,cxx=gcc@11.4.0 --------------
berkeley-db@18.1.40  flex@2.6.3	     m4@1.4.20		   openssl@3.6.0
bison@3.8.2	     gettext@0.23.1  ncurses@6.5-20250705  tcl@8.6.17
cmake@3.31.9	     hwloc@2.12.2    nghttp2@1.48.0	   zlib-ng@2.0.7
curl@8.15.0	     krb5@1.21.3     openssh@9.9p1	   zstd@1.5.7

-- linux-ubuntu22.04-x86_64_v3 / %c=gcc@11.4.0 ------------------
automake@1.16.5	  gmake@4.4.1		libsigsegv@2.14	  mbedtls@2.28.9  pmix@6.0.0
bzip2@1.0.8	  libedit@3.1-20240808	libssh2@1.11.1	  numactl@2.0.18  prrte@4.0.0
diffutils@3.12	  libevent@2.1.12	libtool@2.4.7	  perl@5.42.0	  readline@8.3
findutils@4.10.0  libiconv@1.18		libxcrypt@4.4.38  pigz@2.8	  tar@1.35
gdbm@1.25	  libpciaccess@0.17	libxml2@2.13.5	  pkgconf@2.5.1	  xz@5.6.3

-- linux-ubuntu22.04-x86_64_v3 / %cxx=gcc@11.4.0 ----------------
kokkos@4.5.01  kokkos-kernels@4.5.01

-- linux-ubuntu22.04-x86_64_v3 / no compilers -------------------
autoconf@2.72			    gcc@11.4.0		util-macros@1.20.1
ca-certificates-mozilla@2025-08-12  gcc-runtime@11.4.0
compiler-wrapper@1.0		    glibc@2.35
==> 53 installed packages
==> 0 concretized packages to be installed (show with `spack find -c`)

Phew! We can see that myproject still has trilinos as a root spec.

Note

You can also uninstall a package and remove it from the environment in one go with spack uninstall --remove trilinos.

The spack.yaml file

An environment is more than just a list of root specs — it includes configuration settings that control how Spack behaves when the environment it activated. So far, myproject relies on configuration defaults, but these can be overridden to customize our environment’s behavior.

In this section, we’ll learn how to enforce that all the packages in our environment depending on mpi build with mpich by modifying our configuration.

We can customize the selection of the mpi provider using concretization preferences to change the behavior of the concretizer.

Let’s start by examining our environment’s configuration using spack config edit:

$ EDITOR=cat spack config edit
# This is a Spack Environment file.
#
# It describes a set of packages to be installed, along with
# configuration settings.
spack:
  # add package specs to the `specs` list
  specs:
  - tcl
  - trilinos
  view: true
  concretizer:
    unify: true

The output shows the special spack.yaml configuration file that Spack uses to store environment configurations.

There are several important parts of this file:

  • specs: The list of package specs to install in the environment.

  • view: Controls whether the environment generates a view (the directory tree with symlinks to installed packages we discussed earlier).

  • concretizer:unify: Determines how package specs in the environment are concretized together to reduce duplicated dependencies when possible.

The specs list should look familiar — these are the package specs we’ve been modifying previously with spack add and spack install.

The concretizer:unify:true setting controls how Spack resolves dependencies across packages specs in an environment:

  • true (default): specs are concretized together, ensuring there is only one version of each package in the environment.

  • false: specs are concretized independently from each other, potentially allowing multiple versions of the package to appear in the environment twice.

  • when_possible: A middle ground — Spack attempts to unify dependencies as possible but will backoff to allow duplicates when root specs require incompatible versions of dependencies.

Editing environment configuration

Note

Before proceeding, make sure your EDITOR environment variable is set to the path of your preferred text editor.

Let’s edit spack.yaml to require mpich as our mpi provider using spack config edit.

You should now have the above file open in your editor. Change it to include the packages:mpi:require entry below:

# This is a Spack Environment file.
#
# It describes a set of packages to be installed, along with
# configuration settings.
spack:
  packages:
    mpi:
      require: [mpich]

  # add package specs to the `specs` list
  specs:
  - tcl
  - trilinos

Note

We introduce this here to show you how environment configuration can affect concretization. Configuration options are covered in much more detail in the configuration tutorial.

We’ve only scratched the surface here by requiring a specific mpi provider for packages depending on mpi. There are many other customizations you can make to an environment. Refer to the links at the end of this section for more information.

Re-concretizing the environment

You may need to re-install packages in the environment after making significant changes to the configuration, such as changing virtual providers. This can be accomplished by forcing Spack to re-concretize the environment and re-install the specs.

For example, the packages installed in our myproject environment are now out of sync with our new configuration since we already installed part of the environment with openmpi. Suppose we want to install everything in myproject with mpich.

Let’s run spack concretize --force (or -f in short) to make Spack re-concretize all the environment’s specs:

$ spack concretize --force
==> Concretized 2 specs:
[+]  tsq4fjj  tcl@8.6.17 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  ntccuj2	  ^compiler-wrapper@1.0 build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3
[e]  ml7cem5	  ^gcc@11.4.0~binutils+bootstrap~graphite~nvptx~piclibs~profiled~strip build_system=autotools build_type=RelWithDebInfo languages:='c,c++,fortran' platform=linux os=ubuntu22.04 target=x86_64_v3
[+]  nokfxva	  ^gcc-runtime@11.4.0 build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3
[e]  qg7qyaz	  ^glibc@2.35 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3
[+]  4obn7cg	  ^gmake@4.4.1~guile build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  zk6kesh	  ^zlib-ng@2.2.4+compat+new_strategies+opt+pic+shared build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  k3ozjlu  trilinos@16.1.0~adelus~adios2+amesos+amesos2+anasazi+aztec~basker+belos~boost~chaco~complex~cuda~cuda_constexpr~cuda_rdc~debug~dtk+epetra+epetraext~epetraextbtf~epetraextexperimental~epetraextgraphreorderings~exodus+explicit_template_instantiation~float+fortran~gtest+hdf5~hypre+ifpack+ifpack2~intrepid~intrepid2~ipo~isorropia+kokkos~mesquite~minitensor+ml+mpi+muelu~mumps~nox~openmp~pamgen~panzer~phalanx~piro~python~rocm~rocm_rdc~rol~rythmos+sacado~scorec~shards+shared~shylu~stk~stokhos~stratimikos~strumpack~suite-sparse~superlu-dist~teko~tempus~test~thyra+tpetra~trilinoscouplings~wrapper~x11~zoltan~zoltan2 build_system=cmake build_type=Release cxxstd=17 generator=make gotype=long_long platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx,fortran=gcc@11.4.0
[+]  dmmnd4u	  ^cmake@3.31.9~doc+ncurses+ownlibs~qtgui build_system=generic build_type=Release platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  jtps3jq	      ^curl@8.15.0~gssapi~ldap~libidn2~librtmp~libssh~libssh2+nghttp2 build_system=autotools libs:=shared,static tls:=openssl platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  ft5kpbd		  ^nghttp2@1.48.0 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  cih4xrz		      ^diffutils@3.12 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  oa4vrqq		  ^openssl@3.6.0~docs+shared build_system=generic certs=mozilla platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  etqlnw5		      ^ca-certificates-mozilla@2025-08-12 build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3
[+]  cvuukni		  ^perl@5.42.0+cpanm+opcode+open+shared+threads build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  vdgigsw		      ^berkeley-db@18.1.40+cxx~docs+stl build_system=autotools patches:=26090f4,b231fcc platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  x7t4naj		      ^bzip2@1.0.8~debug~pic+shared build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  aq7qwy6		      ^gdbm@1.25 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  ncdxq3j	      ^ncurses@6.5-20250705~symlinks+termlib abi=none build_system=autotools patches:=7a351bc platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  gdk3ghc	  ^hdf5@1.14.6~cxx~fortran+hl~ipo~java~map+mpi+shared~subfiling~szip~threadsafe+tools api=default build_system=cmake build_type=Release generator=make platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  f4qiprw	      ^pkgconf@2.5.1 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  pmdeyoy	  ^hwloc@2.12.2~cairo~cuda~gl~level_zero~libudev+libxml2~nvml~opencl+pci~rocm build_system=autotools libs:=shared,static platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  txbwcin	      ^libpciaccess@0.17 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  hwxnwvm		  ^util-macros@1.20.1 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3
[+]  lguldtj	      ^libxml2@2.13.5~http+pic~python+shared build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  qtepnkr		  ^libiconv@1.18 build_system=autotools libs:=shared,static platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  yzaocbs		  ^xz@5.6.3~pic build_system=autotools libs:=shared,static platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  k2pkvic	  ^kokkos@4.5.01~aggressive_vectorization~cmake_lang~compiler_warnings~complex_align~cuda~debug~debug_bounds_check~debug_dualview_modify_check~deprecated_code~examples~hip_relocatable_device_code~hpx~hpx_async_dispatch~hwloc~ipo~memkind~numactl~openmp~openmptarget+pic~rocm+serial+shared~sycl~tests~threads~tuning~wrapper build_system=cmake build_type=Release cxxstd=17 generator=make intel_gpu_arch=none platform=linux os=ubuntu22.04 target=x86_64_v3 %cxx=gcc@11.4.0
[+]  ivvor7v	      ^cmake@3.31.9~doc+ncurses+ownlibs~qtgui build_system=generic build_type=Release platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  isdtvvd		  ^curl@8.15.0~gssapi~ldap~libidn2~librtmp~libssh+libssh2+nghttp2 build_system=autotools libs:=shared,static tls:=mbedtls,openssl platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  txa2olx		      ^libssh2@1.11.1+shared build_system=autotools crypto=mbedtls platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  bz3ghzh		      ^mbedtls@2.28.9+pic build_system=makefile build_type=Release libs:=shared,static platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  gv7wpik		      ^openssl@3.6.0~docs+shared build_system=generic certs=mozilla platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  62kt5y4		      ^perl@5.42.0+cpanm+opcode+open+shared+threads build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  qlavhjb		  ^zlib-ng@2.0.7 cflags=-O3 +compat+new_strategies+opt+pic+shared build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  qknxuyj	  ^kokkos-kernels@4.5.01~blas~cblas~cublas~cuda~cusolver~cusparse~execspace_cuda~execspace_openmp~execspace_serial~execspace_threads~ipo~lapack~lapacke~memspace_cudaspace~memspace_cudauvmspace~mkl~openmp~rocblas~rocsolver~rocsparse~serial+shared~superlu~threads build_system=cmake build_type=Release generator=make layouts=left offsets:=int,size_t ordinals:=int scalars:=double platform=linux os=ubuntu22.04 target=x86_64_v3 %cxx=gcc@11.4.0
[+]  amwozyi	  ^mpich@4.3.2~argobots~cuda+fortran+hwloc+hydra~level_zero+libxml2+pci~rocm+romio~slurm~vci~verbs+wrapperrpath~xpmem build_system=autotools datatype-engine=auto device=ch4 netmod=ofi pmi=default platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx,fortran=gcc@11.4.0
[+]  irvryts	      ^findutils@4.10.0 build_system=autotools patches:=440b954 platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  cakgj4n		  ^gettext@0.23.1+bzip2+curses+git~libunistring+libxml2+pic+shared+tar+xz build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  5trxrsw		      ^libxml2@2.13.5~http+pic~python+shared build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  lfgvgva		      ^tar@1.35 build_system=autotools zip=pigz platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  kaz756e			  ^pigz@2.8 build_system=makefile platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  n2l4cks	      ^libfabric@2.3.1~cuda~debug~kdreg~level_zero~rocm~uring build_system=autotools fabrics:=sockets,tcp,udp platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  zuutzfx	      ^yaksa@0.4~cuda~level_zero~rocm build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  r3ant5t		  ^autoconf@2.72 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3
[+]  6ib4pvm		  ^automake@1.16.5 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  yt7ajy4		  ^libtool@2.4.7 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  lxvpwti		  ^m4@1.4.20+sigsegv build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  bs5ujst		      ^libsigsegv@2.14 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  pazbuxs		  ^python@3.14.0+bz2+ctypes+dbm~debug+libxml2+lzma~optimizations+pic+pyexpat+pythoncmd+readline+shared+sqlite3+ssl~tkinter+uuid+zlib+zstd build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  7yr5v6w		      ^expat@2.7.3+libbsd build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  ucrhsyw			  ^libbsd@0.12.2 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  gth3ii5			      ^libmd@1.1.0 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  xxxc56n		      ^gettext@0.23.1+bzip2+curses+git~libunistring+libxml2+pic+shared+tar+xz build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  e3ajmyq			  ^tar@1.35 build_system=autotools zip=pigz platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  zjrnsfo			      ^pigz@2.8 build_system=makefile platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  zgro4tw		      ^libffi@3.5.2 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  c6d2zlj		      ^readline@8.3 build_system=autotools patches:=21f0a03 platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  a4zeurp		      ^sqlite@3.50.4+column_metadata+fts+rtree build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  n45otd3		      ^util-linux-uuid@2.41 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  foiizhd		      ^zstd@1.5.7+programs build_system=makefile compression:=none libs:=shared,static platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  qz3ay7b	  ^openblas@0.3.30~bignuma~consistent_fpcsr+dynamic_dispatch+fortran+ilp64+locking+pic+shared build_system=makefile symbol_suffix=64_ threads=openmp platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx,fortran=gcc@11.4.0

==> Updating view at /home/spack/spack/var/spack/environments/myproject/.spack-env/view

All the specs are now concrete and ready to be installed with mpich as the MPI implementation.

Creating an environment incrementally

We can also add and install specs to an environment incrementally. For example:

$ spack install --add python
$ spack install --add py-numpy@1.20

If we create environments incrementally, Spack ensures that already installed roots are not re-concretized. So, adding specs to an environment at a later point in time will not cause existing packages to rebuild.

Adding and installing specs incrementally leads to greedy concretization, meaning that the environment may have different package versions compared to an environment created all at once.

When you first install python in an environment, Spack will pick a recent version.

$ spack env activate --temp
==> Created and activated temporary environment in /tmp/spack-vsjhw26x
$ spack install --add python
==> Concretized 1 spec
[+]  pazbuxs  python@3.14.0+bz2+ctypes+dbm~debug+libxml2+lzma~optimizations+pic+pyexpat+pythoncmd+readline+shared+sqlite3+ssl~tkinter+uuid+zlib+zstd build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  x7t4naj	  ^bzip2@1.0.8~debug~pic+shared build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  cih4xrz	      ^diffutils@3.12 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  ntccuj2	  ^compiler-wrapper@1.0 build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3
[+]  7yr5v6w	  ^expat@2.7.3+libbsd build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  ucrhsyw	      ^libbsd@0.12.2 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  gth3ii5		  ^libmd@1.1.0 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[e]  ml7cem5	  ^gcc@11.4.0~binutils+bootstrap~graphite~nvptx~piclibs~profiled~strip build_system=autotools build_type=RelWithDebInfo languages:='c,c++,fortran' platform=linux os=ubuntu22.04 target=x86_64_v3
[+]  nokfxva	  ^gcc-runtime@11.4.0 build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3
[+]  aq7qwy6	  ^gdbm@1.25 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  xxxc56n	  ^gettext@0.23.1+bzip2+curses+git~libunistring+libxml2+pic+shared+tar+xz build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  qtepnkr	      ^libiconv@1.18 build_system=autotools libs:=shared,static platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  lguldtj	      ^libxml2@2.13.5~http+pic~python+shared build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  e3ajmyq	      ^tar@1.35 build_system=autotools zip=pigz platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  zjrnsfo		  ^pigz@2.8 build_system=makefile platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[e]  qg7qyaz	  ^glibc@2.35 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3
[+]  4obn7cg	  ^gmake@4.4.1~guile build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  zgro4tw	  ^libffi@3.5.2 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  ncdxq3j	  ^ncurses@6.5-20250705~symlinks+termlib abi=none build_system=autotools patches:=7a351bc platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  oa4vrqq	  ^openssl@3.6.0~docs+shared build_system=generic certs=mozilla platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  etqlnw5	      ^ca-certificates-mozilla@2025-08-12 build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3
[+]  cvuukni	      ^perl@5.42.0+cpanm+opcode+open+shared+threads build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  vdgigsw		  ^berkeley-db@18.1.40+cxx~docs+stl build_system=autotools patches:=26090f4,b231fcc platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  f4qiprw	  ^pkgconf@2.5.1 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  c6d2zlj	  ^readline@8.3 build_system=autotools patches:=21f0a03 platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  a4zeurp	  ^sqlite@3.50.4+column_metadata+fts+rtree build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  n45otd3	  ^util-linux-uuid@2.41 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  yzaocbs	  ^xz@5.6.3~pic build_system=autotools libs:=shared,static platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  zk6kesh	  ^zlib-ng@2.2.4+compat+new_strategies+opt+pic+shared build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  foiizhd	  ^zstd@1.5.7+programs build_system=makefile compression:=none libs:=shared,static platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0

[+] /usr (external glibc-2.35-qg7qyazcn2fwrck5vgr3mxq3i4uxkhlo)
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/gcc-runtime-11.4.0-nokfxvaa4aklxfhoymvz6hlvbqw3kwnh
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/ncurses-6.5-20250705-ncdxq3juvboefpavgmovg5rb5bx76ohz
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/libmd-1.1.0-gth3ii5boey5akbsen5la4rgqpeaqkmx
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/zstd-1.5.7-foiizhdg2mc4jdjtuddksbzvr64roxea
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/xz-5.6.3-yzaocbs7geczi5d7qyvmqwrxi4r7dvph
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/bzip2-1.0.8-x7t4najic2jb46srjiebkrf55utda3nl
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/libiconv-1.18-qtepnkrdvqazp3jmfnheapckbemejrhq
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/libffi-3.5.2-zgro4twqg3qnq6hx6ohsjlejatth3rxa
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/zlib-ng-2.2.4-zk6keshnphcta4rwsmvvexg5e25uqnbd
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/util-linux-uuid-2.41-n45otd3wy4fv7iawv52hiogfs63hxfpz
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/readline-8.3-c6d2zljdklrjdya4xy236brmpdonc2xo
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/libbsd-0.12.2-ucrhsywwalxwcqigisozcu2xvvhx3zwx
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/pigz-2.8-zjrnsfoh55fgq4mulondeam2eqf3pd2f
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/openssl-3.6.0-oa4vrqqj43a7pvuq7pyjgnnd3tesfmwk
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/libxml2-2.13.5-lguldtjks3wogzgqmuuoen2om3tywxr6
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/gdbm-1.25-aq7qwy6yezwhtwdrsyqen65rmjmlth27
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/sqlite-3.50.4-a4zeurpolt7jzq5322xemecmfmtlhk7d
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/expat-2.7.3-7yr5v6w2xu5f4bohfxjcsnb2snnwwj5m
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/tar-1.35-e3ajmyqkyiuwvvht2psujrfw5loh4our
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/gettext-0.23.1-xxxc56npfdu7iblnylvrzbetpjm3kr2n
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/python-3.14.0-pazbuxsobovm6zqkhuwf3nv3sopvo52q
==> Updating view at /tmp/spack-dsf2z9ol/.spack-env/view

If you then add py-numpy, it may be in conflict with the python version already installed, and fail to concretize.

Warning

There is a known bug in Spack that causes this set of specs to take over an hour to concretize, so there is no need to run it for this tutorial.

$ spack install --add py-numpy@1.20 2>&1 | tail -n1
internal_error("version weights must exist and be unique"). Couldn't concretize without changing the existing environment. If you are ok with changing it, try `spack concretize --force`. You could consider setting `concretizer:unify` to `when_possible` or `false` to allow multiple versions of some packages.

The solution is to re-concretize the environment as a whole, which causes python to downgrade to a version compatible with py-numpy:

$ spack add py-numpy@1.20
==> Adding py-numpy@1.20 to environment /tmp/spack-dsf2z9ol
$ spack concretize -f
==> Warning: using "python@3.9.25" which is a deprecated version
==> Concretized 2 specs:
 -   wuu3ogl  py-numpy@1.20.3 build_system=python_pip patches:=802970a,873745d platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@12.3.0
[+]  ntccuj2	  ^compiler-wrapper@1.0 build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3
 -   fmnvqo4	  ^gcc@12.3.0~binutils+bootstrap~graphite~mold~nvptx~piclibs~profiled~strip build_system=autotools build_type=RelWithDebInfo languages:='c,c++,fortran' platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  cih4xrz	      ^diffutils@3.12 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  irhvzch	      ^gawk@5.3.1~nls build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  bs5ujst		  ^libsigsegv@2.14 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[e]  ml7cem5	      ^gcc@11.4.0~binutils+bootstrap~graphite~nvptx~piclibs~profiled~strip build_system=autotools build_type=RelWithDebInfo languages:='c,c++,fortran' platform=linux os=ubuntu22.04 target=x86_64_v3
[+]  nokfxva	      ^gcc-runtime@11.4.0 build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3
[+]  mj4re3l	      ^gmp@6.3.0+cxx build_system=autotools libs:=shared,static platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  fgsf5ij		  ^autoconf@2.72 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3
[+]  pzmnwzm		  ^automake@1.16.5 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  lxvpwti		  ^m4@1.4.20+sigsegv build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  yt7ajy4	      ^libtool@2.4.7 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  irvryts		  ^findutils@4.10.0 build_system=autotools patches:=440b954 platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  sczvrku	      ^mpc@1.3.1 build_system=autotools libs:=shared,static platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  m3nwalt	      ^mpfr@4.2.1 build_system=autotools libs:=shared,static patches:=3ec29a6 platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  7p7gq7u		  ^autoconf-archive@2023.02.20 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3
[+]  62kt5y4	      ^perl@5.42.0+cpanm+opcode+open+shared+threads build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  vdgigsw		  ^berkeley-db@18.1.40+cxx~docs+stl build_system=autotools patches:=26090f4,b231fcc platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  k6ygirs	      ^texinfo@7.2~xs build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  cakgj4n		  ^gettext@0.23.1+bzip2+curses+git~libunistring+libxml2+pic+shared+tar+xz build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  5trxrsw		      ^libxml2@2.13.5~http+pic~python+shared build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  lfgvgva		      ^tar@1.35 build_system=autotools zip=pigz platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  kaz756e			  ^pigz@2.8 build_system=makefile platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  qlavhjb	      ^zlib-ng@2.0.7 cflags=-O3 +compat+new_strategies+opt+pic+shared build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  foiizhd	      ^zstd@1.5.7+programs build_system=makefile compression:=none libs:=shared,static platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
 -   pgwnyw7	  ^gcc-runtime@12.3.0 build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3
[e]  qg7qyaz	  ^glibc@2.35 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3
 -   dwjd7g2	  ^openblas@0.3.30~bignuma~consistent_fpcsr+dynamic_dispatch+fortran~ilp64+locking+pic+shared build_system=makefile symbol_suffix=none threads=openmp platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx,fortran=gcc@12.3.0
 -   4k6fijm	  ^py-cython@0.29.36 build_system=python_pip patches:=c4369ad platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@12.3.0
 -   ufk4qie	  ^py-pip@24.3.1 build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3
 -   i4ej36w	  ^py-setuptools@59.4.0 build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3
 -   tp6u25o	  ^py-wheel@0.45.1 build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3
 -   bcwlh3a	  ^python-venv@1.0 build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3
 -   xjle6fq  python@3.9.25+bz2+crypt+ctypes+dbm~debug+libxml2+lzma~optimizations+pic+pyexpat+pythoncmd+readline+shared+sqlite3+ssl~tkinter+uuid+zlib build_system=generic patches:=0d98e93,4c24573,ebdca64,f2fd060 platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@12.3.0
[+]  x7t4naj	  ^bzip2@1.0.8~debug~pic+shared build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  7yr5v6w	  ^expat@2.7.3+libbsd build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  ucrhsyw	      ^libbsd@0.12.2 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  gth3ii5		  ^libmd@1.1.0 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  aq7qwy6	  ^gdbm@1.25 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  xxxc56n	  ^gettext@0.23.1+bzip2+curses+git~libunistring+libxml2+pic+shared+tar+xz build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  qtepnkr	      ^libiconv@1.18 build_system=autotools libs:=shared,static platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  lguldtj	      ^libxml2@2.13.5~http+pic~python+shared build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  e3ajmyq	      ^tar@1.35 build_system=autotools zip=pigz platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  zjrnsfo		  ^pigz@2.8 build_system=makefile platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  4obn7cg	  ^gmake@4.4.1~guile build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
 -   s56v4gf	  ^libffi@3.5.2 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@12.3.0
[+]  yiij42p	  ^libxcrypt@4.4.38~obsolete_api build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  ncdxq3j	  ^ncurses@6.5-20250705~symlinks+termlib abi=none build_system=autotools patches:=7a351bc platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  oa4vrqq	  ^openssl@3.6.0~docs+shared build_system=generic certs=mozilla platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  etqlnw5	      ^ca-certificates-mozilla@2025-08-12 build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3
[+]  cvuukni	      ^perl@5.42.0+cpanm+opcode+open+shared+threads build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  f4qiprw	  ^pkgconf@2.5.1 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  c6d2zlj	  ^readline@8.3 build_system=autotools patches:=21f0a03 platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  a4zeurp	  ^sqlite@3.50.4+column_metadata+fts+rtree build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
 -   b4npzn6	  ^util-linux-uuid@2.41 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@12.3.0
[+]  yzaocbs	  ^xz@5.6.3~pic build_system=autotools libs:=shared,static platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  zk6kesh	  ^zlib-ng@2.2.4+compat+new_strategies+opt+pic+shared build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0

==> Updating view at /tmp/spack-dsf2z9ol/.spack-env/view

Note

There are other advantages to concretizing and installing an environment all at once:

  • If you have a number of specs that can be installed together, adding them first and installing them together enables them to share dependencies and reduces total installation time.

  • You can launch all builds in parallel by taking advantage of Spack’s install-level build parallelism.

Building in environments

Activated environments allow you to invoke any programs installed in them as if they were installed on the system. In this section, we will take advantage of that feature.

Suppose you want to compile some MPI programs. We have an MPI implementation installed in our myproject2 environment, so mpicc is available in our path. We can confirm this using which:

$ spack env activate myproject2
$ spack env status
==> In environment myproject2
$ which mpicc
/home/spack/spack/var/spack/environments/myproject2/.spack-env/view/bin/mpicc

As mentioned before, activating the environment sets a number of environment variables. That includes variables like PATH, MANPATH, and CMAKE_PREFIX_PATH, which allows you to easily find package executables and libraries installed in the environment.

Let’s look specifically at path-related environment variables using env | grep PATH:

$ env | grep PATH=
LD_LIBRARY_PATH=.
GI_TYPELIB_PATH=/home/spack/spack/var/spack/environments/myproject2/.spack-env/view/lib/girepository-1.0:.
PKG_CONFIG_PATH=/home/spack/spack/var/spack/environments/myproject2/.spack-env/view/lib/pkgconfig:/home/spack/spack/var/spack/environments/myproject2/.spack-env/view/lib64/pkgconfig:/usr/share/pkgconfig:/home/spack/spack/var/spack/environments/myproject2/.spack-env/view/share/pkgconfig:.
ACLOCAL_PATH=/home/spack/spack/var/spack/environments/myproject2/.spack-env/view/share/aclocal:.
PATH=/home/spack/spack/var/spack/environments/myproject2/.spack-env/view/bin:/home/spack/spack/bin:/opt/spack/view/bin:/root/spack/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PYTHONPATH=/home/spack/spack/var/spack/environments/myproject2/.spack-env/view/lib/python3.11/site-packages:.
MANPATH=/home/spack/spack/var/spack/environments/myproject2/.spack-env/view/share/man:/home/spack/spack/var/spack/environments/myproject2/.spack-env/view/man:/usr/share/man:.:
CMAKE_PREFIX_PATH=/home/spack/spack/var/spack/environments/myproject2/.spack-env/view:.

We can demonstrate use of these environment settings by building a really simple MPI program.

Let’s create a program called mpi-hello.c that contains the following code:

#include <stdio.h>
#include <mpi.h>
#include <zlib.h>

int main(int argc, char **argv) {
  int rank;
  MPI_Init(&argc, &argv);

  MPI_Comm_rank(MPI_COMM_WORLD, &rank);
  printf("Hello world from rank %d\n", rank);

  if (rank == 0) {
    printf("zlib version: %s\n", ZLIB_VERSION);
        printf("zlib-ng version: %s\n", ZLIBNG_VERSION);
  }

  MPI_Finalize();
}

This program includes headers from mpi and zlib. It also prints out a message from each MPI rank and the version of zlib.

Let’s build and run our program:

$ mpicc ./mpi-hello.c -I$(spack location -i zlib-ng)/include
$ mpirun -n 2 ./a.out
Hello world from rank 0
zlib version: 1.2.11.zlib-ng
zlib-ng version: 2.0.7
Hello world from rank 1

Notice that we only needed to pass the include path to the compiler. We also see that Hello world is output for each of the ranks 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:

$ spack find zlib-ng
==> In environment myproject2
==> 1 root specs
-- no arch / no compilers ---------------------------------------
[+] scr

-- linux-ubuntu22.04-x86_64_v3 / %c,cxx=gcc@11.4.0 --------------
zlib-ng@2.0.7
==> 1 installed package
==> 0 concretized packages to be installed (show with `spack find -c`)

Note that the reported version does match that of our installation.

Reproducing builds

Spack environments provide users with virtual environments similar to Python venv and Conda environments). The goal is to ensure packages in one environment are kept separate from those of another. These environments can be managed by Spack or independent. In either case, their environment files can be used to reproduce builds by other users and on other machines. Since those files are key to reproducing builds, let’s start with them.

Environment files

There are two key files tracking the contents of environments: spack.yaml and spack.lock. The spack.yaml file holds the environment configuration that we previously edited through spack config edit. The spack.lock file is automatically generated during concretization.

The two files represent two fundamental concepts:

  • spack.yaml: abstract specs and configuration to install; and

  • spack.lock: all fully concrete specs.

These files are intended to be used by developers and administrators to manage the environments in a reproducible way. We will cover their reuse later.

Note

Both environment files can be versioned in repositories, shared, and used to install the same set of software by different users and on other machines.

Managed versus independent environments

Environments are either Spack-managed or independent. Both types of environments are defined by their environment files. So far, we have only created managed environments. This section describes their differences.

Managed environments are created using spack env create <name>. They are automatically created in the var/spack/environments subdirectory and can be referenced by their names.

Independent environments can be created in one of two ways. First, the Spack environment file(s) can be placed in any directory (other than var/spack/environments). Alternatively, you can use spack env create -d <directory> to specify the directory (<directory>) in which the files should reside. Independent environments are not named.

Reviewing a managed environment

We created the myproject environment earlier using spack env create myproject so let’s mainly focus on its environment files in this section.

Earlier, when we changed the environment’s configuration using spack config edit, we were actually editing its spack.yaml file. We can move to the directory containing the file using spack cd:

$ spack cd -e myproject
$ pwd
/home/spack/spack/var/spack/environments/myproject
$ ls
spack.lock  spack.yaml

Notice that myproject is a subdirectory of var/spack/environments within the Spack installation making it a managed environment. Consequently, it can be referenced by name. It will also show up when running spack env list:

$ spack env list
==> 2 environments
    myproject  myproject2

which indicates the active environment by highlighting it in green.

We can also see from the listing above that the current environment directory contains both of the environment files: spack.yaml and spack.lock. This is because spack.lock was generated when we concretized the environment.

If we cat the spack.yaml file, we’ll see the same specs and view options previously shown by spack config edit:

$ cat spack.yaml
# This is a Spack Environment file.
#
# It describes a set of packages to be installed, along with
# configuration settings.
spack:
  # add package specs to the `specs` list
  specs:
  - tcl
  - trilinos
  view: true
  concretizer:
    unify: true
  packages:
    mpi:
      require: [mpich]

Creating an independent environment

Environments do not have to be created in or managed by a Spack instance. Rather, their environment files can be placed in any directory. This feature can be quite helpful for use cases such as environment-based software releases and CI/CD.

Let’s create an independent environment from scratch for a simple project:

$ cd
$ mkdir code
$ cd code
$ spack env create -d .
==> Created independent environment in: /home/spack/code
==> Activate with: spack env activate .

Notice that the command shows Spack created the environment, updated the view, and printed the command needed to activate it. As we can see in the activation command, since the environment is independent, it must be referenced by its directory path.

Let’s see what really happened with this command by listing the directory contents and looking at the configuration file:

$ ls
spack.yaml
$ cat spack.yaml
# This is a Spack Environment file.
#
# It describes a set of packages to be installed, along with
# configuration settings.
spack:
  # add package specs to the `specs` list
  specs: []
  view: true
  concretizer:
    unify: true

Notice that Spack created a spack.yaml file in the code directory. Also note that the configuration file has an empty spec list (i.e., []). That list is intended to contain only the root specs of the environment.

We can confirm that it is not a managed environment by running spack env list:

$ spack env list
==> 2 environments
    myproject  myproject2

and noting that the path does not appear in the output.

Now let’s add some specs to the environment. Suppose your project depends on trilinos and openmpi. Add these packages to the spec list using your favorite text editor. The dash syntax for a YAML list is used in our example. Your package should now contain the following entries:

# This is a Spack Environment file.
#
# It describes a set of packages to be installed, along with
# configuration settings.
spack:
  # add package specs to the `specs` list
  specs:
  - trilinos
  - openmpi
  view: true
  concretizer:
    unify: true

Now activate the environment and install the packages:

$ spack env activate .
$ spack install
==> Concretized 2 specs
[+]  tqxbnvo  openmpi@5.0.8+atomics~cuda~debug+fortran~gpfs~internal-hwloc~internal-libevent~internal-pmix~ipv6~java~lustre~memchecker~openshmem~rocm~romio+rsh~static~two_level_namespace+vt+wrapper-rpath build_system=autotools fabrics:=none romio-filesystem:=none schedulers:=none platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx,fortran=gcc@11.4.0
[+]  fgsf5ij	  ^autoconf@2.72 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3
[+]  lxvpwti	      ^m4@1.4.20+sigsegv build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  cih4xrz		  ^diffutils@3.12 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  bs5ujst		  ^libsigsegv@2.14 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  pzmnwzm	  ^automake@1.16.5 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  ntccuj2	  ^compiler-wrapper@1.0 build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3
[e]  ml7cem5	  ^gcc@11.4.0~binutils+bootstrap~graphite~nvptx~piclibs~profiled~strip build_system=autotools build_type=RelWithDebInfo languages:='c,c++,fortran' platform=linux os=ubuntu22.04 target=x86_64_v3
[+]  nokfxva	  ^gcc-runtime@11.4.0 build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3
[e]  qg7qyaz	  ^glibc@2.35 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3
[+]  4obn7cg	  ^gmake@4.4.1~guile build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  4hos372	  ^hwloc@2.12.2~cairo~cuda~gl~level_zero~libudev+libxml2~nvml~opencl+pci~rocm build_system=autotools libs:=shared,static platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  txbwcin	      ^libpciaccess@0.17 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  hwxnwvm		  ^util-macros@1.20.1 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3
[+]  5trxrsw	      ^libxml2@2.13.5~http+pic~python+shared build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  qtepnkr		  ^libiconv@1.18 build_system=autotools libs:=shared,static platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  yzaocbs		  ^xz@5.6.3~pic build_system=autotools libs:=shared,static platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  ncdxq3j	      ^ncurses@6.5-20250705~symlinks+termlib abi=none build_system=autotools patches:=7a351bc platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  lprginh	  ^libevent@2.1.12+openssl build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  gv7wpik	      ^openssl@3.6.0~docs+shared build_system=generic certs=mozilla platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  etqlnw5		  ^ca-certificates-mozilla@2025-08-12 build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3
[+]  yt7ajy4	  ^libtool@2.4.7 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  irvryts	      ^findutils@4.10.0 build_system=autotools patches:=440b954 platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  cakgj4n		  ^gettext@0.23.1+bzip2+curses+git~libunistring+libxml2+pic+shared+tar+xz build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  lfgvgva		      ^tar@1.35 build_system=autotools zip=pigz platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  kaz756e			  ^pigz@2.8 build_system=makefile platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  foiizhd			  ^zstd@1.5.7+programs build_system=makefile compression:=none libs:=shared,static platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  yzbm5q6	  ^numactl@2.0.18 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  cxdcxo5	  ^openssh@9.9p1+gssapi build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  hnmy4fw	      ^krb5@1.21.3+shared build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  n7yzkyl		  ^bison@3.8.2~color build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  hdzcfgi	      ^libedit@3.1-20240808 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  yiij42p	      ^libxcrypt@4.4.38~obsolete_api build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  62kt5y4	  ^perl@5.42.0+cpanm+opcode+open+shared+threads build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  vdgigsw	      ^berkeley-db@18.1.40+cxx~docs+stl build_system=autotools patches:=26090f4,b231fcc platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  x7t4naj	      ^bzip2@1.0.8~debug~pic+shared build_system=generic platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  aq7qwy6	      ^gdbm@1.25 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  c6d2zlj		  ^readline@8.3 build_system=autotools patches:=21f0a03 platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  f4qiprw	  ^pkgconf@2.5.1 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  yqlblh6	  ^pmix@6.0.0~munge~python build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  buin62m	  ^prrte@4.0.0 build_system=autotools schedulers:=none platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  gmhq65u	      ^flex@2.6.3+lex~nls build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  qlavhjb	  ^zlib-ng@2.0.7 cflags=-O3 +compat+new_strategies+opt+pic+shared build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  tj433ut  trilinos@16.1.0~adelus~adios2+amesos+amesos2+anasazi+aztec~basker+belos~boost~chaco~complex~cuda~cuda_constexpr~cuda_rdc~debug~dtk+epetra+epetraext~epetraextbtf~epetraextexperimental~epetraextgraphreorderings~exodus+explicit_template_instantiation~float+fortran~gtest~hdf5~hypre+ifpack+ifpack2~intrepid~intrepid2~ipo~isorropia+kokkos~mesquite~minitensor+ml+mpi+muelu~mumps~nox~openmp~pamgen~panzer~phalanx~piro~python~rocm~rocm_rdc~rol~rythmos+sacado~scorec~shards+shared~shylu~stk~stokhos~stratimikos~strumpack~suite-sparse~superlu-dist~teko~tempus~test~thyra+tpetra~trilinoscouplings~wrapper~x11~zoltan~zoltan2 build_system=cmake build_type=Release cxxstd=17 generator=make gotype=long_long platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx,fortran=gcc@11.4.0
[+]  ivvor7v	  ^cmake@3.31.9~doc+ncurses+ownlibs~qtgui build_system=generic build_type=Release platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  isdtvvd	      ^curl@8.15.0~gssapi~ldap~libidn2~librtmp~libssh+libssh2+nghttp2 build_system=autotools libs:=shared,static tls:=mbedtls,openssl platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  txa2olx		  ^libssh2@1.11.1+shared build_system=autotools crypto=mbedtls platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  bz3ghzh		  ^mbedtls@2.28.9+pic build_system=makefile build_type=Release libs:=shared,static platform=linux os=ubuntu22.04 target=x86_64_v3 %c=gcc@11.4.0
[+]  ft5kpbd		  ^nghttp2@1.48.0 build_system=autotools platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx=gcc@11.4.0
[+]  k2pkvic	  ^kokkos@4.5.01~aggressive_vectorization~cmake_lang~compiler_warnings~complex_align~cuda~debug~debug_bounds_check~debug_dualview_modify_check~deprecated_code~examples~hip_relocatable_device_code~hpx~hpx_async_dispatch~hwloc~ipo~memkind~numactl~openmp~openmptarget+pic~rocm+serial+shared~sycl~tests~threads~tuning~wrapper build_system=cmake build_type=Release cxxstd=17 generator=make intel_gpu_arch=none platform=linux os=ubuntu22.04 target=x86_64_v3 %cxx=gcc@11.4.0
[+]  qknxuyj	  ^kokkos-kernels@4.5.01~blas~cblas~cublas~cuda~cusolver~cusparse~execspace_cuda~execspace_openmp~execspace_serial~execspace_threads~ipo~lapack~lapacke~memspace_cudaspace~memspace_cudauvmspace~mkl~openmp~rocblas~rocsolver~rocsparse~serial+shared~superlu~threads build_system=cmake build_type=Release generator=make layouts=left offsets:=int,size_t ordinals:=int scalars:=double platform=linux os=ubuntu22.04 target=x86_64_v3 %cxx=gcc@11.4.0
[+]  qz3ay7b	  ^openblas@0.3.30~bignuma~consistent_fpcsr+dynamic_dispatch+fortran+ilp64+locking+pic+shared build_system=makefile symbol_suffix=64_ threads=openmp platform=linux os=ubuntu22.04 target=x86_64_v3 %c,cxx,fortran=gcc@11.4.0

[+] /usr (external glibc-2.35-qg7qyazcn2fwrck5vgr3mxq3i4uxkhlo)
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/gcc-runtime-11.4.0-nokfxvaa4aklxfhoymvz6hlvbqw3kwnh
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/zlib-ng-2.0.7-qlavhjbsgqyboovfvsultjdwzz5nvthw
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/libiconv-1.18-qtepnkrdvqazp3jmfnheapckbemejrhq
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/kokkos-4.5.01-k2pkvic65lggk6lukma2humh6t2axbo6
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/xz-5.6.3-yzaocbs7geczi5d7qyvmqwrxi4r7dvph
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/bzip2-1.0.8-x7t4najic2jb46srjiebkrf55utda3nl
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/openblas-0.3.30-qz3ay7bveep7fy2v7vcln2zxc5ajfjxt
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/numactl-2.0.18-yzbm5q6nblzcjccy7kddijqdnkgkxvtp
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/zstd-1.5.7-foiizhdg2mc4jdjtuddksbzvr64roxea
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/libxcrypt-4.4.38-yiij42powrfh2mwjebwiqxmkvinutofr
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/ncurses-6.5-20250705-ncdxq3juvboefpavgmovg5rb5bx76ohz
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/libpciaccess-0.17-txbwcin227323qmxmg4opnj4r4tvenz4
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/pigz-2.8-kaz756eya6nj3ardls4b6aiaclkaux7i
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/openssl-3.6.0-gv7wpik32unrnickoxbgm5iqza572w6s
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/kokkos-kernels-4.5.01-qknxuyj5vbyheego7mbhhwqrooi7kght
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/libxml2-2.13.5-5trxrsws5dig3bf63uc4xzcbsywsqtjo
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/libedit-3.1-20240808-hdzcfgipukcqxsw7hjkksstbbz5otx3x
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/tar-1.35-lfgvgvawnpdxxz7prdfn4vsfgtwruxjc
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/libevent-2.1.12-lprginh6npwjirdhmghjqjckaa7ukrri
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/hwloc-2.12.2-4hos3725nynk2bsskofvtcmk6pmtcjg4
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/gettext-0.23.1-cakgj4ntlncc4zsgty5z6sa7f7mwvlt7
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/pmix-6.0.0-yqlblh6p4u6vwmfhtffyrnxyqrliw2jm
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/krb5-1.21.3-hnmy4fwwly5s4xifp5roodj6opppwwiu
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/prrte-4.0.0-buin62mintd2cczzj6vsvai45vhpgg6w
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/openssh-9.9p1-cxdcxo5pdxc2nk7domxigdqiygg4757e
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/openmpi-5.0.8-tqxbnvoiw3nzds4xypcualamx3cvisln
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/trilinos-16.1.0-tj433utqwna4zgloncl5jwlabsqgghcv
==> Updating view at /home/spack/code/.spack-env/view

Notice that Spack concretized the specs before installing them and their dependencies. It also updated the environment’s view. Since we already installed all these packages outside of the environment, their links were simply added to the view.

Updating an installed environment

Spack supports tweaking an environment even after the initial specs are installed. You are free to add and remove specs just as you would outside of the environment using the command line interface as before.

For example, let’s add hdf5 and look at our file:

$ spack add hdf5@5.5.1
==> Adding hdf5@5.5.1 to environment /home/spack/code
$ cat spack.yaml
# This is a Spack Environment file.
#
# It describes a set of packages to be installed, along with
# configuration settings.
spack:
  # add package specs to the `specs` list
  specs:
  - trilinos
  - openmpi
  - hdf5@5.5.1
  view: true
  concretizer:
    unify: true

Notice that spack add added the package to our active environment and it appears in the configuration file’s spec list.

Note

You’ll need to run spack concretize and spack install to install added packages in your environment because spack add only adds it to the configuration and spack install only automatically concretizes the first time an environment is used.

Now use spack remove to remove the spec from the configuration:

$ spack remove hdf5
==> hdf5 has been removed from /home/spack/code/spack.yaml
$ cat spack.yaml
# This is a Spack Environment file.
#
# It describes a set of packages to be installed, along with
# configuration settings.
spack:
  # add package specs to the `specs` list
  specs:
  - trilinos
  - openmpi
  view: true
  concretizer:
    unify: true

and we see that the spec was removed from the spec list of our environment.

Note

You can also edit the spack.yaml file directly instead of using the spack add and spack remove commands.

Reviewing spack.lock

Now let’s turn our attention from the abstract to the concrete.

Our focus so far has been on the abstract environment configuration represented by the spack.yaml file. Once that file is concretized, Spack generates a corresponding spack.lock file representing the full concretized state of the environment.

This file is intended to be a machine-readable representation of the information needed to reproduce the build of an environment. As such, it is written in json, which is less readable than yaml.

Let’s look at the top 30 lines of our current environment:

$ jq < spack.lock | head -30
{
  "_meta": {
    "file-type": "spack-lockfile",
    "lockfile-version": 6,
    "specfile-version": 5
  },
  "spack": {
    "version": "1.1.0",
    "type": "git",
    "commit": "89b3f0baae13477ee5384cd30ebf512489a69890"
  },
  "roots": [
    {
      "hash": "tqxbnvoiw3nzds4xypcualamx3cvisln",
      "spec": "openmpi"
    },
    {
      "hash": "tj433utqwna4zgloncl5jwlabsqgghcv",
      "spec": "trilinos"
    }
  ],
  "concrete_specs": {
    "tqxbnvoiw3nzds4xypcualamx3cvisln": {
      "name": "openmpi",
      "version": "5.0.8",
      "arch": {
	"platform": "linux",
	"platform_os": "ubuntu22.04",
	"target": "x86_64_v3"
      },

While it is still readable, it consists of over 1900 lines of information representing the actual configurations for each of the environment’s packages.

Reproducing an environment

Now that we’ve described the contents of the environment files we can discuss how they can be used to reproduce environments. You may want to do this yourself on a different machine, or use an environment built by someone else. The process is the same in either case.

You can recreate an environment by passing either of the environment files to spack env create. The file you choose depends on whether you want to approximate the build using the abstract specs or an exact build based on the concrete specs.

Using spack.yaml

An approximate build is created using the spack.yaml file. This approach is relevant when we want to build the same specs on a new platform, for example. It allows you to reproduce the environment by preserving the abstract requirements in the file. However, the software may actually build differently in part because the concretizer may choose different dependencies.

Let’s use spack env create to create an abstract environment from the file that we’ll call abstract:

$ spack env create abstract spack.yaml
==> Created environment abstract in: /home/spack/spack/var/spack/environments/abstract
==> Activate with: spack env activate abstract

Here we see that Spack created a managed environment with the name we provided.

And, since it is a newly created environment, it does not have any installed specs yet as we can see from calling spack find after activating the environment:

$ spack env activate abstract
$ spack find
==> In environment abstract
==> 2 root specs
-- no arch / no compilers ---------------------------------------
 -  openmpi   -	 trilinos

==> 0 installed packages
==> 0 concretized packages to be installed (show with `spack find -c`)

Notice that we have the same root specs as were listed in the spack.yaml file.

Using spack.lock

The spack.lock file is used for an exact reproduction of the original build. It can replicate the build because it contains the information for all the decisions made during concretization.

Now let’s create a concrete environment, called concrete, from the file:

$ spack env create concrete spack.lock
==> Created environment concrete in: /home/spack/spack/var/spack/environments/concrete
==> Activate with: spack env activate concrete
==> Updating view at /home/spack/spack/var/spack/environments/concrete/.spack-env/view

Here we see that Spack again created a managed environment with the provided name.

Since we created the environment from our spack.lock file, not only do we get the same root specs, all of the packages are installed in the environment as we can see from calling spack find after activating the environment:

$ spack env activate concrete
$ spack find
==> In environment concrete
==> 2 root specs
-- no arch / no compilers ---------------------------------------
[+] openmpi  [+] trilinos

-- linux-ubuntu22.04-x86_64_v3 / %c,cxx,fortran=gcc@11.4.0 ------
openblas@0.3.30	 openmpi@5.0.8	trilinos@16.1.0

-- linux-ubuntu22.04-x86_64_v3 / %c,cxx=gcc@11.4.0 --------------
berkeley-db@18.1.40  curl@8.15.0     hwloc@2.12.2  ncurses@6.5-20250705	 openssl@3.6.0
bison@3.8.2	     flex@2.6.3	     krb5@1.21.3   nghttp2@1.48.0	 zlib-ng@2.0.7
cmake@3.31.9	     gettext@0.23.1  m4@1.4.20	   openssh@9.9p1	 zstd@1.5.7

-- linux-ubuntu22.04-x86_64_v3 / %c=gcc@11.4.0 ------------------
automake@1.16.5	  gmake@4.4.1		libsigsegv@2.14	  mbedtls@2.28.9  pmix@6.0.0
bzip2@1.0.8	  libedit@3.1-20240808	libssh2@1.11.1	  numactl@2.0.18  prrte@4.0.0
diffutils@3.12	  libevent@2.1.12	libtool@2.4.7	  perl@5.42.0	  readline@8.3
findutils@4.10.0  libiconv@1.18		libxcrypt@4.4.38  pigz@2.8	  tar@1.35
gdbm@1.25	  libpciaccess@0.17	libxml2@2.13.5	  pkgconf@2.5.1	  xz@5.6.3

-- linux-ubuntu22.04-x86_64_v3 / %cxx=gcc@11.4.0 ----------------
kokkos@4.5.01  kokkos-kernels@4.5.01

-- linux-ubuntu22.04-x86_64_v3 / no compilers -------------------
autoconf@2.72			    gcc@11.4.0		util-macros@1.20.1
ca-certificates-mozilla@2025-08-12  gcc-runtime@11.4.0
compiler-wrapper@1.0		    glibc@2.35
==> 52 installed packages
==> 0 concretized packages to be installed (show with `spack find -c`)

Note

Use of spack.lock to reproduce a build (currently) requires you to be on the same type of machine.

Clean-up

The later sections of this tutorial are not designed to be run in whatever environment we happened to be in, so we will despacktivate now to avoid accidentally running in this environment later.

spack env deactivate

Warning

If you do not deactivate the environment, you will get errors in later sections of the tutorial.

More information

This tutorial only scratches the surface of environments and what they can do. For more information, take a look at the Spack resources below.

Setting up and building environments

Using environments

Finding examples of environments