Search code examples
androidtensorflowbazel

Getting libpthread.so was not created error on Android bazel build


I'm trying to get the tensorflow Android example running but I keep running into this issue:

ERROR: /home/administrator/TensorFlow_Git/tensorflow/examples/android/BUILD:41:1: output 'tensorflow/examples/android/libpthread.so' was not created.

ERROR: /home/administrator/TensorFlow_Git/tensorflow/examples/android/BUILD:41:1: not all outputs were created.

Version Details: OS: Ubuntu 14.04LTS; bazel version 0.2.1; tensorflow version: tensorflow-0.7.1-cp34-none-linux_x86_64.whl

Excerpt of WORKSPACE file:

android_sdk_repository(
    name = "androidsdk",
    api_level = 23,
    build_tools_version = "23.0.3", #also wget'ed 23.0.1, same result
    path = "/home/administrator/Android/Sdk",)

android_ndk_repository(
    name="androidndk",
    path="/home/administrator/Downloads/android-ndk-r10e", #also tried android-ndk-r11c but README not found error
    api_level=21)

I can successfully compile and deploy android apps via android studio.

If I comment out the part in the BUILD file and copy the libpthread.so file from the internet to the target location the error changes to the following:

ERROR: /home/administrator/TensorFlow/tensorflow/tensorflow/examples/android/BUILD:12:1: output 'tensorflow/examples/android/libtensorflow_demo.so' was not created.

ERROR: /home/administrator/TensorFlow/tensorflow/tensorflow/examples/android/BUILD:12:1: not all outputs were created.

Not sure if this is a bug but I guess not.


Solution

  • I have no idea what and where something went wrong but there were broken link files pointing to a non existing directory with libtensorflow_demo.so. The solution for me was to start all over with a fresh VM with enough diskspace (20GB is clearly not enough), enough memory (default is pretty low) and all cores assigned (default is 1) with the current Ubuntu 16.04 LTS and Android Studio. Also tensorflow v8.0 which came out meanwhile seems to be a bit less troublesome.

    I had an issue with the VM where I had 0byte left and had blackscreen before login. I fixed that but it was during an installation and maybe it was the installation of bazel that messed up something. I can't tell.