我试图从源代码构buildtensorflow,但由于gcc错误而失败。
错误日志:
gcc: error trying to exec 'as': execvp: No such file or directory ERROR: /home/pcy/tensorflow-r0.10/tensorflow/core/kernels/BUILD:369:1: output 'tensorflow/core/kernels/_objs/batch_matrix_band_part_op_gpu/tensorflow/core/kernels/batch_matrix_band_part_op_gpu.cu.pic.o' was not created. ERROR: /home/pcy/tensorflow-r0.10/tensorflow/core/kernels/BUILD:369:1: not all outputs were created. Target //tensorflow/tools/pip_package:build_pip_package failed to build Use --verbose_failures to see the command lines of failed build steps. INFO: Elapsed time: 24.255s, Critical Path: 23.90s pcy@BJSH-DATAGPU-134-200:~/tensorflow-r0.10$ whereis as as: /usr/bin/as /usr/share/man/man1/as.1.gz
任何人都可以解释吗? 我不知道为什么这是错的…
我不确定,但我相信这是因为Bazel取消了路径变量,并在内部复制了所需的工具。
解决方法是不幸的,你必须重新编译你的编译器,并将路径硬编码as
, ld
和nm
。
这与问题#2806有关 。
你必须像这样配置你的编译器:
./configure --prefix=/opt/gcc-5.3 --disable-nls --enable-languages=c,c++ --with-ld=/bin/ld --with-nm=/bin/nm --with-as=/usr/bin/as
你显然可以选择你自己的前缀路径。