TensorFlow Bazel build failing

三世轮回 提交于 2019-12-03 14:22:25
Martinez Mariano

I had the same issue building tensorflow in Ubuntu 16.04.

First of all ensure that you are using gcc version <= 4.8

In my case I had to install it doing:

For gcc

sudo apt-get install gcc-4.8
sudo update-alternatives --remove-all gcc
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 10

For g++

sudo apt-get install g++-4.8
sudo update-alternatives --remove-all g++
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 10

Once having the right version of gcc and g++, I had to edit the CROSSTOOL file as follows:

gedit tensorflow_sources_folder/third_party/gpus/crosstool/CROSSTOOL

Search every ocurrence of this specific line:

tool_path { name: "gcc" path: "clang/bin/crosstool_wrapper_driver_is_not_gcc" }

And insert the following line exactly above it:

cxx_flag: "-D_FORCE_INLINES"

So the result must be:

cxx_flag: "-D_FORCE_INLINES"
tool_path { name: "gcc" path: "clang/bin/crosstool_wrapper_driver_is_not_gcc" }
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!