Skip to content

Commit

Permalink
riscv64 clang ci
Browse files Browse the repository at this point in the history
  • Loading branch information
nihui committed Dec 3, 2024
1 parent 032b07a commit df7e93f
Showing 1 changed file with 21 additions and 31 deletions.
52 changes: 21 additions & 31 deletions .github/workflows/linux-riscv64-cpu-gnu-clang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ permissions:

jobs:
linux-gcc-riscv64-rvv:
runs-on: [self-hosted, linux, centos]
runs-on: [self-hosted, linux, ubuntu]
steps:
- uses: actions/checkout@v4

#- name: cache-qemu
#id: cache-qemu
#uses: actions/cache@v3
#uses: actions/cache@v4
#with:
#path: qemu-install
#key: qemu-riscv64-install-20220502-3
#key: qemu-riscv64-install-20241202
#- name: install-qemu-build-deps
#if: steps.cache-qemu.outputs.cache-hit != 'true'
#run: |
Expand All @@ -51,23 +51,21 @@ jobs:
#with:
#repository: qemu/qemu
#path: qemu
#ref: f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65
#ref: 72b88908d12ee9347d13539c7dd9a252625158d1
#- name: qemu
#if: steps.cache-qemu.outputs.cache-hit != 'true'
#run: |
#cd qemu
#wget https://raw.githubusercontent.com/nihui/ncnn-assets/master/qemu-patches/0007-linux-user-Expose-risc-v-V-isa-bit-in-get_elf_hwcap.patch
#patch -p1 -i 0007-linux-user-Expose-risc-v-V-isa-bit-in-get_elf_hwcap.patch
#./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=riscv64-linux-user --disable-system
#make -j2
#make -j4
#make install

#- name: cache-riscv
#id: cache-riscv
#uses: actions/cache@v3
#uses: actions/cache@v4
#with:
#path: rv64gcv-install-next
#key: rv64gcv-linux-install-20210504
#path: riscv-install
#key: riscv-linux-install-20241202

#- name: install-riscv-build-deps
#if: steps.cache-riscv.outputs.cache-hit != 'true'
Expand All @@ -79,9 +77,9 @@ jobs:
#if: steps.cache-riscv.outputs.cache-hit != 'true'
#uses: actions/checkout@v4
#with:
#repository: riscv/riscv-gnu-toolchain
#repository: riscv-collab/riscv-gnu-toolchain
#path: riscv-gnu-toolchain
#ref: da01ba455ce3802ffa84fdca3a089079996dbfc3
#ref: 20f615317e2ce888dfc11b29ccde4a649494b654
#- name: checkout-riscv-gnu-toolchain-submodules
#if: steps.cache-riscv.outputs.cache-hit != 'true'
#run: |
Expand All @@ -96,47 +94,39 @@ jobs:
#if: steps.cache-riscv.outputs.cache-hit != 'true'
#run: |
#cd riscv-gnu-toolchain
#sed -i '/__OBSOLETE_MATH/d' newlib/newlib/libm/common/math_errf.c
#./configure --prefix=$GITHUB_WORKSPACE/rv64gcv-install-next --with-arch=rv64gcv_zfh
#make linux
#./configure --prefix=$GITHUB_WORKSPACE/riscv
#make linux -j4

#- name: riscv-strip-install
#if: steps.cache-riscv.outputs.cache-hit != 'true'
#run: find $GITHUB_WORKSPACE/rv64gcv-install-next -type f | xargs -i strip -g {} || true
#run: find $GITHUB_WORKSPACE/riscv -type f | xargs -i strip -g {} || true

# - name: install-clang
# run: |
# wget https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.1/llvm-project-15.0.1.src.tar.xz
# tar -xf llvm-project-15.0.1.src.tar.xz
# cd llvm-project-15.0.1.src
# wget https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.4/llvm-project-19.1.4.src.tar.xz
# tar -xf llvm-project-19.1.4.src.tar.xz
# cd llvm-project-19.1.4.src
# mkdir build
# cd build
# cmake -DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DLLVM_ENABLE_PROJECTS="clang" -DLLVM_TARGETS_TO_BUILD="RISCV" -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF ../llvm/
# cmake -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/riscv -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DLLVM_ENABLE_PROJECTS="clang" -DLLVM_TARGETS_TO_BUILD="RISCV" -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF ../llvm/
# make -j16
# make install

- name: build
env:
LD_LIBRARY_PATH: /data/action/install/lib64
run: |
export RISCV_ROOT_PATH=/data/action/osd/rv64gcv-install-next
export PATH=/data/action/osd/llvm-project-15.0.1.src/build/install/bin:$PATH
export RISCV_ROOT_PATH=/data/action/osd/riscv
mkdir build && cd build
cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/riscv64-unknown-linux-gnu.llvm-toolchain.cmake -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON ..
cmake --build . -j 4
cmake --build . -j 8
- name: test-vlen256
env:
LD_LIBRARY_PATH: /data/action/install/lib64
run: |
export PATH=/data/action/osd/qemu-install/bin:$PATH
cd build
TESTS_EXECUTABLE_LOADER=qemu-riscv64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-cpu;rv64,v=true,Zfh=true,vlen=256,elen=64,vext_spec=v1.0;-L;/data/action/osd/rv64gcv-install-next/sysroot" ctest --output-on-failure -j 4
TESTS_EXECUTABLE_LOADER=qemu-riscv64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-cpu;rv64,v=true,zfh=true,zvfh=true,vlen=256,elen=64,vext_spec=v1.0;-L;/data/action/osd/riscv/sysroot" ctest --output-on-failure -j 8
- name: test-vlen128
env:
LD_LIBRARY_PATH: /data/action/install/lib64
run: |
export PATH=/data/action/osd/qemu-install/bin:$PATH
cd build
TESTS_EXECUTABLE_LOADER=qemu-riscv64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-cpu;rv64,v=true,Zfh=true,vlen=128,elen=64,vext_spec=v1.0;-L;/data/action/osd/rv64gcv-install-next/sysroot" ctest --output-on-failure -j 4
TESTS_EXECUTABLE_LOADER=qemu-riscv64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-cpu;rv64,v=true,zfh=true,zvfh=true,vlen=128,elen=64,vext_spec=v1.0;-L;/data/action/osd/riscv/sysroot" ctest --output-on-failure -j 8

0 comments on commit df7e93f

Please sign in to comment.