Skip to content

Commit

Permalink
iOS/RPi Add the ability to choose ANDROID_TYPES_FULL
Browse files Browse the repository at this point in the history
Some networks require "full" types instead of "slim" so remove
the hard coding of SLIM in iOS and RPi. It still defaults to
building SLIM for them if not ENV var is specified but now
you can build with

ANDROID_TYPES="-D__ANDROID_TYPES_FULL" \
./tensorflow/contrib/makefile/build_all_ios.sh

TEST: Verify the  -D__ANDROID_TYPES_SLIM__ flag is default and
you can override with an env var
  • Loading branch information
powderluv committed Oct 26, 2017
1 parent e9d2b60 commit 029ce4e
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions tensorflow/contrib/makefile/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ ifdef HEXAGON_LIBS
endif
endif # HEXAGON_LIBS

# If ANDROID_TYPES is not set assume __ANDROID_TYPES_SLIM__
ifeq ($(ANDROID_TYPES),)
ANDROID_TYPES := -D__ANDROID_TYPES_SLIM__
endif

# Try to figure out the host system
HOST_OS :=
ifeq ($(OS),Windows_NT)
Expand Down Expand Up @@ -216,7 +221,7 @@ ifeq ($(TARGET),LINUX)
endif
# If we're cross-compiling for the Raspberry Pi, use the right gcc.
ifeq ($(TARGET),PI)
CXXFLAGS += -D__ANDROID_TYPES_SLIM__ -DRASPBERRY_PI
CXXFLAGS += $(ANDROID_TYPES) -DRASPBERRY_PI
LDFLAGS := -Wl,--no-whole-archive
LIBS += -ldl -lpthread
LIBFLAGS += -Wl,--allow-multiple-definition -Wl,--whole-archive
Expand Down Expand Up @@ -338,7 +343,7 @@ ifeq ($(TARGET),IOS)
-Wno-c++11-narrowing \
-mno-thumb \
-DTF_LEAN_BINARY \
-D__ANDROID_TYPES_SLIM__ \
$(ANDROID_TYPES) \
-fno-exceptions \
-isysroot \
${IPHONEOS_SYSROOT}
Expand All @@ -362,7 +367,7 @@ ifeq ($(TARGET),IOS)
-Wno-c++11-narrowing \
-mno-thumb \
-DTF_LEAN_BINARY \
-D__ANDROID_TYPES_SLIM__ \
$(ANDROID_TYPES) \
-fno-exceptions \
-isysroot \
${IPHONEOS_SYSROOT}
Expand All @@ -385,7 +390,7 @@ ifeq ($(TARGET),IOS)
-DUSE_GEMM_FOR_CONV \
-Wno-c++11-narrowing \
-DTF_LEAN_BINARY \
-D__ANDROID_TYPES_SLIM__ \
$(ANDROID_TYPES) \
-fno-exceptions \
-isysroot \
${IPHONEOS_SYSROOT}
Expand All @@ -409,7 +414,7 @@ ifeq ($(TARGET),IOS)
-DUSE_GEMM_FOR_CONV \
-Wno-c++11-narrowing \
-DTF_LEAN_BINARY \
-D__ANDROID_TYPES_SLIM__ \
$(ANDROID_TYPES) \
-fno-exceptions \
-isysroot \
${IPHONESIMULATOR_SYSROOT}
Expand All @@ -432,7 +437,7 @@ ifeq ($(TARGET),IOS)
-DUSE_GEMM_FOR_CONV \
-Wno-c++11-narrowing \
-DTF_LEAN_BINARY \
-D__ANDROID_TYPES_SLIM__ \
$(ANDROID_TYPES) \
-fno-exceptions \
-isysroot \
${IPHONESIMULATOR_SYSROOT}
Expand Down

0 comments on commit 029ce4e

Please sign in to comment.