我尝试从源代码构建tensorflow但由于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
任何人都能解释一下吗?我不知道为什么这是错的......
答案 0 :(得分:2)
我不确定,但我相信这是因为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
您显然可以选择自己的前缀路径。