Back to home page

EIC code displayed by LXR

 
 

    


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 ### Running with dependencies
0065 
0066 In order to run code depending on ACTS dependencies such as DD4hep, you may
0067 need to run an additional shell script when you activate your Spack
0068 environment. This shell script is called `this_acts_withdeps.sh` and resides in
0069 your ACTS build directory:
0070 
0071 ```console
0072 $ source <build directory>/this_acts_withdeps.sh
0073 ```
0074 
0075 ## Build caches
0076 
0077 Work on build caches for ACTS is in progress.
0078 
0079 ## Support
0080 
0081 Spack support is experimental and not officially supported. Because ACTS'
0082 dependencies are constantly changing, it is possible that Spack's database may
0083 at times be out of date. If you encounter any problems using Spack to build
0084 ACTS, unofficial support is available in the
0085 [#Spack](https://mattermost.web.cern.ch/acts/channels/spack) channel on the
0086 ACTS Mattermost.
0087 
0088 ## Troubleshooting
0089 
0090 The following are some common problems you may encounter using Spack to build
0091 ACTS.
0092 
0093 ### DD4hep not finding factories
0094 
0095 If you run into an error like the following, DD4hep is failing to find the
0096 object files required to parse some its required factories. Remember to
0097 initialize the ACTS dependencies as described in ["Running
0098 with dependencies"](#running-with-dependencies):
0099 
0100 ```text
0101 dd4hep: Failed to locate plugin to interprete files of type "lccdd" - no factory:lccdd_XML_reader.
0102         No factory with name Create(lccdd_XML_reader) for type lccdd_XML_reader found.
0103         Please check library load path and/or plugin factory name.
0104 ```