* [Buildroot] Embedding Python Interpreter with pybind11
@ 2023-08-23 4:26 Ryan Smith
2023-08-23 21:18 ` Thomas Petazzoni via buildroot
0 siblings, 1 reply; 2+ messages in thread
From: Ryan Smith @ 2023-08-23 4:26 UTC (permalink / raw)
To: buildroot
I am attempting to write a program that embeds the Python interpreter
in C++ code using pybind11. When I attempt to compile the package in
Buildroot, I get the following error message.
/src/output-internal/host/include/python3.11/pyport.h:601:2: error:
#error "LONG_BIT definition appears wrong for platform (bad gcc/glibc
config?)."
#error "LONG_BIT definition appears wrong for platform (bad gcc/glibc
config?)."
^~~~~
In file included from
/src/output-internal/host/include/python3.11/Python.h:38:0,
from
/src/output-internal/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/pybind11/detail/common.h:266,
from
/src/output-internal/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/pybind11/attr.h:13,
from
/src/output-internal/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/pybind11/detail/class.h:12,
from
/src/output-internal/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/pybind11/pybind11.h:13,
from
/src/output-internal/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/pybind11/embed.h:12,
from
/src/output-internal/build/mmwave-eventd-custom/src/event_detector.h:4,
from
/src/output-internal/build/mmwave-eventd-custom/src/event_detector.cpp:4:
Am I missing something, or is this way of using pybind11 in Buildroot
not supported? TIA for any pointers or suggestions.
--
Ryan Smith
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [Buildroot] Embedding Python Interpreter with pybind11
2023-08-23 4:26 [Buildroot] Embedding Python Interpreter with pybind11 Ryan Smith
@ 2023-08-23 21:18 ` Thomas Petazzoni via buildroot
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni via buildroot @ 2023-08-23 21:18 UTC (permalink / raw)
To: Ryan Smith; +Cc: buildroot
Hello Ryan,
On Tue, 22 Aug 2023 22:26:10 -0600
Ryan Smith <ryan.smith@density.io> wrote:
> I am attempting to write a program that embeds the Python interpreter
> in C++ code using pybind11. When I attempt to compile the package in
> Buildroot, I get the following error message.
>
> /src/output-internal/host/include/python3.11/pyport.h:601:2: error:
> #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc
> config?)."
> #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc
> config?)."
> ^~~~~
> In file included from
> /src/output-internal/host/include/python3.11/Python.h:38:0,
> from
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This is the problem: it's including the host python headers while
building code for the target. That's why it says "LONG_BIT definition
appears wrong for platform".
This is typically addressed by passing the right sysconfigdata, using
the _PYTHON_SYSCONFIGDATA_NAME variable. This is done automatically by
our python-package infrastructure.
Do you have a reproducer for this issue? People on this mailing list
are more likely to provide some help/support if they can reproduce the
issue.
Best regards,
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-08-23 21:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-23 4:26 [Buildroot] Embedding Python Interpreter with pybind11 Ryan Smith
2023-08-23 21:18 ` Thomas Petazzoni via buildroot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox