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

Cannot cross-compile for Raspberry Pi with official instructions in MacOS #30764

Closed
marianopeck opened this issue Jul 16, 2019 · 3 comments
Closed
Assignees
Labels
subtype: raspberry pi Raspberry Pi Build/Installation Issues TF 1.13 Issues related to TF 1.13 type:build/install Build and install issues

Comments

@marianopeck
Copy link

System information

  • OSX 10.14.5
  • TensorFlow installed from (source or binary): source
  • TensorFlow version: 1.13.1
  • Python version: 2.7
  • Installed using virtualenv? pip? conda?: docker
  • Bazel version (if compiling from source):
  • GCC/Compiler version (if compiling from source):
  • CUDA/cuDNN version:
  • GPU model and memory:

Describe the problem

I am following this official guide to cross-compile for the Raspberry Pi. I am doing:

   tensorflow/tools/ci_build/ci_build.sh PI \
   tensorflow/tools/ci_build/pi/build_raspberry_pi.sh

The process hungs (all CPUs being used 100% for a long long time) while compiling. Each time I kill it and the next time hungs at a different place. The scenario is always very similar.. I paste below some examples:

Example1

[1,152 / 1,160] Compiling tensorflow/core/kernels/data/experimental/group_by_reducer_dataset_op.cc; 131s local ... (4 actions running)
ERROR: /workspace/tensorflow/core/kernels/BUILD:3114:1: C++ compilation of rule '//tensorflow/core/kernels:batch_matmul_op' failed (Exit 4): arm-linux-gnueabihf-gcc failed: error executing command
  (cd /Users/mariano/Trabajo/Instantiations/InstantiationsShared/TensorFlow/tensorflow/bazel-ci_build-cache/.cache/bazel/_bazel_mariano/eab0d61a99b6696edb3d2aff87b585e8/execroot/org_tensorflow && \
  exec env - \
    LD_LIBRARY_PATH='' \
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin \
    PWD=/proc/self/cwd \
    PYTHON_BIN_PATH=/usr/bin/python \
    PYTHON_LIB_PATH=/usr/local/lib/python2.7/dist-packages \
    TF_DOWNLOAD_CLANG=0 \
    TF_NEED_CUDA=0 \
    TF_NEED_OPENCL_SYCL=0 \
    TF_NEED_ROCM=0 \
  /Users/mariano/Trabajo/Instantiations/InstantiationsShared/TensorFlow/tensorflow/bazel-ci_build-cache/.cache/bazel/_bazel_mariano/eab0d61a99b6696edb3d2aff87b585e8/external/arm_compiler/bin/arm-linux-gnueabihf-gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -DRASPBERRY_PI -g0 -O2 -DNDEBUG -ffunction-sections -fdata-sections '-std=c++11' -isystem /usr/include/arm-linux-gnueabihf -isystem /usr/include/python2.7 -isystem /usr/include/ -MD -MF bazel-out/armeabi-opt/bin/tensorflow/core/kernels/_objs/batch_matmul_op/batch_matmul_op_real.d '-frandom-seed=bazel-out/armeabi-opt/bin/tensorflow/core/kernels/_objs/batch_matmul_op/batch_matmul_op_real.o' -DEIGEN_MPL2_ONLY '-DEIGEN_MAX_ALIGN_BYTES=64' '-DEIGEN_HAS_TYPE_TRAITS=0' -D__CLANG_SUPPORT_DYN_ANNOTATION__ -DTF_USE_SNAPPY -DCURL_STATICLIB -iquote . -iquote bazel-out/armeabi-opt/genfiles -iquote bazel-out/armeabi-opt/bin -iquote external/bazel_tools -iquote bazel-out/armeabi-opt/genfiles/external/bazel_tools -iquote bazel-out/armeabi-opt/bin/external/bazel_tools -iquote external/eigen_archive -iquote bazel-out/armeabi-opt/genfiles/external/eigen_archive -iquote bazel-out/armeabi-opt/bin/external/eigen_archive -iquote external/local_config_sycl -iquote bazel-out/armeabi-opt/genfiles/external/local_config_sycl -iquote bazel-out/armeabi-opt/bin/external/local_config_sycl -iquote external/com_google_absl -iquote bazel-out/armeabi-opt/genfiles/external/com_google_absl -iquote bazel-out/armeabi-opt/bin/external/com_google_absl -iquote external/nsync -iquote bazel-out/armeabi-opt/genfiles/external/nsync -iquote bazel-out/armeabi-opt/bin/external/nsync -iquote external/gif_archive -iquote bazel-out/armeabi-opt/genfiles/external/gif_archive -iquote bazel-out/armeabi-opt/bin/external/gif_archive -iquote external/jpeg -iquote bazel-out/armeabi-opt/genfiles/external/jpeg -iquote bazel-out/armeabi-opt/bin/external/jpeg -iquote external/protobuf_archive -iquote bazel-out/armeabi-opt/genfiles/external/protobuf_archive -iquote bazel-out/armeabi-opt/bin/external/protobuf_archive -iquote external/com_googlesource_code_re2 -iquote bazel-out/armeabi-opt/genfiles/external/com_googlesource_code_re2 -iquote bazel-out/armeabi-opt/bin/external/com_googlesource_code_re2 -iquote external/farmhash_archive -iquote bazel-out/armeabi-opt/genfiles/external/farmhash_archive -iquote bazel-out/armeabi-opt/bin/external/farmhash_archive -iquote external/fft2d -iquote bazel-out/armeabi-opt/genfiles/external/fft2d -iquote bazel-out/armeabi-opt/bin/external/fft2d -iquote external/highwayhash -iquote bazel-out/armeabi-opt/genfiles/external/highwayhash -iquote bazel-out/armeabi-opt/bin/external/highwayhash -iquote external/zlib_archive -iquote bazel-out/armeabi-opt/genfiles/external/zlib_archive -iquote bazel-out/armeabi-opt/bin/external/zlib_archive -iquote external/double_conversion -iquote bazel-out/armeabi-opt/genfiles/external/double_conversion -iquote bazel-out/armeabi-opt/bin/external/double_conversion -iquote external/snappy -iquote bazel-out/armeabi-opt/genfiles/external/snappy -iquote bazel-out/armeabi-opt/bin/external/snappy -iquote external/curl -iquote bazel-out/armeabi-opt/genfiles/external/curl -iquote bazel-out/armeabi-opt/bin/external/curl -iquote external/boringssl -iquote bazel-out/armeabi-opt/genfiles/external/boringssl -iquote bazel-out/armeabi-opt/bin/external/boringssl -iquote external/jsoncpp_git -iquote bazel-out/armeabi-opt/genfiles/external/jsoncpp_git -iquote bazel-out/armeabi-opt/bin/external/jsoncpp_git -iquote external/aws -iquote bazel-out/armeabi-opt/genfiles/external/aws -iquote bazel-out/armeabi-opt/bin/external/aws -isystem external/eigen_archive -isystem bazel-out/armeabi-opt/genfiles/external/eigen_archive -isystem bazel-out/armeabi-opt/bin/external/eigen_archive -isystem external/nsync/public -isystem bazel-out/armeabi-opt/genfiles/external/nsync/public -isystem bazel-out/armeabi-opt/bin/external/nsync/public -isystem external/gif_archive/lib -isystem bazel-out/armeabi-opt/genfiles/external/gif_archive/lib -isystem bazel-out/armeabi-opt/bin/external/gif_archive/lib -isystem external/protobuf_archive/src -isystem bazel-out/armeabi-opt/genfiles/external/protobuf_archive/src -isystem bazel-out/armeabi-opt/bin/external/protobuf_archive/src -isystem external/farmhash_archive/src -isystem bazel-out/armeabi-opt/genfiles/external/farmhash_archive/src -isystem bazel-out/armeabi-opt/bin/external/farmhash_archive/src -isystem external/zlib_archive -isystem bazel-out/armeabi-opt/genfiles/external/zlib_archive -isystem bazel-out/armeabi-opt/bin/external/zlib_archive -isystem external/double_conversion -isystem bazel-out/armeabi-opt/genfiles/external/double_conversion -isystem bazel-out/armeabi-opt/bin/external/double_conversion -isystem external/curl/include -isystem bazel-out/armeabi-opt/genfiles/external/curl/include -isystem bazel-out/armeabi-opt/bin/external/curl/include -isystem external/boringssl/src/include -isystem bazel-out/armeabi-opt/genfiles/external/boringssl/src/include -isystem bazel-out/armeabi-opt/bin/external/boringssl/src/include -isystem external/jsoncpp_git/include -isystem bazel-out/armeabi-opt/genfiles/external/jsoncpp_git/include -isystem bazel-out/armeabi-opt/bin/external/jsoncpp_git/include -isystem external/aws/aws-cpp-sdk-core/include -isystem bazel-out/armeabi-opt/genfiles/external/aws/aws-cpp-sdk-core/include -isystem bazel-out/armeabi-opt/bin/external/aws/aws-cpp-sdk-core/include -isystem external/aws/aws-cpp-sdk-kinesis/include -isystem bazel-out/armeabi-opt/genfiles/external/aws/aws-cpp-sdk-kinesis/include -isystem bazel-out/armeabi-opt/bin/external/aws/aws-cpp-sdk-kinesis/include -isystem external/aws/aws-cpp-sdk-s3/include -isystem bazel-out/armeabi-opt/genfiles/external/aws/aws-cpp-sdk-s3/include -isystem bazel-out/armeabi-opt/bin/external/aws/aws-cpp-sdk-s3/include '-march=armv7-a' '-mfpu=neon-vfpv4' '-std=gnu11' '-DS_IREAD=S_IRUSR' '-DS_IWRITE=S_IWUSR' -O3 -U__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 -U__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 -U__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 -funsafe-math-optimizations -ftree-vectorize -fomit-frame-pointer -DEIGEN_AVOID_STL_ARRAY -Iexternal/gemmlowp -Wno-sign-compare -fno-exceptions '-ftemplate-depth=900' -DTENSORFLOW_MONOLITHIC_BUILD -pthread -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -no-canonical-prefixes -fno-canonical-system-headers -c tensorflow/core/kernels/batch_matmul_op_real.cc -o bazel-out/armeabi-opt/bin/tensorflow/core/kernels/_objs/batch_matmul_op/batch_matmul_op_real.o)
