J-Alves | 241c66c | 2023-10-19 13:59:29 +0100 | [diff] [blame] | 1 | Prerequisites |
| 2 | ============= |
| 3 | |
| 4 | Build Host |
| 5 | ---------- |
| 6 | |
| 7 | A relatively recent Linux distribution is recommended. |
| 8 | CI runs are done using Ubuntu 22.04 LTS (64-bit). |
| 9 | |
| 10 | Toolchain |
| 11 | --------- |
| 12 | |
| 13 | The following toolchain is recommended for building Hafnium and the test |
| 14 | infrastructure: |
| 15 | |
| 16 | - For a x86_64 Ubuntu host, |
| 17 | |
| 18 | .. code:: shell |
| 19 | |
Karl Meakin | 66a38bd | 2024-05-28 16:00:56 +0100 | [diff] [blame] | 20 | 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-Alves | 241c66c | 2023-10-19 13:59:29 +0100 | [diff] [blame] | 21 | |
| 22 | - For a AArch64 Ubuntu host, |
| 23 | |
| 24 | .. code:: shell |
| 25 | |
Karl Meakin | 66a38bd | 2024-05-28 16:00:56 +0100 | [diff] [blame] | 26 | https://github.com/llvm/llvm-project/releases/download/llvmorg-18.1.8/clang+llvm-18.1.8-aarch64-linux-gnu.tar.xz |
J-Alves | 241c66c | 2023-10-19 13:59:29 +0100 | [diff] [blame] | 27 | |
| 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 | |
| 38 | The PATH environment variable shall be adjusted to contain the LLVM/clang directory, e.g.: |
| 39 | |
| 40 | .. code:: shell |
| 41 | |
Karl Meakin | 66a38bd | 2024-05-28 16:00:56 +0100 | [diff] [blame] | 42 | PATH=<toolchain_dir>/clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04/bin:$PATH |
J-Alves | 241c66c | 2023-10-19 13:59:29 +0100 | [diff] [blame] | 43 | |
| 44 | Dependencies |
| 45 | ------------ |
| 46 | |
| 47 | Build |
| 48 | ^^^^^ |
| 49 | |
| 50 | The 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 | |
| 56 | In addion, install the following python lib using `pip`_: |
| 57 | |
| 58 | .. code:: shell |
| 59 | |
| 60 | pip3 install fdt |
| 61 | |
J-Alves | 8018929 | 2024-10-23 14:39:13 +0100 | [diff] [blame^] | 62 | The file kokoro/static_checks.sh runs a series of static code checks into Hafnium's codebase. |
| 63 | Hafnium 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 | |
| 69 | Then test it works with: |
| 70 | |
| 71 | .. code:: shell |
| 72 | make checkpatch |
| 73 | |
J-Alves | 241c66c | 2023-10-19 13:59:29 +0100 | [diff] [blame] | 74 | Documentation |
| 75 | ^^^^^^^^^^^^^ |
| 76 | |
| 77 | To 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 |
| 79 | pages. |
| 80 | |
| 81 | For 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 | |
| 87 | Below is an example set of instructions to get a working environment (tested on |
| 88 | Ubuntu): |
| 89 | |
| 90 | .. code:: shell |
| 91 | |
| 92 | sudo apt install python3 python3-pip plantuml |
| 93 | curl -sSL https://install.python-poetry.org | python3 - |
| 94 | |
Harrison Mutai | 94f9a73 | 2024-08-05 16:33:15 +0100 | [diff] [blame] | 95 | Run the command below to install using Poetry, Python dependencies to build the documentation: |
J-Alves | 241c66c | 2023-10-19 13:59:29 +0100 | [diff] [blame] | 96 | |
| 97 | .. code:: shell |
| 98 | |
Harrison Mutai | 94f9a73 | 2024-08-05 16:33:15 +0100 | [diff] [blame] | 99 | poetry install --with docs |
J-Alves | 241c66c | 2023-10-19 13:59:29 +0100 | [diff] [blame] | 100 | |
| 101 | Poetry will create a new virtual environment and install all dependencies listed |
| 102 | in ``pyproject.toml``. You can get information about this environment, such as |
| 103 | its 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/ |