无法在Linux中安装bazel

时间:2016-04-16 14:12:57

标签: bazel

从git中卸载代码,然后运行sh compile.sh 错误如下:

INFO: You can skip this first step by providing a path to the bazel binary as second argument: 
INFO: compile.sh compile /path/to/bazel 
Building Bazel from scratch...... 
Building Bazel with Bazel. 
WARNING: /search/david/bazel-master/src/main/native/BUILD:46:16: in includes attribute of cc_binary rule //src/main/native:libunix.so: '.' resolves to 'src/main/native' not in 'third_party'. This will be an error in the future. 
WARNING: /search/david/bazel-master/src/main/protobuf/BUILD:36:1: in includes attribute of cc_library rule //src/main/protobuf:command_server_cc_proto: '.' resolves to 'src/main/protobuf' not in 'third_party'. This will be an error in the future. Since this rule was created by the macro 'cc_grpc_library', the error might have been caused by the macro implementation in /search/david/bazel-master/tools/build_rules/genproto.bzl:104:18. 
INFO: Found 1 target... 
ERROR: /search/david/bazel-master/src/main/cpp/BUILD:53:1: C++ compilation of rule '//src/main/cpp:blaze_abrupt_exit' failed: gcc -std=gnu99 failed: error executing command 
(cd /tmp/bazel.MM2za3vz/out/bazel-master && \ 
exec env - \ 
PATH=/usr/local/cuda-7.0/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/go/bin:/home/david/bin \ 
'/tmp/bazel.MM2za3vz/out/external/local_config_cc/gcc -std=gnu99' -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -Wall -Wl,-z,-relro,-z,now -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics -fno-omit-frame-pointer '-std=c++0x' -iquote . -iquote bazel-out/local-fastbuild/genfiles -iquote external/bazel_tools -iquote bazel-out/local-fastbuild/genfiles/external/bazel_tools -isystem external/bazel_tools/tools/cpp/gcc3 -no-canonical-prefixes -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' '-frandom-seed=bazel-out/local-fastbuild/bin/src/main/cpp/_objs/blaze_abrupt_exit/src/main/cpp/blaze_abrupt_exit.pic.o' -MD -MF bazel-out/local-fastbuild/bin/src/main/cpp/_objs/blaze_abrupt_exit/src/main/cpp/blaze_abrupt_exit.pic.d -fPIC -c src/main/cpp/blaze_abrupt_exit.cc -o bazel-out/local-fastbuild/bin/src/main/cpp/_objs/blaze_abrupt_exit/src/main/cpp/blaze_abrupt_exit.pic.o): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 127. 
/tmp/bazel.MM2za3vz/out/bazel-master/_bin/process-wrapper: line 12: /tmp/bazel.MM2za3vz/out/external/local_config_cc/gcc -std=gnu99: No such file or directory 
Target //src:bazel failed to build 
INFO: Elapsed time: 3.054s, Critical Path: 0.19s

The bazel.MM2za3vz is created tmp.And the gcc is not in this dir.How can be fixed

2 个答案:

答案 0 :(得分:2)

尝试使用bazel-version-installer-os.sh,当我使用source code时我也失败了,与你的不同,当我尝试运行complie.sh时,我就停止了。 Bazel是新的,让我们来探索它。加油: - )

答案 1 :(得分:1)

请检查the installation guidecompile.sh仅在您下载distribution archive时有效。如果你想从源代码构建bazel @ HEAD,你需要安装bazel(从预建的二进制文件或使用分发存档),然后运行bazel build //src:bazel