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
Failed to run Android demo targeting API < 20 #419
Comments
Hi Hamid, The libpthread.so target is just a kludge to get around the fact that the A cleaner workaround for you is to edit google/protobuf/BUILD and change LINK_OPTS = ["-lpthread"] Ideally the protobuf linkopts would be dependent on build target, or the On Sat, Dec 5, 2015 at 5:19 PM, Hamid Bazargani notifications@github.com
|
Hi Andrew, |
The libpthread.so in the TF repo is not actually a copy of libpthead.so If you:
with no other changes do you still get the same errors? Please attach a log On Sat, Dec 5, 2015 at 8:13 PM, Hamid Bazargani notifications@github.com
|
First I should mention that there is no issue when trying the app on a Android 5.0 device. The problem happens when using KitKat device. 1- changed google/protobuf/BUILD
2- changed tensorflow/examples/android/BUILD
3- My workspace looks:
4- I issued (I also tried without android_arm)bazel build --verbose_failures //tensorflow/examples/android:tensorflow_demo --config=android_arm After running the apk file my logcat logs:
|
Thanks Hamid. I'm guessing this might be a discrepancy between what the I've just tried setting my WORKSPACE ndk api_level to 20 and found that the On Sat, Dec 5, 2015 at 9:33 PM, Hamid Bazargani notifications@github.com
|
Thank you Andrew. Thanks again for your guidelines. |
Great, glad that worked! I have a patch for the original libpthread.so issue coming, so that it will On Sun, Dec 6, 2015 at 10:03 AM, Vincent Vanhoucke <notifications@github.com
|
Thanks Andrew, |
Is this procedure even works for API 19? |
It should, if you follow these steps:
Note that "--config=android_arm" is not necessary or beneficial, and was only included by mistake in earlier comments. |
@CalmWaves |
Hi, thanks for the instructions on how to build the library for API < 20. The steps outlined by @andrewharp don't seem to work with the latest TF code though. I've modified the Android demo to remove dependencies on APIs lower than 21, modified AndroidManifest.xml, and configured the WORKSPACE file, all that to make the build target API 19. However, the build fails with the following error: ERROR: /home/bruno/tensorflow/tensorflow/contrib/android/BUILD:36:1: C++ compilation of rule '//tensorflow/contrib/android:android_tensorflow_inference_jni' failed: linux-sandbox failed: error executing command /home/bruno/.cache/bazel/_bazel_bruno/fc8ca368ddd99b1148acfb9b362d6174/execroot/tensorflow/_bin/linux-sandbox ... (remaining 65 argument(s) skipped). Any advice? Thanks. |
@barantes If you add |
The include tree for the newer NDK APIs must be including errno.h implicitly. Adding it explicitly fixes the build error on older APIs. Fix incoming. |
Hi Andrew. Thanks for the quick response. The library was successfully built after adding the #include <errno.h> to limiting_file_input_stream.h. |
Adding this include fixes the compilation for APIs < 20, as described in tensorflow#419
Add packages to docker for hip-clang . Failures in `rocm` and `rocm-v2` paths aren't relevant to this PR and had been fixed in other PRs.
I tried to build the demo application for Android for KitKat device (API 20). I was able to modify the app not to use new
hardware.camera2
and it worked on Android Lollipops successfully. However there is an issue targeting older Android device.It turned out that the app crashes right after trying to load the native shared library,
tensorflow_demo
in my case.And that's due to dependency of
libpthread.so
tolibmediandk.so
that is not supported for API older than 21. See the following logcat message:Error:
..dlopen failed: could not load library "libmediandk.so" needed by "libtensorflow_demo.so"; caused by library "libmediandk.so" not found
I also desperately tried to replace the cloned
libpthread.so
with the same file from my/usr/arm-linux-gnueabi/lib/
directory with no success.I am using:
1- android-ndk-r10c
2- api_level=20
3- build_tools_version = "20.0.0"
Did I missed anything in that process?
The text was updated successfully, but these errors were encountered: