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

[Building from source with bazel] Failure when linking libm-libraries during compilation of flatbuffers #73798

Closed
hanssssssssssssss opened this issue Aug 14, 2024 · 4 comments
Assignees
Labels
2.17 Issues related to 2.17 release stale This label marks the issue/pr stale - to be closed automatically if no activity stat:awaiting response Status - Awaiting response from author subtype: ubuntu/linux Ubuntu/Linux Build/Installation Issues type:build/install Build and install issues

Comments

@hanssssssssssssss
Copy link

Issue type

Build/Install

Have you reproduced the bug with TensorFlow Nightly?

No

Source

source

TensorFlow version

2.17

Custom code

No

OS platform and distribution

Linux Debian 5.10.216-1 x86_64

Mobile device

No response

Python version

3.12

Bazel version

7.3.0

GCC/compiler version

clang 17.0.2

CUDA/cuDNN version

CUDA 12 /cuDNN 8

GPU model and memory

NVIDIA A2

Current behavior?

I'm trying to build tensorflow from source with bazel for use in a C++ project. I'm working in a conda environment wit the specifics mentioned above and try to compile the libraries with the following command:

bazel build //tensorflow:libtensorflow_cc.so //tensorflow:libtensorflow_framework.so

Bazel fails with the follwing error message:

ERROR: /my/home/path/cache/bazel/_bazel_myuser/45c6a78e7c7688232d885d39238fef70/external/flatbuffers/BUILD.bazel:84:10: Linking external/flatbuffers/flatc [for tool] failed: (Exit 1): clang-17 failed: error executing command (from target @flatbuffers//:flatc) /my/home/path/.conda/envs/poet/bin/clang-17 @bazel-out/k8-opt-exec-50AE0418/bin/external/flatbuffers/flatc-2.params
/usr/bin/ld: warning: /my/home/path/.conda/envs/poet/bin/../lib/gcc/x86_64-conda-linux-gnu/14.1.0/crtbeginS.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010002
/usr/bin/ld: warning: /my/home/path/.conda/envs/poet/bin/../lib/gcc/x86_64-conda-linux-gnu/14.1.0/crtbeginS.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010001
/usr/bin/ld: cannot find /lib64/libm.so.6 inside /
/usr/bin/ld: cannot find /usr/lib64/libmvec_nonshared.a inside /
/usr/bin/ld: cannot find /lib64/libmvec.so.1 inside /
clang-17: error: linker command failed with exit code 1 (use -v to see invocation)

I tried to add the following lines to .bazelrc to explicitly link the locations of the libraries that were not found. That did not change the error.

build:linux --linkopt=-L/mnt/beegfs/home/straile/.conda/envs/poet/x86_64-conda-linux-gnu/sysroot/lib64
build:linux --linkopt=-L/mnt/beegfs/home/straile/.conda/envs/poet/x86_64-conda-linux-gnu/sysroot/usr/lib64
build:linux --linkopt=-Wl,-rpath,/mnt/beegfs/home/straile/.conda/envs/poet/x86_64-conda-linux-gnu/sysroot/lib64
build:linux --linkopt=-Wl,-rpath,/mnt/beegfs/home/straile/.conda/envs/poet/x86_64-conda-linux-gnu/sysroot/usr/lib64

Any help on this issue is much appreciated.

Standalone code to reproduce the issue

git clone https://github.com/tensorflow/tensorflow.git
cd tensorflow
git checkout r2.17
./configure 
# [with CUDA version 12, cuDNN version 8, NCCL version 2.18, compute capabilities 8.6]
# I also had to add "linux:build --copt=-Qunused-arguments" to .bazelrc to ignore compile errors in protoc
bazel build //tensorflow:libtensorflow_cc.so //tensorflow:libtensorflow_framework.so

Relevant log output

No response

@google-ml-butler google-ml-butler bot added the type:build/install Build and install issues label Aug 14, 2024
@Venkat6871 Venkat6871 added 2.17 Issues related to 2.17 release subtype: ubuntu/linux Ubuntu/Linux Build/Installation Issues labels Aug 16, 2024
@Venkat6871
Copy link
Contributor

Hi @hanssssssssssssss ,

  • Apologies for the delay. This might be due to a version incompatibility. Please verify version compatibility using the attached documentation. Let me know if the issue persists.

Thank you!

@Venkat6871 Venkat6871 added the stat:awaiting response Status - Awaiting response from author label Aug 19, 2024
Copy link

This issue is stale because it has been open for 7 days with no activity. 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 Aug 27, 2024
Copy link

github-actions bot commented Sep 3, 2024

This issue was closed because it has been inactive for 7 days since being marked as stale. Please reopen if you'd like to work on this further.

@github-actions github-actions bot closed this as completed Sep 3, 2024
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
2.17 Issues related to 2.17 release stale This label marks the issue/pr stale - to be closed automatically if no activity stat:awaiting response Status - Awaiting response from author subtype: ubuntu/linux Ubuntu/Linux Build/Installation Issues type:build/install Build and install issues
Projects
None yet
Development

No branches or pull requests

2 participants