Execution platform: @bazel_tools//platforms:host_platform
cc1plus: warning: command line option '-std=gnu11' is valid for C/ObjC but not for C++
arm-linux-gnueabihf-gcc: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
INFO: Elapsed time: 781.885s, Critical Path: 218.64s
INFO: 108 processes: 108 local.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully
>>> elapsed time 16m45s

Example2

ERROR: /Users/mariano/Trabajo/Instantiations/InstantiationsShared/TensorFlow/tensorflow/bazel-ci_build-cache/.cache/bazel/_bazel_mariano/eab0d61a99b6696edb3d2aff87b585e8/external/com_github_nanopb_nanopb/BUILD.bazel:1:1: C++ compilation of rule '@com_github_nanopb_nanopb//:nanopb' failed (Exit 1): arm-linux-gnueabihf-gcc failed: error executing command
  (cd /Users/mariano/Trabajo/Instantiations/InstantiationsShared/TensorFlow/tensorflow/bazel-ci_build-cache/.cache/bazel/_bazel_mariano/eab0d61a99b6696edb3d2aff87b585e8/execroot/org_tensorflow && \
  exec env - \
    LD_LIBRARY_PATH='' \
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin \
    PWD=/proc/self/cwd \
    PYTHON_BIN_PATH=/usr/bin/python \
    PYTHON_LIB_PATH=/usr/local/lib/python2.7/dist-packages \
    TF_DOWNLOAD_CLANG=0 \
    TF_NEED_CUDA=0 \
    TF_NEED_OPENCL_SYCL=0 \
    TF_NEED_ROCM=0 \
  /Users/mariano/Trabajo/Instantiations/InstantiationsShared/TensorFlow/tensorflow/bazel-ci_build-cache/.cache/bazel/_bazel_mariano/eab0d61a99b6696edb3d2aff87b585e8/external/arm_compiler/bin/arm-linux-gnueabihf-gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -DRASPBERRY_PI -g0 -O2 -DNDEBUG -ffunction-sections -fdata-sections -MD -MF bazel-out/armeabi-opt/bin/external/com_github_nanopb_nanopb/_objs/nanopb/pb_decode.pic.d -fPIC '-DPB_FIELD_32BIT=1' -iquote external/com_github_nanopb_nanopb -iquote bazel-out/armeabi-opt/genfiles/external/com_github_nanopb_nanopb -iquote bazel-out/armeabi-opt/bin/external/com_github_nanopb_nanopb -iquote external/bazel_tools -iquote bazel-out/armeabi-opt/genfiles/external/bazel_tools -iquote bazel-out/armeabi-opt/bin/external/bazel_tools '-march=armv7-a' '-mfpu=neon-vfpv4' '-std=gnu11' '-DS_IREAD=S_IRUSR' '-DS_IWRITE=S_IWUSR' -O3 -U__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 -U__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 -U__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 -funsafe-math-optimizations -ftree-vectorize -fomit-frame-pointer -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -no-canonical-prefixes -fno-canonical-system-headers -c external/com_github_nanopb_nanopb/pb_decode.c -o bazel-out/armeabi-opt/bin/external/com_github_nanopb_nanopb/_objs/nanopb/pb_decode.pic.o)
