Building TensorFlow: bazel cannot find libstdc ++ in non-standard directory

I am trying to build an MKL accelerated version of TensorFlow using bazel 0.5.1, gcc 6.2, binutils 2.28, Anaconda2 python on Scientific Linux 7.2. Apparently the / lib 64 / libstdc ++. So.6 system is too old, so I am trying to use gcc installed in a different directory. PATH, LD_LIBRARY_PATH changed to add appropriate paths (using modules). However, while bazel has no problem building the correct binaries for gcc, ld, python, it still tries to load the old / lib 64 / libstdc ++. So.6 system. How do I make it use one of gcc 6.2? Why doesn't it pick it from LD_LIBRARY_PATH? According to Google, a lot of people have problems with this, but I couldn't find a solution that would work for me. I had no problem building TensorFlow under Ubuntu 16.04,which has a fairly new gcc in its standard location.

I am doing:

1) ./configure The only options other than the defaults I choose are to use MKL and load MKL

2) bazel build --config = mkl --copt = "- DEIGEN_USE_VML" -s -c opt // tensorflow / tools / pip_package: build_pip_package

.....

Example / example_parser_configuration.proto tensorflow / core /Protobuf/control_flow.proto tensorflow / core /Protobuf/meta_graph.proto tensorflow / core /Protobuf/named_tensor.proto tensorflow / core / Protobuf/saved_model.proto tensorflow / core /Protobuf/tensorflow_server.proto tensorflow / core / util / event.proto tensorflow / core / util / test_log.proto) ERROR: / scratch / midway2 / ivy2 / TF_intel / tensorflow / tensorflow / tools / tfprof / BUILD: 42: 1: null failed: protoc failed: failed bazel-out / host / bin / external / protobuf / protoc '- python_out = bazel-out / local-opt / genfiles /' - I. -I AM. -Iexternal / protobuf / python -Ibazel-out / local-opt / genfiles / external / protobuf / python ... (remaining 5 arguments omitted): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.bazel-out / host / bin / external / protobuf / protoc:/lib64/libstdc++.so.6: versionGLIBCXX_3.4.20' not found (required by bazel-out/host/bin/external/protobuf/protoc) bazel-out/host/bin/external/protobuf/protoc: /lib64/libstdc++.so.6: version

CXXABI_1.3.8 'not found (requires bazel-out / host / bin / external / protobuf / protoc) bazel-out / host / bin / external / protobuf / protoc: / lib64 / libstdc ++. So.6: version `GLIBCXX_3.4.21 'not found (requires bazel-out / host / bin / external / protobuf / protoc)

.....

Thanks Igor

+3


source to share


1 answer


Sorry for the slow response. Bazel by design ignores LD_LIBRARY_PATH when performing actions. It shouldn't ignore them while discovering the C ++ tools, but at the moment it does the following: / To help you forward, I would try to add --sysroot = as linkopt, or use the bazel grte_top flag. Depending on where your libstdc ++ is. This is how it lives, you may need to disable the sandbox. The principal solution would be to write a custom CROSSTOOL that specifies builtin_sysroot or grte_top. But this is not an easy task.



Let me know if I lost you anywhere at this point :)

0


source







All Articles