bazel - OSX Tensorflow + Opencv: Symbol Not Found, expected in Flat Namespace -
i use osx10.12, try use opencv in tensorflow, use first method mentioned in question.
i build code there questions following when execute it:
dyld: lazy symbol binding failed: symbol not found: __zn2cv6string8allocateem referenced from: /users/philokey/practice/github/tensorflow/./bazel-bin/tensorflow/examples/test_cv/test_cv expected in: flat namespace
the build file following:
cc_binary( name = "test_cv", srcs = [ "test_cv.cc", ], deps = [ "@opencv//:opencv", ], )
how can solve problem?
you need make sure updated following files under tensorflow directory, correctly:
in workspace - (./tensorflow/tensorflow/workspace) add following:
new_local_repository( name = "opencv", path = "/usr/local/", build_file = "opencv.build", )
opencv.build - (./tensorflow/tensorflow/opencv.build) add following:
cc_library( name = "opencv", srcs = glob(["lib/*.dylib*"]), <<<<<<< hdrs = glob(["include/**/*.hpp"]), includes = ["include"], visibility = ["//visibility:public"], linkstatic = 1, )
[note] different operating systems, different dynamic libraries created, example:
- linux -> *.so,
- windows -> *.dll, and
- on osx -> *.dylib
even if face problems please set dyld_print_library
environment variable check if correct libraries linked, @ times different versions of libraries may keep busy.
Comments
Post a Comment