Hi ,I encountered the following problems in using the C++ SDK:
QUESTION 1:APP_CUSTOM=1 TARGET_LINUX_AARCH64=1 USE_FULL_TFLITE=1 CC=clang CXX=clang++ make -j
In file included from edge-impulse-sdk/dsp/dct/fast-dct-fft.cpp:23:
In file included from edge-impulse-sdk/dsp/dct/…/numpy.hpp:43:
./model-parameters/model_metadata.h:118:2: error: “Cannot use full TensorFlow
Lite with EON” #error “Cannot use full TensorFlow Lite with EON”
^
1 error generated.
Makefile:122: recipe for target ‘edge-impulse-sdk/dsp/dct/fast-dct-fft.o’ failed
make: *** [edge-impulse-sdk/dsp/dct/fast-dct-fft.o] Error 1
make: *** Waiting for unfinished jobs…
QUESTION 2:APP_AUDIO=1 make -j
source/audio.cpp: In function ‘void classify_current_buffer()’:
source/audio.cpp:238:44: error: ‘classifier_maf’ was not declared in this scope
run_moving_average_filter(&classifier_maf[ix], result.classification[ix].value);
^~~~~~~~~~~~~~
source/audio.cpp:238:44: note: suggested alternative: ‘classifier_buffer’
run_moving_average_filter(&classifier_maf[ix], result.classification[ix].value);
^~~~~~~~~~~~~~
classifier_buffer
source/audio.cpp:238:17: error: ‘run_moving_average_filter’ was not declared in this scope
run_moving_average_filter(&classifier_maf[ix], result.classification[ix].value);
^~~~~~~~~~~~~~~~~~~~~~~~~
source/audio.cpp: In function ‘int main(int, char**)’:
source/audio.cpp:291:38: error: ‘classifier_maf’ was not declared in this scope
clear_moving_average_filter(&classifier_maf[ix]);
^~~~~~~~~~~~~~
source/audio.cpp:291:38: note: suggested alternative: ‘classifier_buffer’
clear_moving_average_filter(&classifier_maf[ix]);
^~~~~~~~~~~~~~
classifier_buffer
source/audio.cpp:291:9: error: ‘clear_moving_average_filter’ was not declared in this scope
clear_moving_average_filter(&classifier_maf[ix]);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
At global scope:
cc1plus: warning: unrecognized command line option ‘-Wno-asm-operand-widths’
Makefile:122: recipe for target ‘source/audio.o’ failed
make: *** [source/audio.o] Error 1
make: *** Waiting for unfinished jobs…
@rjames
Hi James,
There comes a new problem in Q1:
/usr/bin/ld: skipping incompatible ./tflite/linux-aarch64/libtensorflow-lite.a when searching for -ltensorflow-lite
/usr/bin/ld: cannot find -ltensorflow-lite
/usr/bin/ld: skipping incompatible ./tflite/linux-aarch64/libfarmhash.a when searching for -lfarmhash
/usr/bin/ld: cannot find -lfarmhash
/usr/bin/ld: skipping incompatible ./tflite/linux-aarch64/libfft2d_fftsg.a when searching for -lfft2d_fftsg
/usr/bin/ld: cannot find -lfft2d_fftsg
/usr/bin/ld: skipping incompatible ./tflite/linux-aarch64/libfft2d_fftsg2d.a when searching for -lfft2d_fftsg2d
/usr/bin/ld: cannot find -lfft2d_fftsg2d
/usr/bin/ld: skipping incompatible ./tflite/linux-aarch64/libruy.a when searching for -lruy
/usr/bin/ld: cannot find -lruy
/usr/bin/ld: skipping incompatible ./tflite/linux-aarch64/libXNNPACK.a when searching for -lXNNPACK
/usr/bin/ld: cannot find -lXNNPACK
/usr/bin/ld: skipping incompatible ./tflite/linux-aarch64/libcpuinfo.a when searching for -lcpuinfo
/usr/bin/ld: cannot find -lcpuinfo
/usr/bin/ld: skipping incompatible ./tflite/linux-aarch64/libpthreadpool.a when searching for -lpthreadpool
/usr/bin/ld: cannot find -lpthreadpool
/usr/bin/ld: skipping incompatible ./tflite/linux-aarch64/libclog.a when searching for -lclog
/usr/bin/ld: cannot find -lclog
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Makefile:140: recipe for target ‘runner’ failed
make: *** [runner] Error 1
I’ve updated the audio.cpp and removed the moving average filter features (maf) as workaround until we fix this. Can you get the latest changes and try again?
It looks like your trying to cross compile the audio app for aarch64 target. This won’t work the way your doing it now, because -lasound library you’re linking to was built for your host.
You’d need to
install libasound2-dev on the AARCH64 linux target.
clone the example-standalone-inferencing-linux repo onto your AARCH64 linux target and run
CC=gcc CXX=g++ APP_AUDIO=1 TARGET_LINUX_AARCH64=1 USE_FULL_TFLITE=1 make clean
CC=gcc CXX=g++ APP_AUDIO=1 TARGET_LINUX_AARCH64=1 USE_FULL_TFLITE=1 make -j
Note: you will be compiling audio app natively and linking with the correct libraries.
On target you could verify that usr/include is in G++ path with the following:
echo | gcc -E -Wp,-v -
It may have worked yesterday because I had included /usr/include to the CLFAGS (here) but then removed it (here) because I realized it wouldn’t work for cross-compilation.
@rjames Hi rjames,thanks for your reply.I don’t have Ubuntu software package in my AARCH64 linux target.
Q1: I have alsa-lib in my AARCH64 linux target. Do i need to install it ? How could i install correct version of libasound2-dev on the AARCH64 linux target.
Q2:I tried the two commands,maybe i need to install gcc on my AARCH64 linux target?
@rjames Hi,rjames
Thanks for reply. It looks like the ‘/include’ and ‘libasound2-dev.h’ cannot be found. Could i mkdir /include,copy the ***.h into /include and set PATH variable? My current architecture is shown as the figure.
And I am trying to achieve real-time keywords-spotting on my Aarch64 target. Maybe we can cross-compiler all the dependencies by Cmakelist.txt or Makefile? I used to assume it can achieve my goal by using the command “APP_CUSTOM=1 TARGET_LINUX_AARCH64=1 USE_FULL_TFLITE=1 CC=clang CXX=clang++ make -j” . Maybe you get another way?
Regarding alsa-lib, I can confirm that I can natively build the APP_AUDIO on a Linux x86 machine.
The same should be possible on arm64 if you have the header and library.
Which compiler do you have on your target? gcc is not installed or not found in PATH. You will need a compiler, first install one, set the PATH accordingly so that it can be found.
FYI:
Follow instructions found here (and e.g. for Node.js here) to get edge-impulse-linux-runner.
You shouldn’t have to move the header file. You’d have to find where the headers for this package is installed. It may be in other places than /usr/include try widening your search to
find / -name 'asoundlib.h'
EDIT: I see that you already searched and didn’t find it.
You’d need to install the alsa lib development package (to get the headers) for your target.
Search for example: alsa-lib-dev, alsa-lib-devel, libasound2-dev in your package manager