bazel build //tensorflow/examples/android:tensorflow_demo报错: fatal error: 'cuda_runtime.h' file not found

In file included from ./third_party/eigen3/unsupported/Eigen/CXX11/Tensor:1:
external/eigen_archive/unsupported/Eigen/CXX11/Tensor:84:10: fatal error: 'cuda_runtime.h' file not found
#include <cuda_runtime.h>
1 error generated.
Target //tensorflow/examples/android:tensorflow_demo failed to build

这是找不到cuda_runtime.h,在:

tensorflow/third_party/gpus/crosstool/目录,打开CROSSTOOL_nvcc.tpl文件,搜索cxx_builtin_include_directory,在下面添加行如下
cxx_builtin_include_directory: "/usr/local/cuda-8.0/include"    连接到路径就可以啦

不过,最后的最后,我还是没ok,可能还有个CROSSTOOL_***.tpl文件没有加路径吧,因为是编译android:tensorflow_demo 所以我

在./config的时候屏蔽了cuda。后面就可以编译ok了。

原文地址:https://www.cnblogs.com/YouXiangLiThon/p/8243163.html