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

Linking of rule '@com_github_grpc_grpc//src/compiler:grpc_cpp_plugin' failed #52153

Closed
oooooome opened this issue Sep 27, 2021 · 9 comments
Closed
Assignees
Labels
stale This label marks the issue/pr stale - to be closed automatically if no activity stat:awaiting response Status - Awaiting response from author subtype:bazel Bazel related Build_Installation issues subtype: ubuntu/linux Ubuntu/Linux Build/Installation Issues TF 2.2 Issues related to TF 2.2 type:build/install Build and install issues

Comments

@oooooome
Copy link

oooooome commented Sep 27, 2021

Please make sure that this is a build/installation issue. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:build_template

System information

  • OS Platform and Distribution: linux Centos7.7.1908
  • TensorFlow installed from (source or binary): source
  • TensorFlow version: 2.2.0
  • Python version: 3.8.10
  • Installed using virtualenv? pip? conda?: pip
  • Bazel version (if compiling from source): 2.0.0
  • GCC/Compiler version (if compiling from source): 9.3.1
  • CUDA/cuDNN version: N/A
  • GPU model and memory: N/A

Describe the problem
hi,

I am trying to build TensorFlow 2.2.0's cpp dependency library on centos7.7, but bazel will always prompt me

Linking of rule'@com_github_grpc_grpc//src/compiler:grpc_cpp_plugin' failed

I used the same method and everything went well when I built TensorFlow on Ubuntu system. I don’t know if it’s the problem of the system or my method.

Provide the exact sequence of commands / steps that you executed before running into the problem

sk103@super5:/home/sk103/tool/tensorflow/tensorflow-2.2.0>./configure 
You have bazel 2.0.0 installed.
Please specify the location of python. [Default is /usr/bin/python]: 


Found possible Python library paths:
  /usr/local/python3/lib/python3.8/site-packages
Please input the desired Python library path to use.  Default is [/usr/local/python3/lib/python3.8/site-packages]

Do you wish to build TensorFlow with OpenCL SYCL support? [y/N]: n
No OpenCL SYCL support will be enabled for TensorFlow.

Do you wish to build TensorFlow with ROCm support? [y/N]: n
No ROCm support will be enabled for TensorFlow.

Do you wish to build TensorFlow with CUDA support? [y/N]: n
No CUDA support will be enabled for TensorFlow.

Do you wish to download a fresh release of clang? (Experimental) [y/N]: n
Clang will not be downloaded.

Please specify optimization flags to use during compilation when bazel option "--config=opt" is specified [Default is -march=native -Wno-sign-compare]: 


Would you like to interactively configure ./WORKSPACE for Android builds? [y/N]: n
Not configuring the WORKSPACE for Android builds.

Preconfigured Bazel build configs. You can use any of the below by adding "--config=<>" to your build command. See .bazelrc for more details.
	--config=mkl         	# Build with MKL support.
	--config=monolithic  	# Config for mostly static monolithic build.
	--config=ngraph      	# Build with Intel nGraph support.
	--config=numa        	# Build with NUMA support.
	--config=dynamic_kernels	# (Experimental) Build kernels into separate shared objects.
	--config=v2          	# Build TensorFlow 2.x instead of 1.x.
Preconfigured Bazel build configs to DISABLE default on features:
	--config=noaws       	# Disable AWS S3 filesystem support.
	--config=nogcp       	# Disable GCP support.
	--config=nohdfs      	# Disable HDFS support.
	--config=nonccl      	# Disable NVIDIA NCCL support.
Configuration finished
sk103@super5:/home/sk103/tool/tensorflow/tensorflow-2.2.0>
sk103@super5:/home/sk103/tool/tensorflow/tensorflow-2.2.0>bazel build //tensorflow:libtensorflow_cc.so
...

