Skip to content

Commit e0bce8a

Browse files
authored
Merge pull request #233 from haonanya/ocl-open-120
Update version number and branch names for ocl-open-120 branch
2 parents 43bee08 + c915765 commit e0bce8a

File tree

4 files changed

+29
-18
lines changed

4 files changed

+29
-18
lines changed

.travis.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ git:
1212
branches:
1313
only:
1414
- master
15+
- ocl-open-120
1516

1617
env:
1718
global:
@@ -31,14 +32,17 @@ before_install:
3132
libclang-cpp${LLVM_VERSION}-dev
3233

3334
install:
34-
- wget https://github.com/KhronosGroup/SPIRV-LLVM-Translator/releases/download/dev-build/SPIRV-LLVM-Translator-dev-build-linux-Release.zip -O /tmp/SPIRV-LLVM-Translator-dev-build-linux-${BUILD_TYPE}.zip
35-
- unzip /tmp/SPIRV-LLVM-Translator-dev-build-linux-${BUILD_TYPE}.zip -d spirv-llvm-translator
35+
git clone https://github.com/KhronosGroup/SPIRV-LLVM-Translator.git spirv-llvm-translator -b llvm_release_${LLVM_VERSION}0
36+
- mkdir spirv-llvm-translator/build && cd spirv-llvm-translator/build
37+
- cmake .. -DCMAKE_INSTALL_PREFIX=./install -DBUILD_SHARED_LIBS=ON -DLLVM_BUILD_TOOLS=ON -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
38+
- make -j`nproc` && make install
39+
- cd ../../
3640

3741
compiler:
3842
- gcc
3943
- clang
4044

4145
script:
4246
- mkdir build && cd build
43-
- cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DLLVM_NO_DEAD_STRIP=ON -DLLVMSPIRV_INCLUDED_IN_LLVM=OFF -DSPIRV_TRANSLATOR_DIR=./spirv-llvm-translator -DCMAKE_INSTALL_PREFIX=./install ..
47+
- cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DLLVM_NO_DEAD_STRIP=ON -DLLVMSPIRV_INCLUDED_IN_LLVM=OFF -DSPIRV_TRANSLATOR_DIR=${TRAVIS_BUILD_DIR}/spirv-llvm-translator/build/install -DCMAKE_INSTALL_PREFIX=./install ..
4448
- make install

CMakeLists.txt

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,13 @@ set(TARGET_NAME ${COMMON_CLANG_LIBRARY_NAME}${BUILD_PLATFORM} )
8080
if(NOT USE_PREBUILT_LLVM)
8181

8282
if(NOT LLVM_EXTERNAL_CLANG_SOURCE_DIR)
83+
set(LLVM_BASE_REVISION release_12)
8384
set(CLANG_SOURCE_DIR ${LLVM_SOURCE_DIR}/tools/clang)
85+
set(CLANG_BASE_REVISION release_12)
8486
elseif(EXISTS "${LLVM_EXTERNAL_CLANG_SOURCE_DIR}/CMakeLists.txt")
87+
set(LLVM_BASE_REVISION release/12.x)
8588
set(CLANG_SOURCE_DIR "${LLVM_EXTERNAL_CLANG_SOURCE_DIR}")
89+
set(CLANG_BASE_REVISION release/12.x)
8690
endif()
8791
if(EXISTS ${CLANG_SOURCE_DIR})
8892
message(STATUS "[OPENCL-CLANG] Using Clang source code direcotry: ${CLANG_SOURCE_DIR}")
@@ -117,18 +121,22 @@ if(NOT USE_PREBUILT_LLVM)
117121
)
118122
endif()
119123

120-
set(CLANG_BASE_REVISION master)
121-
set(SPIRV_BASE_REVISION master)
122-
set(TARGET_BRANCH "ocl-open-110")
123124

124-
apply_patches(${CLANG_SOURCE_DIR}
125-
${CMAKE_CURRENT_SOURCE_DIR}/patches/clang
126-
${CLANG_BASE_REVISION}
127-
${TARGET_BRANCH})
125+
set(SPIRV_BASE_REVISION llvm_release_120)
126+
set(TARGET_BRANCH "ocl-open-120")
127+
get_filename_component(LLVM_MONOREPO_DIR ${LLVM_SOURCE_DIR} DIRECTORY)
128+
set(LLVM_PATCHES_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm
129+
${CMAKE_CURRENT_SOURCE_DIR}/patches/clang)
130+
apply_patches(${LLVM_MONOREPO_DIR}
131+
"${LLVM_PATCHES_DIRS}"
132+
${LLVM_BASE_REVISION}
133+
${TARGET_BRANCH}
134+
ret)
128135
apply_patches(${SPIRV_SOURCE_DIR}
129136
${CMAKE_CURRENT_SOURCE_DIR}/patches/spirv
130137
${SPIRV_BASE_REVISION}
131-
${TARGET_BRANCH})
138+
${TARGET_BRANCH}
139+
ret)
132140
endif(NOT USE_PREBUILT_LLVM)
133141

134142
#

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ Before the build all dependencies must be downloaded and laid out as follows:
2525
This can be done using the following commands:
2626
```bash
2727
cd <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/12.x
29+
git clone https://github.com/KhronosGroup/SPIRV-LLVM-Translator.git -b llvm_release_120
30+
git clone https://github.com/intel/opencl-clang.git -b ocl-open-120
3131
```
3232

3333
Then we need to create a build directory and run the build:
@@ -58,7 +58,7 @@ documented in [Embedding LLVM in your project](https://llvm.org/docs/CMake.html#
5858
Commands to checkout sources and build:
5959
```bash
6060
cd <workspace>
61-
git clone https://github.com/intel/opencl-clang.git
61+
git clone https://github.com/intel/opencl-clang.git -b ocl-open-120
6262
mkdir build && cd build
6363
cmake ../opencl-clang
6464
make all -j`nproc`
@@ -68,13 +68,13 @@ make all -j`nproc`
6868

6969
##### Preferred LLVM version
7070

71-
By default, openclc-clang's cmake script is searching for LLVM 12.0.0. You can
71+
By default, opencl-clang's cmake script is searching for LLVM 12.0.0. You can
7272
override target version of LLVM by using the `PREFERRED_LLVM_VERSION` cmake
7373
option:
7474

7575
Example:
7676
```bash
77-
cmake -DPREFERRED_LLVM_VERSION="10.0.0" ../opencl-clang
77+
cmake -DPREFERRED_LLVM_VERSION="12.0.0" ../opencl-clang
7878
```
7979

8080
##### Custom LLVM installation

options_compile.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ std::string EffectiveOptionsFilter::processOptions(const OpenCLArgList &args,
178178
effectiveArgs.push_back("-cl-kernel-arg-info");
179179
effectiveArgs.push_back("-fno-validate-pch");
180180
effectiveArgs.push_back("-fno-caret-diagnostics");
181-
effectiveArgs.push_back("-dwarf-column-info");
182181

183182
if (std::find_if(effectiveArgs.begin(), effectiveArgs.end(),
184183
[](const ArgsVector::value_type& a) {

0 commit comments

Comments
 (0)