Hanmu Zuo
Hanmu Zuo

Reputation: 1

error bazel build in tensorflow

At first, I would like to use bazel to help me run tensorflow with SSE and avx so I tried this within work space:

bazel build -c opt --copt=-mavx --copt=-mavx2 --copt=-mfma --copt=-mfpmath=both --copt=-msse4.2 --config=cuda -k //tensorflow/tools/pip_package:build_pip_package

but it gives me a new error like following, I wonder what is wrong and what should I do? Thanks for help.

WARNING: Config values are not defined in any .rc file: cuda
ERROR: Skipping '//tensorflow/tools/pip_package:build_pip_package': no such package 'tensorflow/tools/pip_package': BUILD file not found on package path WARNING: Target pattern parsing failed.
INFO: Analysed 0 targets (2 packages loaded).
INFO: Found 0 targets...
ERROR: command succeeded, but there were errors parsing the target pattern INFO: Elapsed time: 2.727s, Critical Path: 0.02s FAILED: Build did NOT complete successfully

Upvotes: 0

Views: 2609

Answers (2)

SG_Bazel
SG_Bazel

Reputation: 355

You have to run ./configure. That will create a .bazelrc and .tf_configure.bazel file in your Tensorflow workspace.

The --config=cuda Bazel flag refers to entries in those two files (they are both text files). The entries typically look like this: build:cuda --some_bazel_flag.

It was answered here

Upvotes: 0

markroxor
markroxor

Reputation: 6476

You probably have an outdated bazel. I am not sure but you can try to use --config=opt instead of -c opt for initial versions.

Upvotes: 0

Related Questions