2
bazel build -c opt -- //tensorflow/...
produces these errors (after running for a long while):

ERROR: /home/luke/tensorflow/tensorflow/c/eager/BUILD:125:1: Linking of rule '//tensorflow/c/eager:c_api_test_gpu' failed (Exit 1) gcc failed: error executing command /usr/bin/gcc -o bazel-out/k8-opt/bin/tensorflow/c/eager/c_api_test_gpu '-Wl,-rpath,$ORIGIN/../../../_solib_k8/' -Lbazel-out/k8-opt/bin/_solib_k8 ... (remaining 64 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
bazel-out/k8-opt/bin/_solib_k8/libexternal_Sgrpc_Slibgrpc_Uresolver_Udns_Uares.so: error: undefined reference to 'ares_library_cleanup'
bazel-out/k8-opt/bin/_solib_k8/libexternal_Sgrpc_Slibgrpc_Uresolver_Udns_Uares.so: error: undefined reference to 'ares_library_init'
bazel-out/k8-opt/bin/_solib_k8/libexternal_Sgrpc_Slibgrpc_Uresolver_Udns_Uares.so: error: undefined reference to 'ares_inet_ntop'
bazel-out/k8-opt/bin/_solib_k8/libexternal_Sgrpc_Slibgrpc_Uresolver_Udns_Uares.so: error: undefined reference to 'ares_parse_srv_reply'
bazel-out/k8-opt/bin/_solib_k8/libexternal_Sgrpc_Slibgrpc_Uresolver_Udns_Uares.so: error: undefined reference to 'ares_free_data'
bazel-out/k8-opt/bin/_solib_k8/libexternal_Sgrpc_Slibgrpc_Uresolver_Udns_Uares.so: error: undefined reference to 'ares_parse_txt_reply_ext'
bazel-out/k8-opt/bin/_solib_k8/libexternal_Sgrpc_Slibgrpc_Uresolver_Udns_Uares.so: error: undefined reference to 'ares_query'
bazel-out/k8-opt/bin/_solib_k8/libexternal_Sgrpc_Slibgrpc_Uresolver_Udns_Uares.so: error: undefined reference to 'ares_search'
bazel-out/k8-opt/bin/_solib_k8/libexternal_Sgrpc_Slibgrpc_Uresolver_Udns_Uares.so: error: undefined reference to 'ares_gethostbyname'
bazel-out/k8-opt/bin/_solib_k8/libexternal_Sgrpc_Slibgrpc_Uresolver_Udns_Uares.so: error: undefined reference to 'ares_set_servers_ports'
bazel-out/k8-opt/bin/_solib_k8/libexternal_Sgrpc_Slibgrpc_Uresolver_Udns_Uares.so: error: undefined reference to 'ares_strerror'
bazel-out/k8-opt/bin/_solib_k8/libexternal_Sgrpc_Slibgrpc_Uresolver_Udns_Uares.so: error: undefined reference to 'ares_init'
bazel-out/k8-opt/bin/_solib_k8/libexternal_Sgrpc_Slibgrpc_Uresolver_Udns_Uares.so: error: undefined reference to 'ares_process_fd'
bazel-out/k8-opt/bin/_solib_k8/libexternal_Sgrpc_Slibgrpc_Uresolver_Udns_Uares.so: error: undefined reference to 'ares_cancel'
bazel-out/k8-opt/bin/_solib_k8/libexternal_Sgrpc_Slibgrpc_Uresolver_Udns_Uares.so: error: undefined reference to 'ares_getsock'
bazel-out/k8-opt/bin/_solib_k8/libexternal_Sgrpc_Slibgrpc_Uresolver_Udns_Uares.so: error: undefined reference to 'ares_destroy'

我尝试运行sudo apt-get install libc-ares-dev,它确实解决了一些依赖于 c-ares 的构建步骤,但不是这个

我从源代码构建了 c-ares 并运行make install了将 .so 放在 .solibcares.so中的位置/usr/local/lib/。我还验证了libcares确实导出了这些符号。那并没有解决任何问题。

我确保我的LD_LIBRARY_PATH包括/usr/local/lib/

如何让 bazel 找到图书馆?

先感谢您。

4

0 回答 0