With those changes, builds ok and 'import numpy' doesn't core dump.

Stu

On Fri, 16 Jan 2026, Theo Buehler wrote:

> > CPU Optimization Options
> >   baseline:
> >     Requested : min
> >     Enabled   : X86_V2
> >   dispatch:
> >     Requested : max
> >     Enabled   : X86_V3 X86_V4 AVX512_ICL AVX512_SPR
> 
> With the below diff I get this:
> 
> CPU Optimization Options
>   baseline:
>     Requested : none
>     Enabled   :
>   dispatch:
>     Requested : max
>     Enabled   : X86_V2 X86_V3 X86_V4 AVX512_ICL AVX512_SPR
> 
> If it works, I think it is what we want. This is now unmaintained and
> may break at some point, but for now I guess it's the best we can do:
> keep the old boxes working, newer hardware gets to use the fancy code.
> 
> https://github.com/numpy/numpy/blob/729d61c84d087dccf17e4ef960391227aaa0c5b3/doc/source/reference/simd/build-options.rst#targeting-older-cpus
> 
> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/math/py-numpy/Makefile,v
> diff -u -p -r1.96 Makefile
> --- Makefile  12 Jan 2026 05:39:02 -0000      1.96
> +++ Makefile  16 Jan 2026 22:16:39 -0000
> @@ -4,6 +4,8 @@ MODPY_DISTV=  2.4.1
>  DISTNAME=    numpy-${MODPY_DISTV}
>  PKGNAME=     py-${DISTNAME}
>  
> +REVISION=    0
> +
>  CATEGORIES=  math devel
>  
>  HOMEPAGE=    https://numpy.org/
> @@ -78,6 +80,9 @@ pre-build:
>  # https://github.com/numpy/numpy/issues/20799
>  .if ${MACHINE_ARCH} == i386
>       sed -i '/^option.*disable-optim/ s/false/true/' ${WRKSRC}/meson.options
> +.endif
> +.if ${MACHINE_ARCH} == amd64
> +MODPY_PYBUILD_ARGS += -Csetup-args=-Dcpu-baseline="none"
>  .endif
>  
>  do-test:
> 
> 

Reply via email to