1
1
[ ![ Build Status] ( https://travis-ci.com/intel/opencl-clang.svg?branch=master )] ( https://travis-ci.com/intel/opencl-clang )
2
2
3
- Common clang is a thin wrapper library around clang. Common clang has
3
+ opencl- clang is a thin wrapper library around clang. The library has
4
4
OpenCL-oriented API and is capable to compile OpenCL C kernels to SPIR-V
5
5
modules.
6
6
@@ -48,15 +48,15 @@ For sanity check of the build please run `make check-clang` and
48
48
49
49
### Out-of-tree build
50
50
51
- To build Common clang as a standalone project, you need to obtain pre-built LLVM
51
+ To build opencl- clang as a standalone project, you need to obtain pre-built LLVM
52
52
and SPIR-V Translator libraries. ** Note:** currently this kind of build is
53
53
supported on Linux only.
54
54
55
55
Integration with pre-built LLVM is done using standard ` find_package ` way as
56
56
documented in [ Embedding LLVM in your project] ( https://llvm.org/docs/CMake.html#embedding-llvm-in-your-project ) .
57
57
58
58
Commands to checkout sources and build:
59
- ```
59
+ ``` bash
60
60
cd < workspace>
61
61
git clone https://github.com/intel/opencl-clang.git
62
62
mkdir build && cd build
@@ -68,36 +68,37 @@ make all -j`nproc`
68
68
69
69
##### Preferred LLVM version
70
70
71
- By default, Common clang's cmake script is searching for LLVM 11.0.0. You can
72
- override target version of LLVM by using the ` PREFERRED_LLVM_VERSION ` cmake option:
71
+ By default, openclc-clang's cmake script is searching for LLVM 11.0.0. You can
72
+ override target version of LLVM by using the ` PREFERRED_LLVM_VERSION ` cmake
73
+ option:
73
74
74
75
Example:
75
- ```
76
+ ``` bash
76
77
cmake -DPREFERRED_LLVM_VERSION=" 10.0.0" ../opencl-clang
77
78
```
78
79
79
80
##### Custom LLVM installation
80
81
81
82
If LLVM is installed somewhere in custom (non-system directories) location, you
82
- could point to it using the ` LLVM_DIR ` cmake option. ** Note** : You need to specify
83
- the path to a directory containing the ` LLVMConfig.cmake ` file.
83
+ could point to it using the ` LLVM_DIR ` cmake option. ** Note** : You need to
84
+ specify the path to a directory containing the ` LLVMConfig.cmake ` file.
84
85
85
86
This file is available in two different locations.
86
87
* ` <INSTALL_PREFIX>/lib/cmake/llvm/LLVMConfig.cmake ` where ` <INSTALL_PREFIX> `
87
- is the install prefix of an installed version of LLVM. On Linux this is typically
88
- ` /usr/lib/cmake/llvm/LLVMConfig.cmake ` .
88
+ is the install prefix of an installed version of LLVM. On Linux this is
89
+ typically ` /usr/lib/cmake/llvm/LLVMConfig.cmake ` .
89
90
* ` <LLVM_BUILD_ROOT>/lib/cmake/llvm/LLVMConfig.cmake ` where ` <LLVM_BUILD_ROOT> `
90
91
is the root of the LLVM build tree.
91
92
** Note: this is only available when building LLVM with CMake.**
92
93
93
94
Example:
94
- ```
95
+ ``` bash
95
96
cmake -DLLVM_DIR=/path/to/installed/llvm/lib/cmake/llvm ../opencl-clang
96
97
```
97
98
98
99
##### Location of SPIR-V Translator library
99
100
100
- By default, Common clang's cmake script assumes that SPIR-V Translator library
101
+ By default, opencl- clang's cmake script assumes that SPIR-V Translator library
101
102
is built as part of LLVM, installed in the same place and libLLVMSPIRVLib is
102
103
linked into libLLVM.
103
104
@@ -107,11 +108,12 @@ directory where SPIR-V Translator is installed by using `SPIRV_TRANSLATOR_DIR`
107
108
cmake option.
108
109
109
110
Example:
110
- ```
111
+ ``` bash
111
112
cmake -DLLVMSPIRV_INCLUDED_IN_LLVM=OFF -DSPIRV_TRANSLATOR_DIR=/path/to/installed/spirv/translator ../opencl-clang
112
113
```
113
114
114
- There is a known issue (linker crash) for this kind of build on Ubuntu 16.04 Xenial.
115
+ There is a known issue (linker crash) for this kind of build on Ubuntu 16.04
116
+ Xenial.
115
117
In this case the following cmake option should fix it:
116
118
```
117
119
-DLLVM_NO_DEAD_STRIP=ON
0 commit comments