Skip to content
This repository has been archived by the owner on Jan 22, 2019. It is now read-only.

Commit

Permalink
Target ARMV6 for the arm crossbuild of TF
Browse files Browse the repository at this point in the history
With this change, we can run the generated .so on a raspberry pi zero,
this doesn't seem to affect performance on the armv7 pi3, at least from
the few benches I ran, so we're not providing a specific armv7 deb for
now
  • Loading branch information
fredszaq committed Mar 7, 2017
1 parent dd75b4b commit 241b4f2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion compile-arm.sh
Expand Up @@ -18,7 +18,7 @@ mkdir $TARGET

CURRENT_DIR=$(pwd)

git clone https://github.com/raspberrypi/tools "$TARGET/$TOOLS_DIR"
git clone https://github.com/raspberrypi/tools "$TARGET/$TOOLS_DIR" --depth 1

./cross-compile.sh $CURRENT_DIR/$TARGET/$TOOLS_DIR/$TOOLCHAIN_ROOT $TOOLCHAIN_NAME $VERSION

Expand Down
2 changes: 1 addition & 1 deletion cross-compile.sh
Expand Up @@ -44,4 +44,4 @@ yes ''|./configure || exit 1

echo "launching bazel with flags '$BAZEL_FLAGS'"

bazel build $BAZEL_FLAGS -c opt --copt="-mfpu=neon-vfpv4" --copt="-funsafe-math-optimizations" --copt="-ftree-vectorize" --copt="-fomit-frame-pointer" tensorflow:libtensorflow.so --cpu=armeabi-v7a --crosstool_top=//tools/arm_compiler:toolchain --verbose_failures
bazel build $BAZEL_FLAGS -c opt --copt="-march=armv6" --copt="-mfpu=vfp" --copt="-funsafe-math-optimizations" --copt="-ftree-vectorize" --copt="-fomit-frame-pointer" tensorflow:libtensorflow.so --cpu=armeabi --crosstool_top=//tools/arm_compiler:toolchain --verbose_failures
2 changes: 1 addition & 1 deletion debian/versions.sh
@@ -1,4 +1,4 @@
#/usr/env/bin bash
export TF_VERSION="v1.0.0"
export TF_DEB_VERSION="1.0.0-snips-5"
export TF_DEB_VERSION="1.0.0-snips-6"

20 changes: 10 additions & 10 deletions tf-crosscompile.patch
Expand Up @@ -126,7 +126,7 @@ index 000000000..ccddd6d50
+cc_toolchain_suite(
+ name = 'toolchain',
+ toolchains = {
+ 'armeabi-v7a|compiler':':cc-compiler-armeabi-v7a',
+ 'armeabi|compiler':':cc-compiler-armeabi',
+ "local|compiler": ":cc-compiler-local",
+ },
+)
Expand Down Expand Up @@ -159,10 +159,10 @@ index 000000000..ccddd6d50
+
+
+cc_toolchain(
+ name = 'cc-compiler-armeabi-v7a',
+ name = 'cc-compiler-armeabi',
+ all_files = ':linaro_linux_all_files',
+ compiler_files = ':linaro_linux_all_files',
+ cpu = 'armeabi-v7a',
+ cpu = 'armeabi',
+ dwp_files = ':empty',
+ dynamic_runtime_libs = [':empty'],
+ linker_files = ':linaro_linux_all_files',
Expand Down Expand Up @@ -198,7 +198,7 @@ index 000000000..3ff006da8
+ toolchain_identifier: "local_freebsd"
+}
+default_toolchain {
+ cpu: "armeabi-v7a"
+ cpu: "armeabi"
+ toolchain_identifier: "%%CT_NAME%%"
+}
+default_toolchain {
Expand All @@ -219,21 +219,21 @@ index 000000000..3ff006da8
+}
+
+toolchain {
+ abi_version: "armeabi-v7a"
+ abi_libc_version: "armeabi-v7a"
+ abi_version: "armeabi"
+ abi_libc_version: "armeabi"
+ builtin_sysroot: ""
+ compiler: "compiler"
+ host_system_name: "armeabi-v7a"
+ host_system_name: "armeabi"
+ needsPic: true
+ supports_gold_linker: false
+ supports_incremental_linker: false
+ supports_fission: false
+ supports_interface_shared_objects: false
+ supports_normalizing_ar: false
+ supports_start_end_lib: false
+ target_libc: "armeabi-v7a"
+ target_cpu: "armeabi-v7a"
+ target_system_name: "armeabi-v7a"
+ target_libc: "armeabi"
+ target_cpu: "armeabi"
+ target_system_name: "armeabi"
+ toolchain_identifier: "%%CT_NAME%%"
+
+ tool_path { name: "ar" path: "%%CT_ROOT_DIR%%/bin/%%CT_NAME%%-ar" }
Expand Down

0 comments on commit 241b4f2

Please sign in to comment.