Fangjun Kuang
Committed by GitHub

Use manylinux_2_28_x86_64 to build linux gpu for sherpa-onnx (#2123)

@@ -56,20 +56,34 @@ jobs: @@ -56,20 +56,34 @@ jobs:
56 with: 56 with:
57 fetch-depth: 0 57 fetch-depth: 0
58 58
59 - - name: ccache  
60 - uses: hendrikmuhs/ccache-action@v1.2 59 + - name: Build sherpa-onnx
  60 + uses: addnab/docker-run-action@v3
61 with: 61 with:
62 - key: ${{ matrix.os }}-${{ matrix.build_type }}-gpu  
63 -  
64 - - name: Configure CMake 62 + image: quay.io/pypa/manylinux_2_28_x86_64
  63 + options: |
  64 + --volume ${{ github.workspace }}/:/home/runner/work/sherpa-onnx/sherpa-onnx
65 shell: bash 65 shell: bash
66 run: | 66 run: |
67 - export CMAKE_CXX_COMPILER_LAUNCHER=ccache  
68 - export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" 67 + uname -a
  68 + gcc --version
69 cmake --version 69 cmake --version
  70 + cat /etc/*release
  71 + id
  72 + pwd
  73 +
  74 + cd /home/runner/work/sherpa-onnx/sherpa-onnx
  75 +
  76 + git clone --depth 1 --branch v1.2.12 https://github.com/alsa-project/alsa-lib
  77 + pushd alsa-lib
  78 + ./gitcompile
  79 + popd
  80 +
  81 + export CPLUS_INCLUDE_PATH=$PWD/alsa-lib/include:$CPLUS_INCLUDE_PATH
  82 + export SHERPA_ONNX_ALSA_LIB_DIR=$PWD/alsa-lib/src/.libs
70 83
71 mkdir build 84 mkdir build
72 cd build 85 cd build
  86 +
73 cmake \ 87 cmake \
74 -D CMAKE_BUILD_TYPE=${{ matrix.build_type }} \ 88 -D CMAKE_BUILD_TYPE=${{ matrix.build_type }} \
75 -D CMAKE_INSTALL_PREFIX=./install \ 89 -D CMAKE_INSTALL_PREFIX=./install \
@@ -77,12 +91,6 @@ jobs: @@ -77,12 +91,6 @@ jobs:
77 -D SHERPA_ONNX_ENABLE_GPU=ON \ 91 -D SHERPA_ONNX_ENABLE_GPU=ON \
78 .. 92 ..
79 93
80 - - name: Build sherpa-onnx for ubuntu  
81 - shell: bash  
82 - run: |  
83 - export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"  
84 -  
85 - cd build  
86 make -j2 94 make -j2
87 make install 95 make install
88 96
@@ -98,6 +106,59 @@ jobs: @@ -98,6 +106,59 @@ jobs:
98 - name: Display dependencies of sherpa-onnx for linux 106 - name: Display dependencies of sherpa-onnx for linux
99 shell: bash 107 shell: bash
100 run: | 108 run: |
  109 + du -h -d1 .
  110 + sudo chown -R $USER ./build
  111 + ls -lh build/bin
  112 + ls -lh build/_deps/onnxruntime-src/lib/
  113 +
  114 + echo "strip"
  115 + strip build/bin/*
  116 + echo "after strip"
  117 + ls -lh build/bin
  118 +
  119 + file build/bin/sherpa-onnx
  120 + file build/bin/sherpa-onnx
  121 + ls -lh build/bin/sherpa-onnx
  122 + readelf -d build/bin/sherpa-onnx
  123 +
  124 + rm -fv build/install/include/cargs.h
  125 + rm -fv build/install/lib/cargs.h
  126 + rm -fv build/install/lib/libcargs.so
  127 + rm -rfv build/install/lib/pkgconfig
  128 +
  129 + strings build/install/lib/*.so | grep "^GLIBC_"
  130 +
  131 + - name: Copy files
  132 + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
  133 + shell: bash
  134 + run: |
  135 + SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
  136 +
  137 + dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-linux-x64-gpu
  138 + mkdir $dst
  139 +
  140 + cp -a build/install/bin $dst/
  141 + cp -a build/install/lib $dst/
  142 + cp -a build/install/include $dst/
  143 +
  144 + tree $dst
  145 +
  146 + tar cjvf ${dst}.tar.bz2 $dst
  147 +
  148 + - name: Release pre-compiled binaries and libs for linux x64
  149 + if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
  150 + uses: svenstaro/upload-release-action@v2
  151 + with:
  152 + file_glob: true
  153 + overwrite: true
  154 + file: sherpa-onnx-*linux-x64-gpu.tar.bz2
  155 + # repo_name: k2-fsa/sherpa-onnx
  156 + # repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
  157 + # tag: v1.11.3
  158 +
  159 + - name: Display dependencies of sherpa-onnx for linux
  160 + shell: bash
  161 + run: |
101 file build/bin/sherpa-onnx 162 file build/bin/sherpa-onnx
102 readelf -d build/bin/sherpa-onnx 163 readelf -d build/bin/sherpa-onnx
103 164
@@ -174,27 +235,6 @@ jobs: @@ -174,27 +235,6 @@ jobs:
174 235
175 .github/scripts/test-online-transducer.sh 236 .github/scripts/test-online-transducer.sh
176 237
177 - - name: Copy files  
178 - if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/')  
179 - shell: bash  
180 - run: |  
181 - SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)  
182 238
183 - dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-linux-x64-gpu  
184 - mkdir $dst  
185 -  
186 - cp -a build/install/bin $dst/  
187 - cp -a build/install/lib $dst/  
188 - cp -a build/install/include $dst/  
189 -  
190 - tree $dst  
191 239
192 - tar cjvf ${dst}.tar.bz2 $dst  
193 240
194 - - name: Release pre-compiled binaries and libs for linux x64  
195 - if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && github.event_name == 'push' && contains(github.ref, 'refs/tags/')  
196 - uses: svenstaro/upload-release-action@v2  
197 - with:  
198 - file_glob: true  
199 - overwrite: true  
200 - file: sherpa-onnx-*linux-x64-gpu.tar.bz2