Warning, /eic-spack/README.md is written in an unsupported language. File is not indexed.
0001 # EIC Spack Repository (builds on Key4HEP)
0002
0003 [![Build Environments](https://github.com/eic/eic-spack/workflows/Build%20Environments/badge.svg)](https://github.com/eic/eic-spack/actions?query=workflow%3A%22Build+Environments%22)
0004 [![Build Docker Images](https://github.com/eic/eic-spack-docker/workflows/Build%20Docker%20Images/badge.svg)](https://github.com/eic/eic-spack-docker/actions?query=workflow%3A%22Build+Docker+Images%22)
0005 [![EIC CI against CVMFS Software Stack](https://github.com/eic/eic-spack-cvmfs-tests/workflows/EIC%20CI%20against%20CVMFS%20Software%20Stack/badge.svg)](https://github.com/eic/eic-spack-cvmfs-tests/actions?query=workflow%3A%22EIC+CI+against+CVMFS+Software+Stack%22)
0006
0007 This repository contains [Spack](https://spack.readthedocs.io/en/latest/index.html) packages for the EIC, building on the [Key4HEP packages](https://github.com/key4hep/key4hep-spack).
0008
0009 While we encourage the inclusion of Spack packages in the [Spack repository](https://github.com/spack/spack), we realize that some packages may not be mature enough or have too small of a user base to be accepted there.
0010
0011 ## Installing Spack
0012
0013 Installing Spack is outside the scope of this repository, but described in the Spack [Getting Started](https://spack.readthedocs.io/en/latest/getting_started.html) page.
0014
0015 The default `develop` branch of this package repository depends on builtin packages in the upstream Spack `develop` repository. For specific vesions of Spack (e.g. v0.18.1), please use the corresponding branch (e.g. v0.18) or the latest tag on that branch (e.g. v0.18.5).
0016
0017 Because packages in this repository may depend on packages in the [Key4HEP spack repository](https://github.com/key4hep/key4hep-spack), you
0018
0019 ## Adding the EIC Spack Repository
0020
0021 1. Clone this repository:
0022 ```sh
0023 git clone https://github.com/eic/eic-spack.git
0024 ```
0025
0026 2. Add this repository to your Spack configuration:
0027 ```sh
0028 spack repo add eic-spack
0029 ```
0030
0031 ## Installing EIC Spack Packages
0032
0033 1. Find an EIC Spack package:
0034 ```sh
0035 spack find epic-eic
0036 ```
0037
0038 2. Install an EIC Spack package:
0039 ```sh
0040 spack install epic-eic
0041 ```
0042 If this is the first package you install, it will also install all dependencies.
0043
0044 ## Using EIC Spack Packages
0045
0046 1. Load the EIC Spack package:
0047 ```sh
0048 spack load epic-eic
0049 ```
0050
0051 2. Unload the EIC Spack package:
0052 ```sh
0053 spack unload epic-eic
0054 ```
0055
0056 3. Unload all Spack packages:
0057 ```sh
0058 spack unload -a
0059 ```
0060
0061 ## Using EIC Spack Packages in Environments
0062
0063 1. Create and activate a new Spack environment:
0064 ```sh
0065 spack env create epic-eic-env
0066 spack env activate epic-eic-env
0067 ```
0068
0069 2. Install an EIC Spack package:
0070 ```sh
0071 spack install epic-eic
0072 ```
0073 If you already installed this package earlier, this will go very quick.
0074
0075 3. Deactivate the Spack environment:
0076 ```sh
0077 spack env deactivate
0078 ```
0079 You can verify with `which root` inside and outside the environment that you did indeed use a different installation base.
0080
0081 ## Containerizing a Spack Environment
0082
0083 Once you have a Spack environment setup, you can easily turn it into a Docker container recipe from any directory with an environment spack.yaml file:
0084 ```sh
0085 cd $SPACK_ROOT/var/spack/environments/epic-eic-env/
0086 spack containerize > Dockerfile
0087 ```