Execution platform: @bazel_tools//platforms:host_platform
external/com_github_nanopb_nanopb/pb_decode.c:18:23: fatal error: pb_common.h: No such file or directory
 #include "pb_common.h"
                       ^
compilation terminated.
INFO: Elapsed time: 380.977s, Critical Path: 35.72s
INFO: 390 processes: 390 local.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully

Any other info / logs
The very very same instructions, running on a Linux Mint 18.3 work perfectly. Docker version on OSX is "Docker version 18.09.2, build 6247962" and in Mint "Docker version 18.09.6, build 481bc77". The documentation says nothing about which Docker version to use and it does says that MacOS is supported:

it's easier to build TensorFlow on a more powerful host machine running Linux, macOS, or Windows.

Any ideas?

@ravikyram ravikyram self-assigned this Jul 17, 2019
@ravikyram ravikyram added subtype: raspberry pi Raspberry Pi Build/Installation Issues TF 1.13 Issues related to TF 1.13 type:build/install Build and install issues labels Jul 17, 2019
@marianopeck
Copy link
Author

I finally took the time to write down everything I found during my attempt to get TensorFlow C library compiled for Raspberry Pi. In that tutorial, I point back to this issue in case any progress is done.
Thank you

@ravikyram ravikyram assigned gunan and unassigned ravikyram Jul 18, 2019
@ravikyram ravikyram added the stat:awaiting tensorflower Status - Awaiting response from tensorflower label Jul 18, 2019
@gunan gunan assigned petewarden and unassigned gunan Jul 18, 2019
@jvishnuvardhan
Copy link
Contributor

@marianopeck Is this duplicate of #30716? Thanks!

@tensorflowbutler tensorflowbutler removed the stat:awaiting tensorflower Status - Awaiting response from tensorflower label Aug 10, 2019
@jvishnuvardhan
Copy link
Contributor

Closing due to lack of recent activity. Please update the issue when new information becomes available, and we will reopen the issue. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
subtype: raspberry pi Raspberry Pi Build/Installation Issues TF 1.13 Issues related to TF 1.13 type:build/install Build and install issues
Projects
None yet
Development

No branches or pull requests

6 participants