Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Illegal instruction: 4 thrown on darwin #2

Open
mysyzygy opened this issue Jul 2, 2018 · 7 comments
Open

Illegal instruction: 4 thrown on darwin #2

mysyzygy opened this issue Jul 2, 2018 · 7 comments

Comments

@mysyzygy
Copy link

mysyzygy commented Jul 2, 2018

Performing the following on specific mac computers throws an illegal instruction: 4 error and kills python running python 3.6.5, 3.6.3, and 3.5.4.

$ ipython
In [1]: import samplerate
In [2]: src = samplerate.Resampler('sinc_best', channels=1)
Illegal instruction: 4

Occurs on:
Model Identifier: MacPro6,1
Processor Name: Quad-Core Intel Xeon E5
macOS: 10.12.6
Darwin Kernel Version 16.7.0

$ pip list
Package Version


cffi 1.11.5
numpy 1.14.5
pip 10.0.1
pycparser 2.18
samplerate 0.1.0
setuptools 39.0.1

@tuxu
Copy link
Owner

tuxu commented Jul 3, 2018

Interesting. I'll check the compiler options for the included binaries. In the meantime, you could install libsamplerate from Homebrew, and either replace the included binary (see here) or remove it (will fall back to the one installed on the system).

@mysyzygy
Copy link
Author

Thanks tuxu, I'll give that a try and let you know.

@mysyzygy
Copy link
Author

Yea, that build works thanks!

@CrepeGoat
Copy link

CrepeGoat commented Apr 23, 2021

I'm finding what looks like the same issue on my machine:

>>> import samplerate
>>> resampler = samplerate.Resampler('sinc_medium', channels=1)
Illegal instruction: 4

Machine details:

$ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.13.6
BuildVersion:	17G14042

$ python --version
Python 3.8.6

$ pip list
Package             Version
------------------- ---------
...
cffi                1.14.5
numpy               1.20.2
pip                 21.0.1
pycparser           2.20
samplerate          0.1.0
setuptools          49.2.1
...

@tuxu
Copy link
Owner

tuxu commented Apr 25, 2021

Could you try to install libsamplerate through Homebrew?

$ brew install libsamplerate

The binary shipped with python-samplerate unfortunately still contains instructions for a newer processor generation.

@CrepeGoat
Copy link

CrepeGoat commented Apr 29, 2021

The binary shipped with python-samplerate unfortunately still contains instructions for a newer processor generation.

so is my problem that my processor is too old for the OSX wheel for this package? Is such a compatible wheel something I could make and contribute to this package?

Could you try to install libsamplerate through Homebrew?

...ok it took me a couple reads to understand this right, sorry... here you're asking me to install the required DLL, NOT the package itself.

In that case, it seems like it'd be more useful to fix the wheels/tarball than do a one-time fix on just my machine. But that depends on your response to my first comment, I guess. I'm curious what you think!

@tuxu
Copy link
Owner

tuxu commented Apr 30, 2021

Yes, indeed. I took the binary from a Homebrew installation on my 2014 MacBook Pro (3 GHz, Core i7). Unfortunately the binary was optimized for this CPU when I installed it.

Regarding the second point: I fully agree that the wheel should be fixed! However, the dylib that is included in the wheel will only be used if libsamplerate can't be found elsewhere on your system. So installing the library through Homebrew should resolve the problem too, without modifying the wheel or Python installation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants