tensorflow: Bazel build does not pick up correct compiler include paths

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): RHEL 7.5
  • TensorFlow installed from (source or binary): source
  • TensorFlow version: 2.0.0
  • Python version: 3.7.5
  • Installed using virtualenv? pip? conda?: no
  • Bazel version (if compiling from source): 0.26.1
  • GCC/Compiler version (if compiling from source): GCC 8.2.0
  • CUDA/cuDNN version: 10.1

Describe the problem

Bazel does not pick up the correct include paths of GCC and returns errors such as:

ERROR: /tmp/easybuild-tmp/eb-5QGVSJ/tmpMZolLj-bazel-build/external/fft2d/BUILD.bazel:27:1: undeclared inclusion(s) in rule '@fft2d//:fft2d':
this rule is missing dependency declarations for the following files included by 'external/fft2d/fft2d/fftsg2d.c':
  '/sw/installed/GCCcore/8.2.0/lib/gcc/x86_64-pc-linux-gnu/8.2.0/include/stddef.h'
  '/sw/installed/GCCcore/8.2.0/lib/gcc/x86_64-pc-linux-gnu/8.2.0/include/stdarg.h'
Target //tensorflow/tools/pip_package:build_pip_package failed to build

Provide the exact sequence of commands / steps that you executed before running into the problem

  • TF_NEED_CUDA=1 ./configure
  • export TF_MKL_DOWNLOAD=1 && bazel --output_base=/tmp/easybuild-tmp/eb-5QGVSJ/tmpMZolLj-bazel-build --install_base=/tmp/easybuild-tmp/eb-5QGVSJ/tmpMZolLj-bazel-build/inst_base --output_user_root=/tmp/easybuild-tmp/eb-5QGVSJ/tmp514aJM-user_root build --compilation_mode=opt --config=opt --subcommands --verbose_failures --jobs=24 --action_env=PYTHONPATH --action_env=EBPYTHONPREFIXES --distinct_host_configuration=false --config=mkl //tensorflow/tools/pip_package:build_pip_package

Note that the installation is triggered via EasyBuild

Any other info / logs command.log

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 1
  • Comments: 23 (14 by maintainers)

Commits related to this issue

Most upvoted comments

I was able to dance around this issue using the following patch: https://github.com/easybuilders/easybuild-easyconfigs/blob/develop/easybuild/easyconfigs/t/TensorFlow/TensorFlow-1.14.0_fix-cuda-build.patch .

If you’re using EasyBuild: note that a sufficiently recent CUDA version is required by TensorFlow 2.0.0 (the one included in fosscuda/2019a is too old)