Skip to content

Commit 429d56f

Browse files
committed
initial instructions for gpu offload
1 parent 1d8f15e commit 429d56f

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

src/offload/installation.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Installation
2+
3+
In the future, `std::offload` should become available in nightly builds for users. For now, everyone still needs to build rustc from source.
4+
5+
## Build instructions
6+
7+
First you need to clone and configure the Rust repository:
8+
```bash
9+
git clone --depth=1 [email protected]:rust-lang/rust.git
10+
cd rust
11+
./configure --enable-llvm-link-shared --release-channel=nightly --enable-llvm-assertions --enable-offload --enable-clang --enable-lld --enable-option-checking --enable-ninja --disable-docs
12+
```
13+
14+
Afterwards you can build rustc using:
15+
```bash
16+
./x.py build --stage 1 library
17+
```
18+
19+
Afterwards rustc toolchain link will allow you to use it through cargo:
20+
```
21+
rustup toolchain link enzyme build/host/stage1
22+
rustup toolchain install nightly # enables -Z unstable-options
23+
```
24+
25+
26+
27+
## Build instruction for LLVM itself
28+
```bash
29+
git clone --depth=1 [email protected]:llvm/llvm-project.git
30+
cd llvm-project
31+
mkdir build
32+
cd build
33+
cmake -G Ninja ../llvm -DLLVM_TARGETS_TO_BUILD="host,AMDGPU,NVPTX" -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_ENABLE_PROJECTS="clang;lld" -DLLVM_ENABLE_RUNTIMES="offload,openmp" -DLLVM_ENABLE_PLUGINS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=.
34+
ninja
35+
ninja install
36+
```
37+
This gives you a working LLVM build.

0 commit comments

Comments
 (0)