在ubuntu 16.04lts上交叉编译Raspberry Pi 3的Tensorflow时出错

2024-04-25 14:34:00 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图在Tensorflowbuild_raspberry_pi.sh的帮助下交叉编译Raspberry PI3的Tensorflow,但是我遇到了错误,我遵循了以下步骤步骤:-在

1:安装Bazel 0.10.0

2:从git克隆Tensorflow并对r1.5进行校验

3:运行/tensorflow/tools/ci_build/pi/中的脚本,该脚本是build_raspberry_pi.sh。在

我正在交叉编译raspberry Pi 3,在编译过程中出现以下错误:

ERROR: /home/baladev/.cache/bazel/_bazel_baladev/da0e175f87e998fe3d550279550cec2c/external/grpc/BUILD:431:1: C++ compilation of rule '@grpc//:gpr_base' failed (Exit 1): arm-linux-gnueabihf-gcc failed: error executing command 

(cd /home/baladev/.cache/bazel/_bazel_baladev/da0e175f87e998fe3d550279550cec2c/execroot/org_tensorflow && \   exec env - \
    PATH=/home/baladev/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin \
    PWD=/proc/self/cwd \
    PYTHON_BIN_PATH=/usr/bin/python \
    PYTHON_LIB_PATH=/usr/local/lib/python2.7/dist-packages \
    TF_NEED_CUDA=0 \
    TF_NEED_OPENCL_SYCL=0 \   /home/baladev/.cache/bazel/_bazel_baladev/da0e175f87e998fe3d550279550cec2c/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 -DGEMMLOWP_ALLOW_SLOW_SCALAR_FALLBACK '-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 '-std=c++11' -isystem /usr/include/arm-linux-gnueabihf -isystem /usr/include/python2.7
-isystem /usr/include/ -MD -MF bazel-out/armeabi-opt/bin/external/grpc/_objs/gpr_base/external/grpc/src/core/lib/support/subprocess_posix.pic.d '-frandom-seed=bazel-out/armeabi-opt/bin/external/grpc/_objs/gpr_base/external/grpc/src/core/lib/support/subprocess_posix.pic.o'
-fPIC '-DGRPC_ARES=0' -D__CLANG_SUPPORT_DYN_ANNOTATION__ -iquote external/grpc -iquote bazel-out/armeabi-opt/genfiles/external/grpc
-iquote external/bazel_tools -iquote bazel-out/armeabi-opt/genfiles/external/bazel_tools -iquote external/com_google_absl -iquote bazel-out/armeabi-opt/genfiles/external/com_google_absl -isystem external/grpc/include -isystem bazel-out/armeabi-opt/genfiles/external/grpc/include -isystem external/bazel_tools/tools/cpp/gcc3 -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -no-canonical-prefixes
-fno-canonical-system-headers -c external/grpc/src/core/lib/support/subprocess_posix.cc -o bazel-out/armeabi-opt/bin/external/grpc/_objs/gpr_base/external/grpc/src/core/lib/support/subprocess_posix.pic.o) cc1plus: warning: command line option '-std=gnu11' is valid for C/ObjC but not for C++ In file included from external/grpc/src/core/lib/support/subprocess_posix.cc:33:0: /home/baladev/.cache/bazel/_bazel_baladev/da0e175f87e998fe3d550279550cec2c/external/arm_compiler/bin/../arm-linux-gnueabihf/sysroot/usr/include/sys/wait.h:101:3: error: redeclaration of 'P_ALL'    P_ALL,  /* Wait for any child.  */  ^ In file included from /usr/include/stdlib.h:41:0,
                 from external/grpc/src/core/lib/support/subprocess_posix.cc:30: /usr/include/bits/waitflags.h:52:3: note: previous declaration 'idtype_t P_ALL'    P_ALL,  /* Wait for any child.  */    ^ In file included from external/grpc/src/core/lib/support/subprocess_posix.cc:33:0: /home/baladev/.cache/bazel/_bazel_baladev/da0e175f87e998fe3d550279550cec2c/external/arm_compiler/bin/../arm-linux-gnueabihf/sysroot/usr/include/sys/wait.h:102:3: error: redeclaration of 'P_PID'    P_PID,  /* Wait for specified process.  */    ^ In file included from /usr/include/stdlib.h:41:0,
                 from external/grpc/src/core/lib/support/subprocess_posix.cc:30: /usr/include/bits/waitflags.h:53:3: note: previous declaration 'idtype_t P_PID'    P_PID,  /* Wait for specified process.  */    ^ In file included from external/grpc/src/core/lib/support/subprocess_posix.cc:33:0: /home/baladev/.cache/bazel/_bazel_baladev/da0e175f87e998fe3d550279550cec2c/external/arm_compiler/bin/../arm-linux-gnueabihf/sysroot/usr/include/sys/wait.h:103:3: error: redeclaration of 'P_PGID'    P_PGID  /* Wait for members of process group.  */    ^ In file included from /usr/include/stdlib.h:41:0,
                 from external/grpc/src/core/lib/support/subprocess_posix.cc:30: /usr/include/bits/waitflags.h:54:3: note: previous declaration 'idtype_t P_PGID'    P_PGID  /* Wait for members of process group.  */ ^ In file included from external/grpc/src/core/lib/support/subprocess_posix.cc:33:0: /home/baladev/.cache/bazel/_bazel_baladev/da0e175f87e998fe3d550279550cec2c/external/arm_compiler/bin/../arm-linux-gnueabihf/sysroot/usr/include/sys/wait.h:104:3: error: conflicting declaration 'typedef enum idtype_t idtype_t'  } idtype_t;    ^ In file included from /usr/include/stdlib.h:41:0,
                 from external/grpc/src/core/lib/support/subprocess_posix.cc:30: /usr/include/bits/waitflags.h:55:3: note: previous declaration as 'typedef enum idtype_t idtype_t'  } idtype_t;    ^ INFO: Elapsed time:
984.156s, Critical Path: 40.58s FAILED: Build did NOT complete successfully

我是否遗漏了交叉编译所需的东西?在


Tags: fromcoresrcsupportgrpcbinincludelib