Skip to content

Commit

Permalink
[ BUILD ] Add 16K shared lib package option for Android
Browse files Browse the repository at this point in the history
Android encourage to use 16KB package for the shared library. This PR
add the 16KB package option and also recommand to use ndk which is
higher or equal version of r27.

Resolves:

**Self evaluation:**
1. Build test:	 [X]Passed [ ]Failed [ ]Skipped
2. Run test:	 [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: jijoong.moon <[email protected]>
  • Loading branch information
jijoongmoon committed Aug 29, 2024
1 parent 1377f1c commit 9ae7d2d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions jni/Android.mk.in
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ LOCAL_MODULE := ml-api-inference

LOCAL_SRC_FILES := @MESON_ML_API_COMMON_ROOT@/lib/arm64-v8a/libnnstreamer-native.so
LOCAL_EXPORT_C_INCLUDES := @MESON_ML_API_COMMON_ROOT@/include
LOCAL_LDFLAGS += "-Wl,-z,max-page-size=16384"

include $(PREBUILT_SHARED_LIBRARY)

Expand Down Expand Up @@ -65,6 +66,7 @@ LOCAL_CXXFLAGS += -std=c++17 -frtti -fexceptions @ML_API_COMMON@ @MESON_CXX
LOCAL_MODULE_TAGS := optional

LOCAL_LDLIBS := -llog -landroid -fopenmp -static-openmp
LOCAL_LDFLAGS += "-Wl,-z,max-page-size=16384"

LOCAL_STATIC_LIBRARIES += iniparser openblas

Expand All @@ -87,6 +89,7 @@ LOCAL_CXXFLAGS += -std=c++17 -frtti -fexceptions @ML_API_COMMON@ -DVERSION_
LOCAL_MODULE_TAGS := optional

LOCAL_LDLIBS := -llog -landroid -fopenmp -static-openmp
LOCAL_LDFLAGS += "-Wl,-z,max-page-size=16384"

LOCAL_SHARED_LIBRARIES += nntrainer

Expand All @@ -105,6 +108,7 @@ LOCAL_CXXFLAGS += -std=c++17 -frtti -fexceptions @ML_API_COMMON@ @MESON_CXX
LOCAL_MODULE_TAGS := optional

LOCAL_LDLIBS := -llog -landroid -fopenmp -static-openmp
LOCAL_LDFLAGS += "-Wl,-z,max-page-size=16384"

LOCAL_SHARED_LIBRARIES += ccapi-nntrainer nntrainer ml-api-inference

Expand Down

0 comments on commit 9ae7d2d

Please sign in to comment.