summaryrefslogtreecommitdiff
path: root/math/py-jij-cimod
diff options
context:
space:
mode:
Diffstat (limited to 'math/py-jij-cimod')
-rw-r--r--math/py-jij-cimod/Makefile34
-rw-r--r--math/py-jij-cimod/distinfo3
-rw-r--r--math/py-jij-cimod/files/patch-CMakeLists.txt20
-rw-r--r--math/py-jij-cimod/files/patch-pyproject.toml11
-rw-r--r--math/py-jij-cimod/pkg-descr7
5 files changed, 75 insertions, 0 deletions
diff --git a/math/py-jij-cimod/Makefile b/math/py-jij-cimod/Makefile
new file mode 100644
index 000000000000..52774739c679
--- /dev/null
+++ b/math/py-jij-cimod/Makefile
@@ -0,0 +1,34 @@
+PORTNAME= jij-cimod
+DISTVERSION= 1.7.3
+CATEGORIES= math
+MASTER_SITES= PYPI
+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
+DISTNAME= ${PORTNAME:S/-/_/}-${DISTVERSION}
+
+MAINTAINER= yuri@FreeBSD.org
+COMMENT= Python binding for the C++ library for a binary quadratic model
+WWW= https://www.openjij.org/ \
+ https://github.com/Jij-Inc/cimod
+
+LICENSE= MIT
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+BUILD_DEPENDS= ${PYNUMPY} \
+ ${PYTHON_PKGNAMEPREFIX}pybind11>0:devel/py-pybind11@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}scikit-build-core>=0.10:devel/py-scikit-build-core@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}setuptools-scm>0:devel/py-setuptools-scm@${PY_FLAVOR} \
+ nlohmann-json>0:devel/nlohmann-json \
+ pybind11-json>0:devel/pybind11-json
+LIB_DEPENDS= libcblas.so:math/cblas \
+ liblapack.so:math/lapack \
+ libopenblas.so:math/openblas
+
+USES= cmake:indirect compiler:c++17-lang eigen:3 localbase:ldflags python
+USE_PYTHON= pep517 cython autoplist pytest
+
+TEST_WRKSRC= ${WRKSRC}/tests
+TEST_ENV= ${MAKE_ENV} PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}
+
+# tests as of 1.7.3: 49 passed, 10 warnings in 19.01s
+
+.include <bsd.port.mk>
diff --git a/math/py-jij-cimod/distinfo b/math/py-jij-cimod/distinfo
new file mode 100644
index 000000000000..3e3ec24af776
--- /dev/null
+++ b/math/py-jij-cimod/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1760203654
+SHA256 (jij_cimod-1.7.3.tar.gz) = f8703ef9d8a876e560fce1b78a4fedaf6e30d47889ff2055a2c596e19f04e589
+SIZE (jij_cimod-1.7.3.tar.gz) = 339350
diff --git a/math/py-jij-cimod/files/patch-CMakeLists.txt b/math/py-jij-cimod/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..68251a0b6c06
--- /dev/null
+++ b/math/py-jij-cimod/files/patch-CMakeLists.txt
@@ -0,0 +1,20 @@
+--- CMakeLists.txt.orig 2022-11-09 12:37:21 UTC
++++ CMakeLists.txt
+@@ -65,13 +65,10 @@ ENDIF ()
+ ENDIF ()
+ ENDIF ()
+
+-IF (CMAKE_REQUIRE_FAILE)
+- SET (CMAKE_REQUIRE_FIND_PACKAGE_Eigen3 ON)
+- SET (CMAKE_REQUIRE_FIND_PACKAGE_nlohmann_json ON)
+- SET (CMAKE_REQUIRE_FIND_PACKAGE_pybind11 ON)
+- SET (CMAKE_REQUIRE_FIND_PACKAGE_pybind11_json ON)
+- SET (CMAKE_REQUIRE_FIND_PACKAGE_GTest ON)
+-ENDIF ()
++SET (CMAKE_REQUIRE_FIND_PACKAGE_Eigen3 ON)
++SET (CMAKE_REQUIRE_FIND_PACKAGE_nlohmann_json ON)
++SET (CMAKE_REQUIRE_FIND_PACKAGE_pybind11 ON)
++SET (CMAKE_REQUIRE_FIND_PACKAGE_pybind11_json ON)
+
+ # detect operating system and host processor
+ MESSAGE (STATUS "We are on a ${CMAKE_SYSTEM_NAME} system")
diff --git a/math/py-jij-cimod/files/patch-pyproject.toml b/math/py-jij-cimod/files/patch-pyproject.toml
new file mode 100644
index 000000000000..3bc3e040dfe8
--- /dev/null
+++ b/math/py-jij-cimod/files/patch-pyproject.toml
@@ -0,0 +1,11 @@
+--- pyproject.toml.orig 2025-10-11 17:30:54 UTC
++++ pyproject.toml
+@@ -17,7 +17,7 @@ requires = [
+ "scikit-build-core>=0.10",
+ "setuptools_scm[toml]",
+ "pybind11",
+- "oldest-supported-numpy",
++ "numpy",
+ ]
+ build-backend = "scikit_build_core.build"
+
diff --git a/math/py-jij-cimod/pkg-descr b/math/py-jij-cimod/pkg-descr
new file mode 100644
index 000000000000..b9c6e268c2b4
--- /dev/null
+++ b/math/py-jij-cimod/pkg-descr
@@ -0,0 +1,7 @@
+jij-cimod provides Python bindings for cimod, a C++ library
+that provides functionalities for handling binary quadratic
+models (BQM) and polynomial quadratic models (PQM).
+
+It allows Python developers to leverage its high-performance
+C++ core for mathematical optimization problems, particularly
+in fields like quantum annealing and combinatorial optimization.