Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KITT wake word in alexa-client-sdk #215

Open
boyce-xx opened this issue Jun 7, 2017 · 8 comments
Open

KITT wake word in alexa-client-sdk #215

boyce-xx opened this issue Jun 7, 2017 · 8 comments

Comments

@boyce-xx
Copy link

boyce-xx commented Jun 7, 2017

Hi, I'm developing an app which want to integrate Alexa's AVS function into it. KITT wake-word is only supported in the current SDK(v0.4), so I'm trying to compile AVS sdk with KITT wake-word detector, and I want to cross-compile it for my target platform, my platform is:

/ # uname -a
Linux apq8009 3.18.44 #1 SMP PREEMPT Fri Jun 2 09:11:05 CST 2017 armv7l GNU/Linux

My cross-compiler is:

king@wks:~/Project/DB20_Linux/AVS/Alexa_Make$ /home/king/opt/gcc-linaro-6.3.1-2017.02-x86_64_arm-linux-gnueabi/bin/arm-linux-gnueabi-g++ --version
arm-linux-gnueabi-g++ (Linaro GCC 6.3-2017.02) 6.3.1 20170109
Copyright (C) 2016 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.

but I got an issue when making the sdk like that:

king@wks:~/Project/DB20_Linux/AVS/Alexa_Make$ cmake -DCURL_LIBRARY=/home/king/Project/DB20_Linux/AVS/Alexa_Make/AvsEnv/lib/libcurl.so -DCURL_INCLUDE_DIR=/home/king/Project/DB20_Linux/AVS/Alexa_Make/AvsEnv/include ../alexa-client-sdk-master_v0.4/ -DKITTAI_KEY_WORD_DETECTOR=ON -DKITTAI_KEY_WORD_DETECTOR_LIB_PATH=/home/king/Project/DB20_Linux/AVS/snowboy-master/lib/rpi/libsnowboy-detect.a -DKITTAI_KEY_WORD_DETECTOR_INCLUDE_DIR=/home/king/Project/DB20_Linux/AVS/snowboy-master/include/
Creating the build directory for the AlexaClientSDK with build type: DEBUG
Creating AlexaClientSDK with keyword detector type: KittAi
CMake Warning (dev) at ThirdParty/googletest-release-1.8.0/CMakeLists.txt:3 (project):
Policy CMP0048 is not set: project() command manages VERSION variables.
Run "cmake --help-policy CMP0048" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.

The following variable(s) would be set to empty:

PROJECT_VERSION
PROJECT_VERSION_MAJOR
PROJECT_VERSION_MINOR
PROJECT_VERSION_PATCH

This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at ThirdParty/googletest-release-1.8.0/googlemock/CMakeLists.txt:40 (project):
Policy CMP0048 is not set: project() command manages VERSION variables.
Run "cmake --help-policy CMP0048" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.

The following variable(s) would be set to empty:

PROJECT_VERSION
PROJECT_VERSION_MAJOR
PROJECT_VERSION_MINOR
PROJECT_VERSION_PATCH

This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at ThirdParty/googletest-release-1.8.0/googletest/CMakeLists.txt:47 (project):
Policy CMP0048 is not set: project() command manages VERSION variables.
Run "cmake --help-policy CMP0048" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.

The following variable(s) would be set to empty:

PROJECT_VERSION
PROJECT_VERSION_MAJOR
PROJECT_VERSION_MINOR
PROJECT_VERSION_PATCH

This warning is for project developers. Use -Wno-dev to suppress it.

