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.04k stars 995 forks source link

Ubuntu-64 (16.04 LTS) Build fail - Alexa-sdk - undefined reference to snowboy #369

Open Lewin225 opened 6 years ago

Lewin225 commented 6 years ago

I'm hitting an error at this stage (Linking CXX executable) when compiling. Building on Ubuntu64 (16.04LTS) running inside a VM with Oracle virtual Box. Following the alexa-sdk guide, Below is my build command.

cd /home/alexa/sdk-folder/sdk-build && cmake /home/alexa/sdk-folder/sdk-source/avs-device-sdk -DKITTAI_KEY_WORD_DETECTOR=ON -DKITTAI_KEY_WORD_DETECTOR_LIB_PATH=/home/alexa/sdk-folder/third-party/snowboy/lib/ubuntu64 -DKITTAI_KEY_WORD_DETECTOR_INCLUDE_DIR=/home/alexa/sdk-folder/third-party/snowboy/include -DGSTREAMER_MEDIA_PLAYER=ON -DPORTAUDIO=ON -DPORTAUDIO_LIB_PATH=/home/alexa/sdk-folder/third-party/portaudio/lib/.libs/libportaudio.a -DPORTAUDIO_INCLUDE_DIR=/home/alexa/sdk-folder/third-party/portaudio/include -DGSTREAMER_MEDIA_PLAYER=ON && make

Produces

[ 64%] Linking CXX executable KittAiKeyWordDetectorTest
/usr/bin/cmake: /usr/local/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
../src/libKITTAI.so: undefined reference to `snowboy::SnowboyDetect::SampleRate() const'
../src/libKITTAI.so: undefined reference to `snowboy::SnowboyDetect::ApplyFrontend(bool)'
../src/libKITTAI.so: undefined reference to `snowboy::SnowboyDetect::SnowboyDetect(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
../src/libKITTAI.so: undefined reference to `snowboy::SnowboyDetect::RunDetection(short const*, int, bool)'
../src/libKITTAI.so: undefined reference to `snowboy::SnowboyDetect::SetSensitivity(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
../src/libKITTAI.so: undefined reference to `snowboy::SnowboyDetect::~SnowboyDetect()'
../src/libKITTAI.so: undefined reference to `snowboy::SnowboyDetect::SetAudioGain(float)'
../src/libKITTAI.so: undefined reference to `snowboy::SnowboyDetect::BitsPerSample() const'
../src/libKITTAI.so: undefined reference to `snowboy::SnowboyDetect::NumChannels() const'
collect2: error: ld returned 1 exit status
KWD/KittAi/test/CMakeFiles/KittAiKeyWordDetectorTest.dir/build.make:101: recipe for target 'KWD/KittAi/test/KittAiKeyWordDetectorTest' failed
make[2]: *** [KWD/KittAi/test/KittAiKeyWordDetectorTest] Error 1
CMakeFiles/Makefile2:4630: recipe for target 'KWD/KittAi/test/CMakeFiles/KittAiKeyWordDetectorTest.dir/all' failed
make[1]: *** [KWD/KittAi/test/CMakeFiles/KittAiKeyWordDetectorTest.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
alexa@alexa-VirtualBox:~/sdk-folder/sdk-build$
chenguoguo commented 6 years ago

What is your g++ version? Could you also try the Snowboy demo alone on your machine and see if that works (https://github.com/Kitt-AI/snowboy)?

Lewin225 commented 6 years ago
alexa@alexa-VirtualBox:~$ g++ --version
g++ (Ubuntu 5.4.0-6ubuntu1~16.04.6) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Thanks for looking into this

chenguoguo commented 6 years ago

Try this: https://github.com/Kitt-AI/snowboy/issues/269

Lewin225 commented 6 years ago

After switching to gcc / g++ 4.8.5 and with or without adding -D_GLIBCXX_USE_CXX11_ABI=0 -pg to CXXFLAG, I'm still encountering the same error

sbobhate commented 5 years ago

I think you're missing the library name libsnowboy-detect.a

Try: -DKITTAI_KEY_WORD_DETECTOR_LIB_PATH=/home/alexa/sdk-folder/third-party/snowboy/lib/ubuntu64/libsnowboy-detect.a