I have a pretty simple setup for libtorch, as I want to use the C++ API in my Bazel project. My WORKSPACE has the following:
http_archive(
name = "libtorch",
strip_prefix = "libtorch",
type = "zip",
urls = ["https://download.pytorch.org/libtorch/cpu/libtorch-macos-2.1.0.zip"],
build_file = Label("//external:BUILD.libtorch")
)
and my libtorch build looks like
cc_library(
name = "torch_cpu",
srcs = glob(["**/*.h", "**/*.hpp", "**/*.a", "**/*.so"]),
hdrs = glob(["include/**/*.h"]),
includes = [
"include",
"include/torch/csrc/api/include",
],
linkopts = ["-undefined error"],
visibility = ["//visibility:public"]
)
Building the main target, which depends on this library, works fine. But when I try running bazel run ...
, I get a runtime error like dyld[22939]: missing symbol called
. Wondering if someone could help me out?
Currently working on an Intel MacOS 13.5.