You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Link error using c api: undefined reference to symbol 'powf@@GLIBC_2.2.5' #332
1 cc_binary(
2 name = "loader",
3 srcs = ["loader.cc"],
4 deps = [
5 "//tensorflow/core:tensorflow",
6 ]
7 )
Here’s the final directory structure:
• tensorflow/tensorflow/loader/
• tensorflow/tensorflow/loader/loader.cc
• tensorflow/tensorflow/loader/BUILD
Compile & Run
• From inside the project folder call bazel build :loader.
• From the repository root, go into bazel-bin/tensorflow/loader.
• Copy the graph protobuf to models/train.pb.
Then run ./loader and check the output!
But when building I got link error
Slow read: a 551318010-byte read from /home/users/chenghuige/.cache/bazel/_bazel_chenghuige/56e262ed5e70da1d7ac42e55562c6970/tensorflow/bazel-out/local_linux-fastbuild/bin/tensorflow/core/libkernels.lo took 6143ms.
INFO: From Linking tensorflow/loader/loader:
/usr/bin/ld: bazel-out/local_linux-fastbuild/bin/tensorflow/core/libkernels.lo(cwise_op_pow.pic.o): undefined reference to symbol 'powf@@GLIBC_2.2.5'
/usr/bin/ld: note: 'powf@@GLIBC_2.2.5' is defined in DSO /top/lib/libm.so.6 so try adding it to the linker command line
/top/lib/libm.so.6: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
ERROR: /home/users/chenghuige/other/tensorflow/tensorflow/loader/BUILD:1:1: Linking of rule '//tensorflow/loader:loader' failed: gcc failed: error executing command /usr/bin/gcc -o bazel-out/local_linux-fastbuild/bin/tensorflow/loader/loader bazel-out/local_linux-fastbuild/bin/tensorflow/loader/_objs/loader/tensorflow/loader/loader.pic.o -Wl,-whole-archive ... (remaining 45 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
Target //tensorflow/loader:loader failed to build
Use --verbose_failures to see the command lines of failed build steps.
changed the title [-]Link error using c api : undefined reference to symbol 'powf@@GLIBC_2.2.5'[/-][+]Link error using c api: undefined reference to symbol 'powf@@GLIBC_2.2.5'[/+]on Nov 23, 2015
It sounds like you're using an older version of glibc than we support (2.2.5, rather than 2.17). You could try adding "-lm" to the returned value from tf_copts() in tensorflow.bzl (see here), but there might be other problems that arise afterwards.
I'd recommend trying to update the version of libc on your machine, or using a Docker container to experiment with a different operating system in a known-good configuration.
Activity
[-]Link error using[/-][+]Link error using c api : undefined reference to symbol 'powf@@GLIBC_2.2.5'[/+][-]Link error using c api : undefined reference to symbol 'powf@@GLIBC_2.2.5'[/-][+]Link error using c api: undefined reference to symbol 'powf@@GLIBC_2.2.5'[/+]mrry commentedon Nov 30, 2015
It sounds like you're using an older version of glibc than we support (2.2.5, rather than 2.17). You could try adding
"-lm"to the returned value fromtf_copts()intensorflow.bzl(see here), but there might be other problems that arise afterwards.I'd recommend trying to update the version of libc on your machine, or using a Docker container to experiment with a different operating system in a known-good configuration.
chenghuige commentedon Dec 1, 2015
@mrry
ll -t libm.so.6
lrwxrwxrwx 1 root root 12 Jul 3 17:57 libm.so.6 -> libm-2.18.so
seems libm.so.6 is of version 2.18 ?
Adding -lm will not solve this problem.
Also I can use bazel build tensorflow project successfully but I can not build this example
girving commentedon Dec 7, 2015
@mrry: Should we close as won't fix due to the version issue?
mrry commentedon Dec 7, 2015
I think so. It sounds like a Bazel issue, not picking up the appropriate libraries from a non-standard location.
Merge pull request tensorflow#332 from ROCmSoftwarePlatform/fix-hipme…
Update XNNPACK in XLA