|
| 1 | +.. _binary_caches: |
| 2 | + |
| 3 | +Binary caches |
| 4 | +============================ |
| 5 | + |
| 6 | +.. warning:: The feature of binary caches is still experimental |
| 7 | + and chosen conventions still may evolve over time. |
| 8 | + |
| 9 | +Some sites may encourage users to set up their own test environments |
| 10 | +before carrying out central installations, or some users prefer to set |
| 11 | +up these environments on their own motivation. To reduce the load of |
| 12 | +recompiling otherwise identical package specs in different installations, |
| 13 | +created build artifacts can be put into binary tarballs, uploaded onto |
| 14 | +your spack mirror and then downloaded and installed by others. |
| 15 | + |
| 16 | + |
| 17 | +Creating binary tarballs |
| 18 | +----------------------- |
| 19 | + |
| 20 | +Tarballs of sofware built can be created via ``spack create-tarball`. |
| 21 | +It allows either to tar up a single package or a package including all |
| 22 | +its dependencies (``-r``, ``--recurse``). The location for the tarballs |
| 23 | +can be given via the ``--directory`` option: |
| 24 | + |
| 25 | +.. code-block:: sh |
| 26 | +
|
| 27 | + $ spack create-tarball -d ~/caches -r bison |
| 28 | + ==> recursing dependencies |
| 29 | + ==> adding dependency bison@3.0.4%gcc@5.3.1=linux-x86_64^libsigsegv@2.10%gcc@5.3.1=linux-x86_64^m4@1.4.17%gcc@5.3.1+sigsegv=linux-x86_64 |
| 30 | + ==> adding dependency m4@1.4.17%gcc@5.3.1+sigsegv=linux-x86_64^libsigsegv@2.10%gcc@5.3.1=linux-x86_64 |
| 31 | + ==> adding dependency libsigsegv@2.10%gcc@5.3.1=linux-x86_64 |
| 32 | + ==> creating tarball for package bison@3.0.4%gcc@5.3.1=linux-x86_64^libsigsegv@2.10%gcc@5.3.1=linux-x86_64^m4@1.4.17%gcc@5.3.1+sigsegv=linux-x86_64 |
| 33 | + ==> /home/hegner/caches/ubuntu16_04-x86_64/gcc-5.3.1/bison/ubuntu16_04-x86_64-bison-3.0.4-n6naf2v2wt2p5tg3jdveuqufhjwlba7o.tar.gz |
| 34 | + ==> creating tarball for package libsigsegv@2.10%gcc@5.3.1=linux-x86_64 |
| 35 | + ==> /home/hegner/caches/ubuntu16_04-x86_64/gcc-5.3.1/libsigsegv/ubuntu16_04-x86_64-libsigsegv-2.10-klc6t4jq2w6ochuz6xosu6vaujbwszds.tar.gz |
| 36 | + ==> creating tarball for package m4@1.4.17%gcc@5.3.1+sigsegv=linux-x86_64^libsigsegv@2.10%gcc@5.3.1=linux-x86_64 |
| 37 | + ==> /home/hegner/caches/ubuntu16_04-x86_64/gcc-5.3.1/m4/ubuntu16_04-x86_64-m4-1.4.17-6hpdn55vhztd25vxwuamxqo7edmootwv.tar.gz |
| 38 | +
|
| 39 | +
|
| 40 | +The created tarballs are put into the directory structure expected for the |
| 41 | +spack mirror. |
| 42 | + |
| 43 | + |
| 44 | +Installing binary tarballs |
| 45 | +----------------------- |
| 46 | + |
| 47 | +To install binary tarballs, one has to add the corresponding spack mirror |
| 48 | +with ``spack mirror add <name> <url>```. Afterwards binaries can be installed |
| 49 | +via: |
| 50 | + |
| 51 | +.. code-block:: sh |
| 52 | +
|
| 53 | + $ spack install --policy download bison |
| 54 | + |
| 55 | +With the download policy ``download`` the package bison and all its dependencies |
| 56 | +will be downloaded from the specified mirror(s). It fails if a package cannot be |
| 57 | +downloaded. |
| 58 | + |
| 59 | +Chosing the install policy |
| 60 | + |
| 61 | +.. code-block:: sh |
| 62 | +
|
| 63 | + $ spack install --policy lazy bison |
| 64 | + |
| 65 | +spack will first attempt to download a pre-built package. If it does not exist, |
| 66 | +it will continue with building locally. |
| 67 | + |
| 68 | + |
| 69 | +Relocation |
| 70 | +----------------------- |
| 71 | + |
| 72 | +Initial build and later installation do not necessarily happen at the same |
| 73 | +location. Spack provides a very basic relocation capability and corrects for |
| 74 | +RPATHs and non-relocatable scripts. However, many packages compile paths into |
| 75 | +binary artificats directly. In such cases, the build instructions of this |
| 76 | +package would need to be adjusted for better re-locatability. |
0 commit comments