| 1 | name: elf-riscv32-cpu-gcc |
| 2 | on: |
| 3 | push: |
| 4 | branches: [master] |
| 5 | paths: |
| 6 | - '.github/workflows/elf-riscv32-cpu-gcc.yml' |
| 7 | - 'toolchains/riscv32-unknown-elf.toolchain.cmake' |
| 8 | - 'CMakeLists.txt' |
| 9 | - 'cmake/**' |
| 10 | - 'src/*' |
| 11 | - 'src/layer/*' |
| 12 | - 'src/layer/riscv/**' |
| 13 | - 'tests/**' |
| 14 | pull_request: |
| 15 | branches: [master] |
| 16 | paths: |
| 17 | - '.github/workflows/elf-riscv32-cpu-gcc.yml' |
| 18 | - 'toolchains/riscv32-unknown-elf.toolchain.cmake' |
| 19 | - 'CMakeLists.txt' |
| 20 | - 'cmake/**' |
| 21 | - 'src/*' |
| 22 | - 'src/layer/*' |
| 23 | - 'src/layer/riscv/**' |
| 24 | - 'tests/**' |
| 25 | concurrency: |
| 26 | group: elf-riscv32-cpu-gcc-${{ github.ref }} |
| 27 | cancel-in-progress: true |
| 28 | permissions: |
| 29 | contents: read |
| 30 | |
| 31 | jobs: |
| 32 | newlib-rv32imc-gcc: |
| 33 | runs-on: [self-hosted, linux, centos] |
| 34 | steps: |
| 35 | - uses: actions/checkout@v4 |
| 36 | |
| 37 | #- name: cache-riscv |
| 38 | #id: cache-riscv |
| 39 | #uses: actions/cache@v3 |
| 40 | #with: |
| 41 | #path: rv32imc-install |
| 42 | #key: rv32imc-newlib-install-20210425 |
| 43 | |
| 44 | #- name: install-riscv-build-deps |
| 45 | #if: steps.cache-riscv.outputs.cache-hit != 'true' |
| 46 | #run: | |
| 47 | #sudo apt-get update |
| 48 | #sudo apt-get install autoconf automake autotools-dev curl python3 libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev device-tree-compiler |
| 49 | |
| 50 | #- name: checkout-riscv-gnu-toolchain |
| 51 | #if: steps.cache-riscv.outputs.cache-hit != 'true' |
| 52 | #uses: actions/checkout@v4 |
| 53 | #with: |
| 54 | #repository: riscv/riscv-gnu-toolchain |
| 55 | #path: riscv-gnu-toolchain |
| 56 | #ref: b715e4f01b43efef487166f75d5d85d3c33fa7ef |
| 57 | #- name: checkout-riscv-gnu-toolchain-submodules |
| 58 | #if: steps.cache-riscv.outputs.cache-hit != 'true' |
| 59 | #run: | |
| 60 | #cd riscv-gnu-toolchain |
| 61 | #git submodule update --init --recursive --depth 1 riscv-binutils |
| 62 | #git submodule update --init --recursive --depth 1 riscv-gcc |
| 63 | #git submodule update --init --recursive --depth 1 riscv-glibc |
| 64 | #git submodule update --init --recursive --depth 1 riscv-dejagnu |
| 65 | #git submodule update --init --recursive --depth 1 riscv-newlib |
| 66 | #git submodule update --init --recursive --depth 1 riscv-gdb |
| 67 | #- name: riscv-gnu-toolchain |
| 68 | #if: steps.cache-riscv.outputs.cache-hit != 'true' |
| 69 | #run: | |
| 70 | #cd riscv-gnu-toolchain |
| 71 | #./configure --prefix=$GITHUB_WORKSPACE/rv32imc-install --with-arch=rv32imc |
| 72 | #make -j2 |
| 73 | |
| 74 | #- name: checkout-riscv-pk |
| 75 | #if: steps.cache-riscv.outputs.cache-hit != 'true' |
| 76 | #uses: actions/checkout@v4 |
| 77 | #with: |
| 78 | #repository: riscv/riscv-pk |
| 79 | #path: riscv-pk |
| 80 | #ref: ef7bebaf9bf24d3e90bcaae96387ce418e136b6d |
| 81 | #- name: riscv-pk |
| 82 | #if: steps.cache-riscv.outputs.cache-hit != 'true' |
| 83 | #run: | |
| 84 | #cd riscv-pk |
| 85 | #mkdir build |
| 86 | #cd build |
| 87 | #export PATH=$GITHUB_WORKSPACE/rv32imc-install/bin:$PATH |
| 88 | #../configure --prefix=$GITHUB_WORKSPACE/rv32imc-install --with-arch=rv32imc --host=riscv32-unknown-elf |
| 89 | #make -j2 |
| 90 | #make install |
| 91 | |
| 92 | #- name: checkout-riscv-isa-sim |
| 93 | #if: steps.cache-riscv.outputs.cache-hit != 'true' |
| 94 | #uses: actions/checkout@v4 |
| 95 | #with: |
| 96 | #repository: riscv/riscv-isa-sim |
| 97 | #path: riscv-isa-sim |
| 98 | #ref: 9d4f45c2ebf105503974fc80a42590ca1584c354 |
| 99 | #- name: riscv-isa-sim |
| 100 | #if: steps.cache-riscv.outputs.cache-hit != 'true' |
| 101 | #run: | |
| 102 | #cd riscv-isa-sim |
| 103 | #mkdir build |
| 104 | #cd build |
| 105 | #export PATH=$GITHUB_WORKSPACE/rv32imc-install/bin:$PATH |
| 106 | #../configure --prefix=$GITHUB_WORKSPACE/rv32imc-install --with-isa=rv32imc |
| 107 | #make -j2 |
| 108 | #make install |
| 109 | |
| 110 | #- name: riscv-strip-install |
| 111 | #if: steps.cache-riscv.outputs.cache-hit != 'true' |
| 112 | #run: find $GITHUB_WORKSPACE/rv32imc-install -type f | xargs -i strip -g {} || true |
| 113 | |
| 114 | - name: configure |
| 115 | run: export RISCV_ROOT_PATH=/data/action/osd/rv32imc-install && mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/riscv32-unknown-elf.toolchain.cmake -DNCNN_THREADS=OFF -DNCNN_OPENMP=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON .. |
| 116 | - name: build |
| 117 | run: cmake --build build -j 4 |
| 118 | |
| 119 | # too slow for softfloat arch :( |
| 120 | #- name: test |
| 121 | #run: | |
| 122 | #sudo apt-get update |
| 123 | #sudo apt-get install device-tree-compiler |
| 124 | #export PATH=/data/action/osd/rv32imc-install/bin:$PATH |
| 125 | #cd build |
| 126 | #TESTS_EXECUTABLE_LOADER=spike TESTS_EXECUTABLE_LOADER_ARGUMENTS=/data/action/osd/rv32imc-install/riscv32-unknown-elf/bin/pk ctest --output-on-failure -j 2 |