Kitt-AI / snowboy

Future versions with model training module will be maintained through a forked version here: https://github.com/seasalt-ai/snowboy
Other
3.03k stars 994 forks source link

A64 support? #88

Closed tomster closed 7 years ago

tomster commented 7 years ago

I tried creating the swig bindings for python on a Pine64 board (running "Debian Base (3.10.102 BSP 2)" found here https://www.pine64.pro/getting-started-linux/) but I get the following error when running make inside swig/Python:

g++ -I/usr/include/python3.4m -I/usr/include/python3.4m  -Wno-unused-result -g -fstack-protector-strong -Wformat -Werror=format-security  -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I../../ -O3 -fPIC -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++0x -c snowboy-detect-swig.cc
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
g++ -I../../ -O3 -fPIC -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++0x  -shared snowboy-detect-swig.o \
../..//lib/ubuntu64/libsnowboy-detect.a -L/usr/lib/python3.4/config-3.4m-aarch64-linux-gnu -L/usr/lib -lpython3.4m -lpthread -ldl  -lutil -lm  -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions -lm -ldl -lf77blas -lcblas -llapack_atlas -latlas -o _snowboydetect.so
/usr/bin/ld: ../..//lib/ubuntu64/libsnowboy-detect.a(snowboy-detect.o): Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../..//lib/ubuntu64/libsnowboy-detect.a(snowboy-detect.o): Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../..//lib/ubuntu64/libsnowboy-detect.a(snowboy-detect.o): Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../..//lib/ubuntu64/libsnowboy-detect.a(snowboy-detect.o): Relocations in generic ELF (EM: 62)
../..//lib/ubuntu64/libsnowboy-detect.a: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
Makefile:50: recipe for target '_snowboydetect.so' failed
make: *** [_snowboydetect.so] Error 1

From my (limited) understanding there is simply no matching library in lib that match what swig expects on this platform (i tried hardcoding the android/armv7a folder in the Makefile but that also gave the same error as above).

Would it be possible for you to add the pine64 as a valid target?

chenguoguo commented 7 years ago

We don't have a pine64 by hand so we can't compile/test snowboy on pine64. The better chance is probably to use the rpi library instead of the ubuntu64 or android library, since rpi also uses ARM processors. Let me know if it works.

tomster commented 7 years ago

hi @chenguoguo i tried the rpi library, but it did not work. Is it possible to compile the library oneself? i would be glad to test and add the support to the project or is that part closed-source?

chenguoguo commented 7 years ago

@tomster we didn't not release the source code, and we do not have a plan to support Pine64 board at this point. So I'm afraid we are out of luck here :-(

tomster commented 7 years ago

@chenguoguo ok, thanks for clearing this up!

Pine-A64 commented 7 years ago

@chenguoguo Hi I am TL Lim, PINE64 founder. If you still interest to receive PINE A64 board to compile/test snowboy, I am happy to provide one.

chenguoguo commented 7 years ago

@Pine-A64 hey good to see you here! Sure if we can compile/test Snowboy on Pine-A64, we can definitely provide a library for it!

I re-opened the issue.

Pine-A64 commented 7 years ago

@Chen, Please provide your shipping address and I will ship out one Pine A64 1GB board to you. My email address is tllim@pine64.org

On 1/17/2017 9:15 AM, Guoguo Chen wrote:

@Pine-A64 https://github.com/Pine-A64 hey good to see you here! Sure if we can compile/test Snowboy on Pine-A64, we can definitely provide a library for it!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Kitt-AI/snowboy/issues/88#issuecomment-273234400, or mute the thread https://github.com/notifications/unsubscribe-auth/APv1LkPBzc3MDdanHhTZp5pJdauzEpStks5rTPc4gaJpZM4K1fZ4.

r00kieone commented 7 years ago

Good to read the issue has been re-opened, looking forward to use this on the pine64! :)

chenguoguo commented 7 years ago

I haven't got a chance to work on the Pine-A64 yet. Will keep this updated.

xuchen commented 7 years ago

@tomster @r00kieone what's your OS? should we first compile for Debian or Ubuntu or Arch?

r00kieone commented 7 years ago

I am using Debian Jessie for the pine64.

Distributor ID: Debian Description: Debian GNU/Linux 8.7 (jessie) Release: 8.7 Codename: jessie

3.10.104-2-pine64-longsleep #113 SMP PREEMPT Thu Dec 15 21:46:07 CET 2016 aarch64 GNU/Linux

xuchen commented 7 years ago

@r00kieone where did you download the image? I tried the following one from https://www.pine64.pro/downloads/#Debian-Linux :

image

But the download link does't work.

xuchen commented 7 years ago

never mind, got it from here: http://cdn.pine64.uk/Debian/

@Pine-A64 your website download link is invalid?

xuchen commented 7 years ago

@tomster @r00kieone model just updated at:

https://github.com/Kitt-AI/snowboy/tree/pine64/lib/pine64

Could you please give it a try to make sure it works? After that I'll merge the PR.

r00kieone commented 7 years ago

Thank you for responding very quickly about this! I tried it as part of building Alexa echo for pine64 (using Rasberry Pi instructions), but I didn't get it working yet, but the main cause is that I am not very experienced building programs from sources | - ) Perhaps I should try building this separately, but I need to have another look at it.

xuchen commented 7 years ago

@r00kieone yes please build this separately, it should be much much easier.

r00kieone commented 7 years ago

I've some dependency problems, e.g.: python3-pyaudio : Depends: python3 (< 3.5) but 3.5.1-4 is to be installed

perhaps there's another pine64-user who can try this? I am not that experienced, sorry | -)

xuchen commented 7 years ago

@r00kieone if you are using Python 2.7 then you don't have to install python3-pyaudio. Give it a try?

sepulker commented 7 years ago

I've build it for nodejs running Armbian_5.26_S9xxx_Debian_jessie_3.14.29_server_20170302.img on Amlogic S905X TVBOX. Nodejs Examples work! The Build did not work out of the Box - I had to modify binding.gpy to match processor arch:

        ['OS=="linux" and target_arch=="arm64"', {
            'link_settings': {
                'ldflags': [
                    '-Wl,--no-as-needed',
                ],
                'libraries': [
                    '<(module_root_dir)/lib/pine64/libsnowboy-detect.a',
                ]
            }
        }]

Thank You for releasing ARM64 binary ! I have tried the python example but it fails because of Soundcard setup - I've tried simple sound examples and can't get them to work In the next days I will try to build for other languages and enchance the nodejs Examples :)

