Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added an extra system include #3

Merged
merged 2 commits into from
Jul 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions tensorflow/workspace.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Copy link
Owner

Choose a reason for hiding this comment

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

is this change necessary / will it have side effects?

strip_prefix = "eigen-eigen-f3a22f35b044",
sha256 = "a34b208da6ec18fa8da963369e166e4a368612c14d956dd2f9d7072904675d9b",
strip_prefix = "eigen-eigen-d781c1de9834",
build_file = str(Label("//third_party:eigen.BUILD")),
)

Expand Down
2 changes: 2 additions & 0 deletions third_party/toolchains/cpus/arm/CROSSTOOL.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down
42 changes: 29 additions & 13 deletions third_party/toolchains/cpus/arm/build_raspberry_pi.sh
Original file line number Diff line number Diff line change
@@ -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 \
Expand Down