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

Error in building from src, got 'undeclared inclusion(s) in rule' in mpi.so generation #5

Open
liismn opened this issue Mar 21, 2017 · 5 comments

Comments

@liismn
Copy link

liismn commented Mar 21, 2017

I want to know the right bazel version for this project. Any suggestion will be appreciated.

Environment info

Operating System: CentOS 7.2

Installed version of CUDA and cuDNN: none

If installed from source, provide

  1. The commit hash (git rev-parse HEAD)
  2. The output of bazel version
[root@localhost tensorflow-allreduce]# git rev-parse HEAD
44302f0961e76002989523c2f424a011e54fd806
[root@localhost tensorflow-allreduce]# bazel version
............
Build label: 0.4.3
Build target: bazel-out/local-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Thu Dec 22 12:31:25 2016 (1482409885)
Build timestamp: 1482409885
Build timestamp as int: 1482409885
[root@localhost mnist]# gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

If possible, provide a minimal reproducible example (We usually don't have time to read hundreds of lines of your code)

After configure success...
[root@localhost tensorflow-allreduce]# bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package

What other attempted solutions have you tried?

Logs or other output that would be helpful

(If logs are large, please upload as attachment or provide link).

 #  warning _FORTIFY_SOURCE requires compiling with optimization (-O)
    ^
ERROR: /root/download/tensorflow-allreduce/tensorflow/contrib/mpi/BUILD:13:1: undeclared inclusion(s) in rule '//tensorflow/contrib/mpi:mpi.so':
this rule is missing dependency declarations for the following files included by 'tensorflow/contrib/mpi/mpi_ops.cc':
  '/root/download/tensorflow-allreduce/tensorflow/stream_executor/lib/statusor.h'
  '/root/download/tensorflow-allreduce/tensorflow/stream_executor/platform/port.h'
  '/root/download/tensorflow-allreduce/tensorflow/stream_executor/lib/error.h'
  '/root/download/tensorflow-allreduce/tensorflow/stream_executor/lib/status.h'
  '/root/download/tensorflow-allreduce/tensorflow/stream_executor/platform/logging.h'.
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/x86_64-redhat-linux/bits/os_defines.h:39:0,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/x86_64-redhat-linux/bits/c++config.h:2097,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/utility:68,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/unordered_map:38,
                 from tensorflow/contrib/mpi/mpi_ops.cc:16:
/usr/include/features.h:330:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
 #  warning _FORTIFY_SOURCE requires compiling with optimization (-O)
    ^
tensorflow/contrib/mpi/mpi_ops.cc: In instantiation of 'void tensorflow::contrib::mpi::MPIAllgatherOp<Device>::ComputeAsync(tensorflow::OpKernelContext*, tensorflow::AsyncOpKernel::DoneCallback) [with Device = Eigen::ThreadPoolDevice; tensorflow::AsyncOpKernel::DoneCallback = std::function<void()>]':
tensorflow/contrib/mpi/mpi_ops.cc:1147:1:   required from here
tensorflow/contrib/mpi/mpi_ops.cc:1086:12: warning: unused variable 'device_context' [-Wunused-variable]
       auto device_context = context->op_device_context();
            ^
tensorflow/contrib/mpi/mpi_ops.cc: In instantiation of 'void tensorflow::contrib::mpi::MPIAllreduceOp<Device>::ComputeAsync(tensorflow::OpKernelContext*, tensorflow::AsyncOpKernel::DoneCallback) [with Device = Eigen::ThreadPoolDevice; tensorflow::AsyncOpKernel::DoneCallback = std::function<void()>]':
tensorflow/contrib/mpi/mpi_ops.cc:1147:1:   required from here
tensorflow/contrib/mpi/mpi_ops.cc:1018:12: warning: unused variable 'device_context' [-Wunused-variable]
       auto device_context = context->op_device_context();
            ^
Target //tensorflow/tools/pip_package:build_pip_package failed to build
@aburden5
Copy link

aburden5 commented May 2, 2017

Hi liismn - did you ever solve this issue? I am having the exact same problem, and haven't had any success tracking down a solution.

@liismn
Copy link
Author

liismn commented May 8, 2017

No. I tried with bazel 0.4.4 and 0.4.5, and got similar errors.

@aburden5
Copy link

aburden5 commented May 8, 2017

I can get past that error by adding this path to the deps in tensorflow/contrib/mpi/BUILD:
"//tensorflow/stream_executor"
and removing "//tensorflow/core:lib" from the disallowed_deps for tf_custom_op_library in tensorflow/tensorflow.bzl

can now build tf, but when I try "import tensorflow.contrib.mpi" I get "WARNING:tensorflow:mpi.so file could not be loaded."

@liismn
Copy link
Author

liismn commented May 15, 2017

"WARNING:tensorflow:mpi.so file could not be loaded."

You can try to add the_path_to_mpi_lib to LD_LIBRARY_PATH

@huansong
Copy link

huansong commented Aug 30, 2017

Same error here. Did anyone have a solution to that yet? Also, this issue seems to be only associated when using CPU-only configuration.

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

3 participants