Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
80442de
Add support for Raspberry PI (ARM) builds.
ebrevdo Jul 21, 2017
c7a78d7
Additional changes to get raspberry pi build working.
ebrevdo Jul 21, 2017
0ca2379
Add build_raspberry_pi.sh with some documentation.
ebrevdo Jul 21, 2017
56127f4
Cleanups for build_raspberry_pi.sh
ebrevdo Jul 21, 2017
35a7c9f
contrib/makefile/Makefile in PI mode: add -DRASPBERRY_PI.
ebrevdo Jul 21, 2017
fe798da
Recommend using aptitude instead of apt-get in build_raspberry_pi.sh.
ebrevdo Jul 22, 2017
0e673f4
More comments to build_raspberry_pi.sh
ebrevdo Jul 22, 2017
a32d821
Switched to tar file for ARM tool chain
petewarden Jul 22, 2017
d554afe
Merge pull request #1 from petewarden/tf_master
ebrevdo Jul 22, 2017
148009c
Merge branch 'master' of github.com:tensorflow/tensorflow into tf_master
ebrevdo Jul 22, 2017
e7d30d3
Merge remote-tracking branch 'origin/tf_master' into tf_master
ebrevdo Jul 22, 2017
2b47c6b
More fixes to arm build scripts; move tools/arm_compiler -> third_par…
ebrevdo Jul 22, 2017
cd4008f
Update comments in build_raspberry_pi: get ubuntu ports for your lsb …
ebrevdo Jul 22, 2017
298cf40
Hacked around cxx_builtin_include_directory problem in CROSSTOOL
petewarden Jul 23, 2017
3c379a6
Merge remote-tracking branch 'upstream/tf_master' into tf_master
petewarden Jul 23, 2017
0efde24
Merge pull request #2 from petewarden/tf_master
ebrevdo Jul 23, 2017
6666367
Added an extra system include
petewarden Jul 23, 2017
c848583
Added Pi Two/Three NEON support, with fix for Eigen version
petewarden Jul 23, 2017
a74bded
Merge pull request #3 from petewarden/tf_master
ebrevdo Jul 25, 2017
550260b
Merge branch 'master' into tf_master
ebrevdo Jul 25, 2017
f1bb14d
Undo pete's Eigen change - it breaks OS X build. Will be fixed later.
ebrevdo Jul 25, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions arm_compiler.BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
package(default_visibility = ['//visibility:public'])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this file also be under third_party/ ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved.


filegroup(
name = 'gcc',
srcs = [
'bin/arm-linux-gnueabihf-gcc',
],
)

filegroup(
name = 'ar',
srcs = [
'bin/arm-linux-gnueabihf-ar',
],
)

filegroup(
name = 'ld',
srcs = [
'bin/arm-linux-gnueabihf-ld',
],
)

filegroup(
name = 'nm',
srcs = [
'bin/arm-linux-gnueabihf-nm',
],
)

filegroup(
name = 'objcopy',
srcs = [
'bin/arm-linux-gnueabihf-objcopy',
],
)

filegroup(
name = 'objdump',
srcs = [
'bin/arm-linux-gnueabihf-objdump',
],
)

filegroup(
name = 'strip',
srcs = [
'bin/arm-linux-gnueabihf-strip',
],
)

filegroup(
name = 'as',
srcs = [
'bin/arm-linux-gnueabihf-as',
],
)

filegroup(
name = 'compiler_pieces',
srcs = glob([
'arm-linux-gnueabihf/**',
'libexec/**',
'lib/gcc/arm-linux-gnueabihf/**',
'include/**',
]),
)

filegroup(
name = 'compiler_components',
srcs = [
':gcc',
':ar',
':ld',
':nm',
':objcopy',
':objdump',
':strip',
':as',
],
)
2 changes: 1 addition & 1 deletion tensorflow/contrib/makefile/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,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__
CXXFLAGS += -D__ANDROID_TYPES_SLIM__ -DRASPBERRY_PI
LDFLAGS := -Wl,--no-whole-archive
LIBS += -ldl -lpthread
LIBFLAGS += -Wl,--allow-multiple-definition -Wl,--whole-archive
Expand Down
5 changes: 3 additions & 2 deletions tensorflow/core/platform/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ limitations under the License.
#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.
// Require an outside macro to tell us if we're building for Raspberry Pi.
#if !defined(RASPBERRY_PI)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add this define to the Makefile for the Pi too? Hopefully that will go away eventually, but for now it would be good to keep them in sync.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

