Build Tensorflow with the latest version of gcc/g++ toolchain will Fail

Bug #1755610 reported by Zhenqing Hu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gcc-7 (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

Following is the build information showing on the terminal.
**************************
ERROR: /home/kevin/research/openSource/tensorflow-fork/tensorflow/core/kernels/BUILD:3286:1: C++ compilation of rule '//tensorflow/core/kernels:bias_op' failed (Exit 4): gcc failed: error executing command
  (cd /home/kevin/.cache/bazel/_bazel_kevin/aa454def16aee7126536ed9e420c2f7a/execroot/org_tensorflow && \
  exec env - \
    PWD=/proc/self/cwd \
    PYTHON_BIN_PATH=/usr/bin/python \
    PYTHON_LIB_PATH=/usr/local/lib/python2.7/dist-packages \
    TF_NEED_CUDA=0 \
    TF_NEED_OPENCL_SYCL=0 \
  /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -B/usr/bin -B/usr/bin -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections -fdata-sections -DGEMMLOWP_ALLOW_SLOW_SCALAR_FALLBACK '-march=native' '-std=c++0x' -MD -MF bazel-out/k8-opt/bin/tensorflow/core/kernels/_objs/bias_op/tensorflow/core/kernels/bias_op.pic.d '-frandom-seed=bazel-out/k8-opt/bin/tensorflow/core/kernels/_objs/bias_op/tensorflow/core/kernels/bias_op.pic.o' -fPIC -DEIGEN_MPL2_ONLY -D__CLANG_SUPPORT_DYN_ANNOTATION__ -DTENSORFLOW_USE_JEMALLOC -DTENSORFLOW_USE_ABSL -DTF_USE_SNAPPY -DCURL_STATICLIB -DPLATFORM_LINUX -DENABLE_CURL_CLIENT -DENABLE_NO_ENCRYPTION -iquote . -iquote bazel-out/k8-opt/genfiles -iquote external/nsync -iquote bazel-out/k8-opt/genfiles/external/nsync -iquote external/bazel_tools -iquote bazel-out/k8-opt/genfiles/external/bazel_tools -iquote external/eigen_archive -iquote bazel-out/k8-opt/genfiles/external/eigen_archive -iquote external/local_config_sycl -iquote bazel-out/k8-opt/genfiles/external/local_config_sycl -iquote external/com_google_absl -iquote bazel-out/k8-opt/genfiles/external/com_google_absl -iquote external/jemalloc -iquote bazel-out/k8-opt/genfiles/external/jemalloc -iquote external/gif_archive -iquote bazel-out/k8-opt/genfiles/external/gif_archive -iquote external/jpeg -iquote bazel-out/k8-opt/genfiles/external/jpeg -iquote external/protobuf_archive -iquote bazel-out/k8-opt/genfiles/external/protobuf_archive -iquote external/com_googlesource_code_re2 -iquote bazel-out/k8-opt/genfiles/external/com_googlesource_code_re2 -iquote external/farmhash_archive -iquote bazel-out/k8-opt/genfiles/external/farmhash_archive -iquote external/fft2d -iquote bazel-out/k8-opt/genfiles/external/fft2d -iquote external/highwayhash -iquote bazel-out/k8-opt/genfiles/external/highwayhash -iquote external/png_archive -iquote bazel-out/k8-opt/genfiles/external/png_archive -iquote external/zlib_archive -iquote bazel-out/k8-opt/genfiles/external/zlib_archive -iquote external/curl -iquote bazel-out/k8-opt/genfiles/external/curl -iquote external/boringssl -iquote bazel-out/k8-opt/genfiles/external/boringssl -iquote external/jsoncpp_git -iquote bazel-out/k8-opt/genfiles/external/jsoncpp_git -iquote external/aws -iquote bazel-out/k8-opt/genfiles/external/aws -isystem external/nsync/public -isystem bazel-out/k8-opt/genfiles/external/nsync/public -isystem external/bazel_tools/tools/cpp/gcc3 -isystem external/eigen_archive -isystem bazel-out/k8-opt/genfiles/external/eigen_archive -isystem external/jemalloc/include -isystem bazel-out/k8-opt/genfiles/external/jemalloc/include -isystem external/gif_archive/lib -isystem bazel-out/k8-opt/genfiles/external/gif_archive/lib -isystem external/protobuf_archive/src -isystem bazel-out/k8-opt/genfiles/external/protobuf_archive/src -isystem external/farmhash_archive/src -isystem bazel-out/k8-opt/genfiles/external/farmhash_archive/src -isystem external/png_archive -isystem bazel-out/k8-opt/genfiles/external/png_archive -isystem external/zlib_archive -isystem bazel-out/k8-opt/genfiles/external/zlib_archive -isystem external/curl/include -isystem bazel-out/k8-opt/genfiles/external/curl/include -isystem external/boringssl/src/include -isystem bazel-out/k8-opt/genfiles/external/boringssl/src/include -isystem external/jsoncpp_git/include -isystem bazel-out/k8-opt/genfiles/external/jsoncpp_git/include -isystem external/aws/aws-cpp-sdk-core/include -isystem bazel-out/k8-opt/genfiles/external/aws/aws-cpp-sdk-core/include -isystem external/aws/aws-cpp-sdk-s3/include -isystem bazel-out/k8-opt/genfiles/external/aws/aws-cpp-sdk-s3/include -DEIGEN_AVOID_STL_ARRAY -Iexternal/gemmlowp -Wno-sign-compare -fno-exceptions '-ftemplate-depth=900' -msse3 -pthread -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c tensorflow/core/kernels/bias_op.cc -o bazel-out/k8-opt/bin/tensorflow/core/kernels/_objs/bias_op/tensorflow/core/kernels/bias_op.pic.o)
gcc: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
Target //tensorflow/tools/pip_package:build_pip_package failed to build
INFO: Elapsed time: 555.990s, Critical Path: 549.14s
FAILED: Build did NOT complete successfully
**************************

Revision history for this message
Matthias Klose (doko) wrote :

> Please submit a full bug report,
> with preprocessed source if appropriate.

please attach the preprocessed source

Changed in gcc-7 (Ubuntu):
status: New → Incomplete
Revision history for this message
Zhenqing Hu (huzq85) wrote :

hi, Matthias,
Sorry that I did not catch your point, by preprocessed source, you mean attach the preprocessed source before the compile procedure? I don't know whether I can get it if so because I just got these errors by following the building instructions provided by TensorFlow. However, I will try to process it.

Revision history for this message
Matthias Klose (doko) wrote :

no, add -save-temps to the gcc options, and attach the (compressed) .ii file.

Revision history for this message
Zhenqing Hu (huzq85) wrote :

hi, Matthias,
Thank you for the reply! Actually, TensorFlow uses bazel to build the source, in the procedure, bazel may invoke gcc, I don't how to add the option "-save-temps" as one of the bazel build command, I will check the bazel command and if any progress, I will attach it.

Revision history for this message
Zhenqing Hu (huzq85) wrote :

hi, Matthias,
Sorry to reply you late. I have no idea how to add the gcc build option to bazel command line. However, I do find a way to resolve my issue for compiling Tensorflow, which is add additional options of bazel command line during the compiling in order to restrict the parallel compile jobs dispatched by bazel. In this way, the memory allocation failure of the compiling work might be avoided.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for gcc-7 (Ubuntu) because there has been no activity for 60 days.]

Changed in gcc-7 (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.