From c915765584c73408a573d89c607d58ced3b09750 Mon Sep 17 00:00:00 2001 From: haonanya Date: Thu, 4 Mar 2021 10:50:35 +0800 Subject: [PATCH] Update version number and branch names for ocl-open-120 branch Signed-off-by: haonanya --- .travis.yml | 10 +++++++--- CMakeLists.txt | 24 ++++++++++++++++-------- README.md | 12 ++++++------ options_compile.cpp | 1 - 4 files changed, 29 insertions(+), 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index d4c11bc8..64a452b8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,7 @@ git: branches: only: - master + - ocl-open-120 env: global: @@ -31,8 +32,11 @@ before_install: libclang-cpp${LLVM_VERSION}-dev install: - - 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 - - unzip /tmp/SPIRV-LLVM-Translator-dev-build-linux-${BUILD_TYPE}.zip -d spirv-llvm-translator + git clone https://github.com/KhronosGroup/SPIRV-LLVM-Translator.git spirv-llvm-translator -b llvm_release_${LLVM_VERSION}0 + - mkdir spirv-llvm-translator/build && cd spirv-llvm-translator/build + - cmake .. -DCMAKE_INSTALL_PREFIX=./install -DBUILD_SHARED_LIBS=ON -DLLVM_BUILD_TOOLS=ON -DCMAKE_BUILD_TYPE=${BUILD_TYPE} + - make -j`nproc` && make install + - cd ../../ compiler: - gcc @@ -40,5 +44,5 @@ compiler: script: - mkdir build && cd build - - 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 .. + - 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 .. - make install diff --git a/CMakeLists.txt b/CMakeLists.txt index 18344c88..f2220091 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -80,9 +80,13 @@ set(TARGET_NAME ${COMMON_CLANG_LIBRARY_NAME}${BUILD_PLATFORM} ) if(NOT USE_PREBUILT_LLVM) if(NOT LLVM_EXTERNAL_CLANG_SOURCE_DIR) + set(LLVM_BASE_REVISION release_12) set(CLANG_SOURCE_DIR ${LLVM_SOURCE_DIR}/tools/clang) + set(CLANG_BASE_REVISION release_12) elseif(EXISTS "${LLVM_EXTERNAL_CLANG_SOURCE_DIR}/CMakeLists.txt") + set(LLVM_BASE_REVISION release/12.x) set(CLANG_SOURCE_DIR "${LLVM_EXTERNAL_CLANG_SOURCE_DIR}") + set(CLANG_BASE_REVISION release/12.x) endif() if(EXISTS ${CLANG_SOURCE_DIR}) message(STATUS "[OPENCL-CLANG] Using Clang source code direcotry: ${CLANG_SOURCE_DIR}") @@ -117,18 +121,22 @@ if(NOT USE_PREBUILT_LLVM) ) endif() - set(CLANG_BASE_REVISION master) - set(SPIRV_BASE_REVISION master) - set(TARGET_BRANCH "ocl-open-110") - apply_patches(${CLANG_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/patches/clang - ${CLANG_BASE_REVISION} - ${TARGET_BRANCH}) + set(SPIRV_BASE_REVISION llvm_release_120) + set(TARGET_BRANCH "ocl-open-120") + get_filename_component(LLVM_MONOREPO_DIR ${LLVM_SOURCE_DIR} DIRECTORY) + set(LLVM_PATCHES_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm + ${CMAKE_CURRENT_SOURCE_DIR}/patches/clang) + apply_patches(${LLVM_MONOREPO_DIR} + "${LLVM_PATCHES_DIRS}" + ${LLVM_BASE_REVISION} + ${TARGET_BRANCH} + ret) apply_patches(${SPIRV_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/patches/spirv ${SPIRV_BASE_REVISION} - ${TARGET_BRANCH}) + ${TARGET_BRANCH} + ret) endif(NOT USE_PREBUILT_LLVM) # diff --git a/README.md b/README.md index fc558311..fb84eafe 100644 --- a/README.md +++ b/README.md @@ -25,9 +25,9 @@ Before the build all dependencies must be downloaded and laid out as follows: This can be done using the following commands: ```bash cd -git clone https://github.com/llvm/llvm-project.git . -git clone https://github.com/KhronosGroup/SPIRV-LLVM-Translator.git -git clone https://github.com/intel/opencl-clang.git +git clone https://github.com/llvm/llvm-project.git . -b release/12.x +git clone https://github.com/KhronosGroup/SPIRV-LLVM-Translator.git -b llvm_release_120 +git clone https://github.com/intel/opencl-clang.git -b ocl-open-120 ``` 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# Commands to checkout sources and build: ```bash cd -git clone https://github.com/intel/opencl-clang.git +git clone https://github.com/intel/opencl-clang.git -b ocl-open-120 mkdir build && cd build cmake ../opencl-clang make all -j`nproc` @@ -68,13 +68,13 @@ make all -j`nproc` ##### Preferred LLVM version -By default, openclc-clang's cmake script is searching for LLVM 12.0.0. You can +By default, opencl-clang's cmake script is searching for LLVM 12.0.0. You can override target version of LLVM by using the `PREFERRED_LLVM_VERSION` cmake option: Example: ```bash -cmake -DPREFERRED_LLVM_VERSION="10.0.0" ../opencl-clang +cmake -DPREFERRED_LLVM_VERSION="12.0.0" ../opencl-clang ``` ##### Custom LLVM installation diff --git a/options_compile.cpp b/options_compile.cpp index 1c5a9598..84997da3 100644 --- a/options_compile.cpp +++ b/options_compile.cpp @@ -178,7 +178,6 @@ std::string EffectiveOptionsFilter::processOptions(const OpenCLArgList &args, effectiveArgs.push_back("-cl-kernel-arg-info"); effectiveArgs.push_back("-fno-validate-pch"); effectiveArgs.push_back("-fno-caret-diagnostics"); - effectiveArgs.push_back("-dwarf-column-info"); if (std::find_if(effectiveArgs.begin(), effectiveArgs.end(), [](const ArgsVector::value_type& a) {