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

Undeclared inclusions and missing dependencies in building #2109

Closed
Dapid opened this issue Apr 26, 2016 · 29 comments
Closed

Undeclared inclusions and missing dependencies in building #2109

Dapid opened this issue Apr 26, 2016 · 29 comments
Assignees

Comments

@Dapid
Copy link

Dapid commented Apr 26, 2016

The following commands were run on a Fedora 23 64 bits on Tensorflow master, but I get similar results on the 0.8 branch.

Using Bazel 0.2.1 on a laptop without graphics card:

$ bazel build -c opt --verbose_failures //tensorflow/tools/pip_package:build_pip_package
INFO: Found 1 target...
ERROR: /home/david/.cache/bazel/_bazel_david/47d00ffdd2fc0515138a34f138cebd63/external/re2/BUILD:9:1: undeclared inclusion(s) in rule '@re2//:re2':
this rule is missing dependency declarations for the following files included by 'external/re2/util/rune.cc':
  '/lib/gcc/x86_64-redhat-linux/5.3.1/include/stdarg.h'
  '/lib/gcc/x86_64-redhat-linux/5.3.1/include/stddef.h'
  '/lib/gcc/x86_64-redhat-linux/5.3.1/include/stdint.h'.
Target //tensorflow/tools/pip_package:build_pip_package failed to build
INFO: Elapsed time: 1.394s, Critical Path: 0.34s

