All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Woolley <rob.woolley@windriver.com>
To: <openembedded-core@lists.openembedded.org>
Cc: Rob Woolley <rob.woolley@windriver.com>, <alex.kanavin@gmail.com>
Subject: [PATCH v2 3/3] boost: Add support for Boost.Python NumPy extension
Date: Wed, 12 Aug 2026 13:34:33 -0700	[thread overview]
Message-ID: <20260812-fix-boost-v2-3-cbcb65f5e186@windriver.com> (raw)
In-Reply-To: <20260812-fix-boost-v2-0-cbcb65f5e186@windriver.com>

Support for NumPy was added to Boost release 1.63.

This additional numpy PACKAGECONFIG ensures that python3-numpy
is added as build-time and run-time dependencies. It uses the
custom-made python-numpy-include feature to supply the directory
for the numpy module headers to the b2 build system.

If numpy is not added the PACKAGECONFIG it will still attempt the
probe and fail gracefully like before.

Signed-off-by: Rob Woolley <rob.woolley@windriver.com>
---
 meta/recipes-support/boost/boost.inc | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-support/boost/boost.inc b/meta/recipes-support/boost/boost.inc
index a718a735dd..e0ffc20447 100644
--- a/meta/recipes-support/boost/boost.inc
+++ b/meta/recipes-support/boost/boost.inc
@@ -53,6 +53,7 @@ PACKAGECONFIG ??= "locale python"
 PACKAGECONFIG[locale] = ",,icu"
 PACKAGECONFIG[graph_parallel] = ",,,boost-mpi mpich"
 PACKAGECONFIG[mpi] = ",,mpich"
+PACKAGECONFIG[numpy] = ",,python3-numpy"
 PACKAGECONFIG[python] = ",,python3"
 
 inherit python3-dir
@@ -86,6 +87,8 @@ FILES:${PN}-serialization = "${libdir}/libboost_serialization*.so.* \
 	${libdir}/libboost_wserialization*.so.*"
 FILES:${PN}-test = "${libdir}/libboost_prg_exec_monitor*.so.* \
 	${libdir}/libboost_unit_test_framework*.so.*"
+FILES:${PN}-python = "${libdir}/libboost_python*.so.* \
+        ${libdir}/libboost_numpy*.so.*"
 
 # -dev last to pick up the remaining stuff
 PACKAGES += "${PN}-dev ${PN}-staticdev"
@@ -173,7 +176,11 @@ do_configure() {
 
 	# If we want Python then we need to tell Boost *exactly* where to find it
 	if ${@bb.utils.contains('BOOST_LIBS', 'python', 'true', 'false', d)}; then
-		echo "using python : ${PYTHON_BASEVERSION} : ${STAGING_DIR_NATIVE}${bindir}/python3-native/python3 : ${STAGING_DIR_HOST}${includedir}/${PYTHON_DIR}${PYTHON_ABI} : ${STAGING_DIR_HOST}${libdir}/${PYTHON_DIR} ;" >> ${WORKDIR}/user-config.jam
+		if ${@bb.utils.contains('PACKAGECONFIG', 'numpy', 'true', 'false', d)}; then
+                        # Use the python-numpy-include feature patched in to boost-build-native
+			ENABLE_NUMPY="<python-numpy-include>${STAGING_LIBDIR}/${PYTHON_DIR}/site-packages/numpy/_core/include"
+		fi
+		echo "using python : ${PYTHON_BASEVERSION} : ${STAGING_DIR_NATIVE}${bindir}/python3-native/python3 : ${STAGING_DIR_HOST}${includedir}/${PYTHON_DIR}${PYTHON_ABI} : ${STAGING_DIR_HOST}${libdir}/${PYTHON_DIR} : ${ENABLE_NUMPY} ;" >> ${WORKDIR}/user-config.jam
 	fi
 
 	if ${@bb.utils.contains('BOOST_LIBS', 'mpi', 'true', 'false', d)}; then

-- 
2.49.0



  parent reply	other threads:[~2026-08-12 20:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-12 20:34 [PATCH v2 0/3] boost: Add Boost.Python NumPy Rob Woolley
2026-08-12 20:34 ` [PATCH v2 1/3] boost: Use python3-native executable Rob Woolley
2026-08-12 20:46   ` Patchtest results for " patchtest
2026-08-12 20:34 ` [PATCH v2 2/3] boost-build-native: Add python-numpy-include feature Rob Woolley
2026-08-12 20:34 ` Rob Woolley [this message]
2026-08-12 20:46   ` Patchtest results for [PATCH v2 3/3] boost: Add support for Boost.Python NumPy extension patchtest

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260812-fix-boost-v2-3-cbcb65f5e186@windriver.com \
    --to=rob.woolley@windriver.com \
    --cc=alex.kanavin@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.