-
Notifications
You must be signed in to change notification settings - Fork 85
Build llvm spirv translator from source for opencl-clang CI test #155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
b117a05
663ca00
f5382a0
0c6a0e2
30524be
a6bd68a
e1f0dcd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,6 @@ os: | |
|
|
||
| # Use Ubuntu 16.04 LTS (Xenial) as the Linux testing environment. | ||
| dist: xenial | ||
| sudo: false | ||
|
|
||
| git: | ||
| depth: 1 | ||
|
|
@@ -33,16 +32,19 @@ addons: | |
| - libclang-8-dev | ||
|
|
||
| install: | ||
| - export TAG=v8.0.1-3 | ||
| - export TARBALL=SPIRV-LLVM-Translator-${TAG}-linux-${BUILD_TYPE}.zip | ||
| - wget https://github.com/KhronosGroup/SPIRV-LLVM-Translator/releases/download/${TAG}/${TARBALL} -O /tmp/${TARBALL} | ||
| - unzip /tmp/${TARBALL} -d spirv-llvm-translator | ||
| - git clone https://github.com/KhronosGroup/SPIRV-LLVM-Translator.git -b llvm_release_80 spirv-llvm-translator | ||
| - cd spirv-llvm-translator | ||
| - for patch in `ls ../patches/spirv/*.patch`; do echo $patch; git apply $patch; done | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we fail the build if we couldn't apply a patch? Probably
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe. The build can pass without these patches. I'll merge this pull request firstly. If needed, I'll add "set -e" to stop build if patch cannot be applied. Thanks.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It depends on patches from patches/clang directory. Patches for spirv translator will not work without patches to clang. |
||
| - mkdir build && cd 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 | ||
| - clang | ||
|
|
||
| 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 .. | ||
| - make 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 ../ | ||
| - make -j`nproc` | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that this would be enough
Basically, we are not triggering build of the translator here.
If I understand correctly, we have to git clone the whole llvm, put both the translator and opencl-clang in there, and only then perform in-tree build
Or, we need to build the translator first as separate cmake invocation and then supply it into opencl-clang build
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. I've updated it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, you don't have to build llvm. It will take a lot of time, probably travis job will time out.
I think we should build translator as a separate step in cmake. This build should use llvm binaries from deb packages as it is done now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. Updated.