Skip to content

Commit

Permalink
math/py-numpy: Update to 1.25.0
Browse files Browse the repository at this point in the history
PR:		272058
Reported by:	wen@
Exp-run by:	antoine@
  • Loading branch information
wenheping committed Jul 7, 2023
1 parent 0347e95 commit 65c21fd
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 51 deletions.
2 changes: 1 addition & 1 deletion Mk/Uses/python.mk
Expand Up @@ -774,7 +774,7 @@ CMAKE_ARGS+= -DPython_ADDITIONAL_VERSIONS=${PYTHON_VER}

# Python 3rd-party modules
PYGAME= ${PYTHON_PKGNAMEPREFIX}game>0:devel/py-game@${PY_FLAVOR}
PYNUMPY= ${PYTHON_PKGNAMEPREFIX}numpy>=1.16,1<1.25,1:math/py-numpy@${PY_FLAVOR}
PYNUMPY= ${PYTHON_PKGNAMEPREFIX}numpy>=1.16,1<1.26,1:math/py-numpy@${PY_FLAVOR}

. if defined(_PYTHON_FEATURE_DISTUTILS)
. if ${PYTHON_MAJOR_VER} < 3
Expand Down
8 changes: 2 additions & 6 deletions math/py-numpy/Makefile
@@ -1,6 +1,5 @@
PORTNAME= numpy
PORTVERSION= 1.24.1
PORTREVISION= 5
PORTVERSION= 1.25.0
PORTEPOCH= 1
CATEGORIES= math python
MASTER_SITES= PYPI \
Expand All @@ -12,9 +11,6 @@ DISTFILES= ${DISTNAME}${EXTRACT_SUFX} \
DIST_SUBDIR= ${PORTNAME}-${PORTVERSION:R}
EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}

PATCH_SITES= https://github.com/numpy/numpy/commit/
PATCHFILES= 8692e2478cc74cc7c08e9b2a0f731a10a1ca7118.patch:-p1

MAINTAINER= python@FreeBSD.org
COMMENT= The New Numeric Extension to Python
WWW= https://www.numpy.org/
Expand All @@ -25,7 +21,7 @@ LICENSE_FILE= ${WRKSRC}/LICENSE.txt
TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pytest>=6.2.5:devel/py-pytest@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}hypothesis>=6.24.1:devel/py-hypothesis@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}typing-extensions>=4.2.0:devel/py-typing-extensions@${PY_FLAVOR}
USES= compiler:c11 cpe fortran python
USES= compiler:c11 cpe fortran python:3.9-3.11
USE_PYTHON= allflavors autoplist concurrent cython distutils

GCCLIBDIR_CMDS= ${FC} -print-file-name=libgfortran.so | ${SED} -e s/libgfortran.so//
Expand Down
16 changes: 7 additions & 9 deletions math/py-numpy/distinfo
@@ -1,9 +1,7 @@
TIMESTAMP = 1686775677
SHA256 (numpy-1.24/numpy-1.24.1.tar.gz) = 2386da9a471cc00a1f47845e27d916d5ec5346ae9696e01a8a34760858fe9dd2
SIZE (numpy-1.24/numpy-1.24.1.tar.gz) = 10903184
SHA256 (numpy-1.24/numpy-ref.pdf) = f493c1cae879a4e0038bec400d349fc34aafa164e1462118bdf18b25a3a07daf
SIZE (numpy-1.24/numpy-ref.pdf) = 7715485
SHA256 (numpy-1.24/numpy-user.pdf) = 3978da15c6a1b00f2737c75458db0cc0fe636ae90b72723a8ff609d40e9b7599
SIZE (numpy-1.24/numpy-user.pdf) = 4123384
SHA256 (numpy-1.24/8692e2478cc74cc7c08e9b2a0f731a10a1ca7118.patch) = 59d96ad7ef708f3b63ff7c4d7daa2a12dbaf510691f84dfd7be126de39eda49e
SIZE (numpy-1.24/8692e2478cc74cc7c08e9b2a0f731a10a1ca7118.patch) = 2861
TIMESTAMP = 1688388955
SHA256 (numpy-1.25/numpy-1.25.0.tar.gz) = f1accae9a28dc3cda46a91de86acf69de0d1b5f4edd44a9b0c3ceb8036dfff19
SIZE (numpy-1.25/numpy-1.25.0.tar.gz) = 10426700
SHA256 (numpy-1.25/numpy-ref.pdf) = f493c1cae879a4e0038bec400d349fc34aafa164e1462118bdf18b25a3a07daf
SIZE (numpy-1.25/numpy-ref.pdf) = 7715485
SHA256 (numpy-1.25/numpy-user.pdf) = 3978da15c6a1b00f2737c75458db0cc0fe636ae90b72723a8ff609d40e9b7599
SIZE (numpy-1.25/numpy-user.pdf) = 4123384
@@ -1,6 +1,6 @@
--- numpy/core/src/common/npy_cpu_features.c.orig 2022-11-19 22:40:58 UTC
--- numpy/core/src/common/npy_cpu_features.c.orig 2023-06-18 00:19:04 UTC
+++ numpy/core/src/common/npy_cpu_features.c
@@ -527,6 +527,18 @@ npy__cpu_init_features(void)
@@ -570,6 +570,18 @@ npy__cpu_init_features(void)
#ifndef PPC_FEATURE2_ARCH_3_1
#define PPC_FEATURE2_ARCH_3_1 0x00040000
#endif
Expand All @@ -19,18 +19,10 @@
#endif