On a machine with Cuda 7.5 and cudnn 5 installed, GCC 4.9 built locally (but I get the same results with system's GCC 5.3.1):

With bazel 0.1.1:

$ bazel build -c opt --config=cuda --spawn_strategy=standalone //tensorflow/tools/pip_package:build_pip_package
Warning: ignoring LD_PRELOAD in environment.
ERROR: /home/david/gits/tensorflow/WORKSPACE:16:6: First argument of load() is a path, not a label. It should start with a single slash if it is an absolute path..
ERROR: /home/david/gits/tensorflow/WORKSPACE:20:6: First argument of load() is a path, not a label. It should start with a single slash if it is an absolute path..
ERROR: WORKSPACE file could not be parsed.
ERROR: no such package 'external': Package 'external' contains errors.
INFO: Elapsed time: 0.065s

With Bazel 0.2.1:

bazel build -c opt --config=cuda --spawn_strategy=standalone //tensorflow/tools/pip_package:build_pip_package
Warning: ignoring LD_PRELOAD in environment.
Sending SIGTERM to previous Bazel server (pid=19634)... done.
.....
INFO: Found 1 target...
ERROR: /home/david/.cache/bazel/_bazel_david/47d00ffdd2fc0515138a34f138cebd63/external/re2/BUILD:9:1: undeclared inclusion(s) in rule '@re2//:re2':
this rule is missing dependency declarations for the following files included by 'external/re2/re2/perl_groups.cc':
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/stddef.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/stdarg.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/stdint.h'
  '/home/david/.local/include/c++/4.9.3/ctime'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/c++config.h'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/os_defines.h'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/cpu_defines.h'
  '/home/david/.local/include/c++/4.9.3/vector'
  '/home/david/.local/include/c++/4.9.3/bits/stl_algobase.h'
  '/home/david/.local/include/c++/4.9.3/bits/functexcept.h'
  '/home/david/.local/include/c++/4.9.3/bits/exception_defines.h'
  '/home/david/.local/include/c++/4.9.3/bits/cpp_type_traits.h'
  '/home/david/.local/include/c++/4.9.3/ext/type_traits.h'
  '/home/david/.local/include/c++/4.9.3/ext/numeric_traits.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_pair.h'
  '/home/david/.local/include/c++/4.9.3/bits/move.h'
  '/home/david/.local/include/c++/4.9.3/bits/concept_check.h'
  '/home/david/.local/include/c++/4.9.3/type_traits'
  '/home/david/.local/include/c++/4.9.3/bits/stl_iterator_base_types.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_iterator_base_funcs.h'
  '/home/david/.local/include/c++/4.9.3/debug/debug.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_iterator.h'
  '/home/david/.local/include/c++/4.9.3/bits/ptr_traits.h'
  '/home/david/.local/include/c++/4.9.3/bits/predefined_ops.h'
  '/home/david/.local/include/c++/4.9.3/bits/allocator.h'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/c++allocator.h'
  '/home/david/.local/include/c++/4.9.3/ext/new_allocator.h'
  '/home/david/.local/include/c++/4.9.3/new'
  '/home/david/.local/include/c++/4.9.3/exception'
  '/home/david/.local/include/c++/4.9.3/bits/atomic_lockfree_defines.h'
  '/home/david/.local/include/c++/4.9.3/bits/exception_ptr.h'
  '/home/david/.local/include/c++/4.9.3/bits/nested_exception.h'
  '/home/david/.local/include/c++/4.9.3/bits/memoryfwd.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_construct.h'
  '/home/david/.local/include/c++/4.9.3/ext/alloc_traits.h'
  '/home/david/.local/include/c++/4.9.3/bits/alloc_traits.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_uninitialized.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_vector.h'
  '/home/david/.local/include/c++/4.9.3/initializer_list'
  '/home/david/.local/include/c++/4.9.3/bits/stl_bvector.h'
  '/home/david/.local/include/c++/4.9.3/bits/functional_hash.h'
  '/home/david/.local/include/c++/4.9.3/bits/hash_bytes.h'
  '/home/david/.local/include/c++/4.9.3/bits/range_access.h'
  '/home/david/.local/include/c++/4.9.3/bits/vector.tcc'
  '/home/david/.local/include/c++/4.9.3/string'
  '/home/david/.local/include/c++/4.9.3/bits/stringfwd.h'
  '/home/david/.local/include/c++/4.9.3/bits/char_traits.h'
  '/home/david/.local/include/c++/4.9.3/bits/postypes.h'
  '/home/david/.local/include/c++/4.9.3/cwchar'
  '/home/david/.local/include/c++/4.9.3/cstdint'
  '/home/david/.local/include/c++/4.9.3/bits/localefwd.h'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/c++locale.h'
  '/home/david/.local/include/c++/4.9.3/clocale'
  '/home/david/.local/include/c++/4.9.3/iosfwd'
  '/home/david/.local/include/c++/4.9.3/cctype'
  '/home/david/.local/include/c++/4.9.3/bits/ostream_insert.h'
  '/home/david/.local/include/c++/4.9.3/bits/cxxabi_forced.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_function.h'
  '/home/david/.local/include/c++/4.9.3/backward/binders.h'
  '/home/david/.local/include/c++/4.9.3/bits/basic_string.h'
  '/home/david/.local/include/c++/4.9.3/ext/atomicity.h'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/gthr.h'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/gthr-default.h'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/atomic_word.h'
  '/home/david/.local/include/c++/4.9.3/ext/string_conversions.h'
  '/home/david/.local/include/c++/4.9.3/cstdlib'
  '/home/david/.local/include/c++/4.9.3/cstdio'
  '/home/david/.local/include/c++/4.9.3/cerrno'
  '/home/david/.local/include/c++/4.9.3/bits/basic_string.tcc'
  '/home/david/.local/include/c++/4.9.3/algorithm'
  '/home/david/.local/include/c++/4.9.3/utility'
  '/home/david/.local/include/c++/4.9.3/bits/stl_relops.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_algo.h'
  '/home/david/.local/include/c++/4.9.3/bits/algorithmfwd.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_heap.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_tempbuf.h'
  '/home/david/.local/include/c++/4.9.3/random'
  '/home/david/.local/include/c++/4.9.3/cmath'
  '/home/david/.local/include/c++/4.9.3/limits'
  '/home/david/.local/include/c++/4.9.3/bits/random.h'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/opt_random.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/x86intrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/ia32intrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/mmintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/xmmintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/mm_malloc.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/emmintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/pmmintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/tmmintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/ammintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/smmintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/popcntintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/wmmintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/immintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/avxintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/avx2intrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/avx512fintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/avx512erintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/avx512pfintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/avx512cdintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/shaintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/lzcntintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/bmiintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/bmi2intrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/fmaintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/f16cintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/rtmintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/xtestintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/mm3dnow.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/prfchwintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/fma4intrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/xopintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/lwpintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/tbmintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/rdseedintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/fxsrintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/xsaveintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/xsaveoptintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/adxintrin.h'
  '/home/david/.local/include/c++/4.9.3/bits/random.tcc'
  '/home/david/.local/include/c++/4.9.3/numeric'
  '/home/david/.local/include/c++/4.9.3/bits/stl_numeric.h'
  '/home/david/.local/include/c++/4.9.3/map'
  '/home/david/.local/include/c++/4.9.3/bits/stl_tree.h'
  '/home/david/.local/include/c++/4.9.3/ext/aligned_buffer.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_map.h'
  '/home/david/.local/include/c++/4.9.3/tuple'
  '/home/david/.local/include/c++/4.9.3/array'
  '/home/david/.local/include/c++/4.9.3/stdexcept'
  '/home/david/.local/include/c++/4.9.3/bits/uses_allocator.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_multimap.h'
  '/home/david/.local/include/c++/4.9.3/stack'
  '/home/david/.local/include/c++/4.9.3/deque'
  '/home/david/.local/include/c++/4.9.3/bits/stl_deque.h'
  '/home/david/.local/include/c++/4.9.3/bits/deque.tcc'
  '/home/david/.local/include/c++/4.9.3/bits/stl_stack.h'
  '/home/david/.local/include/c++/4.9.3/ostream'
  '/home/david/.local/include/c++/4.9.3/ios'
  '/home/david/.local/include/c++/4.9.3/bits/ios_base.h'
  '/home/david/.local/include/c++/4.9.3/bits/locale_classes.h'
  '/home/david/.local/include/c++/4.9.3/bits/locale_classes.tcc'
  '/home/david/.local/include/c++/4.9.3/streambuf'
  '/home/david/.local/include/c++/4.9.3/bits/streambuf.tcc'
  '/home/david/.local/include/c++/4.9.3/bits/basic_ios.h'
  '/home/david/.local/include/c++/4.9.3/bits/locale_facets.h'
  '/home/david/.local/include/c++/4.9.3/cwctype'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/ctype_base.h'
  '/home/david/.local/include/c++/4.9.3/bits/streambuf_iterator.h'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/ctype_inline.h'
  '/home/david/.local/include/c++/4.9.3/bits/locale_facets.tcc'
  '/home/david/.local/include/c++/4.9.3/bits/basic_ios.tcc'
  '/home/david/.local/include/c++/4.9.3/bits/ostream.tcc'
  '/home/david/.local/include/c++/4.9.3/set'
  '/home/david/.local/include/c++/4.9.3/bits/stl_set.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_multiset.h'
  '/home/david/.local/include/c++/4.9.3/tr1/unordered_set'
  '/home/david/.local/include/c++/4.9.3/tr1/type_traits'
  '/home/david/.local/include/c++/4.9.3/tr1/functional_hash.h'
  '/home/david/.local/include/c++/4.9.3/tr1/hashtable.h'
  '/home/david/.local/include/c++/4.9.3/tr1/hashtable_policy.h'
  '/home/david/.local/include/c++/4.9.3/tr1/unordered_set.h'
  '/home/david/.local/include/c++/4.9.3/sstream'
  '/home/david/.local/include/c++/4.9.3/istream'
  '/home/david/.local/include/c++/4.9.3/bits/istream.tcc'
  '/home/david/.local/include/c++/4.9.3/bits/sstream.tcc'.
Target //tensorflow/tools/pip_package:build_pip_package failed to build
Use --verbose_failures to see the command lines of failed build steps.
bazel build -c opt --config=cuda //tensorflow/cc:tutorials_example_trainer
Warning: ignoring LD_PRELOAD in environment.
INFO: Found 1 target...
ERROR: /home/david/.cache/bazel/_bazel_david/47d00ffdd2fc0515138a34f138cebd63/external/re2/BUILD:9:1: undeclared inclusion(s) in rule '@re2//:re2':
this rule is missing dependency declarations for the following files included by 'external/re2/util/valgrind.cc':
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/stddef.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/stdarg.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/stdint.h'
  '/home/david/.local/include/c++/4.9.3/ctime'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/c++config.h'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/os_defines.h'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/cpu_defines.h'
  '/home/david/.local/include/c++/4.9.3/vector'
  '/home/david/.local/include/c++/4.9.3/bits/stl_algobase.h'
  '/home/david/.local/include/c++/4.9.3/bits/functexcept.h'
  '/home/david/.local/include/c++/4.9.3/bits/exception_defines.h'
  '/home/david/.local/include/c++/4.9.3/bits/cpp_type_traits.h'
  '/home/david/.local/include/c++/4.9.3/ext/type_traits.h'
  '/home/david/.local/include/c++/4.9.3/ext/numeric_traits.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_pair.h'
  '/home/david/.local/include/c++/4.9.3/bits/move.h'
  '/home/david/.local/include/c++/4.9.3/bits/concept_check.h'
  '/home/david/.local/include/c++/4.9.3/type_traits'
  '/home/david/.local/include/c++/4.9.3/bits/stl_iterator_base_types.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_iterator_base_funcs.h'
  '/home/david/.local/include/c++/4.9.3/debug/debug.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_iterator.h'
  '/home/david/.local/include/c++/4.9.3/bits/ptr_traits.h'
  '/home/david/.local/include/c++/4.9.3/bits/predefined_ops.h'
  '/home/david/.local/include/c++/4.9.3/bits/allocator.h'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/c++allocator.h'
  '/home/david/.local/include/c++/4.9.3/ext/new_allocator.h'
  '/home/david/.local/include/c++/4.9.3/new'
  '/home/david/.local/include/c++/4.9.3/exception'
  '/home/david/.local/include/c++/4.9.3/bits/atomic_lockfree_defines.h'
  '/home/david/.local/include/c++/4.9.3/bits/exception_ptr.h'
  '/home/david/.local/include/c++/4.9.3/bits/nested_exception.h'
  '/home/david/.local/include/c++/4.9.3/bits/memoryfwd.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_construct.h'
  '/home/david/.local/include/c++/4.9.3/ext/alloc_traits.h'
  '/home/david/.local/include/c++/4.9.3/bits/alloc_traits.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_uninitialized.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_vector.h'
  '/home/david/.local/include/c++/4.9.3/initializer_list'
  '/home/david/.local/include/c++/4.9.3/bits/stl_bvector.h'
  '/home/david/.local/include/c++/4.9.3/bits/functional_hash.h'
  '/home/david/.local/include/c++/4.9.3/bits/hash_bytes.h'
  '/home/david/.local/include/c++/4.9.3/bits/range_access.h'
  '/home/david/.local/include/c++/4.9.3/bits/vector.tcc'
  '/home/david/.local/include/c++/4.9.3/string'
  '/home/david/.local/include/c++/4.9.3/bits/stringfwd.h'
  '/home/david/.local/include/c++/4.9.3/bits/char_traits.h'
  '/home/david/.local/include/c++/4.9.3/bits/postypes.h'
  '/home/david/.local/include/c++/4.9.3/cwchar'
  '/home/david/.local/include/c++/4.9.3/cstdint'
  '/home/david/.local/include/c++/4.9.3/bits/localefwd.h'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/c++locale.h'
  '/home/david/.local/include/c++/4.9.3/clocale'
  '/home/david/.local/include/c++/4.9.3/iosfwd'
  '/home/david/.local/include/c++/4.9.3/cctype'
  '/home/david/.local/include/c++/4.9.3/bits/ostream_insert.h'
  '/home/david/.local/include/c++/4.9.3/bits/cxxabi_forced.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_function.h'
  '/home/david/.local/include/c++/4.9.3/backward/binders.h'
  '/home/david/.local/include/c++/4.9.3/bits/basic_string.h'
  '/home/david/.local/include/c++/4.9.3/ext/atomicity.h'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/gthr.h'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/gthr-default.h'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/atomic_word.h'
  '/home/david/.local/include/c++/4.9.3/ext/string_conversions.h'
  '/home/david/.local/include/c++/4.9.3/cstdlib'
  '/home/david/.local/include/c++/4.9.3/cstdio'
  '/home/david/.local/include/c++/4.9.3/cerrno'
  '/home/david/.local/include/c++/4.9.3/bits/basic_string.tcc'
  '/home/david/.local/include/c++/4.9.3/algorithm'
  '/home/david/.local/include/c++/4.9.3/utility'
  '/home/david/.local/include/c++/4.9.3/bits/stl_relops.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_algo.h'
  '/home/david/.local/include/c++/4.9.3/bits/algorithmfwd.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_heap.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_tempbuf.h'
  '/home/david/.local/include/c++/4.9.3/random'
  '/home/david/.local/include/c++/4.9.3/cmath'
  '/home/david/.local/include/c++/4.9.3/limits'
  '/home/david/.local/include/c++/4.9.3/bits/random.h'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/opt_random.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/x86intrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/ia32intrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/mmintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/xmmintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/mm_malloc.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/emmintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/pmmintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/tmmintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/ammintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/smmintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/popcntintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/wmmintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/immintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/avxintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/avx2intrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/avx512fintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/avx512erintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/avx512pfintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/avx512cdintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/shaintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/lzcntintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/bmiintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/bmi2intrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/fmaintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/f16cintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/rtmintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/xtestintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/mm3dnow.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/prfchwintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/fma4intrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/xopintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/lwpintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/tbmintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/rdseedintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/fxsrintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/xsaveintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/xsaveoptintrin.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/adxintrin.h'
  '/home/david/.local/include/c++/4.9.3/bits/random.tcc'
  '/home/david/.local/include/c++/4.9.3/numeric'
  '/home/david/.local/include/c++/4.9.3/bits/stl_numeric.h'
  '/home/david/.local/include/c++/4.9.3/map'
  '/home/david/.local/include/c++/4.9.3/bits/stl_tree.h'
  '/home/david/.local/include/c++/4.9.3/ext/aligned_buffer.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_map.h'
  '/home/david/.local/include/c++/4.9.3/tuple'
  '/home/david/.local/include/c++/4.9.3/array'
  '/home/david/.local/include/c++/4.9.3/stdexcept'
  '/home/david/.local/include/c++/4.9.3/bits/uses_allocator.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_multimap.h'
  '/home/david/.local/include/c++/4.9.3/stack'
  '/home/david/.local/include/c++/4.9.3/deque'
  '/home/david/.local/include/c++/4.9.3/bits/stl_deque.h'
  '/home/david/.local/include/c++/4.9.3/bits/deque.tcc'
  '/home/david/.local/include/c++/4.9.3/bits/stl_stack.h'
  '/home/david/.local/include/c++/4.9.3/ostream'
  '/home/david/.local/include/c++/4.9.3/ios'
  '/home/david/.local/include/c++/4.9.3/bits/ios_base.h'
  '/home/david/.local/include/c++/4.9.3/bits/locale_classes.h'
  '/home/david/.local/include/c++/4.9.3/bits/locale_classes.tcc'
  '/home/david/.local/include/c++/4.9.3/streambuf'
  '/home/david/.local/include/c++/4.9.3/bits/streambuf.tcc'
  '/home/david/.local/include/c++/4.9.3/bits/basic_ios.h'
  '/home/david/.local/include/c++/4.9.3/bits/locale_facets.h'
  '/home/david/.local/include/c++/4.9.3/cwctype'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/ctype_base.h'
  '/home/david/.local/include/c++/4.9.3/bits/streambuf_iterator.h'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/ctype_inline.h'
  '/home/david/.local/include/c++/4.9.3/bits/locale_facets.tcc'
  '/home/david/.local/include/c++/4.9.3/bits/basic_ios.tcc'
  '/home/david/.local/include/c++/4.9.3/bits/ostream.tcc'
  '/home/david/.local/include/c++/4.9.3/set'
  '/home/david/.local/include/c++/4.9.3/bits/stl_set.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_multiset.h'
  '/home/david/.local/include/c++/4.9.3/tr1/unordered_set'
  '/home/david/.local/include/c++/4.9.3/tr1/type_traits'
  '/home/david/.local/include/c++/4.9.3/tr1/functional_hash.h'
  '/home/david/.local/include/c++/4.9.3/tr1/hashtable.h'
  '/home/david/.local/include/c++/4.9.3/tr1/hashtable_policy.h'
  '/home/david/.local/include/c++/4.9.3/tr1/unordered_set.h'
  '/home/david/.local/include/c++/4.9.3/sstream'
  '/home/david/.local/include/c++/4.9.3/istream'
  '/home/david/.local/include/c++/4.9.3/bits/istream.tcc'
  '/home/david/.local/include/c++/4.9.3/bits/sstream.tcc'.
Target //tensorflow/cc:tutorials_example_trainer failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 2.889s, Critical Path: 2.49s

With Bazel 0.1.5:

bazel build -c opt --config=cuda --verbose_failures //tensorflow/cc:tutorials_example_trainer
Warning: ignoring LD_PRELOAD in environment.
INFO: Found 1 target...
ERROR: /home/david/gits/tensorflow/google/protobuf/BUILD:64:1: undeclared inclusion(s) in rule '//google/protobuf:protobuf':
this rule is missing dependency declarations for the following files included by 'google/protobuf/src/google/protobuf/io/strtod.cc':
  '/home/david/.local/include/c++/4.9.3/cstdio'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/c++config.h'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/os_defines.h'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/cpu_defines.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/stddef.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/stdarg.h'
  '/home/david/.local/include/c++/4.9.3/cstring'
  '/home/david/.local/include/c++/4.9.3/limits'
  '/home/david/.local/include/c++/4.9.3/string'
  '/home/david/.local/include/c++/4.9.3/bits/stringfwd.h'
  '/home/david/.local/include/c++/4.9.3/bits/memoryfwd.h'
  '/home/david/.local/include/c++/4.9.3/bits/char_traits.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_algobase.h'
  '/home/david/.local/include/c++/4.9.3/bits/functexcept.h'
  '/home/david/.local/include/c++/4.9.3/bits/exception_defines.h'
  '/home/david/.local/include/c++/4.9.3/bits/cpp_type_traits.h'
  '/home/david/.local/include/c++/4.9.3/ext/type_traits.h'
  '/home/david/.local/include/c++/4.9.3/ext/numeric_traits.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_pair.h'
  '/home/david/.local/include/c++/4.9.3/bits/move.h'
  '/home/david/.local/include/c++/4.9.3/bits/concept_check.h'
  '/home/david/.local/include/c++/4.9.3/type_traits'
  '/home/david/.local/include/c++/4.9.3/bits/stl_iterator_base_types.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_iterator_base_funcs.h'
  '/home/david/.local/include/c++/4.9.3/debug/debug.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_iterator.h'
  '/home/david/.local/include/c++/4.9.3/bits/ptr_traits.h'
  '/home/david/.local/include/c++/4.9.3/bits/predefined_ops.h'
  '/home/david/.local/include/c++/4.9.3/bits/postypes.h'
  '/home/david/.local/include/c++/4.9.3/cwchar'
  '/home/david/.local/include/c++/4.9.3/cstdint'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/stdint.h'
  '/home/david/.local/include/c++/4.9.3/bits/allocator.h'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/c++allocator.h'
  '/home/david/.local/include/c++/4.9.3/ext/new_allocator.h'
  '/home/david/.local/include/c++/4.9.3/new'
  '/home/david/.local/include/c++/4.9.3/exception'
  '/home/david/.local/include/c++/4.9.3/bits/atomic_lockfree_defines.h'
  '/home/david/.local/include/c++/4.9.3/bits/exception_ptr.h'
  '/home/david/.local/include/c++/4.9.3/bits/nested_exception.h'
  '/home/david/.local/include/c++/4.9.3/bits/localefwd.h'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/c++locale.h'
  '/home/david/.local/include/c++/4.9.3/clocale'
  '/home/david/.local/include/c++/4.9.3/iosfwd'
  '/home/david/.local/include/c++/4.9.3/cctype'
  '/home/david/.local/include/c++/4.9.3/bits/ostream_insert.h'
  '/home/david/.local/include/c++/4.9.3/bits/cxxabi_forced.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_function.h'
  '/home/david/.local/include/c++/4.9.3/backward/binders.h'
  '/home/david/.local/include/c++/4.9.3/bits/range_access.h'
  '/home/david/.local/include/c++/4.9.3/bits/basic_string.h'
  '/home/david/.local/include/c++/4.9.3/ext/atomicity.h'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/gthr.h'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/gthr-default.h'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/atomic_word.h'
  '/home/david/.local/include/c++/4.9.3/initializer_list'
  '/home/david/.local/include/c++/4.9.3/ext/string_conversions.h'
  '/home/david/.local/include/c++/4.9.3/cstdlib'
  '/home/david/.local/include/c++/4.9.3/cerrno'
  '/home/david/.local/include/c++/4.9.3/bits/functional_hash.h'
  '/home/david/.local/include/c++/4.9.3/bits/hash_bytes.h'
  '/home/david/.local/include/c++/4.9.3/bits/basic_string.tcc'
  '/home/david/.local/include/c++/4.9.3/cstddef'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include-fixed/limits.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include-fixed/syslimits.h'
  '/home/david/.local/include/c++/4.9.3/utility'
  '/home/david/.local/include/c++/4.9.3/bits/stl_relops.h'.
Target //tensorflow/cc:tutorials_example_trainer failed to build
INFO: Elapsed time: 2.634s, Critical Path: 2.21s

$ bazel build -c opt --config=cuda --verbose_failures --spawn_strategy=standalone //tensorflow/cc:tutorials_example_trainer
Warning: ignoring LD_PRELOAD in environment.
INFO: Found 1 target...
ERROR: /home/david/gits/tensorflow/google/protobuf/BUILD:64:1: undeclared inclusion(s) in rule '//google/protobuf:protobuf':
this rule is missing dependency declarations for the following files included by 'google/protobuf/src/google/protobuf/stubs/substitute.cc':
  '/home/david/.local/include/c++/4.9.3/string'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/c++config.h'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/os_defines.h'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/cpu_defines.h'
  '/home/david/.local/include/c++/4.9.3/bits/stringfwd.h'
  '/home/david/.local/include/c++/4.9.3/bits/memoryfwd.h'
  '/home/david/.local/include/c++/4.9.3/bits/char_traits.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_algobase.h'
  '/home/david/.local/include/c++/4.9.3/bits/functexcept.h'
  '/home/david/.local/include/c++/4.9.3/bits/exception_defines.h'
  '/home/david/.local/include/c++/4.9.3/bits/cpp_type_traits.h'
  '/home/david/.local/include/c++/4.9.3/ext/type_traits.h'
  '/home/david/.local/include/c++/4.9.3/ext/numeric_traits.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_pair.h'
  '/home/david/.local/include/c++/4.9.3/bits/move.h'
  '/home/david/.local/include/c++/4.9.3/bits/concept_check.h'
  '/home/david/.local/include/c++/4.9.3/type_traits'
  '/home/david/.local/include/c++/4.9.3/bits/stl_iterator_base_types.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_iterator_base_funcs.h'
  '/home/david/.local/include/c++/4.9.3/debug/debug.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_iterator.h'
  '/home/david/.local/include/c++/4.9.3/bits/ptr_traits.h'
  '/home/david/.local/include/c++/4.9.3/bits/predefined_ops.h'
  '/home/david/.local/include/c++/4.9.3/bits/postypes.h'
  '/home/david/.local/include/c++/4.9.3/cwchar'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/stdarg.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/stddef.h'
  '/home/david/.local/include/c++/4.9.3/cstdint'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/stdint.h'
  '/home/david/.local/include/c++/4.9.3/bits/allocator.h'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/c++allocator.h'
  '/home/david/.local/include/c++/4.9.3/ext/new_allocator.h'
  '/home/david/.local/include/c++/4.9.3/new'
  '/home/david/.local/include/c++/4.9.3/exception'
  '/home/david/.local/include/c++/4.9.3/bits/atomic_lockfree_defines.h'
  '/home/david/.local/include/c++/4.9.3/bits/exception_ptr.h'
  '/home/david/.local/include/c++/4.9.3/bits/nested_exception.h'
  '/home/david/.local/include/c++/4.9.3/bits/localefwd.h'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/c++locale.h'
  '/home/david/.local/include/c++/4.9.3/clocale'
  '/home/david/.local/include/c++/4.9.3/iosfwd'
  '/home/david/.local/include/c++/4.9.3/cctype'
  '/home/david/.local/include/c++/4.9.3/bits/ostream_insert.h'
  '/home/david/.local/include/c++/4.9.3/bits/cxxabi_forced.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_function.h'
  '/home/david/.local/include/c++/4.9.3/backward/binders.h'
  '/home/david/.local/include/c++/4.9.3/bits/range_access.h'
  '/home/david/.local/include/c++/4.9.3/bits/basic_string.h'
  '/home/david/.local/include/c++/4.9.3/ext/atomicity.h'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/gthr.h'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/gthr-default.h'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/atomic_word.h'
  '/home/david/.local/include/c++/4.9.3/initializer_list'
  '/home/david/.local/include/c++/4.9.3/ext/string_conversions.h'
  '/home/david/.local/include/c++/4.9.3/cstdlib'
  '/home/david/.local/include/c++/4.9.3/cstdio'
  '/home/david/.local/include/c++/4.9.3/cerrno'
  '/home/david/.local/include/c++/4.9.3/bits/functional_hash.h'
  '/home/david/.local/include/c++/4.9.3/bits/hash_bytes.h'
  '/home/david/.local/include/c++/4.9.3/bits/basic_string.tcc'
  '/home/david/.local/include/c++/4.9.3/cstddef'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include-fixed/limits.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include-fixed/syslimits.h'
  '/home/david/.local/include/c++/4.9.3/utility'
  '/home/david/.local/include/c++/4.9.3/bits/stl_relops.h'
  '/home/david/.local/include/c++/4.9.3/vector'
  '/home/david/.local/include/c++/4.9.3/bits/stl_construct.h'
  '/home/david/.local/include/c++/4.9.3/ext/alloc_traits.h'
  '/home/david/.local/include/c++/4.9.3/bits/alloc_traits.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_uninitialized.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_vector.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_bvector.h'
  '/home/david/.local/include/c++/4.9.3/bits/vector.tcc'
  '/home/david/.local/include/c++/4.9.3/limits'
  '/home/david/.local/include/c++/4.9.3/unordered_map'
  '/home/david/.local/include/c++/4.9.3/tuple'
  '/home/david/.local/include/c++/4.9.3/array'
  '/home/david/.local/include/c++/4.9.3/stdexcept'
  '/home/david/.local/include/c++/4.9.3/bits/uses_allocator.h'
  '/home/david/.local/include/c++/4.9.3/ext/aligned_buffer.h'
  '/home/david/.local/include/c++/4.9.3/bits/hashtable.h'
  '/home/david/.local/include/c++/4.9.3/bits/hashtable_policy.h'
  '/home/david/.local/include/c++/4.9.3/bits/unordered_map.h'
  '/home/david/.local/include/c++/4.9.3/unordered_set'
  '/home/david/.local/include/c++/4.9.3/bits/unordered_set.h'.
Target //tensorflow/cc:tutorials_example_trainer failed to build
ERROR: /home/david/gits/tensorflow/tensorflow/cc/BUILD:28:1 undeclared inclusion(s) in rule '//google/protobuf:protobuf':
this rule is missing dependency declarations for the following files included by 'google/protobuf/src/google/protobuf/stubs/substitute.cc':
  '/home/david/.local/include/c++/4.9.3/string'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/c++config.h'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/os_defines.h'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/cpu_defines.h'
  '/home/david/.local/include/c++/4.9.3/bits/stringfwd.h'
  '/home/david/.local/include/c++/4.9.3/bits/memoryfwd.h'
  '/home/david/.local/include/c++/4.9.3/bits/char_traits.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_algobase.h'
  '/home/david/.local/include/c++/4.9.3/bits/functexcept.h'
  '/home/david/.local/include/c++/4.9.3/bits/exception_defines.h'
  '/home/david/.local/include/c++/4.9.3/bits/cpp_type_traits.h'
  '/home/david/.local/include/c++/4.9.3/ext/type_traits.h'
  '/home/david/.local/include/c++/4.9.3/ext/numeric_traits.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_pair.h'
  '/home/david/.local/include/c++/4.9.3/bits/move.h'
  '/home/david/.local/include/c++/4.9.3/bits/concept_check.h'
  '/home/david/.local/include/c++/4.9.3/type_traits'
  '/home/david/.local/include/c++/4.9.3/bits/stl_iterator_base_types.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_iterator_base_funcs.h'
  '/home/david/.local/include/c++/4.9.3/debug/debug.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_iterator.h'
  '/home/david/.local/include/c++/4.9.3/bits/ptr_traits.h'
  '/home/david/.local/include/c++/4.9.3/bits/predefined_ops.h'
  '/home/david/.local/include/c++/4.9.3/bits/postypes.h'
  '/home/david/.local/include/c++/4.9.3/cwchar'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/stdarg.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/stddef.h'
  '/home/david/.local/include/c++/4.9.3/cstdint'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/stdint.h'
  '/home/david/.local/include/c++/4.9.3/bits/allocator.h'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/c++allocator.h'
  '/home/david/.local/include/c++/4.9.3/ext/new_allocator.h'
  '/home/david/.local/include/c++/4.9.3/new'
  '/home/david/.local/include/c++/4.9.3/exception'
  '/home/david/.local/include/c++/4.9.3/bits/atomic_lockfree_defines.h'
  '/home/david/.local/include/c++/4.9.3/bits/exception_ptr.h'
  '/home/david/.local/include/c++/4.9.3/bits/nested_exception.h'
  '/home/david/.local/include/c++/4.9.3/bits/localefwd.h'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/c++locale.h'
  '/home/david/.local/include/c++/4.9.3/clocale'
  '/home/david/.local/include/c++/4.9.3/iosfwd'
  '/home/david/.local/include/c++/4.9.3/cctype'
  '/home/david/.local/include/c++/4.9.3/bits/ostream_insert.h'
  '/home/david/.local/include/c++/4.9.3/bits/cxxabi_forced.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_function.h'
  '/home/david/.local/include/c++/4.9.3/backward/binders.h'
  '/home/david/.local/include/c++/4.9.3/bits/range_access.h'
  '/home/david/.local/include/c++/4.9.3/bits/basic_string.h'
  '/home/david/.local/include/c++/4.9.3/ext/atomicity.h'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/gthr.h'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/gthr-default.h'
  '/home/david/.local/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/atomic_word.h'
  '/home/david/.local/include/c++/4.9.3/initializer_list'
  '/home/david/.local/include/c++/4.9.3/ext/string_conversions.h'
  '/home/david/.local/include/c++/4.9.3/cstdlib'
  '/home/david/.local/include/c++/4.9.3/cstdio'
  '/home/david/.local/include/c++/4.9.3/cerrno'
  '/home/david/.local/include/c++/4.9.3/bits/functional_hash.h'
  '/home/david/.local/include/c++/4.9.3/bits/hash_bytes.h'
  '/home/david/.local/include/c++/4.9.3/bits/basic_string.tcc'
  '/home/david/.local/include/c++/4.9.3/cstddef'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include-fixed/limits.h'
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include-fixed/syslimits.h'
  '/home/david/.local/include/c++/4.9.3/utility'
  '/home/david/.local/include/c++/4.9.3/bits/stl_relops.h'
  '/home/david/.local/include/c++/4.9.3/vector'
  '/home/david/.local/include/c++/4.9.3/bits/stl_construct.h'
  '/home/david/.local/include/c++/4.9.3/ext/alloc_traits.h'
  '/home/david/.local/include/c++/4.9.3/bits/alloc_traits.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_uninitialized.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_vector.h'
  '/home/david/.local/include/c++/4.9.3/bits/stl_bvector.h'
  '/home/david/.local/include/c++/4.9.3/bits/vector.tcc'
  '/home/david/.local/include/c++/4.9.3/limits'
  '/home/david/.local/include/c++/4.9.3/unordered_map'
  '/home/david/.local/include/c++/4.9.3/tuple'
  '/home/david/.local/include/c++/4.9.3/array'
  '/home/david/.local/include/c++/4.9.3/stdexcept'
  '/home/david/.local/include/c++/4.9.3/bits/uses_allocator.h'
  '/home/david/.local/include/c++/4.9.3/ext/aligned_buffer.h'
  '/home/david/.local/include/c++/4.9.3/bits/hashtable.h'
  '/home/david/.local/include/c++/4.9.3/bits/hashtable_policy.h'
  '/home/david/.local/include/c++/4.9.3/bits/unordered_map.h'
  '/home/david/.local/include/c++/4.9.3/unordered_set'
  '/home/david/.local/include/c++/4.9.3/bits/unordered_set.h'.
INFO: Elapsed time: 0.999s, Critical Path: 0.80s

Bazel 2.2b fails when tensorflow tries to parse the version:

 bazel build -c opt --config=cuda --verbose_failures --spawn_strategy=standalone //tensorflow/cc:tutorials_example_trainer
Warning: ignoring LD_PRELOAD in environment.
Sending SIGTERM to previous Bazel server (pid=24216)... done.
......
ERROR: /home/david/gits/tensorflow/WORKSPACE:21:1: Traceback (most recent call last):
    File "/home/david/gits/tensorflow/WORKSPACE", line 21
        check_version("0.1.4")
    File "/home/david/gits/tensorflow/tensorflow/tensorflow.bzl", line 22, in check_version
        _parse_bazel_version(native.bazel_version)
    File "/home/david/gits/tensorflow/tensorflow/tensorflow.bzl", line 15, in _parse_bazel_version
        int(number)
invalid literal for int(): "2b".
ERROR: Error evaluating WORKSPACE file.
ERROR: no such package 'external': Package 'external' contains errors.
INFO: Elapsed time: 0.610s

Correcting that mistake I get a bulld error again:

 bazel build -c opt --config=cuda --spawn_strategy=standalone --verbose_failures //tensorflow/tools/pip_package:build_pip_package
Warning: ignoring LD_PRELOAD in environment.
ERROR: no such package 'external': Package 'external' contains errors.
INFO: Elapsed time: 0.084s

How can I get it to work? I am interested in building Tensorflow with vector instructions for my laptop and linking against the latest cudnn for my workstation.

@yadbatya
Copy link

following the build from source instructions I also received the next error when trying to build:

ERROR: /home/yadid/tensorflow/tensorflow/WORKSPACE:21:1: Traceback (most recent call last): File "/home/yadid/tensorflow/tensorflow/WORKSPACE", line 21 check_version("0.1.4") File "/home/yadid/tensorflow/tensorflow/tensorflow/tensorflow.bzl", line 22, in check_version _parse_bazel_version(native.bazel_version) File "/home/yadid/tensorflow/tensorflow/tensorflow/tensorflow.bzl", line 15, in _parse_bazel_version int(number) invalid literal for int(): "2b".

@yvirin
Copy link

yvirin commented Apr 26, 2016

Happens to me to when I compile from master for bazel and tensorflow.
I was running on aws ubuntu machines.

I am guessing some inconsistency between the latest bazel and latest tensorflow?

Update: correcting tensorflow/tensorflow/tensorflow.bzl line 15, to parse correctly for the version number, fixes the build for me.

@Dapid: I think you are experiencing some misalignment between bazel and tensorflow on top of this bug.

More update: @Dapid: you are right, there is still something wrong with the version when you fix it... I think the only hack that will work is to set the version manually, to the one that will work :) It does compile when I put "2" for every number, in line 15: int(number) => 2

