thewh1teagle / sherpa-rs

Rust bindings to https://github.com/k2-fsa/sherpa-onnx
MIT License
43 stars 10 forks source link

Trying to build to android target, but failing #11

Open jamwise opened 2 months ago

jamwise commented 2 months ago

I'm able to build my Rust app on my mac and with an Android target without sherpa-rs included, but once it is included , it fails at Compiling sherpa-rs-sys v0.1.9.

I've tried regular build with a different target:

cargo build --target aarch64-linux-android --release

As well as cargo ndk:

cargo ndk --target aarch64-linux-android -- build --release
error: failed to run custom build command for `sherpa-rs-sys v0.1.9`

Caused by:
  process didn't exit successfully: `/Users/myuser/dev/whence/modules/pathfinder/rust/target/release/build/sherpa-rs-sys-36c482cd016cd031/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=TARGET
  cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS_aarch64-linux-android
  cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS_aarch64_linux_android
  cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS
  cargo:rerun-if-changed=wrapper.h
  cargo:rerun-if-changed=./sherpa-onnx/sherpa-onnx/c-api/c-api.h
  cargo:rerun-if-changed=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/stdint.h
  cargo:rerun-if-changed=wrapper.h
  cargo:rerun-if-changed=./sherpa-onnx
  CMAKE_TOOLCHAIN_FILE_aarch64-linux-android = None
  CMAKE_TOOLCHAIN_FILE_aarch64_linux_android = None
  TARGET_CMAKE_TOOLCHAIN_FILE = None
  CMAKE_TOOLCHAIN_FILE = None
  CMAKE_GENERATOR_aarch64-linux-android = None
  CMAKE_GENERATOR_aarch64_linux_android = None
  TARGET_CMAKE_GENERATOR = None
  CMAKE_GENERATOR = None
  CMAKE_PREFIX_PATH_aarch64-linux-android = None
  CMAKE_PREFIX_PATH_aarch64_linux_android = None
  TARGET_CMAKE_PREFIX_PATH = None
  CMAKE_PREFIX_PATH = None
  CMAKE_aarch64-linux-android = None
  CMAKE_aarch64_linux_android = None
  TARGET_CMAKE = None
  CMAKE = None
  running: cd "/Users/myuser/dev/whence/modules/pathfinder/rust/target/aarch64-linux-android/release/build/sherpa-rs-sys-e94d2663518898e8/out/build" && CMAKE_PREFIX_PATH="" "cmake" "/Users/myuser/dev/whence/modules/pathfinder/rust/target/aarch64-linux-android/release/build/sherpa-rs-sys-e94d2663518898e8/out/sherpa-onnx" "-DSHERPA_ONNX_ENABLE_C_API=ON" "-DSHERPA_ONNX_ENABLE_BINARY=OFF" "-DBUILD_SHARED_LIBS=OFF" "-DSHERPA_ONNX_ENABLE_WEBSOCKET=OFF" "-DSHERPA_ONNX_ENABLE_TTS=OFF" "-DSHERPA_ONNX_BUILD_C_API_EXAMPLES=OFF" "-DCMAKE_SYSTEM_NAME=Android" "-DCMAKE_SYSTEM_PROCESSOR=aarch64" "-DCMAKE_INSTALL_PREFIX=/Users/myuser/dev/whence/modules/pathfinder/rust/target/aarch64-linux-android/release/build/sherpa-rs-sys-e94d2663518898e8/out" "-DCMAKE_C_FLAGS= -DANDROID -ffunction-sections -fdata-sections -fPIC --target=aarch64-linux-android --target=aarch64-linux-android31" "-DCMAKE_C_COMPILER=/Users/myuser/Library/Android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang" "-DCMAKE_CXX_FLAGS= -DANDROID -ffunction-sections -fdata-sections -fPIC --target=aarch64-linux-android --target=aarch64-linux-android31" "-DCMAKE_CXX_COMPILER=/Users/myuser/Library/Android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++" "-DCMAKE_ASM_FLAGS= -DANDROID -ffunction-sections -fdata-sections -fPIC --target=aarch64-linux-android --target=aarch64-linux-android31" "-DCMAKE_ASM_COMPILER=/Users/myuser/Library/Android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang" "-DCMAKE_BUILD_TYPE=Release"

  --- stderr
  thread 'main' panicked at /Users/myuser/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cmake-0.1.51/src/lib.rs:1100:5:
thewh1teagle commented 1 month ago

Hey Seems like the end of the error truncated?