2016-08-23 27 views
1

我試圖從源碼構建tensorflow,但由於gcc錯誤而失敗。tensorflow構建失敗,因爲gcc錯誤'as'

錯誤日誌:

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 
[email protected]:~/tensorflow-r0.10$ whereis as 
as: /usr/bin/as /usr/share/man/man1/as.1.gz 

任何人都可以解釋一下嗎?我不知道爲什麼它是錯的...

回答

2

我不確定,但我相信這是因爲Bazel取消路徑變量並在內部複製所需的工具或其他東西。

的解決方法是不幸的是,你必須重新編譯你的編譯器,並進行硬編碼的路徑asldnm

這與問題#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 

可以很明顯的選擇自己的前綴路徑。

+0

爲我工作,用gcc-4.9.4。謝謝! 然後,過了一會兒,我找到了[this](https://gist.github.com/taylorpaul/3e4e405ffad1be8355bf742fa24b41f0)帖子,這表明只是複製「as」來解決這個問題。儘管如此,我還沒有嘗試過,所以我不想發佈這個答案。 – Igor