uber/neuropod

dyld: Library not loaded: bazel-out/darwin-fastbuild/bin/neuropod/libneuropod.so

davidxiaozhi opened this issue · 5 comments

dyld: Library not loaded: bazel-out/darwin-fastbuild/bin/neuropod/libneuropod.so
Referenced from: /private/var/tmp/_bazel_lizhipeng/91d00ce5f60eb5495fbe6fb22a744b94/execroot/main/bazel-out/darwin-fastbuild/bin/atom/hello_atom
Reason: image not found
[1] 74013 abort bazel run //atom:hello_atom

this is Build under the atom package

cc_binary(
    name = "hello_atom",
    srcs = ["hello_atom.cc"],
    #hdrs = ["sandwich.h"],
    # linkopts = select({
    #     "@bazel_tools//src/conditions:darwin": ["-Wl,-rpath,@loader_path"],
    #     "//conditions:default": ["-Wl,-rpath,$$ORIGIN"],
    # }),
    # linkshared = True,
    # linkstatic = True,
    visibility = [
        "//visibility:public",
    ],
    deps = [
        #"@gtest//:main",
        #"@absl//absl/strings",
        #"@folly//:main",
        #"//third_parts:neuropod"
        "//third_parts:neuropod"
        ],
    copts = ["-Ithird_parts/neuropod/include/"],
)

this is the build file under third_parts

ackage(
    default_visibility = ["//visibility:public"],
)

cc_library(
    name = "neuropod",
    srcs = glob(
        [
            "neuropod/lib/libneuropod.so",
        ],
        exclude = [
        ],
    ),
    hdrs = glob([
        "neuropod/include/neuropod/neuropod.hh",
        "neuropod/include/neuropod/**/*.hh",
    ]),
    #linkopts = ["-pthread"],
    copts= ["-Ineuropod/include/"],
    visibility = ["//visibility:public"],
)                            

cc_import(                             
    name = "func",
    hdrs = glob([
        "neuropod/include/neuropod/neuropod.hh",
        "neuropod/include/neuropod/**/*.hh"
        ]),
    shared_library = "neuropod/lib/libneuropod.so",
)

image
image

the libneuropod.so where I downloaded from libneuropod-macos-v0.3.0-rc1.tar.gz

I refer to the official C ++ development case for development,

Thanks for the bug report!

This is happening because our release process on macOS is not changing the dylib id for libneuropod.so before creating the release tar file.

Can you try running install_name_tool -id @rpath/libneuropod.so libneuropod.so in the folder containing libneuropod.so to confirm that fixes the issue?

If that works, I can go ahead and put up a PR to fix this.

Thanks again for trying the release candidate and for the bug report!


Note: This should only affect the prebuilt libneuropod.so on macOS. None of the other macOS libraries are directly linked against and therefore do not have this problem. The Linux release packages are also not affected.

@davidxiaozhi I landed a PR that should fix this issue.

When you get a chance, can you please confirm that the command in my previous comment fixes your issue?

Thanks!

@VivekPanyam when i use that command , the issue was fixed
dyld: Library not loaded: bazel-out/darwin-fastbuild/bin/neuropod/libneuropod.so

@VivekPanyam how could I use the c++ API of neuropod to package the neuropod_model for TensorFlow and torchscript,
Or do I just do this through the Python API

hi, when i rebuild neuropod v3.0.0-rc1 ,where is the python wheel (neuropod-0.3.0rc1-cp37-cp37m-macosx_10_9_x86_64.whl
) which build locally