#define IS_MOBILE_PLATFORM
#endif // !defined(RASPBERRY_PI)

#else
// If no platform specified, use:
Expand Down
23 changes: 21 additions & 2 deletions tensorflow/workspace.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
load("//third_party/gpus:cuda_configure.bzl", "cuda_configure")
load("//third_party/sycl:sycl_configure.bzl", "sycl_configure")
load("//third_party/mkl:build_defs.bzl", "mkl_repository")
load("@io_bazel_rules_closure//closure/private:java_import_external.bzl", "java_import_external")
load("@io_bazel_rules_closure//closure/private:java_import_external.bzl",
"java_import_external")
load("@io_bazel_rules_closure//closure:defs.bzl", "filegroup_external")
load("//third_party/py:python_configure.bzl", "python_configure")
load("//third_party/toolchains/cpus/arm:arm_compiler_configure.bzl",
"arm_compiler_configure")


def _is_windows(repository_ctx):
Expand Down Expand Up @@ -83,7 +86,6 @@ temp_workaround_http_archive = repository_rule(
},
)


# Executes specified command with arguments and calls 'fail' if it exited with
# non-zero code
def _execute_and_check_ret_code(repo_ctx, cmd_and_args):
Expand Down Expand Up @@ -142,6 +144,12 @@ def tf_workspace(path_prefix="", tf_repo_name=""):
sycl_configure(name="local_config_sycl")
python_configure(name="local_config_python")

# Point //external/local_config_arm_compiler to //external/arm_compiler
arm_compiler_configure(
name="local_config_arm_compiler",
remote_config_repo="../arm_compiler",
build_file = str(Label("//third_party/toolchains/cpus/arm:BUILD")))

mkl_repository(
name = "mkl",
urls = [
Expand Down Expand Up @@ -169,6 +177,17 @@ def tf_workspace(path_prefix="", tf_repo_name=""):
build_file = str(Label("//third_party:eigen.BUILD")),
)

native.new_http_archive(
name = "arm_compiler",
build_file = str(Label("//:arm_compiler.BUILD")),
sha256 = "970285762565c7890c6c087d262b0a18286e7d0384f13a37786d8521773bc969",
strip_prefix = "tools-0e906ebc527eab1cdbf7adabff5b474da9562e9f/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf",
urls = [
"http://mirror.bazel.build/github.com/raspberrypi/tools/archive/0e906ebc527eab1cdbf7adabff5b474da9562e9f.tar.gz",
"https://github.com/raspberrypi/tools/archive/0e906ebc527eab1cdbf7adabff5b474da9562e9f.tar.gz",
],
)

native.new_http_archive(
name = "libxsmm_archive",
urls = [
Expand Down
49 changes: 49 additions & 0 deletions third_party/toolchains/cpus/arm/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package(default_visibility = ["//visibility:public"])

cc_toolchain_suite(
name = "toolchain",
toolchains = {
"armeabi|compiler": ":cc-compiler-armeabi",
"local|compiler": ":cc-compiler-local",
},
)

filegroup(
name = "empty",
srcs = [],
)

filegroup(
name = "arm_linux_all_files",
srcs = [
"@arm_compiler//:compiler_pieces",
],
)

cc_toolchain(
name = "cc-compiler-local",
all_files = ":empty",
compiler_files = ":empty",
cpu = "local",
dwp_files = ":empty",
dynamic_runtime_libs = [":empty"],
linker_files = ":empty",
objcopy_files = ":empty",
static_runtime_libs = [":empty"],
strip_files = ":empty",
supports_param_files = 1,
)

cc_toolchain(
name = "cc-compiler-armeabi",
all_files = ":arm_linux_all_files",
compiler_files = ":arm_linux_all_files",
cpu = "armeabi",
dwp_files = ":empty",
dynamic_runtime_libs = [":empty"],
linker_files = ":arm_linux_all_files",
objcopy_files = "arm_linux_all_files",
static_runtime_libs = [":empty"],
strip_files = "arm_linux_all_files",
supports_param_files = 1,
)
Loading