I am trying "Cross-compiling Arm NN for the Raspberry Pi and TensorFlow"
I have followed exact steps mentioned in the below link,
But I got below error when compiling sample application on raspberry pi.
pi@raspberrypi:~/armnn-dist $ export LD_LIBRARY_PATH=/home/pi/armnn-dist/armnn/lib
pi@raspberrypi:~/armnn-dist $ g++ SimpleSample.cpp -I/home/pi/armnn-dist/armnn/include -I/home/pi/armnn-dist/boost/include -L/home/pi/armnn-dist/armnn/lib -larmnn -larmnnTfParser -lprotobuf -o SimpleSample
/home/pi/armnn-dist/armnn/lib/libarmnn.so: undefined reference to `powf@GLIBC_2.27'
/home/pi/armnn-dist/armnn/lib/libarmnn.so: undefined reference to `expf@GLIBC_2.27'
/home/pi/armnn-dist/armnn/lib/libarmnn.so: undefined reference to `logf@GLIBC_2.27'
collect2: error: ld returned 1 exit status
g++ should be changed to use the cross-compiler g++-arm-linux-gnueabihf you used before for crossing compiling the ArmNN and ComputeLibrary, please try again. Let us know if you have further problems with this.
Should be arm-linux-gnueabihf-g++, sorry for the typo.
Please refer https://github.com/ARM-software/armnn/blob/branches/armnn_19_02/BuildGuideCrossCompilation.md.
In raspberry PI, g++ is cross compiler . g++ is a symbolic link to /usr/bin/arm-linux-gnueabihf-g++-6
Instead I suspect on the cross compiler version used in HOST and Pi Target, and they are built with different glibc version.On Host(Ubuntu 18.04)
gcc version 7.3.0 (Ubuntu/Linaro 7.3.0-27ubuntu1~18.04)
gcc version 6.3.0 20170516 (Raspbian 6.3.0-18+rpi1+deb9u1)
OK. I have resolved it.
It was due to the mismatch in the cross compiler version in the host and the target.
I built a new cross-compiler targeting arm-linux-gnueabihf- for host ubuntu18.04/x86_64 with gcc - 6.3 and glibc - 2.4.
Now it works fine.