在 IBM power8 上从源代码构建 bazel



我可以访问一台大型IBM Power8机器(运行Ubuntu(,并希望在其上构建Bazel。但是,当我尝试按照他们的安装说明建议进行操作时,我得到:

me@machine:~/bazel-0.1.5$ ./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.
Compiling Java stubs for protocol buffers...
third_party/protobuf/protoc-linux-x86_32.exe -Isrc/main/protobuf/ --java_out=/tmp/bazel.T9C83cNa/src src/main/protobuf/android_studio_ide_info.proto
scripts/bootstrap/buildenv.sh: line 63: third_party/protobuf/protoc-linux-x86_32.exe: cannot execute binary file: Exec format error
pv@sardonis:~/bazel-0.1.5$ ^C

显然,问题的一部分是编译器尝试使用32位编译器。我尝试了以下方法无济于事。

  • third_party/protobuf/protoc-linux-x86_32.exe替换为 third_party/protobuf/protoc-linux-x86_64.exe 的副本。这给出了相同的错误。
  • 我的发行版附带的指向 /usr/local/bin/protoc 的符号链接替换third_party/protobuf/protoc-linux-x86_32.exe(根据 protoc --version,这是libprotoc 3.0.0版本(。但是,这给出了大量错误:http://pastebin.com/HN0MQiC4
  • 按照 http://www.cnblogs.com/rodenpark/p/5007744.html 的说明从源代码编译 Protobuf,然后使用 http://www.cnblogs.com/rodenpark/p/5007846.html 上的修改构建 Bazel,但这导致了类似的大量错误:http://pastebin.com/KjkseaGx 供参考。

所以,我没有灵感了。如何在 IBM Power8 机器上编译 Bazel?

(PS:我已经发布了这个作为解决在IBM power8上安装TensorFlow的一部分,所以这不是一个重复的问题,只是逐步解决它的一个方面。

您使用的 protobuf 版本必须与签入的 protobuf 运行时匹配。在本例中,它是 protobuf-java-3.0.0-beta-1.jar [1],因此您必须使用编译器版本 3.0.0-beta-1。

(我在Bazel工作。

[1] https://github.com/bazelbuild/bazel/tree/master/third_party/protobuf

最新更新