ERROR: /home/sk103/.cache/bazel/_bazel_sk103/46f66c8afcc04e6816b6d553e9e7afff/external/com_github_grpc_grpc/src/compiler/BUILD:80:1: Linking of rule '@com_github_grpc_grpc//src/compiler:grpc_cpp_plugin' failed (Exit 1)
bazel-out/host/bin/external/com_github_grpc_grpc/src/compiler/_objs/grpc_cpp_plugin/cpp_plugin.o:cpp_plugin.cc:function ProtoBufMethod::~ProtoBufMethod(): error: undefined reference to 'operator delete(void*, unsigned long)'
bazel-out/host/bin/external/com_github_grpc_grpc/src/compiler/_objs/grpc_cpp_plugin/cpp_plugin.o:cpp_plugin.cc:function ProtoBufService::~ProtoBufService(): error: undefined reference to 'operator delete(void*, unsigned long)'
bazel-out/host/bin/external/com_github_grpc_grpc/src/compiler/_objs/grpc_cpp_plugin/cpp_plugin.o:cpp_plugin.cc:function ProtoBufFile::~ProtoBufFile(): error: undefined reference to 'operator delete(void*, unsigned long)'
bazel-out/host/bin/external/com_github_grpc_grpc/src/compiler/_objs/grpc_cpp_plugin/cpp_plugin.o:cpp_plugin.cc:function google::protobuf::io::StringOutputStream::~StringOutputStream(): error: undefined reference to 'operator delete(void*, unsigned long)'
bazel-out/host/bin/external/com_github_grpc_grpc/src/compiler/_objs/grpc_cpp_plugin/cpp_plugin.o:cpp_plugin.cc:function grpc_cpp_generator::ClassName(google::protobuf::Descriptor const*, bool): error: undefined reference to 'std::__throw_out_of_range_fmt(char const*, ...)'
bazel-out/host/bin/external/com_github_grpc_grpc/src/compiler/_objs/grpc_cpp_plugin/cpp_plugin.o:cpp_plugin.cc:function ProtoBufFile::package_parts() const: error: undefined reference to 'std::__throw_out_of_range_fmt(char const*, ...)'
bazel-out/host/bin/external/com_github_grpc_grpc/src/compiler/_objs/grpc_cpp_plugin/cpp_plugin.o:cpp_plugin.cc:function CppGrpcGenerator::Generate(google::protobuf::FileDescriptor const*, std::string const&, google::protobuf::compiler::GeneratorContext*, std::string*) const: error: undefined reference to 'std::__throw_out_of_range_fmt(char const*, ...)'
bazel-out/host/bin/external/com_github_grpc_grpc/src/compiler/_objs/grpc_cpp_plugin/cpp_plugin.o:cpp_plugin.cc:function CppGrpcGenerator::Generate(google::protobuf::FileDescriptor const*, std::string const&, google::protobuf::compiler::GeneratorContext*, std::string*) const: error: undefined reference to 'std::__throw_out_of_range_fmt(char const*, ...)'
bazel-out/host/bin/external/com_google_protobuf/_objs/protobuf/dynamic_message.o:dynamic_message.cc:function google::protobuf::DynamicMessageFactory::GetPrototypeNoLock(google::protobuf::Descriptor const*) [clone .cold]: error: undefined reference to '__cxa_throw_bad_array_new_length'
bazel-out/host/bin/external/com_google_protobuf/_objs/protobuf/struct.pb.o:struct.pb.cc:function google::protobuf::Struct::SerializeWithCachedSizes(google::protobuf::io::CodedOutputStream*) const [clone .cold]: error: undefined reference to '__cxa_throw_bad_array_new_length'
bazel-out/host/bin/external/com_google_protobuf/_objs/protobuf_lite/extension_set.o:extension_set.cc:function google::protobuf::internal::ExtensionSet::~ExtensionSet(): error: undefined reference to 'operator delete[](void*, unsigned long)'
bazel-out/host/bin/external/com_google_protobuf/_objs/protobuf_lite/extension_set.o:extension_set.cc:function google::protobuf::internal::ExtensionSet::GrowCapacity(unsigned long): error: undefined reference to 'operator delete[](void*, unsigned long)'
collect2: error: ld returned 1 exit status
Target //tensorflow:libtensorflow_cc.so failed to build
Use --verbose_failures to see the command lines of failed build steps.
ERROR: /home/sk103/tool/tensorflow/tensorflow-2.2.0/tensorflow/core/BUILD:1763:1 Linking of rule '@com_github_grpc_grpc//src/compiler:grpc_cpp_plugin' failed (Exit 1)
INFO: Elapsed time: 94.025s, Critical Path: 28.32s
INFO: 347 processes: 347 local.
FAILED: Build did NOT complete successfully

@oooooome oooooome added the type:build/install Build and install issues label Sep 27, 2021
@mohantym
Copy link
Contributor

Hi @oooooome !
Could you please fill the issue Template from here as it helps us analyse the issue [tf version, steps followed before you ran into this error or stand alone code/colab gist to reproduce the issue faced].Thanks!

@mohantym mohantym added the stat:awaiting response Status - Awaiting response from author label Sep 27, 2021
@oooooome
Copy link
Author

@mohantym Sorry, there were some problems when I started this issue, now I have updated this issue

@mohantym mohantym added TF 2.2 Issues related to TF 2.2 subtype:bazel Bazel related Build_Installation issues subtype: ubuntu/linux Ubuntu/Linux Build/Installation Issues and removed stat:awaiting response Status - Awaiting response from author labels Sep 28, 2021
@mohantym
Copy link
Contributor

Hi @oooooome ! Could you try again with Tested configurations from here for TF 2.2 .

@mohantym mohantym added the stat:awaiting response Status - Awaiting response from author label Sep 28, 2021
@google-ml-butler
Copy link

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

@google-ml-butler google-ml-butler bot added the stale This label marks the issue/pr stale - to be closed automatically if no activity label Oct 5, 2021
@oooooome
Copy link
Author

oooooome commented Oct 8, 2021

thanks guys, I have solved this problem!

According to the following error messages, I found that it was related to the C++ standard library, so I checked the causes of these errors. Many answers indicated that this error may be related to the libstdc++.so library. So I updated and compiled the gcc version to 7.5, and updated the libstdc++.so library, and finally compiled successfully.

@google-ml-butler google-ml-butler bot removed stale This label marks the issue/pr stale - to be closed automatically if no activity stat:awaiting response Status - Awaiting response from author labels Oct 8, 2021
@mohantym
Copy link
Contributor

Ok @oooooome ,Thanks for updating on the same. Could you please close this issue then?

@mohantym mohantym added the stat:awaiting response Status - Awaiting response from author label Oct 11, 2021
@google-ml-butler
Copy link

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

@google-ml-butler google-ml-butler bot added the stale This label marks the issue/pr stale - to be closed automatically if no activity label Oct 18, 2021
@google-ml-butler
Copy link

Closing as stale. Please reopen if you'd like to work on this further.

@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 Status - Awaiting response from author subtype:bazel Bazel related Build_Installation issues subtype: ubuntu/linux Ubuntu/Linux Build/Installation Issues TF 2.2 Issues related to TF 2.2 type:build/install Build and install issues
Projects
None yet
Development

No branches or pull requests

2 participants