Skip to content

Commit 85ec15f

Browse files
docs: add build instructions for s390x
Signed-off-by: vishruth-thimmaiah <vishruththimmaiah@gmail.com>
1 parent a1a8601 commit 85ec15f

File tree

6 files changed

+152
-0
lines changed

6 files changed

+152
-0
lines changed

docs/contribute/source/build_from_src.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Please follow this guide to build and test WasmEdge from the source code.
1515
- [OpenHarmony](os/openharmony.md)
1616
- [seL4](os/sel4)
1717
- [Raspberry Pi](os/raspberrypi.md)
18+
- [S390x](os/s390x.md)
1819

1920
<!-- prettier-ignore -->
2021
:::note

docs/contribute/source/os/s390x.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
sidebar_position: 10
3+
---
4+
5+
# Build on IBM LinuxONE(s390x)
6+
7+
Please follow this tutorial to build and test WasmEdge on s390x hardware from source code.
8+
9+
## Build WasmEdge
10+
11+
### Get Source code
12+
13+
```bash
14+
git clone https://github.com/WasmEdge/WasmEdge.git
15+
```
16+
17+
### Dependencies
18+
19+
WasmEdge requires LLVM 18 at least and you may need to install the following dependencies yourself.
20+
21+
:::note
22+
As Ubuntu 22.04 and previous versions of Ubuntu do not include the llvm-18 package, you can instead use the official llvm repository to install llvm-18.
23+
24+
```bash
25+
wget https://apt.llvm.org/llvm.sh
26+
chmod +x llvm.sh
27+
sudo ./llvm.sh 18
28+
```
29+
:::
30+
31+
```bash
32+
sudo apt-get update
33+
sudo apt install -y software-properties-common cmake gcc g++
34+
sudo apt install -y llvm-18-dev liblld-18-dev
35+
```
36+
37+
### Compile
38+
39+
Please refer to [here](../build_from_src.md#cmake-building-options) for the descriptions of all CMake options.
40+
41+
```bash
42+
cd WasmEdge
43+
mkdir -p build && cd build
44+
cmake -DCMAKE_BUILD_TYPE=Release .. && make -j
45+
```
46+
47+
## Run Tests
48+
49+
The following tests are available only when the build option `WASMEDGE_BUILD_TESTS` is set to `ON`.
50+
51+
Users can use these tests to verify the correctness of WasmEdge binaries.
52+
53+
```bash
54+
cd <path/to/wasmedge/build_folder>
55+
LD_LIBRARY_PATH=$(pwd)/lib/api ctest
56+
```
57+
58+
## Building Supported Plugins
59+
Currently, the [WASI-NN plugin](../plugin/wasi_nn#build-with-llamacpp-backend-on-linux) is supported on s390x, using the GGML backend.
60+
Building the plugin with BLAS support is recommended. to build the plugin with BLAS support, first install the OpenBLAS library:
61+
62+
```bash
63+
sudo apt install libopenblas-dev
64+
```
65+
66+
Then, build WasmEdge with the following commands:
67+
68+
```bash
69+
cd <path/to/wasmedge/build_folder>
70+
make -DCMAKE_BUILD_TYPE=Release -DWASMEDGE_BUILD_PLUGINS=ON -DWASMEDGE_PLUGIN_WASI_NN_BACKEND="GGML" -DWASMEDGE_PLUGIN_WASI_NN_GGML_LLAMA_BLAS=ON ..
71+
```
72+
73+
A guide on converting models to big endian is available at https://github.com/ggml-org/llama.cpp/blob/master/docs/build-s390x.md#getting-gguf-models
74+

docs/start/wasmedge/features.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ WasmEdge now supports:
6464
- [OpenHarmony](../../contribute/source/os/openharmony.md)
6565
- [Raspberry Pi](../../contribute/source/os/raspberrypi.md)
6666
- [RISC-V (WIP)](../../contribute/source/os/riscv64.md)
67+
- [S390x](../../contribute/source/os/s390x.md)
6768

6869
## Easy extensible
6970

i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/build_from_src.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Please follow this guide to build and test WasmEdge from the source code.
1515
- [OpenHarmony](os/openharmony.md)
1616
- [seL4](os/sel4)
1717
- [Raspberry Pi](os/raspberrypi.md)
18+
- [S390x](os/s390x.md)
1819

1920
<!-- prettier-ignore -->
2021
:::note
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
sidebar_position: 10
3+
---
4+
5+
# Build on IBM LinuxONE(s390x)
6+
7+
Please follow this tutorial to build and test WasmEdge on s390x hardware from source code.
8+
9+
## Build WasmEdge
10+
11+
### Get Source code
12+
13+
```bash
14+
git clone https://github.com/WasmEdge/WasmEdge.git
15+
```
16+
17+
### Dependencies
18+
19+
WasmEdge requires LLVM 18 at least and you may need to install the following dependencies yourself.
20+
21+
:::note
22+
As Ubuntu 22.04 and previous versions of Ubuntu do not include the llvm-18 package, you can instead use the official llvm repository to install llvm-18.
23+
24+
```bash
25+
wget https://apt.llvm.org/llvm.sh
26+
chmod +x llvm.sh
27+
sudo ./llvm.sh 18
28+
```
29+
:::
30+
31+
```bash
32+
sudo apt-get update
33+
sudo apt install -y software-properties-common cmake gcc g++
34+
sudo apt install -y llvm-18-dev liblld-18-dev
35+
```
36+
37+
### Compile
38+
39+
Please refer to [here](../build_from_src.md#cmake-building-options) for the descriptions of all CMake options.
40+
41+
```bash
42+
cd WasmEdge
43+
mkdir -p build && cd build
44+
cmake -DCMAKE_BUILD_TYPE=Release .. && make -j
45+
```
46+
47+
## Run Tests
48+
49+
The following tests are available only when the build option `WASMEDGE_BUILD_TESTS` is set to `ON`.
50+
51+
Users can use these tests to verify the correctness of WasmEdge binaries.
52+
53+
```bash
54+
cd <path/to/wasmedge/build_folder>
55+
LD_LIBRARY_PATH=$(pwd)/lib/api ctest
56+
```
57+
58+
## Building Supported Plugins
59+
Currently, the [WASI-NN plugin](../plugin/wasi_nn#build-with-llamacpp-backend-on-linux) is supported on s390x, using the GGML backend.
60+
Building the plugin with BLAS support is recommended. to build the plugin with BLAS support, first install the OpenBLAS library:
61+
62+
```bash
63+
sudo apt install libopenblas-dev
64+
```
65+
66+
Then, build WasmEdge with the following commands:
67+
68+
```bash
69+
cd <path/to/wasmedge/build_folder>
70+
make -DCMAKE_BUILD_TYPE=Release -DWASMEDGE_BUILD_PLUGINS=ON -DWASMEDGE_PLUGIN_WASI_NN_BACKEND="GGML" -DWASMEDGE_PLUGIN_WASI_NN_GGML_LLAMA_BLAS=ON ..
71+
```
72+
73+
A guide on converting models to big endian is available at https://github.com/ggml-org/llama.cpp/blob/master/docs/build-s390x.md#getting-gguf-models
74+

i18n/zh/docusaurus-plugin-content-docs/current/start/wasmedge/features.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ WasmEdge 目前支持:
6464
- [OpenHarmony](../../contribute/source/os/openharmony.md)
6565
- [Raspberry Pi](../../contribute/source/os/raspberrypi.md)
6666
- [RISC-V(WIP)](../../contribute/source/os/riscv64.md)
67+
- [S390x](../../contribute/source/os/s390x.md)
6768

6869
## 易于扩展
6970

0 commit comments

Comments
 (0)