freebsd-ports/devel/py-tables/Makefile
Kai Knoblich f31b25e7dc 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
2021-09-28 09:43:34 +02:00

52 lines
1.5 KiB
Makefile

# Created by: ijliao@FreeBSD.org
PORTNAME= tables
PORTVERSION= 3.6.1
PORTREVISION= 1
CATEGORIES= devel python
MASTER_SITES= CHEESESHOP
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
MAINTAINER= wen@FreeBSD.org
COMMENT= Hierarchical database for Python
LICENSE= BSD3CLAUSE
BUILD_DEPENDS= ${PYNUMPY} \
${PYTHON_PKGNAMEPREFIX}numexpr>=1.4.1:math/py-numexpr@${PY_FLAVOR}
LIB_DEPENDS= libhdf5.so:science/hdf5 \
liblzo2.so:archivers/lzo2 \
libucl.so:archivers/ucl
RUN_DEPENDS:= ${BUILD_DEPENDS} \
${PYTHON_PKGNAMEPREFIX}six>=1.9.0:devel/py-six@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}mock>=2.0:devel/py-mock@${PY_FLAVOR}
CONFLICTS_BUILD= zstd # conflicting version of zstd is bundled
USES= fortran python:3.6+
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
post-install:
${STRIP_CMD} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/tables/*.so
post-install-EXAMPLES-on:
@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
${INSTALL_DATA} ${WRKSRC}/examples/*.py ${STAGEDIR}${EXAMPLESDIR}
.include <bsd.port.mk>