Added installation script for OS X dependencies under tools/ (#80)

* consolidated OS X instructions to the shell script, removed step-by-step instructions from README.md
This commit is contained in:
avctrh 2017-03-09 19:54:24 -05:00 committed by Greg Steuck
parent 5414f197a1
commit 7cc6a69866
2 changed files with 47 additions and 16 deletions

View File

@ -89,21 +89,11 @@ There is also a demo application:
## Build on Mac OS X
The following instructions were verified with Mac OS X El Capitan.
Run the [install_osx_dependencies.sh](./tools/install_osx_dependencies.sh)
script in the `tools/` directory. The script installs dependencies
via [Homebrew](http://brew.sh) and then downloads and installs the TensorFlow
library on your machine under `/usr/local`.
- Install dependencies via [Homebrew](http://brew.sh):
After running the script to install system dependencies, build the project with stack:
brew install protobuf
brew install snappy
- Install the TensorFlow library on your machine:
curl https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-darwin-x86_64-1.0.0.tar.gz > libtensorflow.tar.gz
tar zxf libtensorflow.tar.gz -C /usr/local
mv /usr/local/lib/libtensorflow.so /usr/local/lib/libtensorflow.dylib
install_name_tool -id libtensorflow.dylib /usr/local/lib/libtensorflow.dylib
rm libtensorflow.tar.gz
- Run stack:
stack test
stack test

View File

@ -0,0 +1,41 @@
#!/bin/bash
set -eu
echo "Installing OSX System Dependencies"
echo "=================================="
if ! type "brew" > /dev/null; then
echo "Requires homebrew to be installed."
echo "Install homebrew from https://brew.sh/"
exit 1
fi
if brew ls --versions protobuf > /dev/null; then
echo "protobuf installation detected."
else
echo "protobuf not installed, installing with homebrew."
brew install protobuf
fi
if brew ls --versions snappy > /dev/null; then
echo "snappy installation detected."
else
echo "snappy not installed, installing with homebrew."
brew install snappy
fi
echo "Downloading libtensorflow..."
curl https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-darwin-x86_64-1.0.0.tar.gz > libtensorflow.tar.gz
echo "Extracting and copying libtensorflow..."
tar zxf libtensorflow.tar.gz -C /usr/local
rm libtensorflow.tar.gz
mv /usr/local/lib/libtensorflow.so /usr/local/lib/libtensorflow.dylib
sudo install_name_tool -id libtensorflow.dylib /usr/local/lib/libtensorflow.dylib
echo "Installing submodule dependencies"
git submodule update --init --recursive
echo ""
echo "Finished"