STT-tensorflow/tensorflow/java/config/version_script.lds
Asim Shankar e8f2aad0c0 Java/C API: Make them Android friendly.
Make the C library and JNI shared library targets Android friendly by linking
with the smaller android runtime when building with --config=android

Relatedly, strip all but the JNI symbols from libtensorflow_jni.so
(regardless of build configuration) to trim its size down (by roughly
50%).

Link in the Java libraries in the Android examples. The longer term intention
is to encourage use of the TensorFlow Java API in Android and do away with the
TensorFlowInferenceInterface class (and related JNI code) currently used in
Android. This will provide a single, more thoroughly tested API for use in all
Java settings - Android or not. An update to the Android example to switch
to this will come in a follow up change.

NOTES:
- For expediency of this change, the C API call: TF_LoadSessionFromSavedModel
  is not available when building for Android. I will look into fixing that
  separately.

- Linking in the JNI library required by the TensorFlow Java API results in
  a small increase (0.7%) in binary size of libtensorflow_demo.so

An unrelatedly, rename libtensorflow-jni.so to libtensorflow_jni.so
to be consistent with other shared libraries created in tensorflow.
Change: 144320074
2017-01-12 07:07:52 -08:00

12 lines
137 B
Plaintext

VERS_1.0 {
# Export JNI symbols.
global:
Java_*;
JNI_OnLoad;
JNI_OnUnload;
# Hide everything else.
local:
*;
};