@@ -39,17 +39,72 @@ accepted into the project.
39
39
Runtime team via the `GitHub issue tracker
40
40
<https://github.com/oneapi-src/unified-runtime/issues/new> `_.
41
41
42
+ Build Environment
43
+ =================
44
+
45
+ To be able to generate the source from the YAML files, the build environment
46
+ must be configured correctly and all dependencies must be installed. The
47
+ instructions for a basic setup are available in the `README
48
+ <https://github.com/oneapi-src/unified-runtime/blob/main/README.md#building> `_.
49
+
50
+ The following additional dependencies are required to support the ``generate ``
51
+ target:
52
+
53
+ * Doxygen (>= 1.8)
54
+
55
+ * The Python script requirements listed in `thirdparty/requirements.txt `_
56
+
57
+ Doxygen can be installed via your system's package manager, e.g. on Ubuntu
58
+ ``sudo apt install doxygen ``, or by downloading it from the Doxygen website. It
59
+ must be available on the current ``PATH `` when the script is run.
60
+
61
+ One way to install the requirements for the script is using a Python virtual
62
+ environment. This can be set up by running the following commands from the
63
+ project root:
64
+
65
+ .. code-block :: console
66
+
67
+ $ python3 -m venv .local
68
+ $ source .local/bin/activate
69
+ $ pip install -r third_party/requirements.txt
70
+
71
+ The virtual environment can be subsequently reactivated before any builds
72
+ without needing to reinstall the requirements:
73
+
74
+ .. code-block :: console
75
+
76
+ $ source .local/bin/activate
77
+
78
+ Alternatively, a Docker container can be used instead of a virtual environment.
79
+ Instructions on building and using a Docker image can be found in
80
+ `.github/docker `_
81
+
82
+ You *must * also enable the ``UR_FORMAT_CPP_STYLE `` CMake option to allow
83
+ formatting of the generated code, or the ``generate `` target will not be
84
+ available.
85
+
86
+ .. code-block :: console
87
+
88
+ $ cmake build/ -DUR_FORMAT_CPP_STYLE=ON
89
+
90
+ You can then follow the instructions below to use the ``generate `` target to
91
+ regenerate the source.
92
+
93
+ .. _thirdparty/requirements.txt :
94
+ https://github.com/oneapi-src/unified-runtime/blob/main/third_party/requirements.txt
95
+ .. _.github/docker :
96
+ https://github.com/oneapi-src/unified-runtime/blob/main/.github/docker
97
+
42
98
Generating Source
43
99
=================
44
100
45
101
The specification and many other components in the Unified Runtime repository
46
102
are generated from a set of YAML _ files which are used as inputs to a Mako _
47
103
based templating system. The YAML file syntax is defined in `YAML syntax `_. To
48
104
generate the outputs of the Mako templates a build directory must be
49
- configured, instructions are available in the `README
50
- <https://github.com/oneapi-src/unified-runtime/blob/main/README.md> `_ file.
51
- Upon successfully configuring a build directory, generate the outputs with the
52
- following command (or suitable build system equivalent):
105
+ configured as detailed above. Upon successfully configuring a build directory,
106
+ generate the outputs with the following command (or suitable build system
107
+ equivalent):
53
108
54
109
.. code-block :: console
55
110
0 commit comments