TensorFlow无法在Debian 8上构建 - 对全局符号不支持的reloc 42

时间:2017-08-16 15:37:42

标签: python gcc tensorflow compiler-errors

我需要从源代码构建TensorFlow,因为我在HPC上使用它,我需要GPU支持。最近,我们已经迁移到Debian 8,我无法构建TensorFlow。

我正在尝试构建TensorFlow r1.3 commit 31b316133db28cd

我的系统设置:

  • Debian 3.16.43-2 + deb8u2(2017-06-26)x86_64 GNU / Linux
  • Python 3.5.3
  • gcc(GCC)6.3.0
  • Java 1.8.0_121
  • Bazel 0.4.5
  • glibc 2.19-18 + deb8u10
  • binutils 2.28
  • cuDNN v7.0
  • CUDA 8.0

./configure输出如下:

    You have bazel 0.4.5- installed.
    Please specify the location of python. [Default is /mnt/gaiagpfs/users/homedirs/mzurad/envs/tf-1.3.0/bin/python]:
    Found possible Python library paths:
      /mnt/gaiagpfs/users/homedirs/mzurad/envs/tf-1.3.0/lib/python3.5/site-packages
    Please input the desired Python library path to use.  Default is [/mnt/gaiagpfs/users/homedirs/mzurad/envs/tf-1.3.0/lib/python3.5/site-packages]

    Using python library path: /mnt/gaiagpfs/users/homedirs/mzurad/envs/tf-1.3.0/lib/python3.5/site-packages
    Do you wish to build TensorFlow with MKL support? [y/N]
    No MKL support will be enabled for TensorFlow
    Please specify optimization flags to use during compilation when bazel option "--config=opt" is specified [Default is -march=native]:
    Do you wish to use jemalloc as the malloc implementation? [Y/n]
    jemalloc enabled
    Do you wish to build TensorFlow with Google Cloud Platform support? [y/N]
    No Google Cloud Platform support will be enabled for TensorFlow
    Do you wish to build TensorFlow with Hadoop File System support? [y/N]
    No Hadoop File System support will be enabled for TensorFlow
    Do you wish to build TensorFlow with the XLA just-in-time compiler (experimental)? [y/N]
    No XLA support will be enabled for TensorFlow
    Do you wish to build TensorFlow with VERBS support? [y/N]
    No VERBS support will be enabled for TensorFlow
    Do you wish to build TensorFlow with OpenCL support? [y/N]
    No OpenCL support will be enabled for TensorFlow
    Do you want to use clang as CUDA compiler? [y/N]
    nvcc will be used as CUDA compiler
    Please specify the CUDA SDK version you want to use, e.g. 7.0. [Leave empty to default to CUDA 8.0]:
    Please specify the location where CUDA 8.0 toolkit is installed. Refer to README.md for more details. [Default is /usr/local/cuda]:
    Please specify which gcc should be used by nvcc as the host compiler. [Default is /opt/apps/resif/data/production/v0.3-20170713/default/software/compiler/GCCcore/6.3.0/bin/gcc]:
    Please specify the cuDNN version you want to use. [Leave empty to default to cuDNN 6.0]: 7
    Please specify a list of comma-separated Cuda compute capabilities you want to build with.
    You can find the compute capability of your device at: https://developer.nvidia.com/cuda-gpus.
    Please note that each additional compute capability significantly increases your build time and binary size.
    [Default is: "3.5,3.5"]: 3.5,3.7
    Do you wish to build TensorFlow with MPI support? [y/N]
    MPI support will not be enabled for TensorFlow
    Configuration finished

由于我们正在使用GCC 5或更高版本(6.3.0),我们必须将--cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0"传递给构建命令,我做了但它没有帮助。

我总是得到同样的错误: unsupported reloc 42 against global symbol ... 但是,我无法追查这个问题。

ERROR: /mnt/gaiagpfs/users/homedirs/mzurad/tensorflow/cache/bazel/_bazel_mzurad/3806dd37ef224099fa756bede20270b4/external/protobuf/BUILD:263:1: Linking of rule '@protobuf//:js_em
bed' failed: crosstool_wrapper_driver_is_not_gcc failed: error executing command
...
/usr/bin/ld.gold: error: /opt/apps/resif/data/production/v0.3-20170713/default/software/compiler/GCCcore/6.3.0/lib/gcc/x86_64-pc-linux-gnu/6.3.0/crtbeginS.o: unsupported reloc 42 against global symbol _ITM_deregisterTMCloneTable
/usr/bin/ld.gold: error: /opt/apps/resif/data/production/v0.3-20170713/default/software/compiler/GCCcore/6.3.0/lib/gcc/x86_64-pc-linux-gnu/6.3.0/crtbeginS.o: unsupported reloc 42 against global symbol _ITM_registerTMCloneTable
/usr/bin/ld.gold: error: /opt/apps/resif/data/production/v0.3-20170713/default/software/compiler/GCCcore/6.3.0/lib/gcc/x86_64-pc-linux-gnu/6.3.0/crtbeginS.o: unsupported reloc 42 against global symbol _Jv_RegisterClasses
/usr/bin/ld.gold: error: bazel-out/host/bin/external/protobuf/_objs/js_embed/external/protobuf/src/google/protobuf/compiler/js/embed.o: unsupported reloc 42 against global symbol std::ios_base::Init::~Init()
/opt/apps/resif/data/production/v0.3-20170713/default/software/compiler/GCCcore/6.3.0/lib/gcc/x86_64-pc-linux-gnu/6.3.0/crtbeginS.o(.text+0x1e): error: unsupported reloc 42
/opt/apps/resif/data/production/v0.3-20170713/default/software/compiler/GCCcore/6.3.0/lib/gcc/x86_64-pc-linux-gnu/6.3.0/crtbeginS.o(.text+0x6b): error: unsupported reloc 42
/opt/apps/resif/data/production/v0.3-20170713/default/software/compiler/GCCcore/6.3.0/lib/gcc/x86_64-pc-linux-gnu/6.3.0/crtbeginS.o(.text+0xeb): error: unsupported reloc 42
bazel-out/host/bin/external/protobuf/_objs/js_embed/external/protobuf/src/google/protobuf/compiler/js/embed.o:embed.cc:function _GLOBAL__sub_I_main: error: unsupported reloc 42
collect2: error: ld returned 1 exit status
Target //tensorflow/tools/pip_package:build_pip_package failed to build

我尝试没有成功:

  • 将GCC降级为4.9.2但未成功。
  • 尝试使用Python 3.6.0
  • 编译TF r1.2提交4acb96a9708a7d7
  • 将cuDNN降级为6.0

0 个答案:

没有答案