# Source: https://github.com/WasmEdge/docs.git
# Path: contribute/source/os/s390x.md

---
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 <path/to/wasmedge/build_folder>
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 <path/to/wasmedge/build_folder>
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