err, it was compiling I think, but now it breaks with: ERROR: error loading package 'external': Package 'external' contains errors.

not sure what is going on.

Update: ok, I think I know what fixes it. You need to clone the repository from scratch (force) before you attempt to compile with the line 15 hack, like this: number = "".join([c for c in number if c.isdigit()])
It woks from me if I do that.

@akors
Copy link

akors commented Apr 26, 2016

Hi. This is my story of how I got TensorFlow to compile on my Fedora 23 machine. Maybe it will be useful for you:

How to compile TensorFlow from source on Fedora 23 with a custom compiler.

Compiling TensorFlow with GPU support is possible, but a bit tricky on Fedora 23 and up.
The compilation requires a specific GCC version which is not available from Fedora repoisitories and specifying the compiler is more complicated than it should be.

Compiling GCC

For CUDA version 7.5, you need to obtain the source code for GCC version 4.9. You can obtain it from here.

Next, you need to install GCC compile-time dependencies:

sudo dnf install mpfr-devel gmp-devel libmpc-devel isl-devel

Now you have to configure the GCC build. For details, check out the GCC configuration page. I suggest installing into a custom prefix, such as /opt/gcc-4.9. I suggest enabling only C and C++ and skipping the rest of the GCC languages to save time and disk space. The options --with-as, --with-ld and --with-nm are required, because otherwise TensorFlow build will fail, complaining that those binaries cannot be found.

