blob: 1e3178d776a35d60cea462fc7b5f16e7ea2845f6 [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
Daniel Boulby0a697182024-11-15 11:46:26 +000067
J-Alves80189292024-10-23 14:39:13 +010068 ./build/setup_checkpatch.sh
69
70Then test it works with:
71
72.. code:: shell
Daniel Boulby0a697182024-11-15 11:46:26 +000073
J-Alves80189292024-10-23 14:39:13 +010074 make checkpatch
75
J-Alves241c66c2023-10-19 13:59:29 +010076Documentation
77^^^^^^^^^^^^^
78
79To create a rendered copy of this documentation locally you can use the
80`Sphinx`_ tool to build and package the plain-text documents into HTML-formatted
81pages.
82
83For building a local copy of the documentation you will need:
84
85- Python 3 (3.8 or later)
86- PlantUML (1.2017.15 or later)
87- `Poetry`_ (Python dependency manager)
88
89Below is an example set of instructions to get a working environment (tested on
90Ubuntu):
91
92.. code:: shell
93
94 sudo apt install python3 python3-pip plantuml
95 curl -sSL https://install.python-poetry.org | python3 -
96
Harrison Mutai94f9a732024-08-05 16:33:15 +010097Run the command below to install using Poetry, Python dependencies to build the documentation:
J-Alves241c66c2023-10-19 13:59:29 +010098
99.. code:: shell
100
Harrison Mutai94f9a732024-08-05 16:33:15 +0100101 poetry install --with docs
J-Alves241c66c2023-10-19 13:59:29 +0100102
103Poetry will create a new virtual environment and install all dependencies listed
104in ``pyproject.toml``. You can get information about this environment, such as
105its location and the Python version, with the command:
106
107.. code:: shell
108
109 poetry env info
110
111--------------
112
113*Copyright (c) 2023, Arm Limited. All rights reserved.*
114
115.. _Sphinx: http://www.sphinx-doc.org/en/master/
116.. _Poetry: https://python-poetry.org/docs/
117.. _pip: https://pip.pypa.io/en/stable/