The problem of trying to build pocketsphinx androiddemo using NDK

I am trying to compile the pocketsphinx androiddemo, which provides a sample implementation of CMU pocketsphinx speech recognizer on Android. I received an error similar to discussing here for the first time. After executing NDK build, I received this error:

Gdbserver      : [arm-linux-androideabi-4.4.3] libs/armeabi/gdbserver
Gdbsetup       : libs/armeabi/gdb.setup
Compile thumb  : pocketsphinx_jni <= pocketsphinx_wrap.c
/home/nick/workspace/android/PocketSphinxDemo/jni/pocketsphinx_wrap.c:761:28: error: sphinxbase/err.h: No such file or directory
/home/nick/workspace/android/PocketSphinxDemo/jni/pocketsphinx_wrap.c: In function 'Java_edu_cmu_pocketsphinx_pocketsphinxJNI_Decoder_1processRaw_1_1SWIG_10':
/home/nick/workspace/android/PocketSphinxDemo/jni/pocketsphinx_wrap.c:1441: warning: assignment discards qualifiers from pointer target type
make: *** [/home/nick/workspace/android/PocketSphinxDemo/obj/local/armeabI/Objs-debug/pocketsphinx_jni/pocketsphinx_wrap.o] Error 1

I tried to rebuild sphinxbase and pocketsphinx libraries and use NDK build - B, but it didn't work. Then I modified the JNI / pocketsphinx. I swig file to change the include of err. H:

#include <pocketsphinx.h>
//#include <sphinxbase/err.h>
#include <err.h>

Have people who have tried to compile pocket Sphinx Android demo encountered this problem? My editor seems to allow me to compile further, but now I get assembly related errors:

Gdbserver      : [arm-linux-androideabi-4.4.3] libs/armeabi/gdbserver
Gdbsetup       : libs/armeabi/gdb.setup
Compile thumb  : pocketsphinx_jni <= pocketsphinx_wrap.c
/home/nick/workspace/android/PocketSphinxDemo/jni/pocketsphinx_wrap.c: In function 'Java_edu_cmu_pocketsphinx_pocketsphinxJNI_Decoder_1processRaw_1_1SWIG_10':
/home/nick/workspace/android/PocketSphinxDemo/jni/pocketsphinx_wrap.c:1442: warning: assignment discards qualifiers from pointer target type
Compile thumb  : sphinxfeat <= cmn.c
/tmp/cceyE035.s: Assembler messages:
/tmp/cceyE035.s:655: Error: selected processor does not support `smull r1,r2,r0,r4'
/tmp/cceyE035.s:657: Error: unshifted register required -- `orr r1,r1,r2,lsl#20'
/tmp/cceyE035.s:932: Error: selected processor does not support `smull r1,r2,r0,r4'
/tmp/cceyE035.s:934: Error: unshifted register required -- `orr r1,r1,r2,lsl#20'
make: *** [/home/nick/workspace/android/PocketSphinxDemo/obj/local/armeabI/Objs-debug/sphinxfeat/cmn.o] Error 1

Again, who knows how to solve this problem? I haven't seen any other developers complain about this problem, so I hesitate to go further. Thank you for your help

resolvent:

Obviously, I still need to mark some source code for arm compilation. I modified the following parts of android.mk to set CMN. C and LDA. C to compile with arm

include $(CLEAR_VARS)
LOCAL_C_INCLUDES := $(Sphinx_PATH)/sphinxbase/include/android $(Sphinx_PATH)/sphinxbase/include
LOCAL_CFLAGS += -DHAVE_CONfig_H
LOCAL_CFLAGS += -DANDROID_NDK

LOCAL_PATH := $(Sphinx_PATH)/sphinxbase/src/libsphinxbase/feat
LOCAL_MODULE := sphinxfeat

LOCAL_SRC_FILES := \
    agc.c \
    cmn.c.arm \
    cmn_prior.c.arm \
    feat.c \
    lda.c.arm

I still wonder if anyone else has to do this to make their code compile successfully

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>