Skip to content

Commit c8ee2af

Browse files
kkreczkoigcbot
authored andcommitted
Update docs
Removed old information from docs and updated script snippets to be easily copyable for user experience.
1 parent dac4abb commit c8ee2af

File tree

1 file changed

+40
-78
lines changed

1 file changed

+40
-78
lines changed

documentation/build_ubuntu.md

Lines changed: 40 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!---======================= begin_copyright_notice ============================
22
3-
Copyright (C) 2019-2021 Intel Corporation
3+
Copyright (C) 2019-2025 Intel Corporation
44
55
SPDX-License-Identifier: MIT
66
@@ -13,14 +13,14 @@ SPDX-License-Identifier: MIT
1313
Building IGC needs flex, bison, libz and cmake version at least 3.13.4. You can install required packages on Ubuntu using this command:
1414

1515
```shell
16-
$ sudo apt-get install flex bison libz-dev cmake libc6 libstdc++6 python3-pip
17-
$ sudo python3 -m pip install mako
16+
sudo apt-get install flex bison libz-dev cmake libc6 libstdc++6 python3-pip
17+
sudo python3 -m pip install mako
1818
```
1919

2020
Some of the incoming git operations will try to download and apply patches. For this purpose it is necessary to setup git credentials if they are not already in the git configuration:
2121
```shell
22-
$ git config --global user.name "FirstName LastName"
23-
$ git config --global user.email "[email protected]"
22+
git config --global user.name "FirstName LastName"
23+
git config --global user.email "[email protected]"
2424
```
2525

