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

Fix flatbuffers link error #36264

Merged

Conversation

wdirons
Copy link
Contributor

@wdirons wdirons commented Jan 27, 2020

Fix flatbuffers link error

This commit:
tensorflow/tf-build-actions@adf6e22#diff-4bdae93a605044a27f9df49a92bcf398L129

Removed the linkopts section from the cc_binary 'flatc' from
third_party/flatbuffers/BUILD.bazel. That caused builds to fail with:

/usr/bin/ld: bazel-out/host/bin/external/flatbuffers/src/libflatbuffers.a(idl_parser.o): undefined reference to symbol 'cos@@GLIBC_2.17'
/dt7/lib/powerpc64le-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

(This is GPU builds on ppc64le)

I tried passing --linkopt=-lm on the bazel build command but it still failed.
Restoring the original linkopts section does resolve this problem. (and it
seems better to have the linkopt here than globally for the entire build)

A simple linkopts = ["-lm"], works for ppc64le, but I figured for windows and
other platforms it was better to restore the original values.

This commit:
tensorflow@adf6e22#diff-4bdae93a605044a27f9df49a92bcf398L129

Removed the linkopts section from the cc_binary 'flatc' from
third_party/flatbuffers/BUILD.bazel. That caused builds to fail with:

/usr/bin/ld: bazel-out/host/bin/external/flatbuffers/src/libflatbuffers.a(idl_parser.o): undefined reference to symbol 'cos@@GLIBC_2.17'
/dt7/lib/powerpc64le-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

(This is GPU builds on ppc64le)

I tried passing `--linkopt=-lm` on the bazel build command but it still failed.
Restoring the original linkopts section does resolve this problem. (and it
seems better to have the linkopt here than globally for the entire build)

A simple `linkopts = ["-lm"],` works for ppc64le, but I figured for windows and
other platforms it was better to restore the original values.
so they can be used in the flatc link options
@tensorflow-bot tensorflow-bot bot added the size:S CL Change Size: Small label Jan 27, 2020
@wdirons
Copy link
Contributor Author

wdirons commented Jan 27, 2020

FYI @petewarden as this changes your recent commit.

@tensorflow-bot tensorflow-bot bot added kokoro:force-run Tests on submitted change ready to pull PR ready for merge process labels Jan 27, 2020
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Jan 27, 2020
@rthadur rthadur self-assigned this Jan 28, 2020
@rthadur rthadur added this to Assigned Reviewer in PR Queue via automation Jan 28, 2020
tensorflow-copybara pushed a commit that referenced this pull request Jan 28, 2020
PiperOrigin-RevId: 291844926
Change-Id: Idc4251ef1b014e395a5fedebdc371954d5cb5876
@tensorflow-copybara tensorflow-copybara merged commit 03e04c6 into tensorflow:master Jan 28, 2020
PR Queue automation moved this from Assigned Reviewer to Merged Jan 28, 2020
@wdirons wdirons deleted the fix_flatbuffers_link_error branch January 28, 2020 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes ready to pull PR ready for merge process size:S CL Change Size: Small
Projects
PR Queue
  
Merged
Development

Successfully merging this pull request may close these issues.

None yet

6 participants