You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run (or re-run) cmake as usual for LLVM. After that you should have `llvm-spirv` and `check-llvm-spirv` targets available.
71
71
```
72
72
mkdir llvm-project/build && cd llvm-project/build
73
-
cmake ../llvm
73
+
cmake ../llvm -DLLVM_ENABLE_PROJECTS="clang"
74
74
make llvm-spirv -j`nproc`
75
75
```
76
76
77
+
Note on enabling the `clang` project: there are tests in the translator that depend
78
+
on `clang` binary, which makes clang a required dependency (search for
79
+
`LLVM_SPIRV_TEST_DEPS` in [test/CMakeLists.txt](test/CMakeLists.txt)) for
80
+
`check-llvm-spirv` target.
81
+
82
+
Building clang from sources takes time and resources and it can be avoided:
83
+
- if you are not interested in launching unit-tests for the translator after
84
+
build, you can disable generation of test targets by passing
85
+
`-DLLVM_INCLUDE_TESTS=OFF` option.
86
+
- if you are interested in launching unit-tests, but don't want to build clang
87
+
you can pass `-DSPIRV_SKIP_CLANG_BUILD` cmake option to avoid adding `clang`
88
+
as dependency for `check-llvm-spirv` target. However, LIT will search for
89
+
`clang` binary when tests are launched and it should be available at this
90
+
point.
91
+
- building and testing completely without `clang` is not supported at the
92
+
moment, see [KhronosGroup/SPIRV-LLVM-Translator#477](https://github.com/KhronosGroup/SPIRV-LLVM-Translator/issues/477)
93
+
to track progress, discuss and contribute.
94
+
77
95
## Test instructions
78
96
79
97
All tests related to the translator are placed in the [test](test) directory. A number of the tests require spirv-as (part of SPIR-V Tools) to run, but the remainder of the tests can still be run without this. Optionally the tests can make use of spirv-val (part of SPIRV-Tools) in order to validate the generated SPIR-V against the official SPIR-V specification.
0 commit comments