1- [ ![ Build Status] ( https://travis-ci.com/intel/opencl-clang.svg?branch=master )] ( https://travis-ci.com/intel/opencl-clang )
1+ [ ![ Build Status] ( https://travis-ci.com/intel/opencl-clang.svg?branch=ocl-open-100 )] ( https://travis-ci.com/intel/opencl-clang )
22
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
44OpenCL-oriented API and is capable to compile OpenCL C kernels to SPIR-V
55modules.
66
@@ -25,9 +25,9 @@ Before the build all dependencies must be downloaded and laid out as follows:
2525This can be done using the following commands:
2626``` bash
2727cd < workspace>
28- git clone https://github.com/llvm/llvm-project.git .
29- git clone https://github.com/KhronosGroup/SPIRV-LLVM-Translator.git
30- git clone https://github.com/intel/opencl-clang.git
28+ git clone https://github.com/llvm/llvm-project.git . -b release/10.x
29+ git clone https://github.com/KhronosGroup/SPIRV-LLVM-Translator.git -b llvm_release_100
30+ git clone https://github.com/intel/opencl-clang.git -b ocl-open-100
3131```
3232
3333Then we need to create a build directory and run the build:
@@ -48,17 +48,17 @@ For sanity check of the build please run `make check-clang` and
4848
4949### Out-of-tree build
5050
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
5252and SPIR-V Translator libraries. ** Note:** currently this kind of build is
5353supported on Linux only.
5454
5555Integration with pre-built LLVM is done using standard ` find_package ` way as
5656documented in [ Embedding LLVM in your project] ( https://llvm.org/docs/CMake.html#embedding-llvm-in-your-project ) .
5757
5858Commands to checkout sources and build:
59- ```
59+ ``` bash
6060cd < workspace>
61- git clone https://github.com/intel/opencl-clang.git
61+ git clone https://github.com/intel/opencl-clang.git -b ocl-open-100
6262mkdir build && cd build
6363cmake ../opencl-clang
6464make all -j` nproc`
@@ -68,36 +68,37 @@ make all -j`nproc`
6868
6969##### Preferred LLVM version
7070
71- By default, Common clang's cmake script is searching for LLVM 10.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 10.0.0. You can
72+ override target version of LLVM by using the ` PREFERRED_LLVM_VERSION ` cmake
73+ option:
7374
7475Example:
75- ```
76+ ``` bash
7677cmake -DPREFERRED_LLVM_VERSION=" 10.0.0" ../opencl-clang
7778```
7879
7980##### Custom LLVM installation
8081
8182If 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.
8485
8586This file is available in two different locations.
8687* ` <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 ` .
8990* ` <LLVM_BUILD_ROOT>/lib/cmake/llvm/LLVMConfig.cmake ` where ` <LLVM_BUILD_ROOT> `
9091 is the root of the LLVM build tree.
9192 ** Note: this is only available when building LLVM with CMake.**
9293
9394Example:
94- ```
95+ ``` bash
9596cmake -DLLVM_DIR=/path/to/installed/llvm/lib/cmake/llvm ../opencl-clang
9697```
9798
9899##### Location of SPIR-V Translator library
99100
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
101102is built as part of LLVM, installed in the same place and libLLVMSPIRVLib is
102103linked into libLLVM.
103104
@@ -107,11 +108,12 @@ directory where SPIR-V Translator is installed by using `SPIRV_TRANSLATOR_DIR`
107108cmake option.
108109
109110Example:
110- ```
111+ ``` bash
111112cmake -DLLVMSPIRV_INCLUDED_IN_LLVM=OFF -DSPIRV_TRANSLATOR_DIR=/path/to/installed/spirv/translator ../opencl-clang
112113```
113114
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.
115117In this case the following cmake option should fix it:
116118```
117119-DLLVM_NO_DEAD_STRIP=ON
0 commit comments