Skip to content

Commit 6f99459

Browse files
authored
Merge pull request #208 from wanghan-sanechips/riscv-benchmark-fix
build: Update benchmark submodule for RISC-V
2 parents 4793b4d + b68435f commit 6f99459

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: riscv64-qemu-test
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
env:
9+
RISCV_CROSSCOMPILE: "ON"
10+
riscv_gnu_toolchain_download_path: https://github.com/riscv-collab/riscv-gnu-toolchain/releases/download/2025.07.03/riscv64-glibc-ubuntu-24.04-gcc-nightly-2025.07.03-nightly.tar.xz
11+
RISCV_PATH: /opt/riscv
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
submodules: recursive
17+
18+
- name: Install dependencies
19+
run: |
20+
sudo apt update
21+
sudo apt install -y --no-install-recommends \
22+
qemu-user qemu-user-static \
23+
build-essential \
24+
cmake \
25+
git
26+
sudo mkdir -p $RISCV_PATH
27+
wget ${riscv_gnu_toolchain_download_path} -O riscv-toolchain.tar.xz
28+
sudo tar -xvf riscv-toolchain.tar.xz -C $RISCV_PATH --strip-components=1
29+
sudo sed -i "s|libdir='/mnt/riscv/riscv64-unknown-linux-gnu/lib'|libdir='$RISCV_PATH/riscv64-unknown-linux-gnu/lib'|g" $RISCV_PATH/riscv64-unknown-linux-gnu/lib/libatomic.la
30+
31+
- name: Build and Run Unit Tests
32+
run: |
33+
export PATH=$RISCV_PATH/bin:$PATH
34+
export LD_LIBRARY_PATH="/opt/riscv/lib:$LD_LIBRARY_PATH"
35+
export QEMU_LD_PREFIX=$RISCV_PATH/sysroot
36+
mkdir build && cd build
37+
cmake -DCMAKE_BUILD_TYPE=Release ../
38+
make -j$(nproc)
39+
make test
40+
41+
- name: Run Benchmark
42+
run: ./build/snappy_benchmark
43+
working-directory: ./

third_party/benchmark

Submodule benchmark updated 166 files

0 commit comments

Comments
 (0)