Skip to content
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

android ndk api_level=9 #2

Open
InsightDev opened this issue Apr 26, 2016 · 4 comments
Open

android ndk api_level=9 #2

InsightDev opened this issue Apr 26, 2016 · 4 comments

Comments

@InsightDev
Copy link

InsightDev commented Apr 26, 2016

android_sdk_repository(
name = "androidsdk",
api_level = 23,
build_tools_version = "23.0.1",
path = "/home/gzzhang/android-sdk",
)

android_ndk_repository(
name="androidndk",
path="/opt/android-ndk",
api_level=9, << ====================
)

can you build the "tensorflow android libs" with android ndk api_level=9.

if you build them with android ndk api_level=21, the libs can't be used below android 5.0

because some functions can't been found.

SO, can you down the android ndk api_level to 9.


I have do something, but when invoke:
tensorflow::NewSession(options)

and, it print message:
Not found: Could not find session factory for DIRECT_SESSION

@InsightDev InsightDev changed the title android ndk api_level android ndk api_level=9 Apr 26, 2016
@miyosuda
Copy link
Owner

miyosuda commented May 9, 2016

Sorry I didn't notice your post and found it just now.

I tried to build with "api_level=9" & android-ndk-r10e,
This error occurred.

INFO: From Compiling tensorflow/examples/android/jni/jni_utils.cc:
In file included from tensorflow/examples/android/jni/jni_utils.cc:33:0:
./tensorflow/examples/android/jni/limiting_file_input_stream.h: In member function 'virtual int tensorflow::android::LimitingFileInputStream::Read(void*, int)':
./tensorflow/examples/android/jni/limiting_file_input_stream.h:39:28: error: 'errno' was not declared in this scope
     } while (result < 0 && errno == EINTR);
                            ^
./tensorflow/examples/android/jni/limiting_file_input_stream.h:39:37: error: 'EINTR' was not declared in this scope
     } while (result < 0 && errno == EINTR);
                                     ^

Did you modify tensorflow source to pass building with api_level9?

@InsightDev
Copy link
Author

InsightDev commented May 9, 2016

@miyosuda

The past few days, I have done something.

Because I want the libandroid_tensorflow_lib.a, so the android_demo is not importance for me.

I just comment out these:
while (result < 0 && errno == EINTR)

then with android-ndk-r10e and api_level=9, the build is success.

After got the libandroid_tensorflow_lib.a, now I develop app under Windows with Android.mk and the libs.


Under Windows, Android-ndk-r10e is also needed, otherwise, it can't find session factory for DIRECT_SESSION.

“Not found: Could not find session factory for DIRECT_SESSION”

@miyosuda
Copy link
Owner

miyosuda commented May 9, 2016

@tiny-app
Ah I see, the error code is from android sample, and not from library itself. OK.

I'll try.

@ChimneyCake
Copy link

Hi,
could you help me make this work on api=15?
Thanks in advance :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants