OS平台和发行版:Ubuntu 17.10 TensorFlow从(源或二进制)安装:源TensorFlow版本:r1.5 Python版本:2.7.14 Bazel版本:0.9 GCC /编译器版本:5.4 CUDA / cuDNN版本:CUDA 8.0 cuDNN 6 GPU型号和内存:NVidia Geforce GTX 1080Ti 11GB

准确的命令来重现:

bazel build --config=opt --config=cuda
--cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0" --verbose_failures=1 //tensorflow/tools/pip_package:build_pip_package

错误:

ERROR: /home/deepinsightlabs/.cache/bazel/_bazel_deepinsightlabs/6216f77445f5abd83461d60d9c399c02/external/flatbuffers/BUILD:86:1: C++ compilation of rule '@flatbuffers//:flatc' failed (Exit 1): crosstool_wrapper_driver_is_not_gcc failed: error executing command 
  (cd /home/deepinsightlabs/.cache/bazel/_bazel_deepinsightlabs/6216f77445f5abd83461d60d9c399c02/execroot/org_tensorflow && \
  exec env - \
    LD_LIBRARY_PATH=:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64 \
    PATH=/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/deepinsightlabs/bin \
    PWD=/proc/self/cwd \
  external/local_config_cuda/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -fPIE -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 -DNDEBUG -ffunction-sections -fdata-sections -g0 -DGEMMLOWP_ALLOW_SLOW_SCALAR_FALLBACK '-march=native' '-std=c++11' -g0 -MD -MF bazel-out/host/bin/external/flatbuffers/_objs/flatc/external/flatbuffers/src/idl_gen_js.d '-frandom-seed=bazel-out/host/bin/external/flatbuffers/_objs/flatc/external/flatbuffers/src/idl_gen_js.o' -iquote external/flatbuffers -iquote bazel-out/host/genfiles/external/flatbuffers -iquote external/bazel_tools -iquote bazel-out/host/genfiles/external/bazel_tools -isystem external/flatbuffers/grpc -isystem bazel-out/host/genfiles/external/flatbuffers/grpc -isystem external/flatbuffers/include -isystem bazel-out/host/genfiles/external/flatbuffers/include -isystem external/bazel_tools/tools/cpp/gcc3 -fexceptions -Wno-implicit-fallthrough -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -fno-canonical-system-headers -c external/flatbuffers/src/idl_gen_js.cpp -o bazel-out/host/bin/external/flatbuffers/_objs/flatc/external/flatbuffers/src/idl_gen_js.o)
external/flatbuffers/src/idl_gen_js.cpp: In static member function 'static std::__cxx11::string flatbuffers::js::JsGenerator::GenFileNamespacePrefix(const string&)':
external/flatbuffers/src/idl_gen_js.cpp:473:17: error: 'to_string' is not a member of 'std'
   return "NS" + std::to_string(
                 ^
At global scope:
cc1plus: warning: unrecognized command line option '-Wno-implicit-fallthrough'
Target //tensorflow/tools/pip_package:build_pip_package failed to build

从源代码构建TensorFlow 1.5时,我一直收到此错误 . 我正在使用gcc-5编译器 . 这是configure脚本的输出 . 我该如何解决这个问题?

build --action_env PYTHON_BIN_PATH="/usr/bin/python"
build --action_env PYTHON_LIB_PATH="/usr/local/lib/python2.7/dist-packages"
build --force_python=py2
build --host_force_python=py2
build --python_path="/usr/bin/python"
build:gcp --define with_gcp_support=true
build:hdfs --define with_hdfs_support=true
build:s3 --define with_s3_support=true
build:xla --define with_xla_support=true
build:gdr --define with_gdr_support=true
build:verbs --define with_verbs_support=true
build --action_env TF_NEED_OPENCL_SYCL="0"
build --action_env TF_NEED_CUDA="1"
build --action_env CUDA_TOOLKIT_PATH="/usr/local/cuda"
build --action_env TF_CUDA_VERSION="8.0"
build --action_env CUDNN_INSTALL_PATH="/usr/local/cuda-8.0"
build --action_env TF_CUDNN_VERSION="6"
build --action_env TF_CUDA_COMPUTE_CAPABILITIES="6.1"
build --action_env TF_CUDA_CLANG="0"
build --action_env GCC_HOST_COMPILER_PATH="/usr/bin/gcc"
build --config=cuda
test --config=cuda
build --define grpc_no_ares=true
build:opt --copt=-march=native
build:opt --host_copt=-march=native
build:opt --define with_default_optimizations=true
build --copt=-DGEMMLOWP_ALLOW_SLOW_SCALAR_FALLBACK
build --host_copt=-DGEMMLOWP_ALLOW_SLOW_SCALAR_FALLBACK
build:mkl --define using_mkl=true
build:mkl -c opt
build:monolithic --define framework_shared_object=false
build --define framework_shared_object=true
build:android --crosstool_top=//external:android/crosstool
build:android --host_crosstool_top=@bazel_tools//tools/cpp:toolchain
build:android_arm --config=android
build:android_arm --cpu=armeabi-v7a
build:android_arm64 --config=android
build:android_arm64 --cpu=arm64-v8a