Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile tensorflow core absl::string_view not be defined #1935

Closed
Cazyshark opened this issue Nov 3, 2021 · 9 comments
Closed

Compile tensorflow core absl::string_view not be defined #1935

Cazyshark opened this issue Nov 3, 2021 · 9 comments
Assignees
Labels
stale This label marks the issue/pr stale - to be closed automatically if no activity stat:awaiting response type:bug

Comments

@Cazyshark
Copy link

Cazyshark commented Nov 3, 2021

Describe the problem the feature is intended to solve

I'm always frustrated when bazel link thensorflow serving.so . The linker report that absl::string_view not defined , that`s confused me ,as i used nm command check absl::string_view the symbol table has defined absl::string_view

Describe alternatives you've considered

-may be env problem
-may be bazel link action does not add absl path

Additional context

Inked屏幕截图 2021-11-04 103215_LI

System information

  • OS Platform and Distribution: CentOS 7.4
  • TensorFlow Serving installed from: source code
  • TensorFlow Serving version: 2.5.1
  • Python version:3.8.12
  • GCC version:7.3.0
  • bazel version:3.7.2
  • abseil version:lts2020.09.23

Describe the problem

When i compile tensorflow serving,the bazel report follow errors:

DEBUG: /home/xxxxx/.cache/bazel/_bazel_xxxxx/88c0b036255caa902dff8573ee49daa1/external/org_tensorflow/third_party/repo.bzl:108:14:
Warning: skipping import of repository 'icu' because it already exists.
INFO: Analyzed target //tensorflow_serving/model_servers:tensorflow_model_server (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: /home/xxxxx/serving/tensorflow_serving/model_servers/BUILD:402:10: Couldn't build file tensorflow_serving/model_servers/tensorflow_model_server: Linking of rule '//tensorflow_serving/model_servers:tensorflow_model_server' failed (Exit 1): gcc failed: error executing command
  (cd /home/xxxxx/.cache/bazel/_bazel_xxxxx/88c0b036255caa902dff8573ee49daa1/execroot/tf_serving && \
  exec env - \
    LD_LIBRARY_PATH=/home/xxxxx/gcc/env/lib:/home/xxxxx/gcc/env/lib64:/home/xxxxx/absel-2020-09-23/env/lib64:/lib64:/lib:/home/xxxxx/openssl/env/openssl/lib \
    PATH=/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/xxxxx/.local/bin:/home/xxxxx/bin \
    PWD=/proc/self/cwd \
  /usr/local/bin/gcc @bazel-out/k8-opt/bin/tensorflow_serving/model_servers/tensorflow_model_server-2.params)
Execution platform: @local_execution_config_platform//:platform
bazel-out/k8-opt/bin/external/org_tensorflow/tensorflow/core/profiler/utils/_objs/xplane_utils/xplane_utils.o:xplane_utils.cc:function tensorflow::profiler::FindPlanesWithNames(tensorflow::profiler::XSpace const&, : error: undefined reference to 'std::allocator<absl::lts_2020_09_23::string_view>::allocator()'
bazel-out/k8-opt/bin/external/com_github_grpc_grpc/_objs/gpr_base/string.o:string.cc:function gpr_leftpad(char const*, char, unsigned long): warning: memset used with constant zero length parameter; this could be due to transposed parameters
collect2: error: ld returned 1 exit status
Target //tensorflow_serving/model_servers:tensorflow_model_server failed to build

Exact Steps to Reproduce

I use this command to build:
bazel build --color=yes --curses=yes \ --verbose_failures \ --config=release \ --output_filter=DONT_MATCH_ANYTHING tensorflow_serving/model_servers:tensorflow_model_server

@UsharaniPagadala UsharaniPagadala self-assigned this Nov 3, 2021
@Cazyshark Cazyshark changed the title Compile tensorflow core absl::string_view not defined Compile tensorflow core absl::string_view not be defined Nov 4, 2021
@UsharaniPagadala
Copy link

@Cazyshark
Could you please refer to this bazel version updated and also check the similar issues #1781 and #60949899 and let us know if this helps.Thanks

@Cazyshark
Copy link
Author

doesn`t work,I think that may be linux-kernel problem.
All libs has compiled,but when linking the target bazel report this problem(PS.undefined reference to 'std::allocatorabsl::lts_2020_09_23::string_view::allocator()')
:(

@shan3290
Copy link
Member

shan3290 commented Dec 8, 2021

Did you try bazel build --cxxopt=-std=c++17 ... as abseil/abseil-cpp/blob/master/FAQ.md suggested? Thanks!

@Cazyshark
Copy link
Author

Did you try bazel build --cxxopt=-std=c++17 ... as abseil/abseil-cpp/blob/master/FAQ.md suggested? Thanks!

doesn`t work

@nickkchenn
Copy link

Did you try bazel build --cxxopt=-std=c++17 ... as abseil/abseil-cpp/blob/master/FAQ.md suggested? Thanks!

doesn`t work

I met similar problem compiling tensorflow_model_server 2.6.2 on a aarch64 machine,it's been a long time but had you solved your problem at last ?

@singhniraj08
Copy link

@Cazyshark,

The recommended approach to building from source is to use Docker. The TensorFlow Serving Docker development images encapsulate all the dependencies you need to build your own version of TensorFlow Serving. In order to build in a hermetic environment with all dependencies taken care of, we will use the run_in_docker.sh script. This script passes build commands through to a Docker container. By default, the script will build with the latest nightly Docker development image.

To build the entire tree, execute:

tools/run_in_docker.sh bazel build -c opt tensorflow_serving/...

Ref: TF Serving: Building from Source. Thank you!

@github-actions
Copy link

This issue has been marked stale because it has no recent activity since 7 days. It will be closed if no further activity occurs. Thank you.

@github-actions github-actions bot added the stale This label marks the issue/pr stale - to be closed automatically if no activity label Jun 15, 2023
@github-actions
Copy link

This issue was closed due to lack of activity after being marked stale for past 7 days.

@google-ml-butler
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale This label marks the issue/pr stale - to be closed automatically if no activity stat:awaiting response type:bug
Projects
None yet
Development

No branches or pull requests

6 participants