|
| 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 | + |
0 commit comments