From ede4b4c111ebd2b96703dce42f0f7c5f2173f0e7 Mon Sep 17 00:00:00 2001 From: Pete Warden Date: Mon, 6 Jun 2016 23:51:58 -0700 Subject: [PATCH] Fixes for Raspberry Pi compilation (#2701) * Added linker options to armv7 in iOS makefile * Updated Eigen version in Xcode iOS examples * Updated iOS link flags * Added support for Raspberry Pi --- tensorflow/contrib/makefile/Makefile | 4 ++-- tensorflow/core/platform/platform.h | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/tensorflow/contrib/makefile/Makefile b/tensorflow/contrib/makefile/Makefile index 8884aa3a74e..093e43397d3 100644 --- a/tensorflow/contrib/makefile/Makefile +++ b/tensorflow/contrib/makefile/Makefile @@ -129,8 +129,8 @@ ifeq ($(TARGET),LINUX) endif # If we're cross-compiling for the Raspberry Pi, use the right gcc. ifeq ($(TARGET),PI) - CXX := arm-linux-gnueabihf-g++ - LDFLAGS := -L$(GENDIR)protobuf_pi/lib/ -Wl,--no-whole-archive + CXXFLAGS += -D__ANDROID_TYPES_SLIM__ + LDFLAGS := -Wl,--no-whole-archive LIBS += -ldl LIBFLAGS += -Wl,--allow-multiple-definition -Wl,--whole-archive endif diff --git a/tensorflow/core/platform/platform.h b/tensorflow/core/platform/platform.h index 8f71a617b6a..02731d92754 100644 --- a/tensorflow/core/platform/platform.h +++ b/tensorflow/core/platform/platform.h @@ -37,6 +37,13 @@ limitations under the License. #define IS_MOBILE_PLATFORM #endif +#elif defined(__arm__) +#define PLATFORM_POSIX + +// Since there's no macro for the Raspberry Pi, assume we're on a mobile +// platform if we're compiling for the ARM CPU. +#define IS_MOBILE_PLATFORM + #else // If no platform specified, use: #define PLATFORM_POSIX