Warning, /acts/docs/misc/spack.md is written in an unsupported language. File is not indexed.
0001 # Building with Spack
0002
0003 [Spack](https://spack.io/) is a package manager designed to handle software
0004 used in scientific computing, including computing in high-energy physics. The
0005 Spack package manager can be used to more easily install ACTS' dependencies.
0006 Builds using Spack are not officially supported. In order to start using Spack,
0007 follow the instructions on the [official Spack
0008 documentation](https://spack.readthedocs.io/en/latest/getting_started.html).
0009
0010 ## Installing dependencies
0011
0012 Once Spack has been installed, we are ready to create a development
0013 environment; for example:
0014
0015 ```console
0016 $ spack env create acts
0017 ```
0018
0019 This new environment can then be activated and deactivated as follows:
0020
0021 ```console
0022 $ spack env activate acts
0023 $ despacktivate
0024 ```
0025
0026 :::{tip}
0027 The creation of a Spack environment is persistent, i.e. you should only need to
0028 create your environment once. The activation of the environment, on the other
0029 hand, affects only your current shell. As a result, you will need to activate
0030 the environment every time you open a new shell.
0031 :::
0032
0033 With the Spack environment activated, you are ready to install ACTS'
0034 dependencies. You can either do this manually, or you can rely on Spack's
0035 definition of how to do this. To use the Spack definition, execute the
0036 following command (tuned for ACTS version 36.1.0; make sure you update the
0037 version number to match the version of ACTS you want to build):
0038
0039 ```console
0040 $ spack install --add --only dependencies "acts@36.1.0"
0041 ```
0042
0043 This specification will suffice to build the core ACTS library. If you want to
0044 build ACTS plugins, you will need to add additional _variants_; the following
0045 is a spec which can be used to build ACTS and all its plugins:
0046
0047 ```console
0048 $ spack install --add --only dependencies "acts@36.1.0+tgeo+geomodel+podio+edm4hep+examples+odd+fatras+json+dd4hep+geant4+fatras_geant4+hepmc3+pythia8+python+svg+traccc"
0049 ```
0050
0051 The string starting with `acts` in the commands above is the so-called _spec_,
0052 and it consists of three parts. The first part is the name of the package,
0053 which is `acts`. The second part is the version of the package, in this case
0054 `36.1.0`; Spack will pull in a set of dependencies suitable for that given
0055 version, so it is recommended to tune the version number to match the version
0056 of ACTS you want to build. The final part is a series of variants, marked with
0057 the `+` symbol. The command above allows you to build virtually all components
0058 of ACTS, but it also pulls in a large number of dependencies. You can remove
0059 variants you do not need in order to speed up the Spack build.
0060
0061 Once Spack has concretized and installed the ACTS dependencies, you can build
0062 ACTS as normal using CMake.
0063
0064
0065 ## Build caches
0066
0067 Work on build caches for ACTS is in progress.
0068
0069 ## Support
0070
0071 Spack support is experimental and not officially supported. Because ACTS'
0072 dependencies are constantly changing, it is possible that Spack's database may
0073 at times be out of date. If you encounter any problems using Spack to build
0074 ACTS, unofficial support is available in the
0075 [#Spack](https://mattermost.web.cern.ch/acts/channels/spack) channel on the
0076 ACTS Mattermost.