Showing Installed Packages

Showing All Installed Packages

After installing some packages, you may need to show all installed packages. The spack find command is used to query installed packages.

Syntax:

spack find [options]

For example, to show installed packages, you simply type:

spack find

The following output shows two different versions of zlib have been installed; 1.2.8 and 1.2.11.

==> 61 installed packages
-- linux-centos7-x86_64 / gcc@4.8.5 -----------------------------
autoconf@2.69        gdbm@1.18.1      libtool@2.4.6  perl@5.32.0    zlib@1.2.11
automake@1.16.2      gmp@6.1.2        m4@1.4.18      pkgconf@1.7.3
berkeley-db@18.1.40  isl@0.20         mpc@1.1.0      readline@8.0
diffutils@3.7        libiconv@1.16    mpfr@3.1.6     tcl@8.6.10
gcc@9.3.0            libsigsegv@2.12  ncurses@6.2    zlib@1.2.8

-- linux-centos7-x86_64 / gcc@9.3.0 -----------------------------
autoconf@2.69                libiconv@1.16           openblas@0.3.12
...

There are different flags that can be used with spack find command. The the most common ones are listed in the following table.

Flag Description

-f

shows any non-empty compiler flags

-d

shows dependency information of installed packages

-l

shows the hash of each package

-v

shows variants of installed Packages

-p

shows paths to package install directories

-L

shows full dependency hashes as well as versions

-x

shows only specs that were installed explicitly

-X

show only specs that were installed as dependencies

-N

shows fully qualified package names

Examples

To show the hash of each installed package, you simply type:

spack find -l

The following output shows the installed packages along with their hashes. For instance, pkmj6e7 is the hash of the version 1.2.11 of zlib.

==> 61 installed packages
-- linux-centos7-x86_64 / gcc@4.8.5 -----------------------------
w2rk6fp autoconf@2.69        fsuch7d isl@0.20         6uccmsd ncurses@6.2
h5atxgm automake@1.16.2      66scwnb libiconv@1.16    emv5ut4 perl@5.32.0
bwuaqje berkeley-db@18.1.40  lctnabj libsigsegv@2.12  vztwdsa pkgconf@1.7.3
7g5yr5g diffutils@3.7        bcbiddk libtool@2.4.6    ojil344 readline@8.0
vxq35mm gcc@9.3.0            kafywd7 m4@1.4.18        3vbkxar tcl@8.6.10
r7nkjni gdbm@1.18.1          vc2jxrg mpc@1.1.0        ss3zkvn zlib@1.2.8
6bsovvk gmp@6.1.2            ykxb7za mpfr@3.1.6       64vg6e4 zlib@1.2.11

-- linux-centos7-x86_64 / gcc@9.3.0 -----------------------------
w2inowk autoconf@2.69                crs4vhy matio@1.5.17
....
Each installed package has a unique hash. This hash can be used to uninstall packages and check the spec of packages.

To show the dependencies of installed packages, you type:

spack find -d

The output shows that tcl depends on zlib.

...
perl@5.32.0
    berkeley-db@18.1.40
    gdbm@1.18.1
        readline@8.0
            ncurses@6.2

pkgconf@1.7.3

readline@8.0
    ncurses@6.2

tcl@8.6.10
    zlib@1.2.11

...

If you would like to show the non-empty compiler flags of installed packages, you type:

spack find -f

The following output shows that one of the versions of zlib was installed with cflags=-O3.

...
libsigsegv@2.12%gcc               util-macros@1.19.1%gcc
libtool@2.4.6%gcc                 xz@5.2.5%gcc
libxml2@2.9.10%gcc                zlib@1.2.11%gcc
m4@1.4.18%gcc                     zlib@1.2.11%gcc  cppflags="-O3"

To show the variants of installed packages, you type:

spack find -v

The following output shows that the three installed versions of zlib have the variants optimize, pic, and shared. The + symbol means the value for those variants is True.

...
zlib@1.2.8+optimize+pic+shared
zlib@1.2.11+optimize+pic+shared
zlib@1.2.11+optimize+pic+shared

Showing Installed Versions of a Package

If you would like to show the installed versions of a specific package, you can use the command spack find as follows:

spack find [option] <package_name>

For example, to show the installed versions of zlib package only, you type:

spack find zlib

The following output shows that five different specs have been used to install zlib.

==> 5 installed packages
-- linux-centos7-x86_64 / gcc@4.8.5 -----------------------------
zlib@1.2.8  zlib@1.2.11

-- linux-centos7-x86_64 / gcc@9.3.0 -----------------------------
zlib@1.2.8  zlib@1.2.11  zlib@1.2.11
The options explained in the previous section can be used to query installations of a specific package.

For more details go to Spack Documentation.