Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bazel can't find target in Step 1 #48

Open
dtsmith2001 opened this issue Aug 20, 2019 · 2 comments
Open

Bazel can't find target in Step 1 #48

dtsmith2001 opened this issue Aug 20, 2019 · 2 comments

Comments

@dtsmith2001
Copy link

dtsmith2001 commented Aug 20, 2019

I'm following Step 1 in the README.

git checkout v1.13.2

I ran ./configure. However, I get

Starting local Bazel server and connecting to it...
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=80
INFO: Reading rc options for 'build' from /opt/tmp/tensorflow/.bazelrc:
  'build' options: --apple_platform_type=macos --define framework_shared_object=true --define open_source_build=true --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --spawn_strategy=standalone --strategy=Genrule=standalone -c opt --announce_rc --define=grpc_no_ares=true --define=PREFIX=/usr --define=LIBDIR=$(PREFIX)/lib --define=INCLUDEDIR=$(PREFIX)/include
INFO: Reading rc options for 'build' from /opt/tmp/tensorflow/.tf_configure.bazelrc:
  'build' options: --action_env PYTHON_BIN_PATH=/usr/bin/python3 --action_env PYTHON_LIB_PATH=/usr/lib/python3/dist-packages --python_path=/usr/bin/python3 --config=xla --action_env TF_CONFIGURE_IOS=0
INFO: Found applicable config definition build:xla in file /opt/tmp/tensorflow/.tf_configure.bazelrc: --define with_xla_support=true
INFO: Found applicable config definition build:v2 in file /opt/tmp/tensorflow/.tf_configure.bazelrc: --define=tf_api_version=2
ERROR: Skipping 'tensorflow:libtensorflow_all.so': no such target '//tensorflow:libtensorflow_all.so': target 'libtensorflow_all.so' not declared in package 'tensorflow' (did you mean 'libtensorflow_cc.so'?) defined by /opt/tmp/tensorflow/tensorflow/BUILD
WARNING: Target pattern parsing failed.
ERROR: no such target '//tensorflow:libtensorflow_all.so': target 'libtensorflow_all.so' not declared in package 'tensorflow' (did you mean 'libtensorflow_cc.so'?) defined by /opt/tmp/tensorflow/tensorflow/BUILD
INFO: Elapsed time: 4.495s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (1 packages loaded)

I ran bazel clean and bazel shutdown, but I have the same problem. My command-line is

bazel build --config=v2 --local_ram_resources=1024 tensorflow:libtensorflow_all.so

Linux xxx 5.0.0-25-generic #26~18.04.1-Ubuntu SMP Thu Aug 1 13:51:02 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Ubuntu 18.04.3 LTS

I apply all updates regularly.

@yohanderose
Copy link

Same issue here.

ERROR: Skipping 'tensorflow:libtensorflow_all.so': no such target '//tensorflow:libtensorflow_all.so': target 'libtensorflow_all.so' not declared in package 'tensorflow' (did you mean 'libtensorflow_cc.so'?) defined by /home/yohan/tensorflow/tensorflow/BUILD WARNING: Target pattern parsing failed. ERROR: no such target '//tensorflow:libtensorflow_all.so': target 'libtensorflow_all.so' not declared in package 'tensorflow' (did you mean 'libtensorflow_cc.so'?) defined by /home/yohan/tensorflow/tensorflow/BUILD INFO: Elapsed time: 5.102s INFO: 0 processes. FAILED: Build did NOT complete successfully (1 packages loaded)

@yohanderose
Copy link

yohanderose commented Aug 24, 2019

Oh my goodness, just fixed it man.
We are appending to the wrong BUILD file, the relevant one is in tensorflow/tensorflow not the root directory and is much longer.

After cloning the repo do:
cd tensorflow/tensorflow
Append the BUILD file there with
cc_binary( name = "libtensorflow_all.so", linkshared = 1, linkopts = ["-Wl,--version-script=tensorflow/tf_version_script.lds"], # Remove this line if you are using MacOS deps = [ "//tensorflow/core:framework_internal", "//tensorflow/core:tensorflow", "//tensorflow/cc:cc_ops", "//tensorflow/cc:client_session", "//tensorflow/cc:scope", "//tensorflow/c:c_api", ], )
Then return back to the root tensorflow and follow the rest of the instructions remembering ./configure.

Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants