Skip to content

dprogm/bazel_pybind_sample

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bazel / pybind11 sample

Simple, working pybind11-via-bazel example on Linux/x64 (tested on Ubuntu).

Background info provided by:

If you're observing segfaults, it may be that the DSO is being built for Python2 while the bazel test interpreter is Python 3.

You can observe what Python headers were used for building by observing the file in a path similar to:

bazel-out/k8-fastbuild/bin/external/local_config_python/python_include/patchlevel.h

And you can help point at the right Python binary by providing it to the python_configure.bzl script in pybind11_bazel through an environment variable:

PYTHON_BIN_PATH=/usr/bin/python3 bazel test -c dbg :example_test --test_output=all

About

Simple example of using pybind11 via Bazel.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Starlark 89.1%
  • Python 6.8%
  • C++ 4.1%