---
# System prepended metadata

title: SIMDE RVV

---

## SIMDE RVV

1. init docker
```
docker pull ubuntu && docker run -it ubuntu
```


2. install dependncy
```
apt-get update && apt-get install vim
vim config.sh
```
```
# add this to config.sh
apt-get install -y python3 python3-pip git
pip3 install sphinx==5.3.0
apt-get install pkg-config
apt-get install libglib2.0-dev
apt-get install -y ninja-build
apt-get install -y lsb-release wget software-properties-common gnupg
add-apt-repository ppa:savoury1/virtualisation
add-apt-repository ppa:savoury1/display
apt-get update -y
apt-get -yq install ninja-build parallel \
binfmt-support qemu-user-static python3-pip \
libc6-riscv64-cross libstdc++-12-dev-riscv64-cross \
binutils-riscv64-linux-gnu
apt-get install -y pip
python3 -m pip install meson==0.55.0
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
git clone https://gitlab.com/qemu-project/qemu.git
cd qemu
mkdir install
./configure --target-list=riscv64-linux-user
make
make install
qemu-riscv64 --version
cd
sudo apt-get update
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
./llvm.sh 17
apt-get install -y clang-17 lldb-17 lld-17
cd
git clone https://github.com/eric900115/simde.git
```
```
chmod +777 config.sh
./config.sh
```

3. add rvv meson config
```
cd simde
vim docker/cross-files/rvv-clang-17.cross
```
add this to simde/docker/cross-files/rvv-clang-17.cross
```
[binaries]
c = 'clang-17'
cpp = 'clang++-17'
ar = 'llvm-ar-17'
strip = 'llvm-strip-17'
objcopy = 'llvm-objcopy-17'
ld = 'llvm-ld-17'
exe_wrapper = ['qemu-riscv64', '-L', '/usr/riscv64-linux-gnu/', '-cpu', 'rv64,v=true,Zfh=true,x-zvfh=true,vlen=128,elen=64,vext_spec=v1.0']

[properties]
c_args = ['--target=riscv64-linux-gnu',
  '-isystem=/usr/riscv64-linux-gnu/include',
  '-march=rv64gcv1_zfh_zvfh',
  '-menable-experimental-extensions',
  '-mrvv-vector-bits=128',
  '-Wextra',
  '-Werror',
  '-Wno-unsafe-buffer-usage']

cpp_args = ['--target=riscv64-linux-gnu',
  '-isystem=/usr/riscv64-linux-gnu/include',
  '-march=rv64gcv1_zfh_zvfh',
  '-menable-experimental-extensions',
  '-mrvv-vector-bits=128',
  '-Wextra',
  '-Werror',
  '-Wno-unsafe-buffer-usage']

c_link_args = ['--target=riscv64-linux-gnu']

cpp_link_args = ['--target=riscv64-linux-gnu']

[host_machine]
system = 'linux'
cpu_family = 'rv64,v=true,Zfh=true,x-zvfh=true,vlen=128,elen=64,vext_spec=v1.0'
cpu = 'rv64,v=true,Zfh=true,x-zvfh=true,vlen=128,elen=64,vext_spec=v1.0'
endian = 'little'
```

4. meson test
```
meson setup --cross-file=docker/cross-files/rvv-clang-17.cross build || (cat build/meson-logs/meson-log.txt ; false)
ninja -C build -v
meson test -C build --print-errorlogs --print-errorlogs $(meson test -C build --list | grep -v emul)
```
