tensorflow: Bazel missing dependency declaration for Eigen

Compilation error that suggests Bazel is not recognizing the Eigen header files. Occurs consistently for me on all versions starting from 21716d8f6e175cd6e8cd97a84e48497574268b0c up until the current master (00726750c9f7dedfc57685c5011e21df3b5b3706).

Environment info

64-bit CentOS / cuda 7.5.18 / cudnn 5.0.5 / bazel 0.2.1 / java 1.8.0_91

Steps to reproduce

Run ./configure and set up compilation with CUDA 7.5 and CuDNN 5.0.

bazel build -c opt --config=cuda //tensorflow/tools/pip_package:build_pip_package

Compiles fine without --config=cuda.

What have you tried?

I ran a git bisect and traced it to 21716d8f6e175cd6e8cd97a84e48497574268b0c. More specifically, it is moving Eigen out of the eigen-eigen-b4fa9622b809 folder that for some reason is causing this. Reverting only these changes from the master makes it compile just fine (see https://github.com/gustavla/tensorflow/commit/058a6517576171bb0c7dcf11ec1aac04bd59aedf). I have so far been unable to fix it while keeping the strip_prefix in.

It suspect it might be a quirk in bazel 0.2.1. It would be great if anyone else running that version can confirm.

Error

The error message (abridged and personal paths removed):

ERROR: /.../tensorflow/core/kernels/BUILD:1527:1: undeclared inclusion(s) in rule '//tensorflow/core/kernels:depth_space_ops_gpu':
this rule is missing dependency declarations for the following files included by 'tensorflow/core/kernels/spacetodepth_op_gpu.cu.cc':
  '/.../.cache/external/eigen_archive/Eigen/Core'
  '/.../.cache/external/eigen_archive/Eigen/src/Core/util/DisableStupidWarnings.h'
  '/.../.cache/external/eigen_archive/Eigen/src/Core/util/Macros.h'
  ...
  '/.../.cache/external/eigen_archive/Eigen/src/Core/ArrayWrapper.h'
  '/.../.cache/external/eigen_archive/Eigen/src/Core/GlobalFunctions.h'
  '/.../.cache/external/eigen_archive/Eigen/src/Core/util/ReenableStupidWarnings.h'.

Issues with related error messages include #1157 and #3589.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 18 (13 by maintainers)

Commits related to this issue

Most upvoted comments

@martinwicke - What is the relationship between third_party/eigen3 and the eigen_archive external repository? //third_party/eigen3 depends on @eigen_archive//:eigen, but I’m not familiar with what the differences between these two packages are.

@flybirdx101’s error message seems to be complaining about headers in //third_party/eigen3 and not @eigen_archive:

third_party/eigen3/unsupported/Eigen/CXX11/CustomOps
third_party/eigen3/unsupported/Eigen/CXX11/src/CustomOps/CTypes.h
third_party/eigen3/unsupported/Eigen/CXX11/src/CustomOps/CMatMatProduct.h

These headers do not seem to be listed in the hdrs for the cc_library rule in third_party/eigen3’s BUILD file.

@flybirdx101 - can you try adding the following items to the hdrs glob for the cc_library rule in third_party/eigen3/BUILD?

        "unsupported/Eigen/CXX11/CustomOps",
        "unsupported/Eigen/CXX11/src/CustomOps/*.h",