cdleary / bazel_pybind_sample Goto Github PK
View Code? Open in Web Editor NEWSimple example of using pybind11 via Bazel.
License: Apache License 2.0
Simple example of using pybind11 via Bazel.
License: Apache License 2.0
I have not been able to get this example to work on my computer. I am using an Apple M1 computer, and consistently get
Traceback (most recent call last): File "/private/var/tmp/_bazel_connie/f24ab60b302356e3037695b783d4e5e0/sandbox/darwin-sandbox/74/execroot/__main__/bazel-out/darwin_arm64-dbg/bin/example_test.runfiles/__main__/example_test.py", line 9, in <module> import my_pb_mod ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/my_pb_mod-1.0.1-py3.10-macosx-10.9-universal2.egg/my_pb_mod.cpython-310-darwin.so, 0x0002): symbol not found in flat namespace '_PyInt_FromSsize_t'
I have been able to install it through g++ with the following command:
g++ -O3 -Wall -shared -std=c++17 -undefined dynamic_lookup $(python3 -m pybind11 --includes) my_pb_mod.cc -o example $(python3-config --extension-suffix)
, but I have not been able to install it through Bazel.
I thought it might be a seg fault issue with the dynamic library, but I ran the troubleshooting environmental variable PYTHON_BIN_PATH with Python 2.7 and 3.8, both result in the same error.
Has anyone fixed the issue with the symbol not found in flat namespace?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.