Some sites may encourage users to set up their own test environments before carrying out central installations, or some users may prefer to set up these environments on their own motivation. To reduce the load of recompiling otherwise identical package specs in different installations, installed packages can be put into build cache tarballs, uploaded to your Spack mirror and then downloaded and installed by others.
Creating build cache files¶
A compressed tarball of an installed package is created. Tarballs are created
for all of its link and run dependency packages as well. Compressed tarballs are
signed with gpg and signature and tarball and put in a
.spack file. Optionally,
the rpaths (and ids and deps on macOS) can be changed to paths relative to
the Spack install tree before the tarball is created.
Build caches are created via:
$ spack buildcache create spec
Finding or installing build cache files¶
To find build caches or install build caches, a Spack mirror must be configured with:
$ spack mirror add <name> <url>
Build caches are found via:
$ spack buildcache list
Build caches are installed via:
$ spack buildcache install
Initial build and later installation do not necessarily happen at the same location. Spack provides a relocation capability and corrects for RPATHs and non-relocatable scripts. However, many packages compile paths into binary artifacts directly. In such cases, the build instructions of this package would need to be adjusted for better re-locatability.
spack buildcache create¶
Create tarball of installed Spack package and all dependencies.
Tarballs are checksummed and signed if gpg2 is available.
Places them in a directory
build_cache that can be copied to a mirror.
spack buildcache install will search Spack mirrors for build_cache to get the list of build caches.
||list of partial specs or hashes with a leading
||directory in which
||the key to sign package with. In the case where multiple keys exist, the package will be unsigned unless
||make paths in binaries relative before creating tarball|
||answer yes to all create unsigned
spack buildcache list¶
Retrieves all specs for build caches available on a Spack mirror.
||list of partial package specs to be matched against specs downloaded for build caches|
spack buildcache list gcc with print only commands to install
spack buildcache install¶
Retrieves all specs for build caches available on a Spack mirror and installs build caches with specs matching the specs input.
||list of partial package specs or hashes with a leading
||remove install directory if it exists before unpacking tarball|
||answer yes to all to don’t verify package with gpg questions|
spack buildcache keys¶
List public keys available on Spack mirror.
||trust the keys downloaded with prompt for each|
||answer yes to all trust all keys downloaded|