You are not logged in.

#1 2026-01-06 12:12:15

Nestor_013
Member
Registered: 2013-07-27
Posts: 9

numpy 2.4.0 illegal instruction ?

Hi,
when upgrading this morning, numpy moved from 2.3.5-1  to 2.4.0-1, and now when I try to import it I got:
   

$ python
    Python 3.13.11 (main, Dec  7 2025, 13:01:45) [GCC 15.2.1 20251112] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import numpy as np
    Illegal instruction        (core dumped) python 

I reckon that my cpu is rather old : Intel(R) Core(TM)2 Quad CPU    Q6600  @ 2.40GHz, but it is still sufficient for it's duty.

Already tested:
  - Downgrade to 2.3.5-2 -> ModuleNotFoundError: No module named 'numpy'
  - Downgrade to 2.3.5-1 -> Works.

Any advice on what to do to be ready for Python 3.14 ?

Thanks

Offline

#2 2026-01-06 13:06:41

mpan
Member
Registered: 2012-08-01
Posts: 1,553
Website

Re: numpy 2.4.0 illegal instruction ?

Hello. It’s a bug in packaging

Numpy 2.4 now uses x86_64-v2 as the minimum architecture with optimizations enabled, and enables that by default, silently even when the platform doesn’t support it. Which generates invalid instructions. This one to be precise:

pinsrq $0x1,0x8b499b(%rip),%xmm0

The announcement is hidden deep in release notes, as a single sentence inside another section.

The workaround, until Arch adjusts the package, is to rebuilt the package with a changed PKGBUILD:

  python -m build --wheel --no-isolation \
    -Csetup-args="-Dblas=cblas" \
    -Csetup-args="-Dlapack=lapack" \
    -Csetup-args="-Denable-openmp=true" \
    -Csetup-args="-Dcpu-baseline=none"

To align with Google Highway, enabling v1 optimizations on v1 platforms is also blocked.

Last edited by mpan (2026-01-06 13:11:36)


Paperclips in avatars? | Sometimes I seem a bit harsh — don’t get offended too easily!

Offline

#3 2026-01-06 13:14:21

Nestor_013
Member
Registered: 2013-07-27
Posts: 9

Re: numpy 2.4.0 illegal instruction ?

Thanks, I'm relieved to ear it will be addressed.
I'll live with 2.3.5 until then.

Offline

#4 2026-01-11 02:10:39

mpan
Member
Registered: 2012-08-01
Posts: 1,553
Website

Re: numpy 2.4.0 illegal instruction ?

I was about to write to arojas about this, but I discovered it’s fixed (as of 2.4.0-3).

Feel free to update. You should: python 3.14 hit the repos and old python-* packages aren’t going to work.


Paperclips in avatars? | Sometimes I seem a bit harsh — don’t get offended too easily!

Offline

Board footer

Powered by FluxBB