/configure --prefix=/opt/gcc-4.9 --disable-nls --enable-languages=c,c++ --with-ld=/bin/ld --with-nm=/bin/nm --with-as=/usr/bin/as

When this step is done, you can compile GCC with the following command:

make -j4

This assumes you want to use 4 processing cores. You can use more or less, or omit the -j option entirely.

Finally, run as root:

make install

Compiling bazel

Obtain the bazel source code. You need the current master branch, NOT any of the recent releases.

git clone https://github.com/bazelbuild/bazel.git

To compile bazel, you need to specify

export CC=/opt/gcc-4.9/bin/gcc
./compile

This will produce the bazel binary in path/to/bazel/output/bazel

Compiling TensorFlow

Obtain the TensorFlow source code

git clone --recurse-submodules https://github.com/tensorflow/tensorflow

Modify the file third_party/gpus/crosstool/CROSSTOOL: Find the toolchain entry where the toolchain_identifieris set to "local_linux". Only change entries here, the rest is irrelevant.

Replace the following lines:

cxx_builtin_include_directory: "/usr/lib/gcc/"
cxx_builtin_include_directory: "/usr/local/include"

with the following lines:
cxx_builtin_include_directory: "/opt/gcc-4.9/lib/gcc/"
cxx_builtin_include_directory: "/opt/gcc-4.9/local/include"
cxx_builtin_include_directory: "/opt/gcc-4.9/include"

