nyumaya/nyumaya_audio_recognition_lib

compile on arm64 error

Closed this issue · 6 comments

at final step after make command get the following error :
root@zcu102:~/tensorflow/nyumaya_audio_recognition_lib# make
Scanning dependencies of target nyumaya
[ 1%] Building CXX object CMakeFiles/nyumaya.dir/root/tensorflow/tensorflow/lite/profiling/time.cc.o
/root/tensorflow/tensorflow/lite/profiling/time.cc:1:0: error: unknown value ‘x86-64’ for -march

Which platform are you compiling on? (Edit just saw the arm64 on the title). Currently, you have to edit the CMakeLists.txt file for your platform. If you compile on the same machine as the program will run I suggest setting the parameters march and mtune to 'native'. Additionally, you might want to use NEON instructions for better performance. The CMakeLists.txt has a configuration for the PI3 which should work for arm64. Just comment line 8

set(CMAKE_CXX_FLAGS_RELEASE " -O3 -march=x86-64 -mtune=generic -fPIC -funsafe-math-optimizations -DGEMMLOWP_ALLOW_SLOW_SCALAR_FALLBACK -s")

and uncomment line 19 and 20

#set(CMAKE_CXX_FLAGS_RELEASE " -O3 -march=native -no-pie -funsafe-math-optimizations -mfpu=neon-vfpv4 -DUSE_NEON -s")
#set(CMAKE_C_FLAGS_RELEASE " -O3 -march=native -no-pie -funsafe-math-optimizations -mfpu=neon-vfpv4 -DUSE_NEON -s")

I'm updating this in the docs.

thanks a lot i will check it now

o.k it seems to be worked can u explain to me please what are the next steps after building

Which board did you compile the library on? I assume it's not the Raspberry since this does not require building the library. In the other repository there is a file nyumaya_audio_recognition/python/src/auto_platform.py . This file is used for convenience to automatically find the prebuilt library for the platform.

If you run it, it should say "Machine not supported" and output system information. Depending on what machine you are on you can make a new entry with the output of the machine. Then you can add your built library to a folder under lib/* and specify the path to it in your new entry.

Alternatively, you can look at examples like https://github.com/nyumaya/nyumaya_audio_recognition/blob/master/python/streaming_example.py . They take a libpath as command line argument where you can specify the location of the library you compiled.

tanks a lot