Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 30 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <http://www.llvm.org/releases/3.2/llvm-3.2.src.tar.gz>.

It is also available directly from the LLVM svn server:
Expand All @@ -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.
Expand All @@ -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
Expand Down