Open ttompk opened 3 years ago
The following warning message is common on the tflite install:
/home/pi/tensorflow_src/tensorflow/lite/tools/make/downloads/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h:679:49: warning: requested alignment 16 is larger than 8 [-Wattributes].
All of these warnings (there are many) appear to be common to the "eigenalign..." in ".../GenericPacketMathFunctions.h" and ".../TensorTrace.h" and other files.
Some sources seem to suggest the gcc version may need to be updated but I'm not certain that will work.
$ gcc –version
another warning type:
_"cc1plus: warning: ‘void __builtin_memcpy(void, const void*, unsigned int)’ reading 32 bytes from a region of size 20 [-Wstringop-overflow=]"_
found this resource for raspberry pi zero:
https://www.tensorflow.org/lite/guide/build_cmake. (overall)
https://www.tensorflow.org/lite/guide/build_cmake_arm. (additional to above)
All the following code from the home directory.
Google says build works with gcc version 8.3.0 (Raspbian 8.3.0-6+rpi1)
$ gcc --version
$ sudo apt-get install cmake
$ git clone https://github.com/tensorflow/tensorflow.git tensorflow_src
$ mkdir tflite_build $ cd tflite_build
$ ldd --version
$ cat /proc/cpuinfo
$ mkdir ./toolchains $ curl -L https://github.com/rvagg/rpi-newer-crosstools/archive/eb68350c5c8ec1663b7fe52c742ac4271e3217c5.tar.gz -o rpi-toolchain.tar.gz $ tar xzf rpi-toolchain.tar.gz -C ./toolchains $ mv ./toolchains/rpi-newer-crosstools-eb68350c5c8ec1663b7fe52c742ac4271e3217c5 ./toolchains/arm-rpi-linux-gnueabihf
$ ARMCC_PREFIX=./toolchains/arm-rpi-linux-gnueabihf/x64-gcc-6.5.0/arm-rpi-linux-gnueabihf/bin/arm-rpi-linux-gnueabihf- $ ARMCC_FLAGS="-march=armv6 -mfpu=vfp -funsafe-math-optimizations" $ cmake -DCMAKE_C_COMPILER=${ARMCC_PREFIX}gcc \ -DCMAKE_CXX_COMPILER=${ARMCC_PREFIX}g++ \ -DCMAKE_C_FLAGS="${ARMCC_FLAGS}" \ -DCMAKE_CXX_FLAGS="${ARMCC_FLAGS}" \ -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \ -DCMAKE_SYSTEM_NAME=Linux \ -DCMAKE_SYSTEM_PROCESSOR=armv6 \ -DTFLITE_ENABLE_XNNPACK=OFF \ ../tensorflow/lite/
$ ARMCC_PREFIX=/home/pi/toolchains/arm-rpi-linux-gnueabihf/x64-gcc-6.5.0/arm-rpi-linux-gnueabihf/bin/arm-rpi-linux-gnueabihf-
$ cmake -DCMAKE_C_COMPILER=${ARMCC_PREFIX}gcc \
-DCMAKE_CXX_COMPILER=${ARMCC_PREFIX}g++ \
-DCMAKE_C_FLAGS="${ARMCC_FLAGS}" \
-DCMAKE_CXX_FLAGS="${ARMCC_FLAGS}" \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DCMAKE_SYSTEM_NAME=Linux \
-DCMAKE_SYSTEM_PROCESSOR=armv6 \
-DTFLITE_ENABLE_XNNPACK=OFF \
/home/pi/tensorflow_src/tensorflow/lite
error on build:
CMake Error at CMakeLists.txt:29 (cmake_minimum_required):
CMake 3.16 or higher is required. You are running version 3.13.4
ran
sudo apt-get install cmake
and it returned
cmake is already the newest version (3.13.4-1).
see this site on how to update cmake: https://askubuntu.com/questions/355565/how-do-i-install-the-latest-version-of-cmake-from-the-command-line
works: $ sudo apt-get install build-essential $ git clone https://github.com/tensorflow/tensorflow.git tensorflow_src $ cd tensorflow_src && ./tensorflow/lite/tools/make/download_dependencies.sh
fails:
$ ./tensorflow/lite/tools/make/build_rpi_lib.sh