Creating the build directory for the AVSUtils with build type: DEBUG
Creating AVSUtils with keyword detector type: KittAi
-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)
Creating the build directory for the AVSCommon with build type: DEBUG
Creating AVSCommon with keyword detector type: KittAi
-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)
-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)
-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)
Creating the build directory for the ACL with build type: DEBUG
Creating ACL with keyword detector type: KittAi
-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)
Creating the build directory for the AuthDelegate with build type: DEBUG
Creating AuthDelegate with keyword detector type: KittAi
-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)
Creating the build directory for the ADSL with build type: DEBUG
Creating ADSL with keyword detector type: KittAi
-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)
Creating the build directory for the AFML with build type: DEBUG
Creating AFML with keyword detector type: KittAi
-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)
Creating the build directory for the ContextManager with build type: DEBUG
Creating ContextManager with keyword detector type: KittAi
-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)
Skip building the GStreamer based media player.
-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)
Creating the build directory for the KITTAI with build type: DEBUG
Creating KITTAI with keyword detector type: KittAi
-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)
Creating the build directory for the CapabilityAgents with build type: DEBUG
Creating CapabilityAgents with keyword detector type: KittAi
Creating the build directory for the AIP with build type: DEBUG
Creating AIP with keyword detector type: KittAi
-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)
Creating the build directory for the SpeechSynthesizer with build type: DEBUG
Creating SpeechSynthesizer with keyword detector type: KittAi
-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)
Creating the build directory for the Integration with build type: DEBUG
Creating Integration with keyword detector type: KittAi
-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)
-- Please fill /home/king/Project/DB20_Linux/AVS/Alexa_Make/Integration/AlexaClientSDKConfig.json before you execute integration tests.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/king/Project/DB20_Linux/AVS/Alexa_Make
king@wks:~/Project/DB20_Linux/AVS/Alexa_Make$ make
[ 2%] Built target gmock_main
[ 4%] Built target gmock
[ 5%] Built target gtest
[ 7%] Built target gtest_main
[ 14%] Built target AVSUtils
[ 15%] Built target ExampleLogger
[ 16%] Built target ExampleLoggerClient
[ 17%] Built target AlexaClientSDKInitTest
[ 18%] Built target ConfigurationNodeTest
[ 19%] Built target ExecutorTest
[ 20%] Built target LogEntryStreamTest
[ 21%] Built target LoggerTest
[ 22%] Built target TaskQueueTest
[ 23%] Built target TaskThreadTest
[ 32%] Built target AVSCommon
[ 34%] Built target TimerTest
[ 35%] Built target JSONUtilTest
[ 36%] Built target AttachmentCommonTestLib
[ 37%] Built target HandlerAndPolicyTest
[ 38%] Built target AttachmentReaderTest
[ 40%] Built target AttachmentTest
[ 41%] Built target AttachmentWriterTest
[ 42%] Built target CapabilityAgentTest
[ 43%] Built target NamespaceAndNameTest
[ 44%] Built target AttachmentManagerV2Test
[ 45%] Built target UUIDGenerationTest
[ 46%] Built target SharedDataStreamTest
[ 51%] Built target ACL
[ 54%] Built target ACLTransportCommonTestLib
[ 55%] Built target AVSConnectionManagerTest
[ 56%] Built target HTTP2StreamTest
[ 58%] Built target MessageRouterTest
[ 59%] Built target MimeParserTest
[ 61%] Built target AuthDelegate
[ 63%] Built target ExampleAuthDelegateClient
[ 64%] Built target AuthDelegateTest
[ 67%] Built target ADSL
[ 68%] Built target ADSLTestCommon
[ 69%] Built target DirectiveProcessorTest
[ 70%] Built target DirectiveRouterTest
[ 71%] Built target MessageInterpreterTest
[ 72%] Built target DirectiveSequencerTest
[ 74%] Built target AFML
[ 75%] Built target FocusManagerTest
[ 76%] Built target ContextManager
[ 77%] Built target ContextManagerTest
[ 78%] Built target KWD
[ 80%] Built target AbstractKeywordDetectorTest
[ 81%] Linking CXX shared library libKITTAI.so
/home/king/opt/gcc-linaro-6.3.1-2017.02-x86_64_arm-linux-gnueabi/bin/../lib/gcc/arm-linux-gnueabi/6.3.1/../../../../arm-linux-gnueabi/bin/ld: cannot find -lblas
collect2: error: ld returned 1 exit status
make[2]: *** [KWD/KittAi/src/libKITTAI.so] Error 1
make[1]: *** [KWD/KittAi/src/CMakeFiles/KITTAI.dir/all] Error 2
make: *** [all] Error 2

