blob: 40d574f6eb8154f310dab744145b6356a00f613f [file] [log] [blame]
J-Alves241c66c2023-10-19 13:59:29 +01001Prerequisites
2=============
3
4Build Host
5----------
6
7A relatively recent Linux distribution is recommended.
8CI runs are done using Ubuntu 22.04 LTS (64-bit).
9
10Toolchain
11---------
12
13The following toolchain is recommended for building Hafnium and the test
14infrastructure:
15
16- For a x86_64 Ubuntu host,
17
18.. code:: shell
19
Karl Meakin66a38bd2024-05-28 16:00:56 +010020 https://github.com/llvm/llvm-project/releases/download/llvmorg-18.1.8/clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04.tar.xz
J-Alves241c66c2023-10-19 13:59:29 +010021
22- For a AArch64 Ubuntu host,
23
24.. code:: shell
25
Karl Meakin66a38bd2024-05-28 16:00:56 +010026 https://github.com/llvm/llvm-project/releases/download/llvmorg-18.1.8/clang+llvm-18.1.8-aarch64-linux-gnu.tar.xz
J-Alves241c66c2023-10-19 13:59:29 +010027
28.. note::
29
30 Use of a native toolchain installed on the host (e.g. /usr/bin/clang) is
31 not supported.
32
33.. note::
34
35 Using a toolchain version greater, or significantly lesser than the one
36 specified is not guaranteed to work.
37
38The PATH environment variable shall be adjusted to contain the LLVM/clang directory, e.g.:
39
40.. code:: shell
41
Karl Meakin66a38bd2024-05-28 16:00:56 +010042 PATH=<toolchain_dir>/clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04/bin:$PATH
J-Alves241c66c2023-10-19 13:59:29 +010043
44Dependencies
45------------
46
47Build
48^^^^^
49
50The following command install the dependencies for the Hafnium build:
51
52.. code:: shell
53
54 sudo apt install make libssl-dev flex bison python3 python3-serial python3-pip device-tree-compiler
55
56In addion, install the following python lib using `pip`_:
57
58.. code:: shell
59
60 pip3 install fdt
61
J-Alves80189292024-10-23 14:39:13 +010062The file kokoro/static_checks.sh runs a series of static code checks into Hafnium's codebase.
63Hafnium follows the linux kernel coding guidelines. As such, the static code checks using the
64'checkpatch.pl' script from linux source tree. To setup and download 'checkpatch.pl':
65
66.. code:: shell
67 ./build/setup_checkpatch.sh
68
69Then test it works with:
70
71.. code:: shell
72 make checkpatch
73
J-Alves241c66c2023-10-19 13:59:29 +010074Documentation
75^^^^^^^^^^^^^
76
77To create a rendered copy of this documentation locally you can use the
78`Sphinx`_ tool to build and package the plain-text documents into HTML-formatted
79pages.
80
81For building a local copy of the documentation you will need:
82
83- Python 3 (3.8 or later)
84- PlantUML (1.2017.15 or later)
85- `Poetry`_ (Python dependency manager)
86
87Below is an example set of instructions to get a working environment (tested on
88Ubuntu):
89
90.. code:: shell
91
92 sudo apt install python3 python3-pip plantuml
93 curl -sSL https://install.python-poetry.org | python3 -
94
Harrison Mutai94f9a732024-08-05 16:33:15 +010095Run the command below to install using Poetry, Python dependencies to build the documentation:
J-Alves241c66c2023-10-19 13:59:29 +010096
97.. code:: shell
98
Harrison Mutai94f9a732024-08-05 16:33:15 +010099 poetry install --with docs
J-Alves241c66c2023-10-19 13:59:29 +0100100
101Poetry will create a new virtual environment and install all dependencies listed
102in ``pyproject.toml``. You can get information about this environment, such as
103its location and the Python version, with the command:
104
105.. code:: shell
106
107 poetry env info
108
109--------------
110
111*Copyright (c) 2023, Arm Limited. All rights reserved.*
112
113.. _Sphinx: http://www.sphinx-doc.org/en/master/
114.. _Poetry: https://python-poetry.org/docs/
115.. _pip: https://pip.pypa.io/en/stable/