Next, run the ./configure and set your options. Specify your self-compiled GCC (for me /opt/gcc-4.9/bin/gcc) as the compiler to be used by nvcc.

To compile the source, use the following command line:

path/to/bazel/output/bazel build -c opt --config=cuda --genrule_strategy=standalone --local_resources 4096,4.0,1.0 -j 4 //tensorflow/cc:tutorials_example_trainer

Explanations:

  • build: what bazel should do
  • -c opt: Don't know, says so in the docu
  • --config=cuda: Compile with CUDA support. Don't ask me why you have to specify that again, even though you did so in ./configure.
  • --genrule_strategy=standalone: This compiles in "standalone mode". Don't ask me what that is, but it's required so that generated output files can find the libcudart.so that they are linked to (see issue Failed to build from source due to missing libcudart.so.7.5: #2053).
  • --local_resources 4096,4.0,1.0 -j 4: Use at most 4096M of memory, 4.0 CPU's, 1.0 of I/O and 4 threads. This is required so that the compilation doesn't crash due to out-of-memory (I have 8GB of physical memory and 4GB of swap). The 4096 is still a lie, because the compilation still used more - but at least it didn't crash.
  • //tensorflow/cc:tutorials_example_trainer: What to build.

I sincerely hope that this guide will be obsolete very soon, and you can just get cracking without all these workarounds. But for now, this will probably be useful.

@poxvoculi poxvoculi added the stat:contribution welcome Status - Contributions welcome label Apr 26, 2016
@poxvoculi
Copy link
Contributor

It would be great to get these instructions into the documentation somewhere. @martinwicke : is there a place for build help specific to linux distributions?

@akors
Copy link

akors commented Apr 26, 2016

It would be great to get these instructions into the documentation somewhere. @martinwicke : is there a place for build help specific to linux distributions?

Honestly, I think a better approach would be actually fixing the bugs in the TensorFlow build system and bazel itself, for example

  • Don't use an infinite amount of threads and memory, even when not limited explicitly
  • Either pass --genrule-strategy=standalone by default or make libcudart.so available in sandbox mode (I believe this is being worked on).
  • Find nm, as, ld by default, from PATH
  • Respect the CC variable instead of having to hack the CROSSTOOL file
  • Fix the version parsing to allow for non-numerical characters in the bazel version string

This guide was born out of my desparation, but new users probably shouldn't jump through all the hoops.

@yvirin
Copy link

yvirin commented Apr 26, 2016

@akors: I see this issue happening not on fedora but ubuntu as well. Just a plain development setup from sources cloning master bazel and tensorflow

@vrv
Copy link

vrv commented Apr 26, 2016

#2094 is fixing the bazel parse version issue.

As for the other four issues, would it be better to file these bugs at buildbazel/bazel ? @damienmg is there anything else we should be doing on the TF side to make this better?

@damienmg
Copy link
Contributor

For the four first issues:

  • A known issue, and not an easy answer. I know that we have a inflight fix for resource detection on OS X, I will gather more info tomorrow.
  • --genrule_strategy=standalone should be in tensorflow's bazel.rc until all the hermeticity issue in TF build are resolved. I think Bazel's one with custom c++ toolchain should be solved prior (see custom crosstool doesn't work with sandboxing bazelbuild/bazel#1019).
  • (last 2 issues): TF's cuda crosstool should do autoconfiguration just like we do for the main c++

Explanations extended:
Explanations:

build: what bazel should do

  • -c opt: build using optimization C++ flags
  • --config=cuda: select cuda configuration, which is different from detecting the cuda environment which could be done inside bazel now.
  • --genrule_strategy=standalone: deactivate namespace sandbox because some tools are outside of mounted paths, this can also be fixed remote repositories (custom crosstool doesn't work with sandboxing bazelbuild/bazel#1019 for bazel).
  • --local_resources 4096,4.0,1.0: unecessary, -j 4 is sufficient
  • -j 4: 4 simultaneous jobs maximum. We should improve resources detection and estimation to better compute than number.
  • //tensorflow/cc:tutorials_example_trainer: What to build.

@Dapid
Copy link
Author

Dapid commented Apr 28, 2016

@akors I followed your instructions, but unfortunately I keep getting the same failures. No idea what the difference between your system and mine may be.

I'll try again, maybe some bugs have been squash in Bazel in the meantime.

@fat-lobyte
Copy link

@Dapid did you use Bazel HEAD and Tensorflow HEAD? And you are still getting "missing dependency declaration" errors?

@Dapid
Copy link
Author

Dapid commented Apr 28, 2016

@fat-lobyte Yes. I just retried with latest master for both TF and Bazel:

ERROR: /home/david/.cache/bazel/_bazel_david/47d00ffdd2fc0515138a34f138cebd63/external/re2/BUILD:9:1: undeclared inclusion(s) in rule '@re2//:re2':
this rule is missing dependency declarations for the following files included by 'external/re2/re2/bitstate.cc':
  '/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/stddef.h'
[etc]

@akors
Copy link

akors commented Apr 28, 2016

@Dapid weird. If you have modified your third_party/gpus/crosstool/CROSSTOOL file to point to your private install, then I am out of ideas. What happens if you add another line

cxx_builtin_include_directory: "/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include"

?

@Dapid
Copy link
Author

Dapid commented Apr 28, 2016

@akors well spotted.

This is how the relevant section of CROSTOOL looks like, and the build finishes:

 56   # TODO(bazel-team): In theory, the path here ought to exactly match the path
 57   # used by gcc. That works because bazel currently doesn't track files at
 58   # absolute locations and has no remote execution, yet. However, this will need
 59   # to be fixed, maybe with auto-detection?
 60   cxx_builtin_include_directory: "/home/david/.local/gcc-4.9/lib/gcc"
 61   cxx_builtin_include_directory: "/home/david/.local/gcc-4.9/include"
 62   cxx_builtin_include_directory: "/home/david/.local/gcc-4.9/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include"
 63   cxx_builtin_include_directory: "/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include"
 64   cxx_builtin_include_directory: "/home/david/.local/include/"
 65   cxx_builtin_include_directory: "/home/david/.local/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include-fixed/"
 66   cxx_builtin_include_directory: "/usr/include"
 67   tool_path { name: "gcov" path: "/usr/bin/gcov" }

@suiyuan2009
Copy link
Contributor

stuck me a lot of time until I reach this post, may be we should rewrite CROSTOOL to make gcc path not static

@MichaelChuai
Copy link

I've got a solution and it performed very well.
Here is it:

  • Using package installer to install tf automatically
sudo pip install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.8.0-cp27-none-linux_x86_64.whl
  • Fix any dependency problem occurred during the process above
  • Remove the installed tensorflow, and any bazel cache:
sudo pip uninstall tensorflow
rm -rf ~/.cache/bazel
  • Implement the usual installation as the guide says and it's done.

The idea is simple: using package installation to detect dependency problem, fix the problem and follow the usual guide.

@girving
Copy link
Contributor

girving commented Jun 8, 2016

@vrv, @akors: Should we split the conclusions of this up into separate bugs, appropriately distributed between TensorFlow and Bazel? At least one of the issues is fixed by #2504, and it's hard from this thread to know what's left.

@girving girving added the stat:awaiting response Status - Awaiting response from author label Jun 8, 2016
@vrv
Copy link

vrv commented Jun 8, 2016

Yes, it would be good to file separate bugs for the individual issues, since catch all bugs like these tend to get filled with lots of hard to parse info.

@akors
Copy link

akors commented Jun 11, 2016

@girving OK, so I redid all the testing with the most recent HEADs of TensorFlow and bazel. I will try to summarize comprehensively:

Custom GCC, Bazel 0.2.3 (Release), TensorFlow head (b3621c9): compilation fails with the undeclared inclusion messages above.

Custom GCC, Bazel head (e7e2301) compiled with CC and CXX set to the custom GCC, TensorFlow head (b3621c9): compilation fails with the undeclared inclusion messages above.

Custom GCC, Bazel head (e7e2301) compiled with CC and CXX set to the custom GCC, TensorFlow head (b3621c9) with CROSSTOOL cxx_builtin_include_directory modified to the custom GCC include paths: compilation succeeds.

Custom GCC, Bazel 0.2.3 (Release), TensorFlow head (b3621c9) with CROSSTOOL cxx_builtin_include_directory modified to the custom GCC include paths: compilation succeeds.

That's what's up. I believe the first two methods should also work, but you can divide this issue up as you wish.


ps.: Might I quote from the CROSSTOOL file, right above the cxx_builtin_include_directory definitions?

# TODO(bazel-team): In theory, the path here ought to exactly match the path
# used by gcc. That works because bazel currently doesn't track files at
# absolute locations and has no remote execution, yet. However, this will need
# to be fixed, maybe with auto-detection?

I would agree to that. This will need to be fixed ;)

@girving
Copy link
Contributor

girving commented Jun 13, 2016

@martinwicke @damienmg Can you advise on how to split this bug across Bazel and Github?

@aselle aselle added the triaged label Jun 13, 2016
@damienmg
Copy link
Contributor

@girving: the TODO is copied from the legacy CROSSTOOL of Bazel. In beetween we did C++ autoconfiguration.

If I understand correctly there is only one issue: cxx_builtin_include_directory? In which case it should be covered by the work that @davidzchen has started on auto-detecting nvcc config.

@girving girving removed stat:awaiting response Status - Awaiting response from author stat:contribution welcome Status - Contributions welcome labels Jun 14, 2016
@davidzchen
Copy link
Contributor

This is the tracking bug for cuda autoconf: #2873

@suiyuan2009
Copy link
Contributor

suiyuan2009 commented Jul 18, 2016

follow @akors guidance, I finally succeed on centos 6.5, with cuda7.5 and cudnn v5.0.5. I set compute capability to 3.0 though my gpu is actually 2.0 (Quadro 4000).
note python config by conda may has some problem with bazel build.

cuda path

in ~/.bash_profile

export CUDA_HOME=/usr/local/cuda-7.5 
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$CUDA_HOME/lib64" 
export PATH="$CUDA_HOME/bin:$PATH" 

build gcc

follow this https://gcc.gnu.org/wiki/InstallingGCC, I use gcc4.9.2
$PWD/../gcc-4.9.2/configure --prefix=$HOME/gcc-4.9.2 --disable-nls --enable-languages=c,c++ --with-ld=/usr/bin/ld --with-nm=/usr/bin/nm --with-as=/usr/bin/as, a little different.

build tensorflow

if you get error like genrule missing dependency of a list of head files, just add these head files paths(like /path/to/include) to the third_party/gpus/crosstool/CROSSTOOL, even cuda/include can be added.

about gpu

I always failed when I set compute capability to 2.0 when configure tensorflow build, error is like ....some symbol not defined....... at the end ,.....not all outputs were created....

@alextp
Copy link
Contributor

alextp commented Aug 15, 2016

@davidzchen is this still being worked on? Or is the procedure by @suiyuan2009 a general fix?

@davidzchen
Copy link
Contributor

@alextp Apologies for the wait. I just returned from vacation. We are ironing out the remaining CI build failure for the PR for CUDA autodetection (#3269). I am hoping to have the PR submitted soon, but feel free to use @suiyuan2009's fix as a workaround in the meantime.

@davidzchen
Copy link
Contributor

@alextp The cuda autoconf change has been merged. Can you try building with the latest tensorflow HEAD and see if you still run into any issues?

@akors
Copy link

akors commented Aug 25, 2016

@davidzchen
I still get the undeclared inclusions with the latest HEAD. Glossing over your PR, it seems that only the CUDA headers are made configurable, but there are no changes to the "cxx_builtin_include_directory" of the host compiler. Namely, I get errors for the directories:

/opt/gcc-5.3/include/c++/5.3.0
/opt/gcc-5.3/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/include
...

Where /opt/gcc-5.3/ is my manually compiled GCC, because the different CUDA version need very specific GCC versions to work (e.g. CUDA 8 -> GCC 5.3) which are often not available on the distributions.

This means, I still have to hack the CROSSTOOL.tpl file to get TF to compile. I believe it's very important to include those directories (depending on the nvcc host compiler configuration choice) in the configuration as well.

@davidzchen
Copy link
Contributor

davidzchen commented Aug 25, 2016

@akors That's a good point. It should not be a difficult fix, and we should be able to reuse _get_cxx_inc_directories() from Bazel's cc_configure rule to get a list of the compiler's include dirs. I'll put together a fix.

@davidzchen
Copy link
Contributor

@akors - I have opened #4058 for the host compiler include directories issue.

@drpngx
Copy link
Contributor

drpngx commented Jan 24, 2017

Clsoing due to inactivity.

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