maybe I'm using a wrong library compatible version of Kitt.ai, please suggest which library is suitable for my target platform, thanks.

For more information, please see this.

@chenguoguo
Copy link
Collaborator

From what I can see in the log

[ 81%] Linking CXX shared library libKITTAI.so
/home/king/opt/gcc-linaro-6.3.1-2017.02-x86_64_arm-linux-gnueabi/bin/../lib/gcc/arm-linux-gnueabi/6.3.1/../../../../arm-linux-gnueabi/bin/ld: cannot find -lblas
collect2: error: ld returned 1 exit status
make[2]: *** [KWD/KittAi/src/libKITTAI.so] Error 1
make[1]: *** [KWD/KittAi/src/CMakeFiles/KITTAI.dir/all] Error 2
make: *** [all] Error 2

It looks like it cannot find the blas library. Normally we use ATLAS or OpenBLAS for CBLAS functions. You can install either ATLAS or OpenBLAS, and then link against them.

@boyce-xx
Copy link
Author

boyce-xx commented Jun 8, 2017

Hi @chenguoguo ,
Sure, I have installed libatlas-base-dev on my ubuntu followed below section from this

NOTE: A matrix calculation library, known as BLAS, is required to use KITT.ai. The following are sample commands to install this library:

Generic Linux - apt-get install libatlas-base-dev
macOS - brew install homebrew/science/openblas
Note: To list all available CMake options, use the following command: -LH.

For generic desktop building, there is no problem: my destkop env is

king@wks:~$ uname -a
Linux wks 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

It's works fine with lib/ubuntu64/libsnowboy-detect.a

But, now, I need to migrate it to my embedded device,to cross compiling it, none of libraries is worked for me. Do I need to cross compile ATLAS? if so, would you have any suggestions about it?

Appreciate!

@chenguoguo
Copy link
Collaborator

If you have to cross compile it, I'd suggest OpenBLAS, it's much more easier to compile.

@chenguoguo
Copy link
Collaborator

BTW, for platforms other than Raspberry Pi, we have not compiled our frontend processing unit into the library yet, which means there will be a performance degradation for the Alexa model we released. We will compile it in the next few weeks, just keep that in mind.

@chenguoguo
Copy link
Collaborator

And what is your embedded platform?

@boyce-xx
Copy link
Author

boyce-xx commented Jun 8, 2017

Hi @chenguoguo ,

My embedded platform is:

/ # uname -a
Linux apq8009 3.18.44 #1 SMP PREEMPT Fri Jun 2 09:11:05 CST 2017 armv7l GNU/Linux

Question here: if the rpi/libsnowboy-detect.a is suitable for my target platform?

My cross-compiler is:

king@wks:~/Project/DB20_Linux/AVS/Alexa_Make$ /home/king/opt/gcc-linaro-6.3.1-2017.02-x86_64_arm-linux-gnueabi/bin/arm-linux-gnueabi-g++ --version
arm-linux-gnueabi-g++ (Linaro GCC 6.3-2017.02) 6.3.1 20170109
Copyright (C) 2016 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.

@chenguoguo
Copy link
Collaborator

It feels like the rpi version should work. You can even try to copy atlas libraries from rpi if you don't want to cross compile OpenBLAS

@avp24
Copy link

avp24 commented Sep 17, 2018

Hi @boyce-xx,
are you successfully able to cross-compile & port avs on your arm platform? Is alexa with Wake Word working in your ARM platform? Which all files do we need to copy on our target platform to make AVS with Wake Word work? I am also using Qualcomm based ARM platform.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants