diff --git a/tensorflow/workspace.bzl b/tensorflow/workspace.bzl index 7b9f5d74cf86fb..02879482805e1c 100644 --- a/tensorflow/workspace.bzl +++ b/tensorflow/workspace.bzl @@ -156,11 +156,11 @@ def tf_workspace(path_prefix="", tf_repo_name=""): native.new_http_archive( name = "eigen_archive", urls = [ - "http://mirror.bazel.build/bitbucket.org/eigen/eigen/get/f3a22f35b044.tar.gz", - "https://bitbucket.org/eigen/eigen/get/f3a22f35b044.tar.gz", + "http://mirror.bazel.build/bitbucket.org/eigen/eigen/get/d781c1de9834.tar.gz", + "https://bitbucket.org/eigen/eigen/get/d781c1de9834.tar.gz", ], - sha256 = "ca7beac153d4059c02c8fc59816c82d54ea47fe58365e8aded4082ded0b820c4", - strip_prefix = "eigen-eigen-f3a22f35b044", + sha256 = "a34b208da6ec18fa8da963369e166e4a368612c14d956dd2f9d7072904675d9b", + strip_prefix = "eigen-eigen-d781c1de9834", build_file = str(Label("//third_party:eigen.BUILD")), ) diff --git a/third_party/toolchains/cpus/arm/CROSSTOOL.tpl b/third_party/toolchains/cpus/arm/CROSSTOOL.tpl index 7090501dad9308..6753476c153b9b 100644 --- a/third_party/toolchains/cpus/arm/CROSSTOOL.tpl +++ b/third_party/toolchains/cpus/arm/CROSSTOOL.tpl @@ -83,6 +83,8 @@ toolchain { # explicitly set them as flags. There's a query to the Bazel team outstanding about # why this is necessary. cxx_flag: "-isystem" + cxx_flag: "/usr/include/arm-linux-gnueabihf" + cxx_flag: "-isystem" cxx_flag: "/usr/include/python2.7" cxx_flag: "-isystem" cxx_flag: "/usr/include/" diff --git a/third_party/toolchains/cpus/arm/build_raspberry_pi.sh b/third_party/toolchains/cpus/arm/build_raspberry_pi.sh index 251a53472a2e6b..a5ad0fce0e4309 100755 --- a/third_party/toolchains/cpus/arm/build_raspberry_pi.sh +++ b/third_party/toolchains/cpus/arm/build_raspberry_pi.sh @@ -1,23 +1,39 @@ #!/usr/bin/env bash set -e -# To be able to build any of the python packages, it is assumed that -# you have a python directory in /usr/include/arm-linux-gnueabihf/. - -# To install the architecture includes for python on ubuntu trusty; -# run: -# sudo dpkg --add-architecture armhf -# echo "deb [arch=armhf] http://ports.ubuntu.com/ $(lsb_release -s -c) main universe" | \ -# sudo tee -a /etc/apt/sources.list.d/armhf.list -# # Ignore errors about missing armhf packages in other repos. -# sudo aptitude update -# # Use aptitude; apt-get sometimes runs into errors on this command. -# sudo aptitude install libpython-all-dev:armhf python-numpy +# By default this builds packages for the Pi Two and Three only, since the NEON support +# this allows makes calculations many times faster. To support the Pi One or Zero, pass +# PI_ONE as the first argument to the script, for example: +# third_party/toolchains/cpus/arm/build_raspberry_pi.sh PI_ONE # +# To install the cross-compilation support for Python this script needs on Ubuntu Trusty, run +# something like these steps, after backing up your original /etc/apt/sources.list file: +# +# dpkg --add-architecture armhf +# echo 'deb [arch=armhf] http://ports.ubuntu.com/ trusty main restricted universe multiverse' >> /etc/apt/sources.list.d/armhf.list +# echo 'deb [arch=armhf] http://ports.ubuntu.com/ trusty-updates main restricted universe multiverse' >> /etc/apt/sources.list.d/armhf.list +# echo 'deb [arch=armhf] http://ports.ubuntu.com/ trusty-security main restricted universe multiverse' >> /etc/apt/sources.list.d/armhf.list +# echo 'deb [arch=armhf] http://ports.ubuntu.com/ trusty-backports main restricted universe multiverse' >> /etc/apt/sources.list.d/armhf.list +# sed -i 's#deb http://archive.ubuntu.com/ubuntu/#deb [arch=amd64] http://archive.ubuntu.com/ubuntu/#g' /etc/apt/sources.list +# apt-get update +# apt-get install -y libpython-all-dev:armhf +# +# Make sure you have an up to date version of the Bazel build tool installed too. yes '' | ./configure -bazel build -c opt --copt=-march=armv6 --copt=-mfpu=vfp \ +if [[ $1 == "PI_ONE" ]]; then + PI_COPTS="--copt=-march=armv6 --copt=-mfpu=vfp" + echo "Building for the Pi One/Zero, with no NEON support" +else + PI_COPTS='--copt=-march=armv7-a --copt=-mfpu=neon-vfpv4 + --copt=-U__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 + --copt=-U__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 + --copt=-U__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8' + echo "Building for the Pi Two/Three, with NEON acceleration" +fi + +bazel build -c opt ${PI_COPTS} \ --copt=-funsafe-math-optimizations --copt=-ftree-vectorize \ --copt=-fomit-frame-pointer --cpu=armeabi \ --crosstool_top=@local_config_arm_compiler//:toolchain \