static void
@@ -551,7 +563,26 @@ npy__cpu_init_features(void)
npy__cpu_have[NPY_CPU_FEATURE_VSX2] = (hwcap & PPC_FEATURE2_ARCH_2_07) != 0;
npy__cpu_have[NPY_CPU_FEATURE_VSX3] = (hwcap & PPC_FEATURE2_ARCH_3_00) != 0;
npy__cpu_have[NPY_CPU_FEATURE_VSX4] = (hwcap & PPC_FEATURE2_ARCH_3_1) != 0;
-// TODO: AIX, FreeBSD
+#elif defined(__FreeBSD__)
+ unsigned long hwcap;
+ elf_aux_info(AT_HWCAP, &hwcap, sizeof(hwcap));
+ if ((hwcap & PPC_FEATURE_HAS_VSX) == 0)
+ return;
+
+ elf_aux_info(AT_HWCAP2, &hwcap, sizeof(hwcap));
@@ -591,6 +603,25 @@ npy__cpu_init_features(void)

elf_aux_info(AT_HWCAP2, &hwcap, sizeof(hwcap));
#endif // __linux__
+ if (hwcap & PPC_FEATURE2_ARCH_3_1)
+ {
+ npy__cpu_have[NPY_CPU_FEATURE_VSX] =
Expand All @@ -43,7 +35,13 @@
+ npy__cpu_have[NPY_CPU_FEATURE_VSX2] = (hwcap & PPC_FEATURE2_ARCH_2_07) != 0;
+ npy__cpu_have[NPY_CPU_FEATURE_VSX3] = (hwcap & PPC_FEATURE2_ARCH_3_00) != 0;
+ npy__cpu_have[NPY_CPU_FEATURE_VSX4] = (hwcap & PPC_FEATURE2_ARCH_3_1) != 0;
+// TODO: AIX, OpenBSD
#else
npy__cpu_have[NPY_CPU_FEATURE_VSX] = 1;
#if defined(NPY_CPU_PPC64LE) || defined(NPY_HAVE_VSX2)
+#elif defined(__FreeBSD__)
+ unsigned long hwcap;
+ elf_aux_info(AT_HWCAP, &hwcap, sizeof(hwcap));
+ if ((hwcap & PPC_FEATURE_HAS_VSX) == 0)
+ return;
+
+ elf_aux_info(AT_HWCAP2, &hwcap, sizeof(hwcap));
if (hwcap & PPC_FEATURE2_ARCH_3_1)
{
npy__cpu_have[NPY_CPU_FEATURE_VSX] =
17 changes: 0 additions & 17 deletions math/py-numpy/files/patch-numpy_distutils_ccompiler__opt.py

This file was deleted.

0 comments on commit 65c21fd

Please sign in to comment.