blob: 387ce03112dd86ab5dc2d8fbb74231c52849ff2f [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
J-Alves3678f202025-05-27 18:05:57 +010013The clang-20 toolchain is recommended for building Hafnium and the test
14infrastructure. On Ubuntu, the toolchain can be installed from the LLVM apt
15repository (https://apt.llvm.org/).
J-Alves241c66c2023-10-19 13:59:29 +010016
17.. note::
18
J-Alves3678f202025-05-27 18:05:57 +010019 Using a toolchain version greater than, or significantly lesser than the one
J-Alves241c66c2023-10-19 13:59:29 +010020 specified is not guaranteed to work.
21
J-Alves3678f202025-05-27 18:05:57 +010022.. note::
J-Alves241c66c2023-10-19 13:59:29 +010023
J-Alves3678f202025-05-27 18:05:57 +010024 You may also use the Docker container if you are unable to install the
25 toolchain on your host machine, see the :ref:`Using_Docker` section.
J-Alves241c66c2023-10-19 13:59:29 +010026
27Dependencies
28------------
29
30Build
31^^^^^
32
33The following command install the dependencies for the Hafnium build:
34
35.. code:: shell
36
37 sudo apt install make libssl-dev flex bison python3 python3-serial python3-pip device-tree-compiler
38
39In addion, install the following python lib using `pip`_:
40
41.. code:: shell
42
43 pip3 install fdt
44
J-Alves80189292024-10-23 14:39:13 +010045The file kokoro/static_checks.sh runs a series of static code checks into Hafnium's codebase.
46Hafnium follows the linux kernel coding guidelines. As such, the static code checks using the
47'checkpatch.pl' script from linux source tree. To setup and download 'checkpatch.pl':
48
49.. code:: shell
Daniel Boulby0a697182024-11-15 11:46:26 +000050
J-Alves80189292024-10-23 14:39:13 +010051 ./build/setup_checkpatch.sh
52
53Then test it works with:
54
55.. code:: shell
Daniel Boulby0a697182024-11-15 11:46:26 +000056
J-Alves80189292024-10-23 14:39:13 +010057 make checkpatch
58
J-Alves241c66c2023-10-19 13:59:29 +010059Documentation
60^^^^^^^^^^^^^
61
62To create a rendered copy of this documentation locally you can use the
63`Sphinx`_ tool to build and package the plain-text documents into HTML-formatted
64pages.
65
66For building a local copy of the documentation you will need:
67
68- Python 3 (3.8 or later)
69- PlantUML (1.2017.15 or later)
70- `Poetry`_ (Python dependency manager)
71
72Below is an example set of instructions to get a working environment (tested on
73Ubuntu):
74
75.. code:: shell
76
77 sudo apt install python3 python3-pip plantuml
78 curl -sSL https://install.python-poetry.org | python3 -
79
Harrison Mutai94f9a732024-08-05 16:33:15 +010080Run the command below to install using Poetry, Python dependencies to build the documentation:
J-Alves241c66c2023-10-19 13:59:29 +010081
82.. code:: shell
83
Harrison Mutai94f9a732024-08-05 16:33:15 +010084 poetry install --with docs
J-Alves241c66c2023-10-19 13:59:29 +010085
86Poetry will create a new virtual environment and install all dependencies listed
87in ``pyproject.toml``. You can get information about this environment, such as
88its location and the Python version, with the command:
89
90.. code:: shell
91
92 poetry env info
93
94--------------
95
96*Copyright (c) 2023, Arm Limited. All rights reserved.*
97
98.. _Sphinx: http://www.sphinx-doc.org/en/master/
99.. _Poetry: https://python-poetry.org/docs/
100.. _pip: https://pip.pypa.io/en/stable/