cmusphinx / pocketsphinx

A small speech recognizer
Other
3.93k stars 717 forks source link

ToT wants arm64e or arm64 to build on Apple silicon, but pypi version is fine #400

Open lenzo-ka opened 4 days ago

lenzo-ka commented 4 days ago

The pypi version instealls fine on macOS on Apple Silicon, but when building from source:

python
Python 3.12.4 (main, Jul  8 2024, 10:17:47) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pocketsphinx
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File ".../ve_slab/lib/python3.12/site-packages/pocketsphinx/__init__.py", line 41, in <module>
    from . import _pocketsphinx as pocketsphinx  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: dlopen(.../ve_slab/lib/python3.12/site-packages/pocketsphinx/_pocketsphinx.cpython-312-darwin.so, 0x0002): tried: '.../ve_slab/lib/python3.12/site-packages/pocketsphinx/_pocketsphinx.cpython-312-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')), '..../ve_slab/lib/python3.12/site-packages/pocketsphinx/_pocketsphinx.cpython-312-darwin.so' (no such file), '...../ve_slab/lib/python3.12/site-packages/pocketsphinx/_pocketsphinx.cpython-312-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64'))
lenzo-ka commented 4 days ago

When doing pip install . it did not complain.

To fix it locally,

arch -arm64 python -m pip install .

does the trick.

dhdaines commented 2 days ago

Thanks Kevin! I must have misconfigured cibuildwheel somehow - is it the case that the universal builds are not really universal?