diff --git a/docs/contribute/source/build_from_src.md b/docs/contribute/source/build_from_src.md index 33f498d8..e66b56ea 100644 --- a/docs/contribute/source/build_from_src.md +++ b/docs/contribute/source/build_from_src.md @@ -15,6 +15,7 @@ Please follow this guide to build and test WasmEdge from the source code. - [OpenHarmony](os/openharmony.md) - [seL4](os/sel4) - [Raspberry Pi](os/raspberrypi.md) +- [S390x](os/s390x.md) :::note diff --git a/docs/contribute/source/os/s390x.md b/docs/contribute/source/os/s390x.md new file mode 100644 index 00000000..f5557baf --- /dev/null +++ b/docs/contribute/source/os/s390x.md @@ -0,0 +1,74 @@ +--- +sidebar_position: 10 +--- + +# Build on IBM LinuxONE(s390x) + +Please follow this tutorial to build and test WasmEdge on s390x hardware from source code. + +## Build WasmEdge + +### Get Source code + +```bash +git clone https://github.com/WasmEdge/WasmEdge.git +``` + +### Dependencies + +WasmEdge requires LLVM 18 at least and you may need to install the following dependencies yourself. + +:::note +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. + +```bash +wget https://apt.llvm.org/llvm.sh +chmod +x llvm.sh +sudo ./llvm.sh 18 +``` +::: + +```bash +sudo apt-get update +sudo apt install -y software-properties-common cmake gcc g++ +sudo apt install -y llvm-18-dev liblld-18-dev +``` + +### Compile + +Please refer to [here](../build_from_src.md#cmake-building-options) for the descriptions of all CMake options. + +```bash +cd WasmEdge +mkdir -p build && cd build +cmake -DCMAKE_BUILD_TYPE=Release .. && make -j +``` + +## Run Tests + +The following tests are available only when the build option `WASMEDGE_BUILD_TESTS` is set to `ON`. + +Users can use these tests to verify the correctness of WasmEdge binaries. + +```bash +cd +LD_LIBRARY_PATH=$(pwd)/lib/api ctest +``` + +## Building Supported Plugins +Currently, the [WASI-NN plugin](../plugin/wasi_nn#build-with-llamacpp-backend-on-linux) is supported on s390x, using the GGML backend. +Building the plugin with BLAS support is recommended. to build the plugin with BLAS support, first install the OpenBLAS library: + +```bash +sudo apt install libopenblas-dev +``` + +Then, build WasmEdge with the following commands: + +```bash +cd +make -DCMAKE_BUILD_TYPE=Release -DWASMEDGE_BUILD_PLUGINS=ON -DWASMEDGE_PLUGIN_WASI_NN_BACKEND="GGML" -DWASMEDGE_PLUGIN_WASI_NN_GGML_LLAMA_BLAS=ON .. +``` + +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 + diff --git a/docs/start/wasmedge/features.md b/docs/start/wasmedge/features.md index f66e6dc3..8c9bb754 100644 --- a/docs/start/wasmedge/features.md +++ b/docs/start/wasmedge/features.md @@ -64,6 +64,7 @@ WasmEdge now supports: - [OpenHarmony](../../contribute/source/os/openharmony.md) - [Raspberry Pi](../../contribute/source/os/raspberrypi.md) - [RISC-V (WIP)](../../contribute/source/os/riscv64.md) +- [S390x](../../contribute/source/os/s390x.md) ## Easy extensible diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/build_from_src.md b/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/build_from_src.md index 33f498d8..e66b56ea 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/build_from_src.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/build_from_src.md @@ -15,6 +15,7 @@ Please follow this guide to build and test WasmEdge from the source code. - [OpenHarmony](os/openharmony.md) - [seL4](os/sel4) - [Raspberry Pi](os/raspberrypi.md) +- [S390x](os/s390x.md) :::note diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/os/s390x.md b/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/os/s390x.md new file mode 100644 index 00000000..f5557baf --- /dev/null +++ b/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/os/s390x.md @@ -0,0 +1,74 @@ +--- +sidebar_position: 10 +--- + +# Build on IBM LinuxONE(s390x) + +Please follow this tutorial to build and test WasmEdge on s390x hardware from source code. + +## Build WasmEdge + +### Get Source code + +```bash +git clone https://github.com/WasmEdge/WasmEdge.git +``` + +### Dependencies + +WasmEdge requires LLVM 18 at least and you may need to install the following dependencies yourself. + +:::note +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. + +```bash +wget https://apt.llvm.org/llvm.sh +chmod +x llvm.sh +sudo ./llvm.sh 18 +``` +::: + +```bash +sudo apt-get update +sudo apt install -y software-properties-common cmake gcc g++ +sudo apt install -y llvm-18-dev liblld-18-dev +``` + +### Compile + +Please refer to [here](../build_from_src.md#cmake-building-options) for the descriptions of all CMake options. + +```bash +cd WasmEdge +mkdir -p build && cd build +cmake -DCMAKE_BUILD_TYPE=Release .. && make -j +``` + +## Run Tests + +The following tests are available only when the build option `WASMEDGE_BUILD_TESTS` is set to `ON`. + +Users can use these tests to verify the correctness of WasmEdge binaries. + +```bash +cd +LD_LIBRARY_PATH=$(pwd)/lib/api ctest +``` + +## Building Supported Plugins +Currently, the [WASI-NN plugin](../plugin/wasi_nn#build-with-llamacpp-backend-on-linux) is supported on s390x, using the GGML backend. +Building the plugin with BLAS support is recommended. to build the plugin with BLAS support, first install the OpenBLAS library: + +```bash +sudo apt install libopenblas-dev +``` + +Then, build WasmEdge with the following commands: + +```bash +cd +make -DCMAKE_BUILD_TYPE=Release -DWASMEDGE_BUILD_PLUGINS=ON -DWASMEDGE_PLUGIN_WASI_NN_BACKEND="GGML" -DWASMEDGE_PLUGIN_WASI_NN_GGML_LLAMA_BLAS=ON .. +``` + +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 + diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/start/wasmedge/features.md b/i18n/zh/docusaurus-plugin-content-docs/current/start/wasmedge/features.md index 704c6b82..98a003e7 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/start/wasmedge/features.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/start/wasmedge/features.md @@ -64,6 +64,7 @@ WasmEdge 目前支持: - [OpenHarmony](../../contribute/source/os/openharmony.md) - [Raspberry Pi](../../contribute/source/os/raspberrypi.md) - [RISC-V(WIP)](../../contribute/source/os/riscv64.md) +- [S390x](../../contribute/source/os/s390x.md) ## 易于扩展