aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Victorovich <yuri@FreeBSD.org>2023-11-12 03:53:57 +0000
committerYuri Victorovich <yuri@FreeBSD.org>2023-11-12 04:49:07 +0000
commit0a6f672ba656cc9323212cdc1722011943771e79 (patch)
treebbc4bf2ce85b5a4ea09d194af8a3eedab8f7be5b
parentd8c0758d48b5e421f3f5cf9ffc7fa30171cbb149 (diff)
math/py-SQNomad: New port: Blackbox optimization software
-rw-r--r--math/Makefile1
-rw-r--r--math/py-SQNomad/Makefile31
-rw-r--r--math/py-SQNomad/distinfo3
-rw-r--r--math/py-SQNomad/files/patch-setup.py11
-rw-r--r--math/py-SQNomad/pkg-descr4
5 files changed, 50 insertions, 0 deletions
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.