math/py-jij-cimod: New port: Python binding for the C++ library for a binary quadratic model

This commit is contained in:
Yuri Victorovich
2025-10-11 16:59:31 -07:00
parent 39c0b508c1
commit 2a203d24fa
6 changed files with 76 additions and 0 deletions
+1
View File
@@ -1015,6 +1015,7 @@
SUBDIR += py-isosurfaces
SUBDIR += py-jacobi
SUBDIR += py-jax
SUBDIR += py-jij-cimod
SUBDIR += py-kahip
SUBDIR += py-keras
SUBDIR += py-keras-applications
+34
View File
@@ -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>
+3
View File
@@ -0,0 +1,3 @@
TIMESTAMP = 1760203654
SHA256 (jij_cimod-1.7.3.tar.gz) = f8703ef9d8a876e560fce1b78a4fedaf6e30d47889ff2055a2c596e19f04e589
SIZE (jij_cimod-1.7.3.tar.gz) = 339350
@@ -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")
@@ -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"
+7
View File
@@ -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.