bazel编译错误:linux / magic.h:没有这样的文件或目录

时间:2017-06-21 23:52:40

标签: tensorflow bazel

ERROR: /ban/yohchang/practice/tensorflow/bazel-0.5.1-dist/src/main/cpp/BUILD:7:1: C++ compilation of rule '//src/main/cpp:blaze_util' failed: gcc failed: error executing command
(cd /tmp/bazel_tC149834/out/execroot/bazel-0.5.1-dist && 
exec env - 
LD_LIBRARY_PATH=:/volp1/quota_ctrl/yohchang/practice/tensorflow/local_install/gcc-4.8.1/lib:/volp1/quota_ctrl/yohchang/practice/tensorflow/local_install/gcc-4.8.1/lib64/:/volp1/quota_ctrl/yohchang/practice/tensorflow/local_install/mpc-0.8.1/lib:/volp1/quota_ctrl/yohchang/practice/tensorflow/local_install/gmp-4.3.2/lib:/volp1/quota_ctrl/yohchang/practice/tensorflow/local_install/mpfr-2.4.2/lib:/volp1/quota_ctrl/yohchang/practice/tensorflow/local_install/isl-0.11/lib:/volp1/quota_ctrl/yohchang/practice/tensorflow/local_install/cloog-0.18.0/lib 
PATH=/volp1/quota_ctrl/yohchang/practice/tensorflow/local_install/binutils-2.28:/sc10/ap/sivl/2005.09-SP1-1/bin:/vol0/sys/myPrint/print_execd-6.2u4/bin/lx24-amd64:/sc10/ap/linux/bin:/ban/yohchang/:.:/bin:/usr/ucb:/usr/ccs/bin:/usr/dt/bin:/usr/openwin/bin:/usr/local/bin:/usr/ucb/bin:/usr/bin:/usr/sbin:/bin/X11:/usr/X11R6/bin:/sc10/ap/xv/sun:/ban/wchuang/tool:/sc10/ap/tool:/vol0/sys/tool:/usr/bin:/volp1/quota_ctrl/yohchang/practice/tensorflow/local_install/gcc-4.8.1/bin 
PWD=/proc/self/cwd 
/volp1/quota_ctrl/yohchang/practice/tensorflow/local_install/gcc-4.8.1/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -B/volp1/quota_ctrl/yohchang/practice/tensorflow/local_install/gcc-4.8.1/bin -B/usr/bin -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections -fdata-sections '-std=c++0x' -MD -MF bazel-out/local-opt/bin/src/main/cpp/objs/blaze_util/src/main/cpp/blaze_util_linux.d '-frandom-seed=bazel-out/local-opt/bin/src/main/cpp/objs/blaze_util/src/main/cpp/blaze_util_linux.o' -DBLAZE_OPENSOURCE -iquote . -iquote bazel-out/local-opt/genfiles -iquote external/bazel_tools -iquote bazel-out/local-opt/genfiles/external/bazel_tools -isystem external/bazel_tools/tools/cpp/gcc3 -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c src/main/cpp/blaze_util_linux.cc -o bazel-out/local-opt/bin/src/main/cpp/_objs/blaze_util/src/main/cpp/blaze_util_linux.o): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
src/main/cpp/blaze_util_linux.cc:18:25: fatal error: linux/magic.h: No such file or directory
#include "linux/magic.h"
^
compilation terminated.

不知道如何解决这个问题...... 我尝试使用谷歌查找一些信息。它告诉我,这个问题可能是由我的旧内核引起的。但我真的不知道接下来我能做些什么。

环境信息

操作系统: 红帽企业Linux服务器版本5.7(Tikanga) ldd(GNU libc)2.5 gcc-4.8.1(我另外安装了这个编译器。) 其他信息: 我无法使用yum或任何其他在线更新来安装软件包...... 所以我下载源代码并在我的redhat计算机上编译它们。

Bazel版本(bazel info发布的输出): 0.5.1-DIST 如果您需要任何其他信息,请告诉我们! 谢谢你的帮助!

1 个答案:

答案 0 :(得分:1)

linux / magic.h不是Bazel的一部分,它是环境的一部分。例如,我在/usr/include/linux/magic.h中有它。

你可以下载相当于kernel-headers(你将yum install kernel-headers安装的那些)并将它们放在gcc可以看到的地方吗?这将是gcc -E -xc++ - -v返回的其中一个目录。