diff --git a/math/py-SQNomad/Makefile b/math/py-SQNomad/Makefile index 1df0b4d20534..060aec217f4b 100644 --- a/math/py-SQNomad/Makefile +++ b/math/py-SQNomad/Makefile @@ -1,34 +1,32 @@ PORTNAME= SQNomad DISTVERSION= 0.2.3 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= math python MASTER_SITES= PYPI PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} MAINTAINER= yuri@FreeBSD.org COMMENT= Blackbox optimization software WWW= https://www.gerad.ca/nomad/ -BROKEN= fails to build with NumPy 2.x - LICENSE= LGPL3 LICENSE_FILE= ${WRKSRC}/LICENSE BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}numpy>=1.16:math/py-numpy@${PY_FLAVOR} \ ${PY_SETUPTOOLS} \ ${PYTHON_PKGNAMEPREFIX}wheel>0:devel/py-wheel@${PY_FLAVOR} RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}numpy>=1.16:math/py-numpy@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}SQCommon>0:misc/py-SQCommon@${PY_FLAVOR} USES= python USE_PYTHON= pep517 autoplist post-install: @${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/libsqnomad${PYTHON_TAG}.so # there are a lot of errors during build stemming from the numpy code, for example: # cc: error: unknown argument: '-mavx5124fmaps' # cc: error: unknown argument: '-mavx5124vnniw' # but these erros are in the test coe nd they don't break the build .include diff --git a/math/py-SQNomad/files/patch-setup.py b/math/py-SQNomad/files/patch-setup.py index b053c7d06f67..9da5b0df0256 100644 --- a/math/py-SQNomad/files/patch-setup.py +++ b/math/py-SQNomad/files/patch-setup.py @@ -1,11 +1,22 @@ ---- setup.py.orig 2023-11-12 00:10:52 UTC +-- Use numpy.get_include() to find NumPy's C headers instead of building +-- the path manually, because NumPy >= 2.0 moved its C API headers from +-- numpy/core/include to numpy/_core/include, breaking the previous +-- hardcoded path. +-- Also enable the FreeBSD platform check that was missing so the C++14 +-- flag is applied on FreeBSD as well as Linux/macOS. + +--- setup.py.orig 2021-03-29 23:39:12 UTC +++ setup.py -@@ -55,7 +55,7 @@ class my_build_extension(_build_ext): - ext.extra_compile_args += ['-I'+os.path.join(numpy.__path__[0], 'core/include/numpy')] +@@ -52,10 +52,10 @@ class my_build_extension(_build_ext): + + # adding numpy late to allow setup to install it in the build env + import numpy +- ext.extra_compile_args += ['-I'+os.path.join(numpy.__path__[0], 'core/include/numpy')] ++ ext.extra_compile_args += ['-I'+numpy.get_include(), '-I'+os.path.join(numpy.get_include(), 'numpy')] # force C++14 - if 'linux' in sys.platform or 'darwin' in sys.platform: + if 'linux' in sys.platform or 'freebsd' in sys.platform or 'darwin' in sys.platform: ext.extra_compile_args += ['-std=c++14'] elif 'win32' in sys.platform: # also define DLL_EXPORTS for sgtelib and NOMAD::Clock