Back to home page

EIC code displayed by LXR

 
 

    


Warning, /acts/docs/pages/contributing/building_acts.md is written in an unsupported language. File is not indexed.

0001 @page building_acts Building ACTS
0002 
0003 # Quick start
0004 
0005 ACTS is developed in C++ and is built using [CMake](https://cmake.org). Building
0006 the core library requires a C++20 compatible compiler,
0007 [Boost](https://www.boost.org), and [Eigen](https://eigen.tuxfamily.org). The
0008 following commands will clone the repository, configure, and build the core
0009 library:
0010 
0011 ```console
0012 git clone https://github.com/acts-project/acts <source>
0013 cmake -B <build> -S <source>
0014 cmake --build <build>
0015 ```
0016 
0017 For a full list of dependencies, including specific versions, see the
0018 [Prerequisites](#prerequisites) section below. Build options to activate
0019 additional components are described in the [Build options](#build-options)
0020 section.
0021 
0022 # Prerequisites {#prerequisites}
0023 
0024 The following dependencies are required to build the ACTS core library:
0025 
0026 - A C++20 compatible compiler (recent versions of either gcc and clang should work)
0027 - [CMake](https://cmake.org) >= 3.14
0028 - [Boost](https://www.boost.org) >= 1.71 with `filesystem`, `program_options`, and `unit_test_framework`
0029 - [Eigen](https://eigen.tuxfamily.org) >= 3.3.7
0030 
0031 The following dependencies are optional and are needed to build additional
0032 components:
0033 
0034 - [CUDA](https://developer.nvidia.com/cuda) for the CUDA plugin and the GNN plugin and its examples
0035 - [DD4hep](http://dd4hep.cern.ch) >= 1.11 for the DD4hep plugin and some examples
0036 - [Doxygen](http://doxygen.org) >= 1.8.15 for the documentation
0037 - [Geant4](https://geant4.org/) for some examples
0038 - [HepMC](https://gitlab.cern.ch/hepmc/HepMC3) >= 3.2.1 for some examples
0039 - [Intel Threading Building Blocks](https://github.com/uxlfoundation/oneTBB) >= 2020.1 for the examples
0040 - [ONNX Runtime](https://onnxruntime.ai/) >= 1.12.0 for the ONNX plugin, the GNN plugin and some examples
0041 - [Pythia8](https://pythia.org) for some examples
0042 - [ROOT](https://root.cern.ch) >= 6.20 for the ROOT plugin and the examples
0043 - [Graphviz](https://www.graphviz.org/) for class diagrams and other graphs in the documentation
0044 - [libtorch](https://docs.pytorch.org/cppdocs/installing.html) for the GNN plugin
0045 - [Pybind11](https://github.com/pybind/pybind11) for the Python bindings of the examples
0046 - [FastJet](https://fastjet.fr/) >= 3.4.0 for the FastJet plugin
0047 
0048 There are some additional dependencies that are automatically provided as part of
0049 the build system.
0050 These are usually not available through the system package manager and can be found in the ``thirdparty`` directory.
0051 
0052 All external dependencies must be provided prior to building ACTS. Compatible
0053 versions of all dependencies are provided e.g. by the [LCG
0054 releases](https://lcginfo.cern.ch/) starting from [LCG 102b](https://lcginfo.cern.ch/release/102b/).
0055 For convenience, it is possible to build the required boost and eigen3 dependencies using the ACTS build system; see [Build options](#build-options).
0056 Other options are also
0057 available and are discussed in the [Building ACTS](#building-acts) section.
0058 
0059 [Profiling](#howto_profiling) details the prerequisites for profiling the ACTS project with gperftools.
0060 
0061 # Building ACTS {#building-acts}
0062 
0063 ACTS uses [CMake](https://cmake.org) to configure, build, and install the
0064 software. After checking out the repository code into a `<source>` directory,
0065 CMake is called first to configure the build into a separate `<build>`
0066 directory. A typical setup is to create a `<source>/build` directory within the
0067 sources, but this is just a convention; not a requirement. The following command
0068 runs the configuration and searches for the dependencies. The `<build>`
0069 directory is automatically created.
0070 
0071 ```console
0072 cmake -B <build> -S <source>
0073 ```
0074 
0075 The build can be configured via various options that are listed in detail in the
0076 [Build options](#build-options) section. Options are set on the command line.
0077 The previous command could be e.g. modified to
0078 
0079 ```console
0080 cmake -B <build> -S <source> -DACTS_BUILD_UNITTESTS=on -DACTS_BUILD_FATRAS=on
0081 ```
0082 
0083 After the configuration succeeded, the software is build. This is also done with cmake via the following command
0084 
0085 ```console
0086 cmake --build <build>
0087 ```
0088 
0089 This automatically calls the configure build tool, e.g. Make or Ninja. To build only a specific target, the target names has to be separated from the CMake options by `--`, i.e.
0090 
0091 ```console
0092 cmake --build <build> -- ActsFatras # to build the Fatras library
0093 ```
0094 
0095 The build commands are the same regardless of where you are building the
0096 software. Depending on your build environment, there are different ways how to
0097 make the dependencies available.
0098 
0099 ## With a LCG release on CVMFS
0100 
0101 If you have access to a machine running [CVMFS](https://cernvm.cern.ch/fs/),
0102 e.g. CERNs lxplus login machines, the dependencies can be easily satisfied
0103 via an LCG releases available through CVMFS. Source the cvmfs setup script
0104 provided by the machine. It is suggested to select a recent `<lcg_release>`
0105 and `<lcg_platform>` combination. (Have a look at the CI jobs to get an
0106 overview on what we are currently testing):
0107 
0108 Current LCG/compiler combinations covered in CI are:
0109 
0110 - `LCG_107`: `gcc13`, `clang16`
0111 - `LCG_107a`: `gcc14`
0112 - `LCG_108`: `gcc15`
0113 - `LCG_109`: `gcc15`, `clang19`
0114 
0115 ```console
0116 source /cvmfs/sft.cern.ch/lcg/views/<lcg_release>/<lcg_platform>/setup.sh
0117 ```
0118 
0119 After sourcing the setup script, you can build ACTS as described above.
0120 
0121 ## In a container
0122 
0123 A set of container images is available through the [ACTS container
0124 registry][acts_containers]. These images are built using the configuration that is used in CI,
0125 and they contain all the dependencies required to build ACTS.
0126 
0127 > [!note]
0128 > Most containers are only build for the `x86_64` platform. If you are on an
0129 > `aarch64` (such as a recent Mac), you'll need to use the `ubuntu2404`
0130 > container, which is built for `aarch64` and `x86_64`!
0131 
0132 Furthermore, we are also testing on, but do not provide the corresponding containers:
0133 
0134 - `alma9` (HEP-specific software from LCG 107/107a/108/109 and compilers `gcc13`, `gcc14`, `gcc15`, `clang16`, `clang19`)
0135 - `macOS-10.15`
0136 
0137 > [!warning]
0138 > We stopped producing fully-contained LCG containers in favor of running LCG
0139 > based tests directly from CVMFS.
0140 
0141 To use these locally, you first need to pull the relevant images from the
0142 registry. Stable versions are tagged as `vX` where `X` is the version number.
0143 The latest, potentially unstable, version is tagged as `latest`. To list all
0144 available tags, e.g. for the `ubuntu2004` image, you can use the following
0145 command:
0146 
0147 ```console
0148 docker search --list-tags ghcr.io/acts-project/ubuntu2404
0149 ```
0150 
0151 The following command then downloads a stable tag of the `ubuntu2404` image:
0152 
0153 ```console
0154 docker pull ghcr.io/acts-project/ubuntu2404:51
0155 ```
0156 
0157 This should print the image id as part of the output. You can also find out the
0158 image id by running `docker images` to list all your locally available container
0159 images.
0160 
0161 Now, you need to start a shell within the container to run the build. Assuming
0162 that `<source>` is the path to your source checkout on your host machine, the
0163 following command will make the source directory available as `/acts` in the
0164 container and start an interactive `bash` shell
0165 
0166 ```console
0167 docker run --volume=<source>:/acts:ro --interactive --tty <image> /bin/bash
0168 ```
0169 
0170 where `<image>` is the image id that was previously mentioned. If you are using the Ubuntu-based image you are already good to go. For the images based on LCG releases, you can now activate the LCG release in the container shell by sourcing a setup script:
0171 
0172 ```console
0173 container $ source /opt/lcg_view/setup.sh
0174 ```
0175 
0176 Building ACTS follows the instructions above with `/acts` as the source directory, e.g.
0177 
0178 ```console
0179 container $ cmake -B build -S /acts -DACTS_BUILD_FATRAS=on
0180 container $ cmake --build build
0181 ```
0182 
0183 [acts_containers]: https://github.com/acts-project/ci-dependencies/pkgs/container/spack-container
0184 
0185 ## On your local machine
0186 
0187 Building and running ACTS on your local machine is not officially supported.
0188 However, if you have the necessary prerequisites installed it is possible to
0189 use it locally. ACTS developers regularly use different Linux distributions and
0190 macOS to build and develop ACTS. It is possible to use Spack to more easily
0191 install ACTS' dependencies; see the [building with Spack](#howto_spack) page for
0192 more information.
0193 
0194 # Building the documentation
0195 
0196 The documentation is built using [Doxygen][doxygen], which extracts the source
0197 code documentation and generates the HTML website. The build uses the
0198 [doxygen-awesome-css](https://github.com/jothepro/doxygen-awesome-css) theme for
0199 styling.
0200 
0201 To build the documentation locally, you need:
0202 
0203 - [Doxygen][doxygen] version 1.9.4 or newer
0204 - [Graphviz](https://www.graphviz.org/) for class diagrams and other graphs
0205 
0206 Configure the build with the `ACTS_BUILD_DOCS` option enabled:
0207 
0208 ```console
0209 cmake -B <build> -S <source> -DACTS_BUILD_DOCS=on
0210 ```
0211 
0212 Then build the documentation:
0213 
0214 ```console
0215 cmake --build <build> --target docs
0216 ```
0217 
0218 The generated HTML documentation will be in `<build>/docs/html/`. Open
0219 `<build>/docs/html/index.html` in a browser to view it.
0220 
0221 For a live preview with automatic rebuilds when files change, you can use the
0222 `serve.py` script (requires Python 3.11+ with [uv](https://docs.astral.sh/uv/) or
0223 the typer, rich, and livereload packages):
0224 
0225 ```console
0226 uv run docs/serve.py --build-dir <build>
0227 ```
0228 
0229 If your build directory is `build`, you can omit the `--build-dir` option. This
0230 serves the documentation at http://localhost:8000 and rebuilds when you edit
0231 source files or documentation.
0232 
0233 [doxygen]: https://doxygen.nl/
0234 
0235 # Build options {#build-options}
0236 
0237 CMake options can be set by adding `-D<OPTION>=<VALUE>` to the configuration
0238 command. The following command would e.g. enable the unit tests
0239 
0240 ```console
0241 cmake -B <build> -S <source> -DACTS_BUILD_UNITTESTS=ON
0242 ```
0243 
0244 Multiple options can be given. `cmake` caches the options so that only changed
0245 options must be specified in subsequent calls to configure the project. The
0246 following options are available to configure the project and enable optional
0247 components.
0248 
0249 <!-- CMAKE_OPTS_BEGIN -->
0250 | Option                              | Description                                                                                                                                                                                                                        |
0251 |-------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
0252 | ACTS_PARAMETER_DEFINITIONS_HEADER   | Use a different (track) parameter<br>definitions header<br> type: `filepath`, default: `""`                                                                                                                                        |
0253 | ACTS_SOURCELINK_SBO_SIZE            | Customize the SBO size used by<br>SourceLink<br> type: `string`, default: `""`                                                                                                                                                     |
0254 | ACTS_FORCE_ASSERTIONS               | Force assertions regardless of build<br>type<br> type: `bool`, default: `OFF`                                                                                                                                                      |
0255 | ACTS_USE_SYSTEM_LIBS                | Use system libraries by default<br> type: `bool`, default: `OFF`                                                                                                                                                                   |
0256 | ACTS_USE_SYSTEM_ACTSVG              | Use the ActSVG system library<br> type: `bool`, default: `ACTS_USE_SYSTEM_LIBS -> OFF`                                                                                                                                             |
0257 | ACTS_USE_SYSTEM_ALGEBRAPLUGINS      | Use a system-provided algebra-plugins<br>installation<br> type: `bool`, default: `ACTS_USE_SYSTEM_LIBS -> OFF`                                                                                                                     |
0258 | ACTS_SETUP_ALGEBRAPLUGINS           | If we want to set up algebra-plugins<br> type: `bool`, default: `ON`                                                                                                                                                               |
0259 | ACTS_USE_SYSTEM_COVFIE              | Use a system-provided covfie<br>installation<br> type: `bool`, default: `ACTS_USE_SYSTEM_LIBS -> OFF`                                                                                                                              |
0260 | ACTS_SETUP_COVFIE                   | If we want to set up covfie<br> type: `bool`, default: `ON`                                                                                                                                                                        |
0261 | ACTS_USE_SYSTEM_DETRAY              | Use a system-provided detray<br>installation<br> type: `bool`, default: `ACTS_USE_SYSTEM_LIBS -> OFF`                                                                                                                              |
0262 | ACTS_SETUP_DETRAY                   | If we want to set up detray<br> type: `bool`, default: `ON`                                                                                                                                                                        |
0263 | ACTS_USE_SYSTEM_VECMEM              | Use a system-provided vecmem<br>installation<br> type: `bool`, default: `ACTS_USE_SYSTEM_LIBS -> OFF`                                                                                                                              |
0264 | ACTS_SETUP_VECMEM                   | If we want to set up vecmem<br> type: `bool`, default: `ON`                                                                                                                                                                        |
0265 | ACTS_USE_SYSTEM_TRACCC              | Use a system-provided traccc<br>installation<br> type: `bool`, default: `ACTS_USE_SYSTEM_LIBS -> OFF`                                                                                                                              |
0266 | ACTS_USE_SYSTEM_NLOHMANN_JSON       | Use nlohmann::json provided by the<br>system instead of the bundled version<br> type: `bool`, default: `ACTS_USE_SYSTEM_LIBS -> OFF`                                                                                               |
0267 | ACTS_USE_SYSTEM_PYBIND11            | Use a system installation of pybind11<br> type: `bool`, default: `ACTS_USE_SYSTEM_LIBS -> OFF`                                                                                                                                     |
0268 | ACTS_USE_SYSTEM_MODULEMAPGRAPH      | Use a system installation of<br>ModuleMapGraph<br> type: `bool`, default: `ACTS_USE_SYSTEM_LIBS -> OFF`                                                                                                                            |
0269 | ACTS_USE_SYSTEM_EIGEN3              | Use a system-provided eigen3<br> type: `bool`, default: `ON`                                                                                                                                                                       |
0270 | ACTS_USE_SYSTEM_MILLE               | Use a system-provided Mille<br> type: `bool`, default: `ON`                                                                                                                                                                        |
0271 | ACTS_BUILD_PLUGIN_ACTSVG            | Build SVG display plugin<br> type: `bool`, default: `OFF`                                                                                                                                                                          |
0272 | ACTS_BUILD_PLUGIN_DD4HEP            | Build DD4hep plugin<br> type: `bool`, default: `OFF`                                                                                                                                                                               |
0273 | ACTS_BUILD_PLUGIN_EDM4HEP           | Build EDM4hep plugin<br> type: `bool`, default: `OFF`                                                                                                                                                                              |
0274 | ACTS_BUILD_PLUGIN_FPEMON            | Build FPE monitoring plugin<br> type: `bool`, default: `OFF`                                                                                                                                                                       |
0275 | ACTS_BUILD_PLUGIN_GEOMODEL          | Build GeoModel plugin<br> type: `bool`, default: `OFF`                                                                                                                                                                             |
0276 | ACTS_BUILD_PLUGIN_TRACCC            | Build Traccc plugin<br> type: `bool`, default: `OFF`                                                                                                                                                                               |
0277 | ACTS_BUILD_PLUGIN_GEANT4            | Build Geant4 plugin<br> type: `bool`, default: `OFF`                                                                                                                                                                               |
0278 | ACTS_BUILD_PLUGIN_GNN               | Build the GNN plugin<br> type: `bool`, default: `OFF`                                                                                                                                                                              |
0279 | ACTS_GNN_ENABLE_ONNX                | Build the Onnx backend for the gnn<br>plugin<br> type: `bool`, default: `OFF`                                                                                                                                                      |
0280 | ACTS_GNN_ENABLE_TORCH               | Build the torchscript backend for the<br>gnn plugin<br> type: `bool`, default: `ON`                                                                                                                                                |
0281 | ACTS_GNN_ENABLE_CUDA                | Enable CUDA for the gnn plugin<br> type: `bool`, default: `OFF`                                                                                                                                                                    |
0282 | ACTS_GNN_ENABLE_MODULEMAP           | Enable Module-Map-based graph<br>construction<br> type: `bool`, default: `OFF`                                                                                                                                                     |
0283 | ACTS_GNN_ENABLE_TENSORRT            | Enable the native TensorRT inference<br>modules<br> type: `bool`, default: `OFF`                                                                                                                                                   |
0284 | ACTS_BUILD_PLUGIN_JSON              | Build json plugin<br> type: `bool`, default: `OFF`                                                                                                                                                                                 |
0285 | ACTS_BUILD_PLUGIN_MILLE             | Build Mille plugin<br> type: `bool`, default: `OFF`                                                                                                                                                                                |
0286 | ACTS_BUILD_PLUGIN_ONNX              | Build ONNX plugin<br> type: `bool`, default: `OFF`                                                                                                                                                                                 |
0287 | ACTS_BUILD_PLUGIN_ROOT              | Build ROOT plugin<br> type: `bool`, default: `OFF`                                                                                                                                                                                 |
0288 | ACTS_SETUP_ANNOY                    | Explicitly set up Annoy for the project<br> type: `bool`, default: `OFF`                                                                                                                                                           |
0289 | ACTS_BUILD_PYTHON_WHEEL             | Settings to build for python deployment<br>with scikit-build-core<br> type: `bool`, default: `OFF`                                                                                                                                 |
0290 | ACTS_BUILD_PYTHON_BINDINGS          | Build python bindings for all enabled<br>components<br> type: `bool`, default: `OFF`                                                                                                                                               |
0291 | ACTS_BUILD_FATRAS                   | Build FAst TRAcking Simulation package<br> type: `bool`, default: `OFF`                                                                                                                                                            |
0292 | ACTS_BUILD_FATRAS_GEANT4            | Build Geant4 Fatras package<br> type: `bool`, default: `OFF`                                                                                                                                                                       |
0293 | ACTS_BUILD_ALIGNMENT                | Build Alignment package<br> type: `bool`, default: `OFF`                                                                                                                                                                           |
0294 | ACTS_BUILD_EXAMPLES                 | Build basic examples components<br> type: `bool`, default: `OFF`                                                                                                                                                                   |
0295 | ACTS_BUILD_EXAMPLES_DD4HEP          | Build DD4hep-based code in the examples<br> type: `bool`, default: `OFF`                                                                                                                                                           |
0296 | ACTS_BUILD_EXAMPLES_EDM4HEP         | Build EDM4hep-based code in the examples<br> type: `bool`, default: `OFF`                                                                                                                                                          |
0297 | ACTS_BUILD_EXAMPLES_FASTJET         | Build FastJet plugin<br> type: `bool`, default: `OFF`                                                                                                                                                                              |
0298 | ACTS_BUILD_EXAMPLES_GEANT4          | Build Geant4-based code in the examples<br> type: `bool`, default: `OFF`                                                                                                                                                           |
0299 | ACTS_BUILD_EXAMPLES_GNN             | Build the GNN example code<br> type: `bool`, default: `OFF`                                                                                                                                                                        |
0300 | ACTS_BUILD_EXAMPLES_HASHING         | Build Hashing-based code in the examples<br> type: `bool`, default: `OFF`                                                                                                                                                          |
0301 | ACTS_BUILD_EXAMPLES_PODIO           | Build Podio-based code in the examples<br> type: `bool`, default: `OFF`                                                                                                                                                            |
0302 | ACTS_BUILD_EXAMPLES_PYTHIA8         | Build Pythia8-based code in the examples<br> type: `bool`, default: `OFF`                                                                                                                                                          |
0303 | ACTS_BUILD_EXAMPLES_PYTHON_BINDINGS | [Deprecated] Build python bindings and<br>enables the examples<br> type: `bool`, default: `OFF`                                                                                                                                    |
0304 | ACTS_BUILD_EXAMPLES_ROOT            | Build modules based on ROOT I/O<br> type: `bool`, default: `OFF`                                                                                                                                                                   |
0305 | ACTS_BUILD_ANALYSIS_APPS            | Build Analysis applications in the<br>examples<br> type: `bool`, default: `OFF`                                                                                                                                                    |
0306 | ACTS_BUILD_BENCHMARKS               | Build benchmarks<br> type: `bool`, default: `OFF`                                                                                                                                                                                  |
0307 | ACTS_BUILD_INTEGRATIONTESTS         | Build integration tests<br> type: `bool`, default: `OFF`                                                                                                                                                                           |
0308 | ACTS_BUILD_UNITTESTS                | Build unit tests<br> type: `bool`, default: `OFF`                                                                                                                                                                                  |
0309 | ACTS_BUILD_EXAMPLES_UNITTESTS       | Build unit tests<br> type: `bool`, default: `ACTS_BUILD_UNITTESTS AND ACTS_BUILD_EXAMPLES`                                                                                                                                         |
0310 | ACTS_RUN_CLANG_TIDY                 | Run clang-tidy static analysis<br> type: `bool`, default: `OFF`                                                                                                                                                                    |
0311 | ACTS_BUILD_DOCS                     | Build documentation<br> type: `bool`, default: `OFF`                                                                                                                                                                               |
0312 | ACTS_SETUP_BOOST                    | Explicitly set up Boost for the project<br> type: `bool`, default: `ON`                                                                                                                                                            |
0313 | ACTS_SETUP_EIGEN3                   | Explicitly set up Eigen3 for the project<br> type: `bool`, default: `ON`                                                                                                                                                           |
0314 | ACTS_BUILD_ODD                      | Build the OpenDataDetector<br> type: `bool`, default: `OFF`                                                                                                                                                                        |
0315 | ACTS_ENABLE_CPU_PROFILING           | Enable CPU profiling using gperftools<br> type: `bool`, default: `OFF`                                                                                                                                                             |
0316 | ACTS_ENABLE_MEMORY_PROFILING        | Enable memory profiling using gperftools<br> type: `bool`, default: `OFF`                                                                                                                                                          |
0317 | ACTS_GPERF_INSTALL_DIR              | Hint to help find gperf if profiling is<br>enabled<br> type: `string`, default: `""`                                                                                                                                               |
0318 | ACTS_ENABLE_LOG_FAILURE_THRESHOLD   | Enable failing on log messages with<br>level above certain threshold<br> type: `bool`, default: `OFF`                                                                                                                              |
0319 | ACTS_LOG_FAILURE_THRESHOLD          | Log level above which an exception<br>should be automatically thrown. If<br>ACTS_ENABLE_LOG_FAILURE_THRESHOLD is set<br>and this is unset, this will enable a<br>runtime check of the log level.<br> type: `string`, default: `""` |
0320 | ACTS_COMPILE_HEADERS                | Generate targets to compile header files<br> type: `bool`, default: `ON`                                                                                                                                                           |
0321 <!-- CMAKE_OPTS_END -->
0322 
0323 All ACTS-specific options are disabled or empty by default and must be
0324 specifically requested.
0325 
0326 ACTS comes with a couple of CMakePresets which allow to collect and
0327 origanize common configuration workflows. On the surface the current
0328 list of presets contains:
0329 
0330 - `dev` as a base for developer configurations. This enables everything
0331   necessary for running the ODD full chain examples with Fatras. It
0332   sets the cpp standard to 20, the generator to ninja and enables ccache.
0333 - `perf` is similar to `dev` but tweaked for performance measurements.
0334 
0335 In addition to the ACTS-specific options, many generic options are available
0336 that modify various aspects of the build. The following options are some of the
0337 most common ones. For more details, have a look at the annotated list of [useful
0338 CMake variables](https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/Useful-Variables) or at the [CMake
0339 documentation](https://cmake.org/documentation/).
0340 
0341 | Option               | Description                                                                                                                       |
0342 |----------------------|-----------------------------------------------------------------------------------------------------------------------------------|
0343 | CMAKE_BUILD_TYPE     | Build type, e.g. Debug or Release; affects compiler flags <br/> (if not specified **`RelWithDebInfo`** will be used as a default) |
0344 | CMAKE_CXX_COMPILER   | Which C++ compiler to use, e.g. g++ or clang++                                                                                    |
0345 | CMAKE_INSTALL_PREFIX | Where to install ACTS to                                                                                                          |
0346 | CMAKE_PREFIX_PATH    | Search path for external packages                                                                                                 |
0347 
0348 The build is also affected by some environment variables. They can be set by prepending them to the configuration call:
0349 
0350 ```console
0351 DD4hep_DIR=<path/to/dd4hep> cmake -B <build> -S <source>
0352 ```
0353 
0354 The following environment variables might be useful.
0355 
0356 | Environment variable | Description                              |
0357 |----------------------|------------------------------------------|
0358 | DD4hep_DIR           | Search path for the DD4hep installation  |
0359 | HepMC3_DIR           | Search path for the HepMC3 installation  |
0360 | Pythia8_DIR          | Search path for the Pythia8 installation |
0361 
0362 > [!tip]
0363 > Even though these individual environment variables can be used to make CMake locate dependency,
0364 > it is usually preferable to use `CMAKE_PREFIX_PATH` to point to the root installation directory of the dependencies.
0365 
0366 # The OpenDataDetector
0367 
0368 ![3D rendering of the OpenDataDetector](figures/odd_render.jpg) {width=66%}
0369 
0370 ACTS comes packaged with a detector modeled using DD4hep that can be used to test your algorithms. It comes equipped with a magnetic field file as well as an already built material map.
0371 When configuring with `ACTS_BUILD_ODD=ON`, the detector is fetched automatically via CMake's `ExternalProject_Add`. This step requires network access during the first build to clone the upstream repository.
0372 
0373 To use it, build ACTS with the `ACTS_BUILD_ODD` option and then point either `LD_LIBRARY_PATH` on Linux or
0374 `DYLD_LIBRARY_PATH` and `DD4HEP_LIBRARY_PATH` on macOS to the install path of the ODD factory (for example: `$ODD_BUILD_DIR/factory`). The setup scripts generated by the build do this automatically when present.
0375 
0376 > [!tip]
0377 > If you source `$BUILD/this_acts_withdeps.sh`, these library paths are set automatically and the ODD python components are available as well.
0378 
0379 You can now use the ODD in the python binding by using:
0380 
0381 @snippet{trimleft} examples/test_odd.py Basic ODD construction
0382 
0383 # Using ACTS in downstream code
0384 
0385 When using ACTS in your own CMake-based project, you need to include the
0386 following lines in your `CMakeLists.txt` file:
0387 
0388 ```cmake
0389 find_package (Acts COMPONENTS comp1 comp2 ...)
0390 ```
0391 
0392 where `compX` are the required components from the ACTS project. See the
0393 `cmake` output for more information about which components are available.