spack: Can't install tensorflow because of bazel

I am trying to install tensor flow for cpu via spack. It falls over at bazel:

==> Installing bazel
==> Searching for binary cache of bazel
==> No binary for bazel found: installing from source
==> Using cached archive: /lus/theta-fs0/projects/datascience/cadams/spack/cooley/spack/var/spack/cache/_source-cache/archive/c0/c0e94f8f818759f3f67af798c38683520c540f469cb41aea8f5e5a0e43f11600.zip
==> Staging archive: /tmp/cadams/spack-stage/spack-stage-bazel-0.26.1-4mmpkcidyja4i6smxm2ahqifvh322xsz/bazel-0.26.1-dist.zip
==> Created stage in /tmp/cadams/spack-stage/spack-stage-bazel-0.26.1-4mmpkcidyja4i6smxm2ahqifvh322xsz
==> Applied patch /lus/theta-fs0/projects/datascience/cadams/spack/cooley/spack/var/spack/repos/builtin/packages/bazel/bazelruleclassprovider-0.25.patch
==> Applied patch /lus/theta-fs0/projects/datascience/cadams/spack/cooley/spack/var/spack/repos/builtin/packages/bazel/unix_cc_configure-0.15.patch
==> Applied patch /lus/theta-fs0/projects/datascience/cadams/spack/cooley/spack/var/spack/repos/builtin/packages/bazel/compile-0.21.patch
==> Building bazel [Package]
==> Executing phase: 'bootstrap'
==> Executing phase: 'install'
==> Error: FileNotFoundError: [Errno 2] No such file or directory: 'output/bazel'

/lus/theta-fs0/projects/datascience/cadams/spack/cooley/spack/var/spack/repos/builtin/packages/bazel/package.py:136, in install:
        134    def install(self, spec, prefix):
        135        mkdir(prefix.bin)
  >>    136        install('output/bazel', prefix.bin)

See build log for details:
  /tmp/cadams/spack-stage/spack-stage-bazel-0.26.1-4mmpkcidyja4i6smxm2ahqifvh322xsz/spack-build-out.txt

Here was the command I have used:

$ spack install py-tensorflow@1.15 cuda_arch=35 ^cuda@10.1 %gcc@6.3.0

And, I am on this system:

$ uname -a
Linux cc047 3.10.0-957.27.2.el7.x86_64 #1 SMP Tue Jul 9 16:53:14 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
$ lsb_release
LSB Version:	:core-4.1-amd64:core-4.1-noarch

Any ideas for how to fix this? I have the latest version of spack as of this morning. Is there an older version of bazel that will work?

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 15 (15 by maintainers)

Commits related to this issue

Most upvoted comments

Maybe we should add a note/warning that says the bazel and py-tensorflow packages are only tested on macOS/Ubuntu and may not build on RHEL and friends? I also had trouble building it on Amazon Linux (https://github.com/bazelbuild/bazel/issues/10418) which is RHEL-based.

Ugh, this is most definitely another instance of https://github.com/bazelbuild/bazel/issues/10437 as I see the error is caused by the same include error for nasm where bazel tries to include the wrong header. I’m still waiting for a reply on that issue but I hope if enough people try to tell the bazel team that this is a serious impediment to building tf on rhel/centos/sles/cle (just any os apart from ubuntu) they would fix it.

For what it’s worth, java moved the build past bazel as @s-sajid-ali suggested via a private email: spack install py-tensorflow@1.15 cuda_arch=35 ^cuda@10.1 ^jdk@1.8.0_231-b11 %gcc@6.3.0

The java specification had to be exactly the one listed or it still failed.

I’ll follow up if there are other crashes in tensorflow.