Created
October 2, 2016 23:11
-
-
Save petewarden/71bd9171c78642d643985c30185c29cc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Script for building TensorFlow and its dependencies on the Nvidia TX1. Based on | |
# https://github.com/neo-titans/odroid | |
sudo apt-get install -y curl openjdk-8-jdk swig python3-numpy python3-dev swig zlib1g-dev | |
git clone https://github.com/neo-titans/odroid | |
sudo fallocate -l 1G /swapfile | |
sudo chmod 600 /swapfile | |
sudo mkswap /swapfile | |
sudo swapon /swapfile | |
sudo rm -rf /var/cuda-repo-8-0-local | |
# For grpc-java build | |
cd ~/projects | |
git clone https://github.com/google/protobuf.git | |
cd protobuf | |
git checkout tags/v3.0.0-beta-3 | |
./autogen.sh | |
LDFLAGS=-static ./configure --prefix=$(pwd)/../ | |
sed -i -e 's/LDFLAGS = -static/LDFLAGS = -all-static/' ./src/Makefile | |
make -j4 | |
make install | |
# For bazel build | |
git checkout tags/v3.0.0-beta-2 | |
./autogen.sh | |
LDFLAGS=-static ./configure --prefix=$(pwd)/../ | |
sed -i -e 's/LDFLAGS = -static/LDFLAGS = -all-static/' ./src/Makefile | |
make -j4 | |
cd ~/projects | |
git clone https://github.com/grpc/grpc-java | |
cd grpc-java | |
patch -p0 < ../odroid/build_tensorflow/grpc-java.v0.15.0.patch | |
CXXFLAGS="-I$(pwd)/../include" LDFLAGS="-L$(pwd)/../lib" ./gradlew java_pluginExecutable -Pprotoc=$(pwd)/../bin/protoc | |
cd ~/projects | |
git clone https://github.com/bazelbuild/bazel.git | |
cd bazel | |
git checkout 47be2a40c601b5e4737f7a6825fad7e7f6ce0302 | |
cp ../protobuf/src/protoc third_party/protobuf/protoc-linux-aarch64.exe | |
cp ../grpc-java/compiler/build/exe/java_plugin/protoc-gen-grpc-java third_party/grpc/protoc-gen-grpc-java-0.15.0-linux-aarch64.exe | |
patch -p0 < ../odroid/build_tensorflow/bazel.47be2a4.patch | |
./compile.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment