git: 0a6f672ba656 - main - math/py-SQNomad: New port: Blackbox optimization software

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Sun, 12 Nov 2023 04:49:14 UTC
The branch main has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=0a6f672ba656cc9323212cdc1722011943771e79

commit 0a6f672ba656cc9323212cdc1722011943771e79
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2023-11-12 03:53:57 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2023-11-12 04:49:07 +0000

    math/py-SQNomad: New port: Blackbox optimization software
---
 math/Makefile                        |  1 +
 math/py-SQNomad/Makefile             | 31 +++++++++++++++++++++++++++++++
 math/py-SQNomad/distinfo             |  3 +++
 math/py-SQNomad/files/patch-setup.py | 11 +++++++++++
 math/py-SQNomad/pkg-descr            |  4 ++++
 5 files changed, 50 insertions(+)

diff --git a/math/Makefile b/math/Makefile
index 1d22dd2e5fbf..06653c0c70fc 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -884,6 +884,7 @@
     SUBDIR += py-PySCIPOpt
     SUBDIR += py-PyWavelets
     SUBDIR += py-Pyomo
+    SUBDIR += py-SQNomad
     SUBDIR += py-affine
     SUBDIR += py-algopy
     SUBDIR += py-altgraph
diff --git a/math/py-SQNomad/Makefile b/math/py-SQNomad/Makefile
new file mode 100644
index 000000000000..f58c8de60700
--- /dev/null
+++ b/math/py-SQNomad/Makefile
@@ -0,0 +1,31 @@
+PORTNAME=	SQNomad
+DISTVERSION=	0.2.3
+CATEGORIES=	math python
+MASTER_SITES=	PYPI
+PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER=	yuri@FreeBSD.org
+COMMENT=	Blackbox optimization software
+WWW=		https://www.gerad.ca/nomad/
+
+LICENSE=	LGPL3
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+BUILD_DEPENDS=	${PYNUMPY} \
+		${PY_SETUPTOOLS} \
+		${PYTHON_PKGNAMEPREFIX}wheel>0:devel/py-wheel@${PY_FLAVOR}
+RUN_DEPENDS=	${PYNUMPY} \
+		${PYTHON_PKGNAMEPREFIX}SQCommon>0:misc/py-SQCommon@${PY_FLAVOR}
+
+USES=		python
+USE_PYTHON=	pep517 autoplist
+
+post-install:
+	@${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/libsqnomad${PYTHON_EXT_SUFFIX}.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 <bsd.port.mk>
diff --git a/math/py-SQNomad/distinfo b/math/py-SQNomad/distinfo
new file mode 100644
index 000000000000..d512f3fd8041
--- /dev/null
+++ b/math/py-SQNomad/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1699747105
+SHA256 (SQNomad-0.2.3.tar.gz) = 07e2b1998ddb6bc6d3ea9515b956fbd2ba053e9445961b2f895e6af7d84a8fa7
+SIZE (SQNomad-0.2.3.tar.gz) = 455191
diff --git a/math/py-SQNomad/files/patch-setup.py b/math/py-SQNomad/files/patch-setup.py
new file mode 100644
index 000000000000..b053c7d06f67
--- /dev/null
+++ b/math/py-SQNomad/files/patch-setup.py
@@ -0,0 +1,11 @@
+--- setup.py.orig	2023-11-12 00:10:52 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')]
+ 
+         # 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
diff --git a/math/py-SQNomad/pkg-descr b/math/py-SQNomad/pkg-descr
new file mode 100644
index 000000000000..02f94fc58178
--- /dev/null
+++ b/math/py-SQNomad/pkg-descr
@@ -0,0 +1,4 @@
+NOMAD is a C++ implementation of the Mesh Adaptive Direct Search algorithm
+(MADS), designed for difficult blackbox optimization problems. These problems
+occur when the functions defining the objective and constraints are the result
+of costly computer simulations.