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

Cannot build libtensorflow.so with bazel 0.19 #23398

Closed
galeone opened this issue Oct 31, 2018 · 3 comments · Fixed by #23583
Closed

Cannot build libtensorflow.so with bazel 0.19 #23398

galeone opened this issue Oct 31, 2018 · 3 comments · Fixed by #23583
Assignees
Labels
type:build/install Build and install issues

Comments

@galeone
Copy link

galeone commented Oct 31, 2018

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Archlinux
  • TensorFlow installed from (source or binary): source
  • TensorFlow version: 1.12
  • Python version: 3.7
  • Bazel version (if compiling from source): Build label: 0.19.0- (@non-git)
  • GCC/Compiler version (if compiling from source): gcc 8.2.1
  • CUDA/cuDNN version: cuda 10, cudnn 7
  • GPU model and memory: nvidia 1080 ti

Describe the problem

When I try to compile tensorflow from sources running:

go get -d github.com/tensorflow/tensorflow/tensorflow/go
cd ${GOPATH}/src/github.com/tensorflow/tensorflow
git checkout origin/r1.12
./configure
bazel build -c opt //tensorflow:libtensorflow.so

I got this warning from bazel:

WARNING: The following rc files are no longer being read, please transfer their contents or import their path into one of the standard rc files:
/data/pgaleone/go/src/github.com/tensorflow/tensorflow/tools/bazel.rc

and this error next:

Starting local Bazel server and connecting to it...
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=271
INFO: Reading rc options for 'build' from /data/pgaleone/go/src/github.com/tensorflow/tensorflow/.tf_configure.bazelrc:
  'build' options: --action_env PYTHON_BIN_PATH=/usr/bin/python --action_env PYTHON_LIB_PATH=/usr/lib/python3.7/site-packages --python_path=/usr/bin/python --define with_ignite_support=true --define with_xla_support=true --action_env TF_NEED_OPENCL_SYCL=0 --action_env TF_NEED_ROCM=0 --action_env TF_NEED_CUDA=1 --action_env CUDA_TOOLKIT_PATH=/opt/cuda --action_env TF_CUDA_VERSION=10.0 --action_env CUDNN_INSTALL_PATH=/opt/cuda --action_env TF_CUDNN_VERSION=7 --action_env NCCL_INSTALL_PATH=/usr/lib --action_env NCCL_HDR_PATH=/usr/lib/../include --action_env TF_NCCL_VERSION=2 --action_env TF_CUDA_COMPUTE_CAPABILITIES=6.1 --action_env LD_LIBRARY_PATH=/opt/cuda/lib64:/opt/cuda/extras/CUPTI/lib64:/home/pgaleone/sources/ml/tensorflow/bazel-bin/tensorflow/ --action_env TF_CUDA_CLANG=0 --action_env GCC_HOST_COMPILER_PATH=/usr/bin/gcc-7 --config=cuda
ERROR: Config value cuda is not defined in any .rc file
@alanpurple
Copy link
Contributor

alanpurple commented Nov 1, 2018

ERROR: Config value cuda is not defined in any .rc file

👍

@neofob
Copy link

neofob commented Nov 3, 2018

@galeone : Add the below line to your .bazelrc file in your checkout tensorflow source

import /data/pgaleone/go/src/github.com/tensorflow/tensorflow/tools/bazel.rc

or whatever that path of your tensorflow source to tools/bazel.rc

@galeone
Copy link
Author

galeone commented Nov 5, 2018

Thank you @neofob - now it works!
However, shouldn't this line being added automatically to the .bazelrc file? Probably this is a bug (although your fix works well)

@ymodak ymodak added the type:build/install Build and install issues label Nov 6, 2018
meteorcloudy added a commit that referenced this issue Nov 7, 2018
To fix build with Bazel 0.19.0 or later and it won't break build with old version or Bazel
Fixes #23398
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:build/install Build and install issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants