Bazel 使用不同的编译器构建

Bazel build using different compiler

如何指定 Bazel 使用的编译器?我看到 --compiler 选项 here,但没有解释其用途。

我已经阅读了有关在我的机器上进行 new toolchains, but it appears that it is per project or something. For Tensorflow in particular, I want to use a icecc 安装以便分发构建的信息

对于 gcc 的包装器,export CC=/path/to/icecc 应该可以正常工作并开始使用带有 bazel 0.4.5 的 icecc。如果 icecc 需要特殊的环境变量,你可能需要添加 --action_env flags.

请注意,Bazel 是为 运行 使用 Google 编译集群创建的,因此将每个编译操作分开,这可能会与 icecc 假设发生严重交互。