jkschin
jkschin

Reputation: 5844

Unable to build TensorFlow from source with bazel. 22nd January 2016

I wanted to install the latest TensorFlow from source. I pulled the repository, and then ran

bazel build -c opt //tensorflow/tools/pip_package:build_pip_package

I got this error:

ERROR: /home/samuelchin/tensorflow/tensorflow/models/embedding/BUILD:10:6: First argument of load() is a path, not a label. It should start with a single slash if it is an absolute path.
ERROR: /home/samuelchin/tensorflow/tensorflow/models/embedding/BUILD:10:6: file '/tensorflow:tensorflow.bzl.bzl' was not correctly loaded. Make sure the 'load' statement appears in the global scope in your file.
ERROR: /home/samuelchin/tensorflow/tensorflow/models/embedding/BUILD:104:1: name 'tf_gen_op_wrapper_py' is not defined.
ERROR: /home/samuelchin/tensorflow/tensorflow/tools/pip_package/BUILD:13:1: Target '//tensorflow/models/embedding:package' contains an error and its package is in error and referenced by '//tensorflow/tools/pip_package:build_pip_package'.
ERROR: Loading failed; build aborted.
INFO: Elapsed time: 0.071s.

Upvotes: 3

Views: 2352

Answers (2)

mrry
mrry

Reputation: 126184

There was a recent change to the TensorFlow BUILD files that causes the dependency on Bazel 0.1.4. This was announced on the [email protected] mailing list, but hasn't made it into the documentation on the website yet.

As you have already discovered, upgrading Bazel to version 0.1.4 should fix this build error.

Upvotes: 5

jkschin
jkschin

Reputation: 5844

Turns out that bazel was outdated. The previous version of my bazel was 0.1.2, which was last updated in December. Bazel has since then been updated to 0.1.4. For those who have this error, updating bazel would do the trick. You can then build as per normal.

I guess in future, if it can't build, you might want to check if bazel is updated to the latest version.

Upvotes: 1

Related Questions