2626
### 2. Install LLVM, LLD, Clang and OpenCL Clang
@@ -43,14 +43,14 @@ Also, depending on the Ubuntu release, SPIRV-LLVM-Translator available through a
4343
For **LLVM**, **LLD** and **Clang** packages please visit this [link](https://apt.llvm.org/) to download and install desired version.
4444
For `apt` package manager you can use this command:
4545
```shell
46-
$ sudo apt-get install llvm-15 llvm-15-dev clang-15 liblld-15 liblld-15-dev libllvmspirvlib15 libllvmspirvlib-15-dev
46+
sudo apt-get install llvm-15 llvm-15-dev clang-15 liblld-15 liblld-15-dev libllvmspirvlib15 libllvmspirvlib-15-dev
4747
```
4848
As of now **OpenCL Clang** is still needed to be built and installed manually. Sources are available [here](https://github.com/intel/opencl-clang). You can use out-of-tree build method with LLVM and Clang preinstalled.
4949
**VC Intrinsics** is a lightweight library that is built from sources with IGC and there is no package for it.
5050

5151
Installing LLVM, Clang, and OpenCL Clang components means you no longer have to download their sources alongside IGC, so the workspace tree in the next step may look like this:
5252
```
53-
<workspace>
53+
IGC_WORKSPACE_DIR
5454
|- igc https://github.com/intel/intel-graphics-compiler
5555
|- vc-intrinsics https://github.com/intel/vc-intrinsics
5656
|- SPIRV-Tools https://github.com/KhronosGroup/SPIRV-Tools
@@ -66,23 +66,26 @@ Moreover, OpenCL Clang and Vector Compiler share the SPIRV-LLVM Translator libra
6666

6767
#### Build from sources
6868

69-
Download all dependencies and create workspace.
70-
You can use following commands for setup:
69+
Create workspace and ```cd``` into it:
7170

7271
```shell
73-
$ cd <workspace>
74-
$ git clone https://github.com/intel/vc-intrinsics vc-intrinsics
75-
$ git clone -b llvmorg-15.0.7 https://github.com/llvm/llvm-project llvm-project
76-
$ git clone -b ocl-open-150 https://github.com/intel/opencl-clang llvm-project/llvm/projects/opencl-clang
77-
$ git clone -b llvm_release_150 https://github.com/KhronosGroup/SPIRV-LLVM-Translator llvm-project/llvm/projects/llvm-spirv
78-
$ git clone https://github.com/KhronosGroup/SPIRV-Tools.git SPIRV-Tools
79-
$ git clone https://github.com/KhronosGroup/SPIRV-Headers.git SPIRV-Headers
72+
export IGC_WORKSPACE_DIR=/your/desired/path
73+
mkdir -p $IGC_WORKSPACE_DIR && cd $IGC_WORKSPACE_DIR
74+
```
75+
Download all dependencies
76+
```shell
77+
git clone https://github.com/intel/vc-intrinsics vc-intrinsics
78+
git clone -b llvmorg-15.0.7 https://github.com/llvm/llvm-project llvm-project
79+
git clone -b ocl-open-150 https://github.com/intel/opencl-clang llvm-project/llvm/projects/opencl-clang
80+
git clone -b llvm_release_150 https://github.com/KhronosGroup/SPIRV-LLVM-Translator llvm-project/llvm/projects/llvm-spirv
81+
git clone https://github.com/KhronosGroup/SPIRV-Tools.git SPIRV-Tools
82+
git clone https://github.com/KhronosGroup/SPIRV-Headers.git SPIRV-Headers
8083
```
8184
These commands will set up a workspace with LLVM 15. If you wish to use any other version please refer to the [component revision table](#Revision-table)
8285

8386
Correct directory tree looks like this:
8487
```
85-
<workspace>
88+
IGC_WORSPACE_DIR
8689
|- igc https://github.com/intel/intel-graphics-compiler
8790
|- vc-intrinsics https://github.com/intel/vc-intrinsics
8891
|- SPIRV-Tools https://github.com/KhronosGroup/SPIRV-Tools
@@ -129,11 +132,16 @@ For more detailed info about every mode see:
129132

130133
1. Download sources:
131134
```shell
132-
$ cd <workspace>
133-
$ git clone https://github.com/intel/intel-graphics-compiler igc
134-
[If using specific release]
135-
$ cd igc && git checkout -b tag igc-<version>
135+
git clone https://github.com/intel/intel-graphics-compiler igc
136+
```
137+
If you want to use a specific IGC release, for example [v2.14.1](https://github.com/intel/intel-graphics-compiler/releases/tag/v2.14.1), do the following:
138+
```shell
139+
cd igc
140+
git fetch --all --tags --prune
141+
git checkout tags/v2.14.1 -b 2.14.1
136142
```
143+
After checkout you can name your new branch however you want, above is only an example.
144+
To get a list of all releases go [here](https://github.com/intel/intel-graphics-compiler/releases).
137145

138146
2. Prepare workspace and build
139147

@@ -143,24 +151,24 @@ If you are using [Build from sources](#build-from-sources) method IGC will autom
143151
You can use following commands to build IGC:
144152

145153
```shell
146-
$ cd <workspace>
147-
$ mkdir build
148-
$ cd build
149-
$ cmake ../igc
150-
$ make -j`nproc`
154+
cd $IGC_WORKSPACE_DIR
155+
mkdir build && cd build
156+
cmake ../igc
157+
make -j`nproc`
151158
```
152159

153160
3. Install IGC:
154161
```shell
155-
$ sudo make install
162+
sudo make install
156163
```
157164

158165
#### Additional notes on OpenCL LIT tests run
159166
If you have installed [intel-opencl-icd](https://github.com/intel/compute-runtime), you can pass the following CMake flags to run the integrated OpenCL LIT test-suite when building IGC, or separately afterwards:
160167

161168
```shell
162-
$ cmake -DIGC_OPTION__ENABLE_OCLOC_LIT_TESTS=ON -DSPIRV_SKIP_EXECUTABLES=OFF ../igc
163-
$ make check-ocloc -j`nproc`
169+
cd $IGC_WORKSPACE_DIR
170+
cmake -DIGC_OPTION__ENABLE_OCLOC_LIT_TESTS=ON -DSPIRV_SKIP_EXECUTABLES=OFF ../igc
171+
make check-ocloc -j`nproc`
164172
```
165173

166174
Also note that these tests require **Debug** IGC build.
@@ -173,9 +181,9 @@ Also note that these tests require **Debug** IGC build.
173181

174182
| Version | Product quality |
175183
|:----------------:|-----------------|
176-
| LLVM 16 | Experimental |
177-
| LLVM 15 | **Production** |
178-
| LLVM 14 and older| Experimental |
184+
| LLVM 16/Clang 16 | Experimental |
185+
| LLVM 15/Clang 15 | **Production** |
186+
| LLVM 14/Clang 14 and older| Experimental |
179187

180188
| Terminology | Description |
181189
|-------------------|-|
@@ -195,49 +203,3 @@ When checking out the components refer to the following table, replace **XX** wi
195203
| SPIRV-Headers | no | master | master |
196204
| SPIRV-LLVM-Translator | yes | llvm_release_**XX**0 | llvm_release_150 |
197205
| opencl-clang | yes | ocl-open-**XX**0 | ocl-open-150 |
198-
199-
### LLVM/LLD/Clang version specific caveats
200-
201-
Some LLVM versions require special steps to build successfully.
202-
203-
#### LLVM7/Clang7
204-
205-
In the **OpenCL Clang** project there are patches for Clang.
206-
If the Clang you are using to build IGC does not have these patches (for example, when you are using prebuilt packages) it is necessary to add ```-DVME_TYPES_DEFINED=FALSE``` to IGC CMake flags.
207-
208-
VectorComplier must be disabled by adding ```-DIGC_BUILD__VC_ENABLED=OFF``` to CMake flags.
209-
210-
#### LLVM8/Clang8
211-
212-
We recommend building LLVM8/Clang8 from sources instead for using prebuilds, because packaged Clang8 is missing these patches:
213-
* [0001-OpenCL-Change-type-of-block-pointer-for-OpenCL.patch](https://github.com/intel/opencl-clang/blob/ocl-open-80/patches/clang/0001-OpenCL-Change-type-of-block-pointer-for-OpenCL.patch)
214-
* [0002-OpenCL-Simplify-LLVM-IR-generated-for-OpenCL-blocks.patch](https://github.com/intel/opencl-clang/blob/ocl-open-80/patches/clang/0002-OpenCL-Simplify-LLVM-IR-generated-for-OpenCL-blocks.patch)
215-
* [0003-OpenCL-Fix-assertion-due-to-blocks.patch](https://github.com/intel/opencl-clang/blob/ocl-open-80/patches/clang/0003-OpenCL-Fix-assertion-due-to-blocks.patch)
216-
217-
which are needed for [enqueue_kernel](https://www.khronos.org/registry/OpenCL/sdk/2.0/docs/man/xhtml/enqueue_kernel.html).
218-
219-
VectorComplier must be disabled by adding ```-DIGC_BUILD__VC_ENABLED=OFF``` to CMake flags.
220-
221-
#### LLVM9/Clang9 to LLVM11/Clang11
222-
223-
**Deprecated/Experimental**
224-
We can no longer provide LLVM9-11/Clang9-11 conformance/performance guarantees.
225-
226-
#### LLVM12/Clang12 to LLVM13/Clang13
227-
228-
**Experimental**
229-
There are no LLVM12-13/Clang12-13 conformance/performance guarantees.
230-
231-
#### LLVM14/Clang14
232-
233-
**Experimental**
234-
There are no LLVM14/Clang14 conformance/performance guarantees.
235-
236-
#### LLVM15/Clang15
237-
238-
No additional steps are needed.
239-
240-
#### LLVM16/Clang16
241-
242-
**Experimental**
243-
There are no LLVM16/Clang16 conformance/performance guarantees.

0 commit comments

Comments
 (0)