fix building linux x86 wheels (#484)
This commit is contained in:
9
.github/workflows/build-wheels-aarch64.yaml
vendored
9
.github/workflows/build-wheels-aarch64.yaml
vendored
@@ -38,6 +38,15 @@ jobs:
|
||||
- name: Build wheels
|
||||
uses: pypa/cibuildwheel@v2.15.0
|
||||
env:
|
||||
CIBW_BEFORE_ALL: |
|
||||
git clone --depth 1 https://github.com/alsa-project/alsa-lib
|
||||
cd alsa-lib
|
||||
./gitcompile
|
||||
cd ..
|
||||
echo "PWD"
|
||||
ls -lh /project/alsa-lib/src/.libs
|
||||
|
||||
CIBW_ENVIRONMENT: CPLUS_INCLUDE_PATH=/project/alsa-lib/include:$CPLUS_INCLUDE_PATH SHERPA_ONNX_ALSA_LIB_DIR=/project/alsa-lib/src/.libs LD_LIBRARY_PATH=/project/build/bdist.linux-x86_64/wheel/sherpa_onnx/lib:$SHERPA_ONNX_ALSA_LIB_DIR SHERPA_ONNX_MAKE_ARGS="VERBOSE=1"
|
||||
CIBW_BUILD: "${{ matrix.python-version}}-* "
|
||||
CIBW_SKIP: "cp27-* cp35-* cp36-* *-win32 pp* *-musllinux* *-manylinux_i686"
|
||||
CIBW_BUILD_VERBOSITY: 3
|
||||
|
||||
11
.github/workflows/build-wheels-linux.yaml
vendored
11
.github/workflows/build-wheels-linux.yaml
vendored
@@ -33,10 +33,19 @@ jobs:
|
||||
- name: Build wheels
|
||||
uses: pypa/cibuildwheel@v2.15.0
|
||||
env:
|
||||
CIBW_BEFORE_ALL: |
|
||||
git clone --depth 1 https://github.com/alsa-project/alsa-lib
|
||||
cd alsa-lib
|
||||
./gitcompile
|
||||
cd ..
|
||||
echo "PWD"
|
||||
ls -lh /project/alsa-lib/src/.libs
|
||||
|
||||
CIBW_ENVIRONMENT: CPLUS_INCLUDE_PATH=/project/alsa-lib/include:$CPLUS_INCLUDE_PATH SHERPA_ONNX_ALSA_LIB_DIR=/project/alsa-lib/src/.libs LD_LIBRARY_PATH=/project/build/bdist.linux-x86_64/wheel/sherpa_onnx/lib:$SHERPA_ONNX_ALSA_LIB_DIR SHERPA_ONNX_MAKE_ARGS="VERBOSE=1"
|
||||
|
||||
CIBW_BUILD: "${{ matrix.python-version}}-* "
|
||||
CIBW_SKIP: "cp27-* cp35-* cp36-* *-win32 pp* *-musllinux* *-manylinux_i686"
|
||||
CIBW_BUILD_VERBOSITY: 3
|
||||
CIBW_ENVIRONMENT_LINUX: LD_LIBRARY_PATH='/project/build/bdist.linux-x86_64/wheel/sherpa_onnx/lib'
|
||||
|
||||
- name: Display wheels
|
||||
shell: bash
|
||||
|
||||
@@ -26,6 +26,18 @@ def is_windows():
|
||||
return platform.system() == "Windows"
|
||||
|
||||
|
||||
def is_linux():
|
||||
return platform.system() == "Linux"
|
||||
|
||||
|
||||
def is_arm64():
|
||||
return platform.machine() in ["arm64", "aarch64"]
|
||||
|
||||
|
||||
def is_x86():
|
||||
return platform.machine() in ["i386", "i686", "x86_64"]
|
||||
|
||||
|
||||
try:
|
||||
from wheel.bdist_wheel import bdist_wheel as _bdist_wheel
|
||||
|
||||
@@ -144,8 +156,10 @@ class BuildExtension(build_ext):
|
||||
binaries += ["sherpa-onnx-vad-microphone-offline-asr"]
|
||||
binaries += ["sherpa-onnx-offline-tts"]
|
||||
binaries += ["sherpa-onnx-offline-tts-play"]
|
||||
binaries += ["sherpa-onnx-alsa"]
|
||||
binaries += ["sherpa-onnx-offline-tts-play-alsa"]
|
||||
|
||||
if is_linux() and (is_arm64() or is_x86()):
|
||||
binaries += ["sherpa-onnx-alsa"]
|
||||
binaries += ["sherpa-onnx-offline-tts-play-alsa"]
|
||||
|
||||
if is_windows():
|
||||
binaries += ["kaldi-native-fbank-core.dll"]
|
||||
@@ -168,10 +182,6 @@ class BuildExtension(build_ext):
|
||||
if not src_file.is_file():
|
||||
src_file = install_dir / ".." / (f + suffix)
|
||||
|
||||
if not src_file.is_file() and 'alsa' in f:
|
||||
print(f'Skipping {f}')
|
||||
continue
|
||||
|
||||
print(f"Copying {src_file} to {out_bin_dir}/")
|
||||
shutil.copy(f"{src_file}", f"{out_bin_dir}/")
|
||||
|
||||
|
||||
10
setup.py
10
setup.py
@@ -12,6 +12,9 @@ from cmake.cmake_extension import (
|
||||
bdist_wheel,
|
||||
cmake_extension,
|
||||
is_windows,
|
||||
is_linux,
|
||||
is_arm64,
|
||||
is_x86,
|
||||
)
|
||||
|
||||
|
||||
@@ -60,8 +63,11 @@ def get_binaries_to_install():
|
||||
binaries += ["sherpa-onnx-vad-microphone-offline-asr"]
|
||||
binaries += ["sherpa-onnx-offline-tts"]
|
||||
binaries += ["sherpa-onnx-offline-tts-play"]
|
||||
binaries += ["sherpa-onnx-alsa"]
|
||||
binaries += ["sherpa-onnx-offline-tts-play-alsa"]
|
||||
|
||||
if is_linux() and (is_arm64() or is_x86()):
|
||||
binaries += ["sherpa-onnx-alsa"]
|
||||
binaries += ["sherpa-onnx-offline-tts-play-alsa"]
|
||||
|
||||
if is_windows():
|
||||
binaries += ["kaldi-native-fbank-core.dll"]
|
||||
binaries += ["sherpa-onnx-c-api.dll"]
|
||||
|
||||
Reference in New Issue
Block a user