Fangjun Kuang
Committed by GitHub

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

@@ -56,44 +56,105 @@ jobs: @@ -56,44 +56,105 @@ 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 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
  66 + run: |
  67 + uname -a
  68 + gcc --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
  83 +
  84 + mkdir build
  85 + cd build
  86 +
  87 + cmake \
  88 + -D CMAKE_BUILD_TYPE=${{ matrix.build_type }} \
  89 + -D CMAKE_INSTALL_PREFIX=./install \
  90 + -D BUILD_SHARED_LIBS=ON \
  91 + -D SHERPA_ONNX_ENABLE_GPU=ON \
  92 + ..
  93 +
  94 + make -j2
  95 + make install
  96 +
  97 + ls -lh lib
  98 + ls -lh bin
  99 +
  100 + echo "----"
  101 + ls -lh install/lib
  102 +
  103 + echo "----"
  104 + ls -lh install/bin
63 105
64 - - name: Configure CMake 106 + - name: Display dependencies of sherpa-onnx for linux
65 shell: bash 107 shell: bash
66 run: | 108 run: |
67 - export CMAKE_CXX_COMPILER_LAUNCHER=ccache  
68 - export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"  
69 - cmake --version  
70 -  
71 - mkdir build  
72 - cd build  
73 - cmake \  
74 - -D CMAKE_BUILD_TYPE=${{ matrix.build_type }} \  
75 - -D CMAKE_INSTALL_PREFIX=./install \  
76 - -D BUILD_SHARED_LIBS=ON \  
77 - -D SHERPA_ONNX_ENABLE_GPU=ON \  
78 - ..  
79 -  
80 - - name: Build sherpa-onnx for ubuntu 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/')
81 shell: bash 133 shell: bash
82 run: | 134 run: |
83 - export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" 135 + SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
84 136
85 - cd build  
86 - make -j2  
87 - make install 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/
88 143
89 - ls -lh lib  
90 - ls -lh bin 144 + tree $dst
91 145
92 - echo "----"  
93 - ls -lh install/lib 146 + tar cjvf ${dst}.tar.bz2 $dst
94 147
95 - echo "----"  
96 - ls -lh install/bin 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
97 158
98 - name: Display dependencies of sherpa-onnx for linux 159 - name: Display dependencies of sherpa-onnx for linux
99 shell: bash 160 shell: bash
@@ -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 -  
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 238
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