我有一个 C++ 库,其中包含如下构建的 Python 绑定,以及一个需要导入libPerceptionPybind.so
生成的 Python 二进制文件。
package(default_visibility = ["//visibility:public"])
load("@pip_pybind//:requirements.bzl", "requirement")
cc_binary(
name = "PerceptionPybind",
srcs = ["PerceptionPybind.cpp"],
deps = [
"@pybind11",
"@libtorch_cpu//:torch_cpu",
],
linkshared = True,
)
py_binary(
name = "TestPerceptionPybind",
srcs = [ "TestPerceptionPybind.py" ],
deps = [
":PerceptionPybind"
requirement("numpy"),
requirement("torch")
],
)
我看到 libPerceptionPybind.so 已在我的bazel-bin/pybind
文件夹中生成。PerceptionPybind
如您所见,我尝试添加 到 deps 中,但它给出了错误:
//pybind:PerceptionPybind' does not have mandatory providers: 'py' or 'PyInfo