Search code examples
centosbazel

Error F_SETLK when building bazel on CentOS 6.5


I am working on building and installing tensorflow on my institution's cluster computer, which is running CentOS 6.5.

Obviously, the first step is building and installing bazel. The build works just fine, but when I try to run the bazel binary, I get the following error:

Error: unexpected result from F_SETLK: Function not implemented

gcc version is 4.7.2

java version is jdk1.8.0_65

edit: I have also tried compiling gcc 4.9.4 and building with this version, and I have tried building both the latest dist of bazel, and the 0.3.1 from the git repo. All variants get the same error.


Solution

  • This happens if the filesystem where Bazel tries to install itself (unpack its embedded tools) doesn't support locking.

    Workaround (until the relevant issue is resolved) is to specify a path on a local, writable (and file-lockable) filesystem for --output_user_root, for example:

    bazel --output_user_root=/usr/local/$USER/bazelout build <targets>