diff --git a/README.md b/README.md index 2b2b9c8e7a..7cae240d2c 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,25 @@ SPIR generator/Clang is designed to be built as part of an LLVM build. SPIR generator/Clang is based on LLVM/Clang version 3.2. +__Quick version:__ + +```bash +mkdir spir +cd spir +git clone -b khronos/spirv-3.6.1 https://github.com/KhronosGroup/SPIRV-LLVM.git llvm +cd llvm/tools +git clone -b spirv-1.1 https://github.com/KhronosGroup/SPIR clang +cd ../.. +mkdir build +cd build +cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=$PWD/done -DCMAKE_BUILD_TYPE=Release ../llvm +make -j 16 +make install +``` +(adapted from https://github.com/KhronosGroup/SPIR/issues/44 ) + +__Details:__ + The LLVM source code could be downloaded from . It is also available directly from the LLVM svn server: @@ -22,13 +41,13 @@ It is also available directly from the LLVM svn server: Or could be cloned from LLVM git repository: ```bash - git clone http://llvm.org/git/llvm.git llvm + git clone https://git.llvm.org/git/llvm.git/ llvm cd llvm git checkout --track -b release_32 remotes/origin/release_32 ``` Assuming that the LLVM source code is located at **$LLVM_SRC_ROOT**, then the clang -source code should be installed as: **$LLVM_SRC_ROOT/tools/clang**. +source code (meaning, this SPIR repo) should be installed as: **$LLVM_SRC_ROOT/tools/clang**. The directory is not required to be called clang, but doing so will allow the LLVM build system to automatically recognize it and build it along with LLVM. @@ -40,11 +59,19 @@ LLVM build system to automatically recognize it and build it along with LLVM. git checkout --track -b spir_12 remotes/origin/spir_12 ``` +_Branches_ + +The following branches are available: + +- `spirv-1.0`: SPIR-V 1.0 +- `spirv-1.1`: SPIR-V 1.1 +- `spir_12`: SPIR 1.2, ie NOT SPIR-V, eg see https://github.com/KhronosGroup/SPIR/issues/69#issuecomment-310892736 + -------------------------------- Step 2: Configure and Build LLVM -------------------------------- -Configure and build your copy of LLVM (see **$LLVM_SRC_ROOT/GettingStarted.html** for more information). +Configure and build your copy of LLVM (see **https://github.com/llvm-mirror/llvm/blob/release_32/docs/GettingStarted.rst** for more information). Assuming you installed clang at **$LLVM_SRC_ROOT/tools/clang** then Clang will automatically be built with LLVM. Otherwise, run `make` in the Clang source