mxnet icon indicating copy to clipboard operation
mxnet copied to clipboard

Creating Logs on Andorid

Open gaush123 opened this issue 10 years ago • 4 comments

Hi, Is there a way to create logs on Android, when I use predictor in WhatsThis applcaition

gaush123 avatar Aug 03 '16 06:08 gaush123

Do you mean in the cpp part?

In the cpp file you can use this

 #include <android/log.h>
...
__android_log_print(ANDROID_LOG_INFO, "TAG_FOR_THE_APP", "LOG_MESSAGE");

When you compile the shared library you have to link android log with

-llog

SlipknotTN avatar Aug 03 '16 16:08 SlipknotTN

Hi @SlipknotTN thank your for providing your feedback. But when i use amalgalmation part of mxnet with all stuff you mentioned earlier lead to an issue of below stuff not defined

ANDROID_LOG_INFO

As i am not clear about where to place -llog in amalgalmation folder.

amanaman118 avatar Aug 03 '16 18:08 amanaman118

You have to add -llog in the Makefile of the amalgamation.

For example, instead of

CFLAGS=-std=c++11 -Wno-unknown-pragmas -Wall ifneq ($(MIN), 1) CFLAGS += -I${OPENBLAS_ROOT} -I${OPENBLAS_ROOT}/include LDFLAGS+= -L${OPENBLAS_ROOT} -L${OPENBLAS_ROOT}/lib -lopenblas endif

use this

CFLAGS=-std=c++11 -Wno-unknown-pragmas -Wall LDFLAGS = -llog ifneq ($(MIN), 1) CFLAGS += -I${OPENBLAS_ROOT} -I${OPENBLAS_ROOT}/include LDFLAGS+= -L${OPENBLAS_ROOT} -L${OPENBLAS_ROOT}/lib -lopenblas endif

SlipknotTN avatar Aug 03 '16 21:08 SlipknotTN

Hi @SlipknotTN thnx for your help. We are now able to have android logging working.

amanaman118 avatar Aug 04 '16 05:08 amanaman118