chenguoguo commented 7 years ago

@sepulker You are right, we didn't update that corner case! Would you like to submit a pull request for it?

sepulker commented 7 years ago

Im just a git newbie I haven't read the Docs yet - I will be back ...

chenguoguo commented 7 years ago

I have added A64 support, so closing this.

r00kieone commented 7 years ago

Back from a long holiday |-)

I followed the steps in the main README.md starting from ### Ubuntu/Raspberry Pi/Pine64" (Debian 8.5@pine64) and after installing some more and changing here and there I got to step: go get github.com/Kitt-AI/snowboy/swig/Go

but there I am getting the following:

snowboy/examples/Go$ go get github.com/Kitt-AI/snowboy/swig/Go

github.com/Kitt-AI/snowboy/swig/Go

/tmp/go-build039528358/github.com/Kitt-AI/snowboy/swig/Go/_obj/_tmp_go-build039528358_github.com_Kitt-AI_snowboy_swig_Goobj_snowboydetect_wrap.cxx.o: In function _wrap_new_SnowboyDetect_snowboydetect_ca0dcd58650a7653': /tmp/go-build/github.com/Kitt-AI/snowboy/swig/Go/_obj/snowboydetect_wrap.cxx:299: undefined reference tosnowboy::SnowboyDetect::SnowboyDetect(std::string const&, std::string const&)' /tmp/go-build039528358/github.com/Kitt-AI/snowboy/swig/Go/_obj/_tmp_go-build039528358_github.com_Kitt-AI_snowboy_swig_Go__obj_snowboydetect_wrap.cxx.o: In function _wrap_SnowboyDetect_Reset_snowboydetect_ca0dcd58650a7653': /tmp/go-build/github.com/Kitt-AI/snowboy/swig/Go/_obj/snowboydetect_wrap.cxx:312: undefined reference tosnowboy::SnowboyDetect::Reset()' /tmp/go-build039528358/github.com/Kitt-AI/snowboy/swig/Go/_obj/_tmp_go-build039528358_github.com_Kitt-AI_snowboy_swig_Goobj_snowboydetect_wrap.cxx.o: In function _wrap_SnowboyDetect_RunDetection__SWIG_0_snowboydetect_ca0dcd58650a7653': /tmp/go-build/github.com/Kitt-AI/snowboy/swig/Go/_obj/snowboydetect_wrap.cxx:332: undefined reference tosnowboy::SnowboyDetect::RunDetection(std::string const&, bool)' /tmp/go-build039528358/github.com/Kitt-AI/snowboy/swig/Go/_obj/_tmp_go-build039528358_github.com_Kitt-AI_snowboy_swig_Goobj_snowboydetect_wrap.cxx.o: In function _wrap_SnowboyDetect_RunDetection__SWIG_1_snowboydetect_ca0dcd58650a7653': /tmp/go-build/github.com/Kitt-AI/snowboy/swig/Go/_obj/snowboydetect_wrap.cxx:350: undefined reference tosnowboy::SnowboyDetect::RunDetection(std::string const&, bool)' /tmp/go-build039528358/github.com/Kitt-AI/snowboy/swig/Go/_obj/_tmp_go-build039528358_github.com_Kitt-AI_snowboy_swig_Goobj_snowboydetect_wrap.cxx.o: In function _wrap_SnowboyDetect_RunDetection__SWIG_2_snowboydetect_ca0dcd58650a7653': /tmp/go-build/github.com/Kitt-AI/snowboy/swig/Go/_obj/snowboydetect_wrap.cxx:369: undefined reference tosnowboy::SnowboyDetect::RunDetection(float const, int, bool)' /tmp/go-build039528358/github.com/Kitt-AI/snowboy/swig/Go/_obj/_tmp_go-build039528358_github.com_Kitt-AI_snowboy_swig_Go__obj_snowboydetect_wrap.cxx.o: In function _wrap_SnowboyDetect_RunDetection__SWIG_3_snowboydetect_ca0dcd58650a7653': /tmp/go-build/github.com/Kitt-AI/snowboy/swig/Go/_obj/snowboydetect_wrap.cxx:386: undefined reference tosnowboy::SnowboyDetect::RunDetection(float const, int, bool)' /tmp/go-build039528358/github.com/Kitt-AI/snowboy/swig/Go/_obj/_tmp_go-build039528358_github.com_Kitt-AI_snowboy_swig_Goobj_snowboydetect_wrap.cxx.o: In function _wrap_SnowboyDetect_RunDetection__SWIG_4_snowboydetect_ca0dcd58650a7653': /tmp/go-build/github.com/Kitt-AI/snowboy/swig/Go/_obj/snowboydetect_wrap.cxx:405: undefined reference tosnowboy::SnowboyDetect::RunDetection(short const*, int, bool)' /tmp/go-build039528358/github.com/Kitt-AI/snowboy/swig/Go/_obj/_tmp_go-build039528358_github.com_Kitt-AI_snowboy_swig_Goobj_snowboydetect_wrap.cxx.o: In function _wrap_SnowboyDetect_RunDetection__SWIG_5_snowboydetect_ca0dcd58650a7653': /tmp/go-build/github.com/Kitt-AI/snowboy/swig/Go/_obj/snowboydetect_wrap.cxx:422: undefined reference tosnowboy::SnowboyDetect::RunDetection(short const, int, bool)' /tmp/go-build039528358/github.com/Kitt-AI/snowboy/swig/Go/_obj/_tmp_go-build039528358_github.com_Kitt-AI_snowboy_swig_Go__obj_snowboydetect_wrap.cxx.o: In function _wrap_SnowboyDetect_RunDetection__SWIG_6_snowboydetect_ca0dcd58650a7653': /tmp/go-build/github.com/Kitt-AI/snowboy/swig/Go/_obj/snowboydetect_wrap.cxx:441: undefined reference tosnowboy::SnowboyDetect::RunDetection(int const, int, bool)' /tmp/go-build039528358/github.com/Kitt-AI/snowboy/swig/Go/_obj/_tmp_go-build039528358_github.com_Kitt-AI_snowboy_swig_Goobj_snowboydetect_wrap.cxx.o: In function _wrap_SnowboyDetect_RunDetection__SWIG_7_snowboydetect_ca0dcd58650a7653': /tmp/go-build/github.com/Kitt-AI/snowboy/swig/Go/_obj/snowboydetect_wrap.cxx:458: undefined reference tosnowboy::SnowboyDetect::RunDetection(int const*, int, bool)' /tmp/go-build039528358/github.com/Kitt-AI/snowboy/swig/Go/_obj/_tmp_go-build039528358_github.com_Kitt-AI_snowboy_swig_Goobj_snowboydetect_wrap.cxx.o: In function _wrap_SnowboyDetect_SetSensitivity_snowboydetect_ca0dcd58650a7653': /tmp/go-build/github.com/Kitt-AI/snowboy/swig/Go/_obj/snowboydetect_wrap.cxx:474: undefined reference tosnowboy::SnowboyDetect::SetSensitivity(std::string const&)' /tmp/go-build039528358/github.com/Kitt-AI/snowboy/swig/Go/_obj/_tmp_go-build039528358_github.com_Kitt-AI_snowboy_swig_Goobj_snowboydetect_wrap.cxx.o: In function _wrap_SnowboyDetect_GetSensitivity_snowboydetect_ca0dcd58650a7653': /tmp/go-build/github.com/Kitt-AI/snowboy/swig/Go/_obj/snowboydetect_wrap.cxx:486: undefined reference tosnowboy::SnowboyDetect::GetSensitivity() const' /tmp/go-build039528358/github.com/Kitt-AI/snowboy/swig/Go/_obj/_tmp_go-build039528358_github.com_Kitt-AI_snowboy_swig_Go__obj_snowboydetect_wrap.cxx.o: In function _wrap_SnowboyDetect_SetAudioGain_snowboydetect_ca0dcd58650a7653': /tmp/go-build/github.com/Kitt-AI/snowboy/swig/Go/_obj/snowboydetect_wrap.cxx:499: undefined reference tosnowboy::SnowboyDetect::SetAudioGain(float)' /tmp/go-build039528358/github.com/Kitt-AI/snowboy/swig/Go/_obj/_tmp_go-build039528358_github.com_Kitt-AI_snowboy_swig_Goobj_snowboydetect_wrap.cxx.o: In function _wrap_SnowboyDetect_UpdateModel_snowboydetect_ca0dcd58650a7653': /tmp/go-build/github.com/Kitt-AI/snowboy/swig/Go/_obj/snowboydetect_wrap.cxx:509: undefined reference tosnowboy::SnowboyDetect::UpdateModel() const' /tmp/go-build039528358/github.com/Kitt-AI/snowboy/swig/Go/_obj/_tmp_go-build039528358_github.com_Kitt-AI_snowboy_swig_Goobj_snowboydetect_wrap.cxx.o: In function _wrap_SnowboyDetect_NumHotwords_snowboydetect_ca0dcd58650a7653': /tmp/go-build/github.com/Kitt-AI/snowboy/swig/Go/_obj/snowboydetect_wrap.cxx:521: undefined reference tosnowboy::SnowboyDetect::NumHotwords() const' /tmp/go-build039528358/github.com/Kitt-AI/snowboy/swig/Go/_obj/_tmp_go-build039528358_github.com_Kitt-AI_snowboy_swig_Go__obj_snowboydetect_wrap.cxx.o: In function _wrap_SnowboyDetect_ApplyFrontend_snowboydetect_ca0dcd58650a7653': /tmp/go-build/github.com/Kitt-AI/snowboy/swig/Go/_obj/snowboydetect_wrap.cxx:534: undefined reference tosnowboy::SnowboyDetect::ApplyFrontend(bool)' /tmp/go-build039528358/github.com/Kitt-AI/snowboy/swig/Go/_obj/_tmp_go-build039528358_github.com_Kitt-AI_snowboy_swig_Goobj_snowboydetect_wrap.cxx.o: In function _wrap_SnowboyDetect_SampleRate_snowboydetect_ca0dcd58650a7653': /tmp/go-build/github.com/Kitt-AI/snowboy/swig/Go/_obj/snowboydetect_wrap.cxx:546: undefined reference tosnowboy::SnowboyDetect::SampleRate() const' /tmp/go-build039528358/github.com/Kitt-AI/snowboy/swig/Go/_obj/_tmp_go-build039528358_github.com_Kitt-AI_snowboy_swig_Goobj_snowboydetect_wrap.cxx.o: In function _wrap_SnowboyDetect_NumChannels_snowboydetect_ca0dcd58650a7653': /tmp/go-build/github.com/Kitt-AI/snowboy/swig/Go/_obj/snowboydetect_wrap.cxx:559: undefined reference tosnowboy::SnowboyDetect::NumChannels() const' /tmp/go-build039528358/github.com/Kitt-AI/snowboy/swig/Go/_obj/_tmp_go-build039528358_github.com_Kitt-AI_snowboy_swig_Go__obj_snowboydetect_wrap.cxx.o: In function _wrap_SnowboyDetect_BitsPerSample_snowboydetect_ca0dcd58650a7653': /tmp/go-build/github.com/Kitt-AI/snowboy/swig/Go/_obj/snowboydetect_wrap.cxx:572: undefined reference tosnowboy::SnowboyDetect::BitsPerSample() const' /tmp/go-build039528358/github.com/Kitt-AI/snowboy/swig/Go/_obj/_tmp_go-build039528358_github.com_Kitt-AI_snowboy_swig_Goobj_snowboydetect_wrap.cxx.o: In function _wrap_delete_SnowboyDetect_snowboydetect_ca0dcd58650a7653': /tmp/go-build/github.com/Kitt-AI/snowboy/swig/Go/_obj/snowboydetect_wrap.cxx:583: undefined reference tosnowboy::SnowboyDetect::~SnowboyDetect()' collect2: error: ld returned 1 exit status

Could you please perhaps help me out?-)

chenguoguo commented 7 years ago

See here: https://github.com/Kitt-AI/snowboy/blob/master/swig/Go/snowboy.go

It is not linking the Pine64 library I believe. If you could fix it and make it more general, feel free to send a PR!