Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Sep 2021 08:05:22 GMT
From:      Kai Knoblich <kai@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-branches@FreeBSD.org
Subject:   git: 70843a665d45 - 2021Q3 - devel/py-tables: Disable AVX2 CPU optimizations
Message-ID:  <202109280805.18S85MAb030325@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch 2021Q3 has been updated by kai:

URL: https://cgit.FreeBSD.org/ports/commit/?id=70843a665d45e14e5b45a87b4c6205555040c555

commit 70843a665d45e14e5b45a87b4c6205555040c555
Author:     Kai Knoblich <kai@FreeBSD.org>
AuthorDate: 2021-09-28 07:43:34 +0000
Commit:     Kai Knoblich <kai@FreeBSD.org>
CommitDate: 2021-09-28 08:04:57 +0000

    devel/py-tables: Disable AVX2 CPU optimizations
    
    On amd64 platforms that have a CPU with Haswell New Instructions (AVX2),
    related optimizations are automatically compiled in, unless this is
    explicitly prevented.
    
    If the package is then used on other amd64 platforms, that have no AVX2
    support, this causes problems, because the generated .so files are
    incompatible and lead to crashes with SIGILL upon invocation.
    
    Remedy the issue by turning off AVX2 support by default which is also
    upstream's default and bump PORTREVISION to force a rebuild.
    
    PR:             258714
    Reported by:    dvl (on IRC)
    Reviewed by:    wen (maintainer)
    Approved by:    portmgr (blanket: build fix)
    MFH:            2021Q3
    
    (cherry picked from commit f31b25e7dc91402729ecc19c1fca66e9ebe5ddc8)
---
 devel/py-tables/Makefile | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/devel/py-tables/Makefile b/devel/py-tables/Makefile
index f10cee471616..d1d4e59fb306 100644
--- a/devel/py-tables/Makefile
+++ b/devel/py-tables/Makefile
@@ -2,6 +2,7 @@
 
 PORTNAME=	tables
 PORTVERSION=	3.6.1
+PORTREVISION=	1
 CATEGORIES=	devel python
 MASTER_SITES=	CHEESESHOP
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
@@ -28,6 +29,15 @@ USE_PYTHON=	autoplist concurrent distutils cython
 PORTEXAMPLES=	*
 
 OPTIONS_DEFINE=		EXAMPLES
+OPTIONS_DEFINE_amd64=		AVX2
+
+AVX2_DESC=	Enable Haswell New Instructions (AVX2) support
+
+# Explicitly disable AVX2 otherwise it will be automatically enabled if the CPU
+# supports it.  If compiled in and run on hosts that have no AVX2 support, it
+# will trigger a SIGILL (Illegal instruction)
+# See also: https://github.com/PyTables/PyTables/issues/841
+AVX2_VARS_OFF=	MAKE_ENV+=DISABLE_AVX2=yes
 
 post-patch:
 	@${REINPLACE_CMD} -e "s,%%LOCALBASE%%,${LOCALBASE}," ${WRKSRC}/setup.py



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202109280805.18S85MAb030325>